Skip to main content
Help us improve Python packaging – donate today!

Removable disk automounter for udisks

Project Description

udiskie is a simple daemon that uses UDisks to automatically mount removable storage devices. This daemon comes with optional mount notifications and gtk tray icon. It also provides a user level CLI for mount and unmount operations.

Dependencies

  • UDisks required for all operation modes. UDisks2 support is experimental and has to be requested explicitly via command line parameter.
  • dbus-python required for all operation modes
  • PyGObject to run the automount/notification daemon (provides the main loop)
  • notify-python or notify2 for mount notifications
  • Zenity to unlock LUKS devices
  • PyGTK to show the system tray icon

Permissions

udiskie requires permission for the following PolicyKit actions:

  • org.freedesktop.udisks.filesystem-mount for mounting and unmounting
  • org.freedesktop.udisks.luks-unlock to unlock LUKS devices
  • org.freedesktop.udisks.drive-eject to eject drives
  • org.freedesktop.udisks.drive-detach to detach drives

These are usually granted when using a desktop environment. If your login session is not properly activated you may need to customize your PolicyKit settings. Create the file /etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla with the following contents:

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

This configuration allows all members of the storage group to run udiskie.

Alternatively, change the setting for allow_inactive to yes in the file /usr/share/polkit-1/actions/org.freedesktop.udisks.policy:

<action id="org.freedesktop.udisks.filesystem-mount">
    ...
    <allow_inactive>yes</allow_inactive>
    ...
</action>

...

<action id="org.freedesktop.udisks.luks-unlock">
    ...
    <allow_inactive>yes</allow_inactive>
    ...
</action>

...

<action id="org.freedesktop.udisks.drive-eject">
    ...
    <allow_inactive>yes</allow_inactive>
    ...
</action>

...

<action id="org.freedesktop.udisks.drive-detach">
    ...
    <allow_inactive>yes</allow_inactive>
    ...
</action>

Note that UDisks2 uses another set of permissions, see /usr/share/polkit-1/actions/org.freedesktop.udisks2.policy.

GTK icons

udiskie comes with a set of themeable custom Tango-style GTK icons for its tray icon menu. The installer tries to install the icons into GTK’s default hicolor theme. Typically this is located in /usr/share/icons/hicolor. If you have any problems with this or you need a custom path you can manually do it like so:

cp ./icons/scalable /usr/share/icons/hicolor -r
gtk-update-icon-cache /usr/share/icons/hicolor

The icons roughly follow the Tango style guidelines. Some icons incorporate the CDROM icon of the base icon theme of the Tango desktop project (released into the public domain).

Usage

The following entry points are defined:

  • udiskie to run the automount/notification daemon
  • udiskie-mount user level mount/unlock operations
  • udiskie-umount user level unmount/lock/eject/detach operations

See the man pages for further instructions

Contributing

udiskie is developed on github. Feel free to contribute patches as pull requests as you see fit.

Try to be consistent with PEP 8 guidelines as far as possible and test everything. Furthermore, your commit messages should start with a capitalized verb for consistency. Unless your modification is completely trivial, also add a message body to your commit.

Where possible dependency injection should be used to keep the module easily testable.

CHANGELOG

0.6.3 (bug fix)

  • fix exception in Mounter.detach_device if unable to detach
  • fix force-detach for UDisks2 backend
  • automatically use UDisks2 if UDisks1 is not available
  • mount unlocked devices only once, removes error message on UDisks2
  • mention __ignore__ in man page

0.6.2 (aesthetic)

  • add custom icons for the context menu of the system tray widget

0.6.1 (bug fix)

  • fix udisks2 external device detection bug: all devices were considered external when using Sniffer (as done in the udiskie-mount and udiskie-umount tools)

0.6.0 (udisks2 support, bug fix)

  • cache device states to avoid some race conditions
  • show filesystem label in mount/unmount notifications
  • retry to unlock LUKS devices when wrong password was entered twice
  • show ‘eject’ only if media is available (udisks1 ejects only in this case)
  • (un-) mount/lock notifications shown even when operations failed
  • refactor internal API
  • experimental support for udisks2

0.5.3 (feature, bug fix)

  • add ‘__ignore__’ config file option to prevent handling specific devices
  • delay notifications until termination of long operations

0.5.2 (tray icon)

  • add tray icon (pygtk based)
  • eject / detach drives from command line

0.5.1 (mainly internal changes)

  • use setuptools entry points to create the executables
  • make udiskie a namespace package

0.5.0 (LUKS support)

  • support for LUKS devices (using zenity for password prompt)
  • major refactoring
  • use setuptools as installer

Release history Release notifications

History Node

1.7.3

History Node

1.7.2

History Node

1.7.1

History Node

1.7.0

History Node

1.6.2

History Node

1.6.1

History Node

1.6.0

History Node

1.5.1

History Node

1.5.0

History Node

1.4.12

History Node

1.4.11

History Node

1.4.10

History Node

1.4.9

History Node

1.4.8

History Node

1.4.7

History Node

1.4.6

History Node

1.4.5

History Node

1.4.4

History Node

1.4.3

History Node

1.4.2

History Node

1.4.1

History Node

1.4.0

History Node

1.3.2

History Node

1.3.1

History Node

1.3.0

History Node

1.2.1

History Node

1.2.0

History Node

1.1.3

History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.8.0

History Node

0.7.0

History Node

0.6.4

This version
History Node

0.6.3

History Node

0.6.2

History Node

0.6.1

History Node

0.6.0

History Node

0.5.3

History Node

0.5.2

History Node

0.5.1

History Node

0.5.0-1

History Node

0.5.0

History Node

0.4.1

History Node

0.4.0

History Node

0.3.10

History Node

0.3.9

History Node

0.3.8

History Node

0.3.7

History Node

0.3.6

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.0

History Node

0.2.0

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
udiskie-0.6.3.tar.gz (49.9 kB) Copy SHA256 hash SHA256 Source None Jan 21, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page