💥 hypr(scripts): fix 'memory leak' in notification-handler-daemon script
This commit is contained in:
@@ -9,7 +9,7 @@ source = ~/.cache/wal/colors-hypr.conf
|
|||||||
|
|
||||||
general {
|
general {
|
||||||
gaps_in = 6
|
gaps_in = 6
|
||||||
gaps_out = 8
|
gaps_out = 12
|
||||||
|
|
||||||
border_size = 2
|
border_size = 2
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ layerrule = animation fade, hyprpaper
|
|||||||
layerrule = animation slide right, swaync-notification-window
|
layerrule = animation slide right, swaync-notification-window
|
||||||
layerrule = animation fade, hyprpicker
|
layerrule = animation fade, hyprpicker
|
||||||
layerrule = animation fade, anyrun
|
layerrule = animation fade, anyrun
|
||||||
|
layerrule = animation slide right, eww-cc
|
||||||
layerrule = animation fade, eww-calendar
|
layerrule = animation fade, eww-calendar
|
||||||
layerrule = animation fade, eww-volume
|
layerrule = animation fade, eww-volume
|
||||||
layerrule = animation fade, eww-powermenu
|
layerrule = animation fade, eww-powermenu
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
# Made by retrozinndev (João Dias)
|
# Made by retrozinndev (João Dias)
|
||||||
# From https://github.com/retrozinndev/Hyprland-Dots
|
# From https://github.com/retrozinndev/Hyprland-Dots
|
||||||
|
|
||||||
eww_config_dir=$(eww get EWW_CONFIG_DIR)
|
|
||||||
logfile="$HOME/.cache/notification-handler-daemon.log"
|
logfile="$HOME/.cache/notification-handler-daemon.log"
|
||||||
|
handler_script="$HOME/.config/eww/scripts/notification-handler.sh"
|
||||||
|
|
||||||
function Send_log() {
|
function Send_log() {
|
||||||
echo "[$1]${@/$1}" >> $logfile
|
echo "[$1]${@/$1}" >> $logfile
|
||||||
@@ -20,20 +20,20 @@ function Exit_daemon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Restart_handler() {
|
function Restart_handler() {
|
||||||
sh $eww_config_dir/scripts/notification-handler.sh &
|
bash $handler_script &
|
||||||
pid_handler=$!
|
pid_handler=$!
|
||||||
Send_log "info" "Handler started!"
|
Send_log "info" "Handler started!"
|
||||||
Send_log "info" "Handler script PID: $pid_handler"
|
Send_log "info" "Handler script PID: $pid_handler"
|
||||||
wait $pid_handler && Exit_daemon || \
|
wait $pid_handler && Exit_daemon || \
|
||||||
(Send_log "error" "An error occurred and handler stopped"
|
(Send_log "error" "An error occurred and handler stopped"
|
||||||
Send_log "info" "Clearing history and starting handler again."
|
Send_log "info" "Clearing history and starting handler again."
|
||||||
Restart_handler)
|
Restart_handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
trap "Send_log 'info' 'SIGINT received, stopping daemon and handler' ; kill \$pid_handler ; exit 1" SIGINT
|
trap "Send_log 'info' 'SIGINT received, stopping daemon and handler' ; kill \$pid_handler ; exit 1" SIGINT
|
||||||
trap "Send_log 'info' 'SIGTERM received, stopping daemon and handler' ; kill \$pid_handler ; exit 1" SIGTERM
|
trap "Send_log 'info' 'SIGTERM received, stopping daemon and handler' ; kill \$pid_handler ; exit 1" SIGTERM
|
||||||
|
|
||||||
echo '' > $logfile
|
echo -e '' > $logfile
|
||||||
Send_log "info" "Starting Daemon..."
|
Send_log "info" "Starting Daemon..."
|
||||||
Send_log "info" "Daemon script PID: $$"
|
Send_log "info" "Daemon script PID: $$"
|
||||||
Restart_handler
|
Restart_handler
|
||||||
|
|||||||
Reference in New Issue
Block a user