#Eject option for removable media such as USB key. #Uses the eject program to do the work - will unmount if possible. #Note 1) Must be able to sudo without password #Note 2)This is uglier than it need be because the contents of sh -c cannot contain internal variables, line-breaks, or double-quotes! [Desktop Entry] ServiceTypes=media/* Actions=eject [Desktop Action eject] Name=Eject removable device Exec=/bin/sh -c "sudo eject /dev/`basename %u` && kdialog --msgbox /dev/`basename %u`' is now safe to remove.' || kdialog --msgbox 'Error: could not eject '/dev/`basename %u`'. Are there any open files on it?'"