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:
99
.scripts/deadd.sh
Executable file
99
.scripts/deadd.sh
Executable 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 $@
|
Reference in New Issue
Block a user