coldfix / udiskie

Automounter for removable media
MIT License
857 stars 53 forks source link

Tray doesn't work as a service #130

Open coldfix opened 7 years ago

coldfix commented 7 years ago

From #129, @mindstormer12:

I'm finding that smart tray doesn't seem to work with the posted service file and the the corrected argument. On my config.yml, I also have tray: auto. No tray is displayed with my USB plugged in.

Tray only appears if I start another instance using udiskie --smart-tray on the terminal, after udiskie is already running via service.

mindstormer12 commented 7 years ago

@coldfix Was this reproducible on your machine?

coldfix commented 7 years ago

I hope to have time to check this evening. I believe to have experienced similar issue in the past when starting via service files (irrespectively of the auto/smart flag). It could be related to X not being started up when udiskie is creating the Gtk.StatusIcon instance. In this case the most straight forward fix would be to start the icon with your window manager (.xinitrc or autostart applications). (You could start the icon without automounting --no-automount plus background daemon with no tray --no-tray via service file, if you need automounting without X login)

BTW: I do currently not recommend starting udiskie as service.

rieje commented 7 years ago

I'm also having this problem--any updates?

And might as well ask questions: Is --eject option useful at all for hard disk drives or flash drives? Is unmount "safe" without also using --detach or is --detach recommended after an unmount in all cases?

coldfix commented 7 years ago

My recommendation for now is: do not use udiskie tray/notifications as a systemd service.

GUI service components should be started with the window manager, i.e. in .xinitrc or in your window manager's autostart feature.

If you sometimes log in without window manager but still want udiskie running, you can start an udiskie instance without notifications/tray via systemd. In this case you would start an additional udiskie instance with notifications/tray but without automount with the window manager as described above.

I'm pretty short on time right now, and this is not my top priority, since there is a workaround.

coldfix commented 7 years ago

About your other questions:

Personally, I usually go for detach when I know I'm gonna remove the drive physically.