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:
22
files/functions/battery.function
Executable file
22
files/functions/battery.function
Executable 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"
|
||||
Reference in New Issue
Block a user