xrootdatetime: fixing crash on initial boot

xrootdatetime: trying to fix crashes
xrootdatetime: allow errors
This commit is contained in:
Zynh Ludwig 2024-10-30 20:33:17 -07:00
parent 28573bd36d
commit b0c18c7c15

View file

@ -44,18 +44,28 @@ in
}; };
systemd.user.services.xrootdatetime = { systemd.user.services.xrootdatetime = {
script = '' script =
while true; do let
if [[ "$(${getExe pkgs.pamixer} --default-source --get-mute)" == "true" ]]; then pamixer = getExe pkgs.pamixer;
mutedString="Mic Muted " xsetroot = getExe pkgs.xorg.xsetroot;
else in
mutedString="" /* bash */ ''
fi while true; do
dateTime=$(date +"<-- %A, %B %d -- %H:%M -->") set +e # allow errors
${getExe pkgs.xorg.xsetroot} -name "$mutedString$dateTime" mute="$(${pamixer} --default-source --get-mute)"
sleep 1 set -e # disallow errors
done
''; if [[ "$mute" == "true" ]]; then
mutedString="Mic Muted "
else
mutedString=""
fi
dateTime=$(date +"<-- %A, %B %d -- %H:%M -->")
${xsetroot} -name "$mutedString$dateTime"
sleep 1
done
'';
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
after = [ "pipewire.service" ]; after = [ "pipewire.service" ];
serviceConfig.Restart = "on-failure"; serviceConfig.Restart = "on-failure";