Autostart shell script under Gnome with wayland


I am trying to start a shell script after user login in gnome. Under Xorg I did this with a .desktop file in ~/.config/autostart.

Today I switched to wayland and the autostart of this script doesn’t work.

The script should start two instances of conky. When I run the script manually all is working fine and conky gives me the information. But the autostart is not working.

Here is the .desktop file (~./config/autostart/startconky.desktop

[Desktop Entry]
Comment=custom script

and the the content of the script:

exec conky --config=/home/NAME/.conky/.conkyrc &
exec conky --config=/home/NAME/.conky/.conkyrcnet &

Is there another way to autostart a script under wayland?

Autostart works just the same under wayland, but I’m not sure if conky does? Have you tried running that script from terminal after switching to wayland?

I tried this and it works. I can start the script manualy.

Maybe add a little delay in the script (sleep 30 ) . If the script is executed to early you might not see conky.

Start with 30 seconds and go backwards if it is working.

Or switch to a systemd user service. I use it for my conky(s)
For example

 $ systemctl --user cat conky-0.service
# /home/xabbu/.config/systemd/user/conky-0.service
Description=Conky Part 0

ExecStartPre=/usr/bin/sleep 1
ExecStart=/usr/bin/conky -c /home/xabbu/.conkyrc


I need a one second delay. Otherwise I would not see my conkys. ( It does not work as good if you use sometimes only ssh without logging in before via GDM. )

A systemd service also works, however Conky already has a delay option built in:

See conky --help:

-p, --pause=SECS          pause for SECS seconds at startup before doing anything


conky --daemonize --pause=30 --config=/home/NAME/.conky/.conkyrc &

I tried to start the script with a unit file. After boot up the sytem I used sudo systemctl start conky.service to start conky manualy but:

➜ sudo systemctl status conky.service
● conky.service - Conky for network and system information
     Loaded: loaded (/etc/systemd/system/conky.service; enabled; vendor preset: disabled)
     Active: inactive (dead) since Fri 2020-10-30 09:13:04 CET; 5s ago
    Process: 584883 ExecStartPre=/usr/bin/sleep 10 (code=exited, status=0/SUCCESS)
    Process: 584946 ExecStart=/home/NAME/.conky/ (code=exited, status=0/SUCCESS)

Okt 30 09:12:54 xxx systemd[1]: Starting Conky for network and system information...
Okt 30 09:13:04 xxx systemd[1]: Started Conky for network and system information.
Okt 30 09:13:04 xxx[584948]: conky:
Okt 30 09:13:04 xxx[584947]: conky:
Okt 30 09:13:04 xxx[584948]: can't open display:
Okt 30 09:13:04 xxx[584947]: can't open display:
Okt 30 09:13:04 xxx systemd[1]: conky.service: Succeeded

You need to use a user service file and not a system service file. A system service is run as root by default (unless you define a user and group).

Also your script starts 2 conky instances. This does not work well. Use fore every conky instance a different service file.

Or use the old way (desktop file in autostart) but add a delay.

1 Like

Thanbs, I will try it

With using user unit files and one file for every conky instance it works. Thanks a lot

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.