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.

40 lines
664 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
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. dunstify -r 52 -a " Notifications" "Switching to do not disturb"
  15. sleep 0.5
  16. dunstctl set-paused true
  17. }
  18. end_dnd() {
  19. dunstctl set-paused false
  20. dunstify -r 52 -a " Notifications" "Turning off do not disturb"
  21. }
  22. toggle_dnd() {
  23. if [ $(dunstctl is-paused) = "false" ]; then
  24. start_dnd
  25. else
  26. end_dnd
  27. fi
  28. }
  29. main() {
  30. getargs "$@";
  31. [[ "$start" ]] && start_dnd;
  32. [[ "$end" ]] && end_dnd;
  33. [[ "$toggle" ]] && toggle_dnd;
  34. kill -52 $(pidof dwmblocks)
  35. }
  36. main "$@"