Sunday, February 18, 2018

automounting with udiskie

This is how udiskie is described here:
udiskie is a UDisks front-end that allows to manage removeable media such as CDs or flash drives from userspace. Its features include:

    - automount removable media when inserted
    - notifications (on insertion, mount, unmount, …)
    - GTK tray icon to manage all available devices
    - command line tools for manual un-/mounting
    - support for LUKS encrypted devices
    - support for unlocking with keyfiles (requires udisks 2.6.4)
    - support for loop devices (mounting iso archives, requires UDisks2)
    - password caching
    - works with either udisks1 or udisks2
    - an extensible code base (python)
    - a maintainer who is open for suggestions;)

All features can be individually enabled or disabled...

I installed udiskie in Arch, to use in Openbox. udiskie puts an icon in tint2's system tray, automounts flash drives when inserted, and provides notifications when flash drives are inserted, mounted, etc.



I'm using the following line in the ~/.config/openbox/autostart file:

udiskie -s &

(According to the man page, that could also be put in ~/.xinitrc.)

That gives me a "smart" icon in the tint2 system tray whenever a flash drive is plugged in:

       -s, --smart-tray
           Show tray icon that automatically hides when there is no action available.


(See man udiskie.)

Shots of the tray icon's left-click and right-click menus:



Also, the following can be used from the command line for mounting and unmounting /dev/sdbx:

$ udiskie-mount /dev/sdbx
$ udiskie-umount /dev/sdbx

No comments: