You are not logged in.

#1 2016-04-01 09:53:47

pvsage
Internal Affairs
Registered: 2015-09-29
Posts: 1,433

Cron job to run changer.sh

^ if the desktop image is all you're using your Conky for, couldn't you have a cron job call changer.sh?


Be excellent to each other, and...party on, dudes!
BunsenLabs Forum Rules
Tending and defending the Flame since 2009

Offline

#2 2016-04-02 02:14:00

seppalta
Member
Registered: 2015-10-02
Posts: 43
Website

Re: Cron job to run changer.sh

pvsage wrote:

if the desktop image is all you're using your Conky for, couldn't you have a cron job call changer.sh?

Will cron require less comp resources than Conky?  Also, cron does not like me.  I have set-up various configurations, for example, * * * * * /home/me/bin/changer.sh in /var/spool/cron/crontabs/me.  But nothing happens.  Tried  sudo /etc/init.d/cron restart.  Got [ ok ] Restarting cron (via systemctl): cron.service.  What am I missing?

Last edited by seppalta (2016-04-02 07:07:33)

Offline

#3 2016-04-02 11:40:47

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,030

Re: Cron job to run changer.sh

Split to it's own thread.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#4 2016-04-02 15:39:20

pingu
Member
Registered: 2015-09-29
Posts: 128

Re: Cron job to run changer.sh

I'm not sure if any of this is necessary, and there's probably a less hacky way to solve this, but my cron job to switch wallpapers needs to export the display being used before running the wallpaper switch script.

This is what I've done:
I put this in my .bashrc

echo "$DISPLAY" > $HOME/.current_display

and this on my crontab (with crontab -e as a normal user):

*/5 * * * * (export DISPLAY=`cat /home/pingu/.current_display`; /home/pingu/scripts/wallpapers.sh)

edit: I didn't read the OP from the other thread, but I assumed it's about changing wallpapers. If it's not the case, sorry...

edit2: Also, you can take a look at your /var/log/cron.log entry to see if the script is being executed, or if there's some error message or something like that.

Last edited by pingu (2016-04-03 11:37:58)


"Chuck Norris can compile syntax errors."

Offline

#5 2016-04-02 19:30:36

seppalta
Member
Registered: 2015-10-02
Posts: 43
Website

Re: Cron job to run changer.sh

Thanks, Pingu.  Your procedure did the job!  It appears that all that is needed is to call up the display: 

* * * * *  DISPLAY=:0.0 /home/me/bin/changer.sh

Last edited by seppalta (2016-04-03 04:55:05)

Offline

#6 2016-04-03 09:20:12

pingu
Member
Registered: 2015-09-29
Posts: 128

Re: Cron job to run changer.sh

seppalta wrote:

Thanks, Pingu.  Your procedure did the job!  It appears that all that is needed is to call up the display: 

* * * * *  DISPLAY=:0.0 /home/me/bin/changer.sh

yes, if you always use DISPLAY=:0.0 that would do it. but if you occasionally startx on display 1 (e.g. I use 0 for openbox and 1 for i3), then the script will fail if you hardcode the display variable.

Last edited by pingu (2016-04-03 09:21:06)


"Chuck Norris can compile syntax errors."

Offline

Board footer

Powered by FluxBB