Skip to content

CodeShot/i3blocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

i3blocks

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=10

The 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

About

My config the occasional self-made block not found in i3blocks-contrib

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors