cedlemo / blingbling

Awesome WM widgets
GNU General Public License v2.0
148 stars 37 forks source link

request: udisks_glue widget - umount all option #14

Closed mykhaylo- closed 11 years ago

mykhaylo- commented 11 years ago

Hi cedlemo. very useful library for awesome. would be great if there will be an option to umount all partitions of mounted USB hard drive. In my case to remove device with four partitions (/dev/sdb1 .. /dev/sdb4) I need to go through 4 submenus and click umount for each partition and only after that I can detach my device. Is it possbile instead (or near) the "busy" or "can't detach" menu item add something like "umount all" option to try umount my partitions automatically for selected device?

cedlemo commented 11 years ago

Hi,

thanks for this suggestion. Yes it 's feasible. As I don't have made the udsik module for the v2 yet , I assume that you are using the v1 of blingbling for awesome v < 3.5. I am currently using awesome V 3.5, so I have first to adapt the module for the v2 version, make some tests, and update the v1 of blingbling. This should be done within 3 or 4 days.

cedlemo

mykhaylo- commented 11 years ago

ok, thanks cedlemo. will wait for this

cedlemo commented 11 years ago

Ok I have made some modifications. Be sure to download the good version of blingbling ( the v1.0).

See the Readme at the end or download it from the web interface https://github.com/cedlemo/blingbling/archive/v1.0.zip

cedlemo

mykhaylo- commented 11 years ago

Thanks for update. Will test it later and let you know how it is working. BTW when do you plan to push it to v 2 branch?

cedlemo commented 11 years ago

already done in v2 too ( v2 correspond now to master don't bother with the blingbling v2.0 branch which will soon be deleted)

cedlemo

mykhaylo- commented 11 years ago

Hi cedlemo. Updated my blingbling from a repository. Now yhe option "unmount all" appears but nothing is happened when I click on it. maybe some mouse click listener is missed? awesome -v awesome v3.5.1 (Ruby Tuesday) • Build: Apr 8 2013 19:08:05 for x86_64 by gcc version 4.6.3 (@vega3) • Compiled against Lua 5.1.5 (running with Lua 5.1) • D-Bus support: ✔

cedlemo commented 11 years ago

I have made some changes. Can you test them please.

As I have written it in the documentation, udisks-glue doesn-t work well with systems that use logind which is the case for me. That is why I didn't make full test for this fonctionnality and I am really sorry for the inconvenience.

I would like to put your name in the contributors section for your suggestion and for the time you have lost with this. Can I do it?

Cedlemo

mykhaylo- commented 11 years ago

Hi cedlemo, I've updated and now I see submenu with my 4 partitions as a top-level menu, without any parent menu item. And no option "umount all" I'm not sure if I pretend for this honor to be mentioned in contributors list, but if you think it makes sense, then I'm happy with this.

Thanks, Mykhaylo

mykhaylo- commented 11 years ago

Sorry, it seems something was wrong, because after I restarted awesome I see correct menu. So still testing. will let you knwo soon..

mykhaylo- commented 11 years ago

Not sure if that is intended way of usage, but when I click on a tray icon with left mouse button, all my partitions are unmounted automatically without any popup menu. Just awesome notifications appeared notifying me about this fact. And when I click second time on the tray icon (after automatic partitions unmount) - I see popup menu with the last item - "detach" by clicking on which my partitions are removed. And I need to unplug the device from USB port physically in next 1-2 seconds because when I keep it plugged-in it is detected by udisks again and is automounted again. For me I think it is safely to unplug my device after all partitions unmounted and I don't need any software removal. Please suggest if that is not correct.

cedlemo commented 11 years ago

Yes I think that you are right, if we unmount all the partitions then the device must be detached. I do the modifications now before focusing on the other problem which make that if you click on a tray icon all partitions are unmounted.

And yes it makes sense for me to include you in contributors :).

cedlemo

mykhaylo- commented 11 years ago

great. thanks. so let me know when this will be resolved so that I can test.

thanks, Mykhaylo

cedlemo commented 11 years ago

It 's already done Mykhaylo ;).

cedlemo

mykhaylo- commented 11 years ago

I mean ".. the other problem which make that if you click on a tray icon all partitions are unmounted." because I've updated and still when I click all partitions are unmounted and removed.

cedlemo commented 11 years ago

Aaah ok,

done. You should take care of your udisks-glue.conf and use the one that I provided as I haven't yet accepted your pull request for notifications enhancements ( I try to treat things one by one)

cedlemo

cedlemo commented 11 years ago

Mykhaylo,

Sorry for the time it took, I needed to make udisks-glue works on my system, but I have found where was the problem with "no media".

First be sure to declare/create your udisks_glue widget outside of the loop of the screens in your rc.lua :

local blingbling = require("blingbling")
udisks_glue=blingbling.udisks_glue.new({ menu_icon = themes_dir .. "/test/titlebar/maximized_focus_active.png"})

for s = 1, screen.count() do

Then as I have said before be sure to use the udisks-glue.conf without the modifications you have pulled.

Now you can test the last commit it should works ( it works for me I have tested it).

Cedlemo

mykhaylo- commented 11 years ago

Hi Cedlemo, Now it is generating "umount all" option for every partition: See screenshot here: http://imm.io/13Q1Q And I'm declaring my blingbling outside of the screens loop. Is it intended?

cedlemo commented 11 years ago

No this is not intended at all. On my Computer, The main menu list the devices and for each entry you have a submenu with the unmount-all option and a list of each partitions on the device.

I don't understand, can you show me your .udsisks-glue.conf?

mykhaylo- commented 11 years ago

I've made my udisks-glue.conf the same as yours and udisks_glue.lua and now it is working. When I click on tray icon menu appears as expected and when I click umount all - all partitions are unmounted and removed and I need to remove device physically within next few seconds. If no, my device will be detected and automounted again.

cedlemo commented 11 years ago

I think that the problem came with the "Usb" to "USB" modifications in your uisks-glue.conf.

For the automatic re-automount, it must be a specific behavior of your system that don't depend on the udisks-glue.lua. Are you are ok with this implementation of unmount all? if so we could close this issue.

mykhaylo- commented 11 years ago

Yes, I'm happy with this implementation. Sure. So, resolving this ticket. Thanks.