List

If you are not using a desktop environment like Gnome or KDE where all this comes for free, you can still get automount for you removable devices, such as flash drives. The utility you need to install is called udiskie and if you run Slackware it’s available as a slackbuild package. udiskie is a simple daemon that uses udisks to automatically mount removable storage devices.

Before you get it working there are a few steps we need to go through first.

Make sure your user is part of the plugdev group, if it’s not you can add with the following command

# usermod -a -G plugdev username

Now, we need to change the policykit according to udiskie documentation. Here we are slightly adapting for Slackware. Make sure if you have the directory structure /etc/polkit-1/localauthority/50-local.d/ and in case not you can create it with the command below

# mkdir -p /etc/polkit-1/localauthority/50-local.d/

Now, let’s create the file udiskie.pkla inside the directory

# nano /etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla

and add the following content

[udiskie]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach
ResultAny=yes

The last thing remaining is to set udiskie daemon to run at startup. In you i3 config file add the line

exec --no-startup-id udiskie -a -n

I like to use the flags -a -n that specifies automount and send notification, respectively. You can also add the command to your .xinitrc file

# echo 'exec udiskie -a -n' >> /home/user/.xinitrc

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.