You are not logged in.
Hey all,
After having a service file to restart an application (that outputs text to the root window for DWM's statusbar) that kept failing numerous times, I decided to go back to the good old scripts to manage things. I already have one in use for my powersaving scripts, that looks like this:
#!/bin/sh
case $1/$2 in
pre/*)
/usr/bin/powersave false ;;
post/*)
if cat /sys/class/power_supply/BAT1/status | grep Discharging > /d$
then
/usr/bin/powersave true
else
/usr/bin/powersave false
fi
;;
esacI based the new script on it, which looks like this:
#!/bin/sh
case $1/$2 in
pre/*)
/usr/bin/killall dwmst
;;
post/*)
/usr/bin/sleep 3 && /usr/bin/dwmst &
;;
esacBut it's not working after suspend; my application is not launched. When I run the script from the terminal, it does work as expected. Here's the output of journalctl:
nov 22 15:05:48 edge systemd-sleep[7405]: /usr/lib/systemd/system-sleep/dwmst.sh exited with exit status 1.What is wrong here?
EDIT 23-12-2013: I went back to a systemd service file.
Last edited by Unia (2013-12-23 00:04:40)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
If you test it by putting some things in there that print to a file or the journal or something, do they show up? I'm just wondering if the formatting is somehow screwed up (which it doesn't appear to be), or if it might be some kind of a race between the things run by /usr/bin/powersave and the things it writes to.
Offline
Indeed, those messages do not show. What does this mean?
I could, of course, combine both scripts but the Wiki clearly states multiple scripts should work so I'd prefer that.
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline