mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 15:00:13 +01:00
fix: make scrips fail-proof (hopefully) so that desktop also works with them or just ignores them
This commit is contained in:
parent
1f302adc0f
commit
c2d0247bc7
1 changed files with 28 additions and 26 deletions
|
|
@ -183,6 +183,7 @@
|
|||
text = ''
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$(hostname)" == "sakura" ]]; then
|
||||
if [[ $(cat /proc/acpi/button/lid/LID0/state | grep "open") ]]; then
|
||||
LTEXT=" "
|
||||
else
|
||||
|
|
@ -209,6 +210,7 @@
|
|||
fi
|
||||
|
||||
echo "$LTEXT $CTEXT $MTEXT"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
"/home/${username}/.local/bin/waybar-powerdraw" = {
|
||||
|
|
@ -216,7 +218,7 @@
|
|||
text = ''
|
||||
#!/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" = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue