You are not logged in.

#1 2016-11-29 17:12:18

fullchaos13
Member
Registered: 2016-04-18
Posts: 9

[SOLVED]Running Conky on Startup

Hey guys so I'm trying to run a simple conky script on startup.
This is the shell script (conky.sh) that runs the conky (has +x permission):
#!/bin/bash

conky -dc /usr/bin/conky_right.conf

So I tried the systemd approach and created conkyscript.service in /etc/system/system. The contents of the service file:
[Unit]
Description=Conky Startup Script

[Service]
Type=oneshot
ExecStart=/usr/bin/conky.sh

[Install]
WantedBy=multi-user.target

After which I enabled it and rebooted. Using Systemctl is-enabled conkyscript.service outputs enabled which tells me the service is running fine but I see no conky on my desktop. If I manually execute the script using ./conky.sh the conky turns on fine telling me the script has no problems with it. Hopping someone has a solution as I'm stuck.

Last edited by fullchaos13 (2016-11-29 20:25:02)

Offline

#2 2016-11-29 17:15:02

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,744

Re: [SOLVED]Running Conky on Startup

Generally, Conky is going to want an X session.  It has to start after you log in.
What window manager are you using?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2016-11-29 17:16:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,452
Website

Re: [SOLVED]Running Conky on Startup

This definitely should not be a system service.  There are several problems, most notably that your script runs conky as root, may run before the x server starts, and is not provided with a DISPLAY environment variable to know which x sesssion to run in.

You could potentially use a user service, but even this would be a lot of work for no reason.  Just put the conky command in your xinitrc or other X startup files.

Also note I suggeted using the conky command itself, not the script.  A script with just a single command is really silly.  You spawn an extra shell for no reason and have an additional file for no reason.  Anything that can run the script can run conky.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2016-11-29 17:16:34

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED]Running Conky on Startup

My guess is that conky is trying to start before your GUI is up and running. What DE/WM are you using, it probably has its own method for autostarting applications.

https://wiki.archlinux.org/index.php/Autostarting


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2016-11-29 17:44:45

fullchaos13
Member
Registered: 2016-04-18
Posts: 9

Re: [SOLVED]Running Conky on Startup

Thanks guys so I disabled the service as you suggested and took a different path and made a .desktop file in ~/.config/autostart with the contents
[Desktop Entry]
Name=Conky
GenericName=ConkyStartup
Comment=Start conky on boot
Exec=/usr/bin/conky.sh
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true

and after rebooting the conky now startups correctly. Thanks a lot guys!

Offline

#6 2016-11-29 17:59:44

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED]Running Conky on Startup

Great. Don't forget to mark your thread as [SOLVED}.

Edit - Is their any reason you're launching your script instead of launching conky directly as per Trilby's post?

Last edited by Slithery (2016-11-29 18:02:13)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#7 2016-11-29 20:25:27

fullchaos13
Member
Registered: 2016-04-18
Posts: 9

Re: [SOLVED]Running Conky on Startup

slithery wrote:

Great. Don't forget to mark your thread as [SOLVED}.

Edit - Is their any reason you're launching your script instead of launching conky directly as per Trilby's post?

haha no reason, just changed that.

Offline

Board footer

Powered by FluxBB