added battery stuff

This commit is contained in:
2025-08-15 21:46:59 +00:00
committed by GitHub
parent 3cd1fb1ec7
commit 60610dc81d
2 changed files with 152 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# toggles display mode (percent <-> time) for the battery module
state_file="${XDG_CACHE_HOME:-$HOME/.cache}/polybar_battery_mode";
current="percent";
if [[ -f "$state_file" ]]; then
current="$(cat "$state_file" 2>/dev/null | tr -d '\n')";
fi
if [[ "$current" == "percent" ]]; then
echo "time" > "$state_file";
else
echo "percent" > "$state_file";
fi