You are not logged in.

#1 2013-02-07 07:47:12

Loth1
Member
Registered: 2012-04-26
Posts: 6

[SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Hi everyone!

I'm using Arch + Awesome WM

I've installed dropbox from aur and it works fine when launched, both manually and from a startup script.

/usr/bin/dropboxd

Hovever, when I try to start dropbox service via systemctl no icon appears in the notification area (dropbox works, nevertheless). The same behaviour occurs enabling the service and rebooting (while a classic autostart launching dropboxd from a script shows the notification icon).

Any hint?

 % sudo systemctl start dropbox@daniele.service
 % sudo systemctl status dropbox@daniele.service
dropboxd@daniele.service - Dropbox
	  Loaded: loaded (/usr/lib/systemd/system/dropbox@.service; enabled)
	  Active: active (running) since Thu 2013-02-07 08:27:27 CET; 3s ago
	Main PID: 1738 (dropbox)
	  CGroup: name=systemd:/system/dropbox@.service/daniele
		  └─1738 /opt/dropbox/dropbox

Feb 07 08:27:27 DanieleXPSA systemd[1]: Starting Dropbox...
Feb 07 08:27:27 DanieleXPSA systemd[1]: Started Dropbox.
Feb 07 08:27:27 DanieleXPSA dropboxd[1738]: /opt/dropbox
Feb 07 08:27:27 DanieleXPSA dropboxd[1738]: /opt/dropbox

EDIT:
The solution is:

WorMzy wrote:

Copy the .service file to /etc/systemd/system/ and add "Environment=DISPLAY=:0" to the [service] definition.

Then

# systemctl daemon-reload

and

# systemctl start dropbox@daniele

Last edited by Loth1 (2013-02-07 15:41:20)

Offline

#2 2013-02-07 08:24:39

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Forget the *.service file... Start Dropbox with:

$ dropboxd &

Then right click the tray icon - Preferences - and check "Start Dropbox on system startup". It creates a "~/.config/autostart/dropbox.desktop" file which will start it automatically.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2013-02-07 11:58:22

matthiaslinux
Member
Registered: 2008-12-01
Posts: 12

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Maybe systemctl starts your dropbox service before the GUI is even up and running? Where should the poor thing put its icon?
You could try to read here about targets and dependencies: https://wiki.archlinux.org/index.php/Systemd.

Then again, the previous suggestion or some other autostart mechanism in Awesome will probably achieve exactly what you want anyhow.

;-)

Offline

#4 2013-02-07 12:19:41

Loth1
Member
Registered: 2012-04-26
Posts: 6

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Sorry, saying "notification area" I meant "System Tray" (wibox.widget.systray()).

I'm still using an autostart script launched by awesome, but since the .service exists I wanted to use it. The icon doesn't appear even doing a systemctl start from the terminal emulator, the process starts, dropbox works but there is no icon in the system tray.

Offline

#5 2013-02-07 12:31:10

matthiaslinux
Member
Registered: 2008-12-01
Posts: 12

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Maybe systemctl starts dropboxd as the user root? Maybe dropboxd then has no access to you display as X would not allow it? Try "xhost +" and then start the service again. If it works then at least you know where to look...

Offline

#6 2013-02-07 12:36:10

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

The service runs outside of an X session, I presume it's there so that you can start dropbox as user X when the PC boots up, so that you can access your files remotely even when you haven't logged in to your machine? I don't use dropbox, so I have no idea how it works.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#7 2013-02-07 12:52:37

Loth1
Member
Registered: 2012-04-26
Posts: 6

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Thanks for your replies.

matthiaslinux wrote:

Maybe systemctl starts dropboxd as the user root? Maybe dropboxd then has no access to you display as X would not allow it? Try "xhost +" and then start the service again. If it works then at least you know where to look...

Unfortnately it didn't work. The service is launched as my user.

daniele  10933 78.6  2.0 1868980 120244 ?      Ssl  13:37   1:19 /opt/dropbox/dropbox
WorMzy wrote:

The service runs outside of an X session, I presume it's there so that you can start dropbox as user X when the PC boots up, so that you can access your files remotely even when you haven't logged in to your machine? I don't use dropbox, so I have no idea how it works.

