2

So: I just installed Conky, and it looks very nice. But it's annoying to constantly open it on startup manually. So I've search for a way to autostart Conky

I've tried:

  • Making a .desktop file and put it in /home/<username>/.config/autostart/, but it wouldn't open, even if I added a 30 seconds delay.
[Desktop Entry] Type=Application Exec=/usr/bin/conky -p 30 Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name=conky Comment=conky 
  • Create a user service, enabled it on startup and try to restart. But when I checked the log, it returned an error conky: can't open display: , even if I added a 30/60 seconds delay.
$ systemctl --user status conky.service conky.service - Conky autostart Loaded: loaded (/home/<username>/.config/systemd/user/conky.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Fri 2022-05-20 16:47:00 +07; 4s ago Process: 1568 ExecStart=/usr/bin/conky --config=/home/anhquan/.conkyrc --daemonize --pause=60 (code=exited, status=1/FAILURE) CPU: 18ms May 20 16:46:00 fedora systemd[1550]: Starting conky.service - Conky autostart... May 20 16:47:00 fedora conky[1568]: conky: can't open display: May 20 16:47:00 fedora systemd[1550]: conky.service: Control process exited, code=exited, status=1/FAILURE May 20 16:47:00 fedora systemd[1550]: conky.service: Failed with result 'exit-code'. May 20 16:47:00 fedora systemd[1550]: Failed to start conky.service - Conky autostart. 

It does seem to work for other people, but doesn't for Fedora 36 / GNOME 42. It might be a bug with the OS / DE, or some changes to Conky that I didn't knew, or maybe it's a problem with Wayland. So is there a different way to autostart it in F36 / G42?

P/S: Here is the new log when forcing Xwayland to start:

○ conky.service - Conky autostart Loaded: loaded (/home/anhquan/.config/systemd/user/conky.service; enabled; vendor preset: disabled) Active: inactive (dead) since Fri 2022-05-20 17:38:23 +07; 17s ago Process: 1575 ExecStartPre=Xwayland (code=exited, status=1/FAILURE) CPU: 56ms May 20 17:38:23 fedora systemd[1556]: Starting conky.service - Conky autostart... May 20 17:38:23 fedora systemd[1556]: conky.service: Control process exited, code=exited, status=1/FAILURE May 20 17:38:23 fedora systemd[1556]: conky.service: Failed with result 'exit-code'. May 20 17:38:23 fedora systemd[1556]: Failed to start conky.service - Conky autostart. 

PSS: After running strace, here's what systemctl reported (No logs written to the /tmp directory can be found)

conky.service - Conky autostart Loaded: loaded (/home/anhquan/.config/systemd/user/conky.service; enabled; vendor preset: disabled) Active: inactive (dead) since Fri 2022-05-20 18:04:11 +07; 21s ago Process: 1578 ExecStart=strace -f /tmp/conky.log /usr/bin/conky --config=/home/anhquan/.conkyrc -p 30 (code=exited, status=203/EXE> CPU: 1ms May 20 18:04:11 fedora systemd[1560]: Starting conky.service - Conky autostart... May 20 18:04:11 fedora systemd[1578]: conky.service: Failed to locate executable strace: No such file or directory May 20 18:04:11 fedora systemd[1578]: conky.service: Failed at step EXEC spawning strace: No such file or directory May 20 18:04:11 fedora systemd[1560]: conky.service: Control process exited, code=exited, status=203/EXEC May 20 18:04:11 fedora systemd[1560]: conky.service: Failed with result 'exit-code'. May 20 18:04:11 fedora systemd[1560]: Failed to start conky.service - Conky autostart. 
0

2 Answers 2

3

-You need put the entry at the file in your HOME dir, the file .profile at the end of the file, a line with the command to start the conky, like this:

 /usr/bin/conky -q -d -a tm -c $HOME/.conkyrc 

At this sample the command just start the conky using the "dot", .conkyrc at the HOME user, take an little test, ok after you verify wich your conky are working so perfectly you just put an redirection to null device file to not get the out put of the command like this:

 /usr/bin/conky -q -d -a tm -c $HOME/.conkyrc > /dev/null & 

With this your conky goes work so perfectly. because the options at the command line does:

**> -q , --quiet - put the conky at the quiet mode.

 -d , --daemonize - put the conky in daemonize mode, fork to background -a , --alignment=ALIGNMENT - put the conky alignment on the screen, {top,bottom,middle}_{left,right,middle} you can use the 

initials to define the alignment like tm to {top}_{middle}.

 -c , --config=FILE - just point the configuration file conkrc, where the file stay.** 

the redirection " >/dev/null " just put out any message to the blackhole and the signal of " & ", put the conky at loop.

1
  • 1
    Although not a direct answer to question, your post provides lots of useful information to help others. Commented Jul 27, 2022 at 17:53
3

So after looking at Issues in the GitHub repo of Conky, more specifically: https://github.com/brndnmtthws/conky/issues/869

and also looking at the log: May 20 16:47:00 fedora conky[1568]: conky: can't open display

I've added a new config into the services file: Environment="DISPLAY=:0"

And now it worked nicely, even with lower delay!

1
  • Don't forget to accept this answer to your own question as the appropriate solution (in your case). Commented Jul 27, 2022 at 17:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.