fix: make scrips fail-proof (hopefully) so that desktop also works with them or just ignores them

This commit is contained in:
Ahwx 2025-05-09 03:51:05 +02:00
parent 1f302adc0f
commit c2d0247bc7

View file

@ -183,6 +183,7 @@
text = '' text = ''
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ "$(hostname)" == "sakura" ]]; then
if [[ $(cat /proc/acpi/button/lid/LID0/state | grep "open") ]]; then if [[ $(cat /proc/acpi/button/lid/LID0/state | grep "open") ]]; then
LTEXT="󰌢 " LTEXT="󰌢 "
else else
@ -209,6 +210,7 @@
fi fi
echo "$LTEXT $CTEXT $MTEXT" echo "$LTEXT $CTEXT $MTEXT"
fi
''; '';
}; };
"/home/${username}/.local/bin/waybar-powerdraw" = { "/home/${username}/.local/bin/waybar-powerdraw" = {
@ -216,7 +218,7 @@
text = '' text = ''
#!/usr/bin/env zsh #!/usr/bin/env zsh
if [[ "$(cat /sys/class/power_supply/BAT1/status)" == "Discharging" ]]; then; cat /sys/class/power_supply/BAT1/current_now /sys/class/power_supply/BAT1/voltage_now | xargs | awk '{print $1*$2/1e12 " W"}'; fi if [[ -f /sys/class/power_supply/BAT1/status && "$(cat /sys/class/power_supply/BAT1/status)" == "Discharging" ]]; then; cat /sys/class/power_supply/BAT1/current_now /sys/class/power_supply/BAT1/voltage_now | xargs | awk '{print $1*$2/1e12 " W"}'; fi
''; '';
}; };
"/home/${username}/.local/bin/waybar-vpn" = { "/home/${username}/.local/bin/waybar-vpn" = {