Because my GPD Pocket 3 loses sound upon resume-from-hibernation, I run a timed shutdown script:
#!/bin/bash
idletime=$((30*120*1000)) # 30 min in milliseconds
idle=0
while [ $idle -lt $idletime ];do
idle=$(xprintidle)
sleep 1
done
/home/jake/Scripts_Icons/Word_Shutdown
sleep 2
sudo shutdown -P now
Word_Shutdown Script:
#!/bin/bash
if test "$(wmctrl -l | grep -c "Microsoft Word" 2>&1)" -eq 1; then
wmctrl -a "Microsoft Word"
sleep .2
xdotool keydown 0xffea + key 4
sleep .2
xdotool keyup 0xffea
sleep .2
xdotool key y
fi
Everything works fine except for logout. At the logout screen, the machine promptly shuts down unassisted. If I kill the above shutdown script before I logout, logout works appropriately.
For now, I run a keystroked logout script, which kills the shutdown script, then runs the logout command.
Any idea why my shutdown script is shutting down the device upon logout?
Thanks,
Jake