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.

27 lines
464 B

4 years ago
4 years ago
4 years ago
  1. #!/bin/zsh
  2. getargs() {
  3. while getopts "se" opt
  4. do
  5. case $opt in
  6. s) start="true";;
  7. e) end="true";;
  8. esac
  9. done
  10. }
  11. start_dnd() {
  12. xset s off -dpms
  13. echo "off" > ~/.cache/screensaver
  14. notify-send "Screensaver off";
  15. }
  16. end_dnd() {
  17. xset s off +dpms
  18. echo "on" > ~/.cache/screensaver
  19. notify-send "Screensaver on.";
  20. }
  21. main() {
  22. getargs "$@";
  23. [[ "$start" ]] && start_dnd;
  24. [[ "$end" ]] && end_dnd;
  25. kill -53 $(pidof dwmblocks)
  26. }
  27. main "$@"