xrootdatetime: fixing crash on initial boot
xrootdatetime: trying to fix crashes xrootdatetime: allow errorsmain
parent
28573bd36d
commit
b0c18c7c15
|
@ -44,18 +44,28 @@ in
|
|||
};
|
||||
|
||||
systemd.user.services.xrootdatetime = {
|
||||
script = ''
|
||||
while true; do
|
||||
if [[ "$(${getExe pkgs.pamixer} --default-source --get-mute)" == "true" ]]; then
|
||||
mutedString="Mic Muted "
|
||||
else
|
||||
mutedString=""
|
||||
fi
|
||||
dateTime=$(date +"<-- %A, %B %d -- %H:%M -->")
|
||||
${getExe pkgs.xorg.xsetroot} -name "$mutedString$dateTime"
|
||||
sleep 1
|
||||
done
|
||||
'';
|
||||
script =
|
||||
let
|
||||
pamixer = getExe pkgs.pamixer;
|
||||
xsetroot = getExe pkgs.xorg.xsetroot;
|
||||
in
|
||||
/* bash */ ''
|
||||
while true; do
|
||||
set +e # allow errors
|
||||
mute="$(${pamixer} --default-source --get-mute)"
|
||||
set -e # disallow errors
|
||||
|
||||
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" ];
|
||||
after = [ "pipewire.service" ];
|
||||
serviceConfig.Restart = "on-failure";
|
||||
|
|
Loading…
Reference in New Issue