I use these blocks from i3blocks-contrib:
Maybe eventually I'll use usb, but for now my own covers my need better.
It is a usb status disply able to mount and unmount with one click. It can optinally poll mount-state of a usb-volume (as seen in config).
i3blocks config example:
[usbmount]
command=$SCRIPT_DIR/usbmount
# Prefix how you wish
LABEL=usb:
# Supposes this mount point is defined in fstab
MOUNT_POINT=/mnt/usb
# Set to once if polling isn't neccessary
interval=10The script itself is pretty uneventful:
doMountAction() {
if grep -qs $MOUNT_POINT /proc/mounts; then
umount $MOUNT_POINT
else
mount $MOUNT_POINT
fi
}
case $BLOCK_BUTTON in
1) doMountAction
esac
if grep -qs '/mnt/usb' /proc/mounts; then
echo "$LABEL on"
else
echo "$LABEL off"
fi