Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
631 B

#!/bin/zsh
getargs() {
while getopts "set" opt
do
case $opt in
s) start="true";;
e) end="true";;
t) toggle="true";;
esac
done
}
start_dnd() {
xset s off -dpms
echo "off" > ~/.cache/screensaver
notify-send "Screensaver off";
}
end_dnd() {
xset s off +dpms
echo "on" > ~/.cache/screensaver
notify-send "Screensaver on.";
}
toggle_dnd() {
if [ $(cat ~/.cache/screensaver) = "on" ]; then
start_dnd
else
end_dnd
fi
}
main() {
getargs "$@";
[[ "$start" ]] && start_dnd;
[[ "$end" ]] && end_dnd;
[[ "$toggle" ]] && toggle_dnd;
kill -53 $(pidof dwmblocks)
}
main "$@"