Dropbox is a deamon, accessible even via console using the dropbox-cli package from AUR. When it starts I suppose it tries to create a system tray icon (I have no idea how it's implemented) and for some reason, the client launched by systemctl can't complete this step.

Last edited by Loth1 (2013-02-07 12:53:01)

Offline

#8 2013-02-07 13:09:57

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

The service starting up - so that dropbox will sync once the network is available - and the icon in the panel are 2 separate events and need to be set up individually depending on your choice of panel wink  ... unless i've been doing it wrong for X years big_smile

Offline

#9 2013-02-07 13:33:03

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Copy the .service file to /etc/systemd/system/ and add "Environment=DISPLAY=:0" to the [service] definition.

Then

# systemctl daemon-reload

and

# systemctl start dropbox@daniele

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#10 2013-02-07 15:39:56

Loth1
Member
Registered: 2012-04-26
Posts: 6

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

WorMzy wrote:

Copy the .service file to /etc/systemd/system/ and add "Environment=DISPLAY=:0" to the [service] definition.

Then

# systemctl daemon-reload

and

# systemctl start dropbox@daniele

Works like a charm, thanks!

Offline

#11 2013-07-23 00:22:14

developej
Member
Registered: 2011-10-02
Posts: 68

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Hey,

I can't get it to work...

I copied the service and added the "Environment=DISPLAY=:0" to the [service] definition. If I manually start the service with # systemctl start dropbox@developej
the service starts and there is the icon in the tray.

But if I do a # systemctl enable dropbox@developej (the output says it linked the  dropbox@developej.service if it means anything), and I reboot, there is no icon!
$ systemctl status dropbox@developej says that it is running though...

Ideas?

Offline

#12 2013-07-23 00:54:09

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

I would bet that it is being started before the existence of a system tray.

Offline

#13 2013-07-23 02:03:49

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

What is the benefit of starting the system tray icon using systemd unless the system tray is also a service managed by systemd? That is, in that case, I could see the point because you could have systemd manage the dependency using After=SysTray or something but I don't really see the point otherwise. The daemon part needs the network so there's a reason to start that with systemd but the sys tray icon seems more like a regular application.

Am I missing something? Maybe with user sessions it makes sense?

I should say that I'm just curious because it seems that a little while ago, it was difficult to persuade anybody to do anything the systemd way - people wanted to know how to run their init scripts using systemd etc. But now people seem to want to do everything the systemd way even when there isn't a systemd way to do it smile. I can't figure out if this is just because people want to see what systemd can do at the limits (fine) or whether it is because they think systemd ought to be doing everything whatsoever to do with automation (which seems to rest on a mistake).


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#14 2013-07-23 02:48:40

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

There is a systemd way to do it, but it is not yet implemented fully as of yet.  That way is using systemd --user.  By doing that, you can effectively order the dropbox service to start after your window manager and/or tray.  But this requires actually implementing systemd --user manually in a not quite fully supported way.

Last edited by WonderWoofy (2013-07-23 02:48:57)

Offline

#15 2013-07-23 06:25:53

developej
Member
Registered: 2011-10-02
Posts: 68

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

So what is the best practice for this kind of problems?

Offline

#16 2013-07-23 06:29:19

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

It depends on how you start X.  But you need to *somehow* delay the start of the dropbox unit until after the tray is started.  So unless you boot straight into X without a DM or anything, I see no clean reasonable solution for this w/o using "systemd --user".

Offline

#17 2013-07-23 07:03:07

developej
Member
Registered: 2011-10-02
Posts: 68

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

 cat .zprofile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

is how I start X.

Thanks, I'll see what will I end up with...

Offline

#18 2013-07-23 07:07:31

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

If you also have autologin to the tty, then as a dirty hack you could probably just use a systemd timer to wait a few seconds before starting the actual service file itself.

Offline

#19 2013-07-23 12:45:39

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

WonderWoofy wrote:

It depends on how you start X.  But you need to *somehow* delay the start of the dropbox unit until after the tray is started.  So unless you boot straight into X without a DM or anything, I see no clean reasonable solution for this w/o using "systemd --user".

Do you mean: no such systemd solution? Isn't it otherwise possible to just have it start as an autostart application in your DE or whatever? I'm not saying the systemd solution isn't a reasonable one - just that it is not the only one.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#20 2013-07-23 13:37:19

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

@cfr, I think that would be the much more sane idea in this case.  But the question in this thread was specifically regarding using it as a systemd service.

Offline

#21 2013-07-23 14:05:01

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

WonderWoofy wrote:

@cfr, I think that would be the much more sane idea in this case.  But the question in this thread was specifically regarding using it as a systemd service.

True enough but I wasn't clear whether developej had the same purpose as the OP, especially given the question about "best practice for this kind of problems" which sounded rather more open-ended than the original enquiry. I just thought it worth clarifying that there are other reasonable solutions if what you want is to solve the problem as opposed to solving it using a particular tool. But probably you are right and developej picked this thread due to a desire to use systemd for it.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#22 2013-07-23 14:10:19

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Oh, you're totally right, developej is not the OP here.  I just read his/her post, read the title and made some assumptions... whoops.

Sorry developej, if you're still around, there are better ways of doing this.

Offline

#23 2013-07-23 17:42:38

developej
Member
Registered: 2011-10-02
Posts: 68

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

I am. smile
Give links, tell me what to read smile

Offline

#24 2013-07-23 18:37:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Did you try the solution earlier in this thread at https://bbs.archlinux.org/viewtopic.php … 6#p1228386 ? I'm pretty sure that's how I did it and it works fine here.

If not, can you post .xinitrc so we can see exactly what you are using? If the earlier solution doesn't work, the best option is likely to depend on what else you are using e.g. DE or standalone WM or whatever as different options have different configurations.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#25 2013-07-23 18:39:34

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dropbox via systemctl, no icon in awesome WM system tray

Yes, I would just put it in your window manager's autostart script (for example, $HOME/.config/openbox/autostart for openbox).  Otherwise, most desktop environments use the xdg autostart directory.  That is, whatever *.desktop is in the given autostart directory is.... well, autostarted.

Offline

Board footer

Powered by FluxBB