Hello,
I've been working on a script to automatically put my computer to sleep when it gets below a certain battery percentage level. It uses zenity for dialog boxes and mpv for alert sounds. I designed it to be run as a Cron job. It seemed to be working when I tested it on the command line but when I tried to use it with Cron I realized that it may not be as easy as I had thought it would have been. Basically I want it to be run as a Cron job but it doesn't seem to work and I'm pretty sure it has something to do with my use of zenity and mpv.
Anyway this is the script: https://github.com/samcdc6600/sleep-FreeBSD-on-low-battery/blob/master/solp
Actually I think the sound might be working as I just heard it LOL. I've still got the entry I mad in my users crontab file with crontab -e. It is "*/4 * * * * export DISPLAY=:0 && /usr/bin/solp".
As you can see I've tried adding "DISPLAY=:0 &&" but I don't think it's working.
Any help would be much appreciated.
I've been working on a script to automatically put my computer to sleep when it gets below a certain battery percentage level. It uses zenity for dialog boxes and mpv for alert sounds. I designed it to be run as a Cron job. It seemed to be working when I tested it on the command line but when I tried to use it with Cron I realized that it may not be as easy as I had thought it would have been. Basically I want it to be run as a Cron job but it doesn't seem to work and I'm pretty sure it has something to do with my use of zenity and mpv.
Anyway this is the script: https://github.com/samcdc6600/sleep-FreeBSD-on-low-battery/blob/master/solp
Actually I think the sound might be working as I just heard it LOL. I've still got the entry I mad in my users crontab file with crontab -e. It is "*/4 * * * * export DISPLAY=:0 && /usr/bin/solp".
As you can see I've tried adding "DISPLAY=:0 &&" but I don't think it's working.
Any help would be much appreciated.