xrootdatetime: force update on SIGUSR1
parent
b0c18c7c15
commit
adc11bc50a
|
@ -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" ];
|
||||
|
|
Loading…
Reference in New Issue