Move function files to their own folder. Move the copy to General from Workstation. Leave dwm-status function under Workstation.

This commit is contained in:
2025-11-10 21:37:25 -07:00
parent 91c0a412bf
commit 683e03eab2
5 changed files with 12 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# 2025-11-10 Hyperling
function battery-display {
detailed="N"
if [[ -n $1 ]]; then
detailed="Y"
fi
if [[ "$detailed" == "Y" ]]; then
upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9.%]*"
else
int="`upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | grep -o "[0-9]*" | head -n 1`"
echo "${int}%"
fi
}
alias show-battery="battery-display"
alias battery="battery-display"
alias battery-use="battery-display"
alias battery-usage="battery-display"
alias battery-level="battery-display"
alias battery-levels="battery-display"