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.

26 lines
513 B

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. 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. echo "off" > ~/.cache/dunst
  13. notify-send "DUNST_COMMAND_PAUSE";
  14. }
  15. end_dnd() {
  16. echo "on" > ~/.cache/dunst
  17. notify-send "DUNST_COMMAND_RESUME";
  18. notify-send "Do Not Disturb" "Do Not Disturb mode ended. Notifications will be shown.";
  19. }
  20. main() {
  21. getargs "$@";
  22. [[ "$start" ]] && start_dnd;
  23. [[ "$end" ]] && end_dnd;
  24. kill -52 $(pidof dwmblocks)
  25. }
  26. main "$@"