diff --git a/modules/dwm.nix b/modules/dwm.nix index ce90302..738d839 100644 --- a/modules/dwm.nix +++ b/modules/dwm.nix @@ -50,7 +50,7 @@ in xsetroot = getExe pkgs.xorg.xsetroot; in /* bash */ '' - while true; do + function update_x_root() { set +e # allow errors mute="$(${pamixer} --default-source --get-mute)" set -e # disallow errors @@ -63,7 +63,14 @@ in dateTime=$(date +"<-- %A, %B %d -- %H:%M -->") ${xsetroot} -name "$mutedString$dateTime" - sleep 1 + } + + trap update_x_root SIGUSR1 + + while true; do + sleep 1 & + wait + update_x_root done ''; wantedBy = [ "graphical-session.target" ];