Switch from Dunst to Deadd Notifications

- Add Deadd Notification Center config & colors to README
- Add Deadd control script
- Exclude picom rounded corners for Deadd Notification
  Center since they are handled by the deadd config
- Replace dunst with deadd in startup script
- Pause/unpause deadd notifications in game launch/exit scripts
- Update control center script to use deadd
This commit is contained in:
Sravan Balaji
2021-06-16 17:26:42 -04:00
parent e4ff08d98c
commit e35ea7a9ab
10 changed files with 807 additions and 31 deletions

View File

@@ -12,7 +12,7 @@ help_menu() {
rofi_menu() {
declare -a options=(
" Compositor - picom"
" Notifications - dunst"
" Notifications - deadd"
" Media - playerctl"
"墳Volume - pactl"
" Hardware - system76-power"
@@ -40,8 +40,8 @@ main() {
--picom)
/home/sravan/.scripts/picom.sh --rofi
;;
--dunst)
/home/sravan/.scripts/dunst.sh --rofi
--deadd)
/home/sravan/.scripts/deadd.sh --rofi
;;
--playerctl)
/home/sravan/.scripts/playerctl.sh --rofi

99
.scripts/deadd.sh Executable file
View File

@@ -0,0 +1,99 @@
#!/bin/bash
help_menu() {
echo "Script to interact with deadd. Use only one argument at a time."
echo " - Toggle On/Off: deadd.sh OR deadd.sh --toggle OR deadd.sh -t"
echo " - Turn On: deadd.sh --on"
echo " - Turn Off: deadd.sh --off"
echo " - Toggle Notification Center: deadd.sh --toggle-center"
echo " - Pause Popup Notifications: deadd.sh --pause"
echo " - Unpause Popup Notifications: deadd.sh --unpause"
echo " - Rofi Menu: deadd.sh --rofi"
echo " - Help: deadd.sh --help OR deadd.sh -h"
}
is_running() {
if pgrep -x deadd-notificat >/dev/null; then
echo 1
else
echo 0
fi
}
rofi_menu() {
declare -a options=(
"⏼ Toggle - toggle"
" Turn On - on"
" Turn Off - off"
" Toggle Notification Center - toggle-center"
" Pause Popup Notifications - pause"
" Unpause Popup Notifications - unpause"
" Quit - quit"
)
choice=$(printf '%s\n' "${options[@]}" | rofi -dmenu -i)
option=$(printf '%s\n' "${choice}" | awk '{print $NF}')
if [[ "$option" != "quit" ]]; then
main "--$option" && main "--rofi"
fi
}
main() {
if [ $# -eq 0 ]; then
# No arguments
help_menu
else
case $1 in
--help | -h)
help_menu
;;
--toggle)
if [ $(is_running) -eq '1' ]; then
main --off
else
main --on
fi
;;
--on)
if [ $(is_running) -eq '1' ]; then
killall deadd-notificat
fi
/home/sravan/.local/bin/notify-send.py a --hint \
boolean:deadd-notification-center:true \
string:type:reloadStyle
notify-send "Turning Deadd ON"
;;
--off)
notify-send "Turning Deadd OFF"
if [ $(is_running) -eq '1' ]; then
killall deadd-notificat
fi
;;
--toggle-center)
kill -s USR1 $(pidof deadd-notification-center)
;;
--pause)
notify-send "Pausing Notifications"
/home/sravan/.local/bin/notify-send.py a --hint \
boolean:deadd-notification-center:true \
string:type:pausePopups > /dev/null 2>&1
;;
--unpause)
/home/sravan/.local/bin/notify-send.py a --hint \
boolean:deadd-notification-center:true \
string:type:unpausePopups > /dev/null 2>&1
notify-send "Unpausing Notifications"
;;
--rofi)
rofi_menu
;;
esac
fi
}
main $@

View File

@@ -1,3 +1,2 @@
#!/bin/bash
/home/sravan/.scripts/dunst.sh --dnd
# /home/sravan/.scripts/picom.sh --on
/home/sravan/.scripts/deadd.sh --unpause

View File

@@ -1,3 +1,2 @@
#!/bin/bash
# /home/sravan/.scripts/picom.sh --off
/home/sravan/.scripts/dunst.sh --dnd
/home/sravan/.scripts/deadd.sh --pause

View File

@@ -1,7 +1,7 @@
#!/bin/bash
declare -a system_array=(\
# Background Processes
"bash /home/sravan/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
"bash /home/sravan/.scripts/deadd.sh --on" \ # Deadd Notification Center
"bash /home/sravan/.scripts/picom.sh --on" \ # Picom Compositor
"greenclip daemon" \ # Greenclip Clipboard Manager
"redshift -x" \ # Reset redshift display gamma
@@ -16,13 +16,13 @@ declare -a system_array=(\
declare -a kill_system_array=(\
# Background Processes
"killall dunst" \ # Dunst Notification Daemon
"killall picom" \ # Picom Compositor
"killall greenclip" \ # Greenclip Clipboard Manager
"killall redshift" \ # Redshift Blue Light Filter
"killall polkit" \ # GNOME Polkit Authentication Agent
"killall light-locker" \ # Screen lock for lightdm
"killall kdeconnectd" \ # KDE Connect Daemon
"killall deadd-notificat" \ # Deadd Notification Center
"killall picom" \ # Picom Compositor
"killall greenclip" \ # Greenclip Clipboard Manager
"killall redshift" \ # Redshift Blue Light Filter
"killall polkit" \ # GNOME Polkit Authentication Agent
"killall light-locker" \ # Screen lock for lightdm
"killall kdeconnectd" \ # KDE Connect Daemon
)
declare -a apps_array=(\