You are not logged in.

#1 2011-03-07 18:43:56

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

obdevicemenu: Udisks pipe menu for Openbox

Links
Sourceforge Project Page
AUR Package
Gitorious

Screenshots
Menu
Notifications

Overview
obdevicemenu is an Openbox pipe menu that uses udisks to easily mount, unmount or eject removable devices. An extensive configuration file allows desktop notifications about the success or failure of operations, as well as the modification of several commands.

This script does not provide automounting of removable media as there are already many ways to automount. The file managers in GNOME and KDE handle automounting, while udev rules or scripts like Udiskie can be used in other environments.

You might also be interested in bashmount, which is more versatile and works in any desktop environment or window manager.

Notes
Dbus  and consolekit/policykit need to be running. If you aren't using a login manager, put this in ~/.xinitrc:

source /etc/X11/xinit/xinitrc.d/30-dbus
exec ck-launch-session openbox

If it doesn't already exist, create the file "/etc/polkit-1/localauthority/50-local.d/10-udiskie.pkla" with these contents:

[Local Users]
Identity=unix-group:storage
Action=org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

Then put inside the "root-menu" part of ~/.config/openbox/menu.xml something like this:

 <menu id="devices" label="Devices" execute="/usr/bin/obdevicemenu" />

Last edited by jnguyen (2011-09-18 15:53:59)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#2 2011-03-07 19:59:05

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

0.8.1 released fixing various issues.
0.8.2 released fixing optical media naming.

Last edited by jnguyen (2011-04-06 06:55:01)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#3 2011-03-08 22:01:35

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

0.8.3 released with more information in the README and another fix for optical media naming.
0.8.4 released with better handling for blank optical discs.
0.8.5 released with various fixes and better handling of devices without labels.
0.8.6 released with some typos fixed.
0.8.7 released with code fixes.
0.8.8 released with a ChangeLog included.

Last edited by jnguyen (2011-03-10 15:28:08)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#4 2011-03-10 16:29:55

rrobis
Member
Registered: 2011-03-03
Posts: 3

Re: obdevicemenu: Udisks pipe menu for Openbox

When I in config file leave removable_devices="sd[b-z].[0-9]*", I can't to see any usb devices in pipemenu and when I change it to   removable_devices="sd[b-z]*.[0-9]*"- I can

Offline

#5 2011-03-10 17:21:09

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

rrobis wrote:

When I in config file leave removable_devices="sd[b-z].[0-9]*", I can't to see any usb devices in pipemenu and when I change it to   removable_devices="sd[b-z]*.[0-9]*"- I can

Hi rrobis, thanks for the feedback. What are your removable devices called? What is your output of "udisks --enumerate" when these usb devices are plugged in?

On my system the devices are only ever called /dev/sdXY, where X is a letter and Y is a number. Based on your feedback, I'm guessing that device naming is not limited to this.


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#6 2011-03-10 17:31:42

rrobis
Member
Registered: 2011-03-03
Posts: 3

Re: obdevicemenu: Udisks pipe menu for Openbox

Output:

[robis@myhost ~]$ udisks --enumerate
/org/freedesktop/UDisks/devices/sda
/org/freedesktop/UDisks/devices/sdb
/org/freedesktop/UDisks/devices/sda1
/org/freedesktop/UDisks/devices/sda2
/org/freedesktop/UDisks/devices/sr0
/org/freedesktop/UDisks/devices/sda5

Offline

#7 2011-03-10 18:02:14

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

rrobis wrote:

Output:

[robis@myhost ~]$ udisks --enumerate
/org/freedesktop/UDisks/devices/sda
/org/freedesktop/UDisks/devices/sdb
/org/freedesktop/UDisks/devices/sda1
/org/freedesktop/UDisks/devices/sda2
/org/freedesktop/UDisks/devices/sr0
/org/freedesktop/UDisks/devices/sda5

Oh of course. I forgot about devices that don't have a partition roll Thanks for pointing this out. I've fixed this in 0.8.9.

However, in 0.8.9, when I plug in my USB drive I get two entries show up: "sdc" and "sdc1" for example. Only sdc1 is mountable, so I've released 0.8.10 to not show "sdc" if partitions exist. I don't have much exotic hardware to test on (I have some bog-standard usb sticks and a couple of unexciting external usb hard drives), so thanks for the feedback smile

Last edited by jnguyen (2011-03-10 18:19:08)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#8 2011-03-10 18:22:26

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: obdevicemenu: Udisks pipe menu for Openbox

jnguyen,thanks. imo mounting the device with volume name would be more opt.

Offline

#9 2011-03-10 18:31:59

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

kgas wrote:

jnguyen,thanks. imo mounting the device with volume name would be more opt.

I'm not sure which name you mean. For one of your devices, run "udisks --show-info /dev/sdXX" and tell me which of the fields you would prefer to see. I'm guessing you're talking about "by-id:" which is informative, but also very long in some/most cases.

I might put some simple configurable options in the configuration file for naming, so that you can view a "short" name (as currently) or "long" name (by-id:).

edit: Oh, perhaps you mean the "label:" field?

Last edited by jnguyen (2011-03-10 18:33:25)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#10 2011-03-10 19:25:11

oliver
Member
Registered: 2007-12-12
Posts: 448

Re: obdevicemenu: Udisks pipe menu for Openbox

jnguyen wrote:
kgas wrote:

