/ screensaver upd

This commit is contained in:
committer
2024-06-25 19:52:27 -05:00
parent 1d0c79bc3f
commit 5f4cd74fca

View File

@@ -55,24 +55,27 @@ nmrestart() {
}
screensaver() {
cmd="status"
cmd="info"
if [[ -n $1 ]]; then
cmd=$1
fi
if [ ${cmd} == "on" ] ; then
xset dpms
xautolock -enable
# tmp file used by i3status - by default screensaver is on, so no need for "screensaver_on.tmp"
trash-put "/tmp/screensaver_off.tmp"
elif [ ${cmd} == "off" ] ; then
xset -dpms
xautolock -disable
touch "/tmp/screensaver_off.tmp"
elif [ ${cmd} == "reset" ] ; then
if xset -q | grep -q 'DPMS is Enabled' ; then
xset -dpms
xset dpms
xautolock -restart
fi
elif [ ${cmd} == "status" ] ; then
elif [ ${cmd} == "info" ] ; then
xset -q
else
echo "error: unknown command \"${cmd}\""