dotfiles/xenodm.Xsetup_0

28 lines
741 B
Bash

#!/bin/sh
# Thanks to www.tumfatig.net for the inspiration
xsetroot -solid "#FCFCFC"
# Sleep / Restart / Shutdown bar
( while true; do
xmessage -geometry +700-40 -buttons "[ Sleep ]":20,"[ Restart ]":21,"[ Shutdown ]":22 ""
ACTION=$?
echo "Xmessage said: $ACTION"
if [ $ACTION -eq 20 ]; then
/usr/sbin/zzz
elif [ $ACTION -eq 21 ]; then
xsetroot -cursor_name watch
/sbin/shutdown -r now
elif [ $ACTION -eq 22 ]; then
xsetroot -cursor_name watch
/sbin/shutdown -p now
else
echo "Xmessage error"
fi
# Stop looping if xmessage died (hopefully killed by GiveConsole)
if [ -z "$(pgrep -U root xclock)" ]; then break; fi
done) &
# Message with OS and release number
xmessage -geometry +850-0 -buttons "" "($(uname -sr))" &