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.

37 lines
600 B

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. #!/bin/zsh
  2. #
  3. getargs() {
  4. while getopts "set" opt
  5. do
  6. case $opt in
  7. s) start="true";;
  8. e) end="true";;
  9. t) toggle="true";;
  10. esac
  11. done
  12. }
  13. start_dnd() {
  14. dunstctl set-paused true
  15. }
  16. end_dnd() {
  17. dunstctl set-paused false
  18. notify-send "Do Not Disturb" "Do Not Disturb mode ended. Notifications will be shown.";
  19. }
  20. toggle_dnd() {
  21. if [ $(dunstctl is-paused) = "false" ]; then
  22. start_dnd
  23. else
  24. end_dnd
  25. fi
  26. }
  27. main() {
  28. getargs "$@";
  29. [[ "$start" ]] && start_dnd;
  30. [[ "$end" ]] && end_dnd;
  31. [[ "$toggle" ]] && toggle_dnd;
  32. kill -52 $(pidof dwmblocks)
  33. }
  34. main "$@"