updated battery status
This commit is contained in:
parent
62b2816bfd
commit
72367bb2b2
@ -3,7 +3,7 @@
|
|||||||
icon=""
|
icon=""
|
||||||
|
|
||||||
current=$(acpi --battery | sed -e 's/%.*//' | sed 's/.*, //')
|
current=$(acpi --battery | sed -e 's/%.*//' | sed 's/.*, //')
|
||||||
|
status="$current%"
|
||||||
state=$(acpi --battery | sed -e 's/,.*//' | sed 's/.*: //')
|
state=$(acpi --battery | sed -e 's/,.*//' | sed 's/.*: //')
|
||||||
|
|
||||||
if [[ "$state" == "Discharging" ]]; then
|
if [[ "$state" == "Discharging" ]]; then
|
||||||
@ -30,4 +30,13 @@ if [[ "$state" == "Not charging" ]]; then
|
|||||||
icon=""
|
icon=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$icon $current%"
|
if [[ "$state" == "Full" ]]; then
|
||||||
|
icon=""
|
||||||
|
status="Full"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$state" == "Charging" ]]; then
|
||||||
|
icon=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$icon $status"
|
||||||
|
|||||||
9
scripts/xmobar-status-bat
Executable file
9
scripts/xmobar-status-bat
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# a simple wrapper for inserting xmobar stuff
|
||||||
|
|
||||||
|
status=$(status-bat)
|
||||||
|
|
||||||
|
parts=($status)
|
||||||
|
|
||||||
|
echo "<fn=1>${parts[0]}</fn> ${parts[1]}"
|
||||||
Reference in New Issue
Block a user