You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have an option to automatically exit dunst after X (configurable) seconds of inactivity (= without active notifications).
dunst is restarted via dbus anyway, if it's needed after a longer period of inactivity.
Currently I use the below wrapper script to achieve this behaviour:
#!/bin/bash## Small wrapper for dunst to kill it, if it becomes unused.## Can be used as dbus execution alternative.set -e -o pipefail
#timeout in seconds after which to kill dunst
TIMEOUT=60
#time in seconds to wait before the next check
CHECK_INTERVAL=3
#current timeout
TIMEOUT_CUR="$TIMEOUT"#is_unmanaged [window id]functionis_unmanaged {
local win="$1"
xwininfo -id "$win"| grep 'Map State: IsUnMapped'&> /dev/null
}
#wait for dunst to become unused for more than $TIMEOUT seconds and kill it afterwardsfunctionkillUnusedDunst {
local windows=
local line=""local win found
local re='^\s+(0x[0-9A-Fa-f]+) "Dunst".*$'while:;do
sleep $CHECK_INTERVAL
TIMEOUT_CUR=$(($TIMEOUT_CUR-$CHECK_INTERVAL))
found=1
windows="$(xwininfo -root -tree | grep '"Dunst"')"while IFS= read -r line || [ -n"$line" ] ;do
[[ "$line"=~$re ]] ||continue
win="${BASH_REMATCH[1]}"
found=0
#reset, if the window is managed
is_unmanaged "$win"|| TIMEOUT_CUR="$TIMEOUT"done<<<"$windows"#no windows found or timeout?if [ $found-ne 0 ] || [ $TIMEOUT_CUR-le 0 ] ;then
killall "dunst"returnfidone
}
dunst "$@"&disown
killUnusedDunst
The text was updated successfully, but these errors were encountered:
This looks quite a lot to me to just show a notification from time to time.
Considering that I currently run ~15 VMs, in the worst case each with 2 dunst processes (one for the regular user, one for root) that could sum up to 20*2*15 = 600 MB RSS memory. Interestingly the VSZ number is higher than even what init or Xorg request...
I run those VMs on Qubes OS, which supports memory load balancing across VMs, but of course only for unallocated memory.
Moreover my window manager is buggy and fails to properly implement override-redirect windows, which may make them appear behind windows, if they are re-mapped (which dunst happens to do). The timeout makes sure that dunst doesn't re-map old windows too often.
We depend on a lot of memory heavy and dubiously memleak-free libraries (cairo, pango, glib). Maybe the memory footprint is high due to some hidden leak? I will have to investigate
However I don't think that adding an option just to quit on idle is worth it. I would rather allow the use of a script on idle at that point
It would be nice to have an option to automatically exit dunst after X (configurable) seconds of inactivity (= without active notifications).
dunst is restarted via dbus anyway, if it's needed after a longer period of inactivity.
Currently I use the below wrapper script to achieve this behaviour:
The text was updated successfully, but these errors were encountered: