You are not logged in.

#1 2015-02-25 17:21:39

ArtsAndLeisure
Member
From: The Netherlands
Registered: 2014-11-24
Posts: 6

Can't get application to start upon login

Hello everyone!

I'm using Gnome 3, and I am trying to get an application to run upon login. I've created the following desktop entry for it:

[Desktop Entry]
Type=Application
Name=xflux
Exec=/usr/bin/xflux -l 52.0 -g 5.0

I've tried saving in ~/.config/autostart and in /usr/share/gnome/autostart, but neither seem to work. The command "/usr/bin/xflux -l 52.0 -g 5.0" executes just fine when invoked in from the terminal, and other desktop entries in /usr/share/gnome/autostart start just fine. Do any of you have a clue of what I'm doing wrong?

Offline

#2 2015-02-25 18:28:29

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Can't get application to start upon login

What is /usr/bin/xflux? If it's a shell script, you need to run it with something like 'bash -c'.

Offline

#3 2015-02-25 20:09:40

ArtsAndLeisure
Member
From: The Netherlands
Registered: 2014-11-24
Posts: 6

Re: Can't get application to start upon login

/usr/bin/xflux is an executable.

Edit: changed flux to xflux

Last edited by ArtsAndLeisure (2015-02-25 20:56:03)

Offline

#4 2015-02-25 20:23:23

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: Can't get application to start upon login

I never had much luck with f.lux on linux. I don't know exactly what the problem is here, it looks okay.

If you don't find a solution, I recommend using redshift. It achieves the same end as f.lux. You can find it in the official repos here.

Edit: in your last post I assume you mean xflux, as that is the name of the executable.

Last edited by nullified (2015-02-25 20:25:09)


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#5 2015-02-25 20:57:33

ArtsAndLeisure
Member
From: The Netherlands
Registered: 2014-11-24
Posts: 6

Re: Can't get application to start upon login

Whoops, I did indeed mean xflux. Thanks for your advice! If I don't figure it out by tomorrow I'll switch to redshift.

Offline

#6 2015-08-20 17:01:36

anserk
Member
Registered: 2015-07-29
Posts: 6

Re: Can't get application to start upon login

I am trying to do the same thing. It seems that you need to wait until after X starts so I wrote something like this but still no luck ...

[Unit]
Description=Launches xflux
Requires=gdm
After=gdm.service

[Service]
Type=forking
ExecStart= /usr/bin/xflux -z zipcode 
#Restart=always

[Install]
WantedBy=graphical.target

Let me know if you have any updated/ideas ...

Last edited by anserk (2015-08-20 17:02:04)

Offline

#7 2015-08-20 17:11:26

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Can't get application to start upon login

Tell the service to restart after e.g. 30 seconds:

...

[Service]
ExecStart=<foo>
Restart=always
RestartSec=30

...

Offline

#8 2015-08-20 17:11:53

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,175
Website

Re: Can't get application to start upon login

It's been a while since I last touched GNOME, but does the Startup Applications part of the GNOME tweak tool allow for a set delay before starting an application? Reason I ask is because they have this in Cinnamon (so I've set Conky to start after a 15 second delay when using Cinnamon, for no particular reason apart from that I can).


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#9 2015-08-20 18:40:55

Fixxer
Member
From: Poland
Registered: 2011-08-29
Posts: 233

Re: Can't get application to start upon login

If program should start immediately with xsession - try xprofile method. Create it simply with command:

echo "xflux -l 52.0 -g 5.0" >> .xprofile

You can also use ~/.xprofile with "external" autostart:

your_executable_shell_autostart_script &

Script wihout defined path (only name) must be located on $PATH, e.g. in /usr/local/bin/

One more valid thing - check out if Gnome 3 has any stored sessions.

Offline

#10 2015-08-20 21:51:08

anserk
Member
Registered: 2015-07-29
Posts: 6

Re: Can't get application to start upon login

Even with the restart always and timeout of 30 seconds I couldn't make it work.
With Fixxer suggestion everything works, I added the script in my home directory and call xflux from there. Seems to work fine so far.
Thank you very much.

Offline

Board footer

Powered by FluxBB