jnguyen,thanks. imo mounting the device with volume name would be more opt.

I'm not sure which name you mean. For one of your devices, run "udisks --show-info /dev/sdXX" and tell me which of the fields you would prefer to see. I'm guessing you're talking about "by-id:" which is informative, but also very long in some/most cases.

I might put some simple configurable options in the configuration file for naming, so that you can view a "short" name (as currently) or "long" name (by-id:).

edit: Oh, perhaps you mean the "label:" field?


I think using the "label" field in the pipe menu would be fantastic (i.e. show it as "ARCH_201005" rather than "sdb1")

This app is great BTW.  Thanks!

Offline

#11 2011-03-10 21:15:11

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

oliver wrote:

I think using the "label" field in the pipe menu would be fantastic (i.e. show it as "ARCH_201005" rather than "sdb1")

This app is great BTW.  Thanks!

OK 0.8.11 released with the "label" field now shown in preference. I never bother putting a label on my removable drives, so that's why I overlooked it, but I can see now it's quite important to show the label if it's available (after all, that's the reason you put the label on in the first place!).

Thank you very much the feedback smile

Last edited by jnguyen (2011-03-10 21:16:50)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#12 2011-03-11 01:01:17

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

0.8.12 fixes a major issue in the string that matches devices. The menu should be a lot faster now if you are hiding several internal drives from the list.

0.8.13 causes the script to behave gracefully if udisks isn't functioning (e.g. dbus isn't running).

Last edited by jnguyen (2011-03-11 01:44:05)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#13 2011-03-11 06:51:38

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: obdevicemenu: Udisks pipe menu for Openbox

thanks for the update, By label I mean volume label.

Offline

#14 2011-03-12 12:51:06

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

0.9.0 [2011-03-12]
* Fixed display of device label if it is mounted
* Improve code
* Improve configuration file
* Add menu to show more detailed device information
* Add option to unmount all devices

I've also updated the screenshots if anyone is thinking about trying this out.

Last edited by jnguyen (2011-03-12 12:51:37)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#15 2011-03-15 22:01:55

sarbash
Member
From: Russia, Naberezhnye Chelny
Registered: 2011-03-15
Posts: 32

Re: obdevicemenu: Udisks pipe menu for Openbox

Thank you very much! This is a great deal, really.

Offline

#16 2011-03-16 22:56:49

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

sarbash wrote:

Thank you very much! This is a great deal, really.

No problem, I'm glad you are finding it useful. Thanks for taking the time to say thanks smile


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#17 2011-03-21 00:06:46

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

1.0.0 released!

I've added options in the configuration file that allow every menu entry and notification message to be customized. This for example allows a different language to be used.


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#18 2011-03-21 13:34:43

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: obdevicemenu: Udisks pipe menu for Openbox

Thanks. Under removable media, instead of displaying the generic sdb1 etc displaying the volume label (if available) will be opt , imo.

Offline

#19 2011-03-21 14:02:50

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

kgas wrote:

Thanks. Under removable media, instead of displaying the generic sdb1 etc displaying the volume label (if available) will be opt , imo.

Oops, I didn't implement it properly it seems. Fixed in 1.0.1 smile

edit: 1.0.2 released with the device label field included in the device information sub-menu.

Last edited by jnguyen (2011-03-21 14:16:00)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#20 2011-03-21 14:20:21

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: obdevicemenu: Udisks pipe menu for Openbox

thanks for the quick fix. yet one suggestion is to display the volume label only (instead of sdb1:<volume lable> (mounted) simply Volume_Label) then the remaining in the next level display would be very nice wink

Thanks for the new version 1.0.2

Last edited by kgas (2011-03-21 14:37:33)

Offline

#21 2011-03-21 15:33:01

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

kgas wrote:

thanks for the quick fix. yet one suggestion is to display the volume label only (instead of sdb1:<volume lable> (mounted) simply Volume_Label) then the remaining in the next level display would be very nice wink

Thanks for the new version 1.0.2

Thanks again for the feedback.

I personally like having the device filename (e.g. sdb1) visible in the menu. But since you asked, I've now implemented options in the configuration file in 1.0.3. To hide the device filename, you can change the appropriate line in the obdevicemenu.conf to this:

show_removable_device_filename="0"

Last edited by jnguyen (2011-03-21 15:33:25)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#22 2011-03-22 12:50:55

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

1.0.4 released, with the menu separator for optical devices now fixed to actually display the right text.

Again, if anybody finds any bugs or missing features then please don't hesitate to mention.


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#23 2011-03-22 16:56:48

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: obdevicemenu: Udisks pipe menu for Openbox

jnguyen, thanks for your work and the time you spend.

Offline

#24 2011-03-22 19:59:37

jnguyen
Member
Registered: 2011-02-17
Posts: 139
Website

Re: obdevicemenu: Udisks pipe menu for Openbox

kgas wrote:

jnguyen, thanks for your work and the time you spend.

No problem, i'm glad you find it useful smile

Last edited by jnguyen (2011-03-22 20:03:05)


TOMOYO Linux: Mandatory Access Control.
My AUR packages

Offline

#25 2011-03-26 23:36:10

mundane
Banned
Registered: 2011-03-23
Posts: 49

Re: obdevicemenu: Udisks pipe menu for Openbox

Thanks so much for this!! It's such a useful part of my desktop now smile

Offline

Board footer

Powered by FluxBB