diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2018-11-11 21:32:51 -0500 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2018-11-11 21:32:51 -0500 |
| commit | 809663bfa4954d9c4c2385a2abdfafd7770a0f46 (patch) | |
| tree | 11d8e84d93c831e554e2731efada54b60a4add7e /.scripts | |
| parent | debbe40d2c60d4eb8c407d16075838a84edf91d6 (diff) | |
| download | eibhear-809663bfa4954d9c4c2385a2abdfafd7770a0f46.tar.gz eibhear-809663bfa4954d9c4c2385a2abdfafd7770a0f46.tar.zst eibhear-809663bfa4954d9c4c2385a2abdfafd7770a0f46.zip | |
message check moved to top of bat
Diffstat (limited to '.scripts')
| -rwxr-xr-x | .scripts/statusbar/i3battery | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/.scripts/statusbar/i3battery b/.scripts/statusbar/i3battery index 2309db1..c13e648 100755 --- a/.scripts/statusbar/i3battery +++ b/.scripts/statusbar/i3battery @@ -1,7 +1,15 @@ #!/bin/sh - # Give a battery name (e.g. BAT0) as an argument. +case $BLOCK_BUTTON in + 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> +🔋: discharging +♻: stagnant charge +🔌: charging +⚡: charged +- Text color reflects charge left" ;; +esac + capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit status=$(cat /sys/class/power_supply/"$1"/status) @@ -20,13 +28,3 @@ fi [ "$status" = "Charging" ] && color="#FFF" printf "<span color='%s'>%s %s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$(echo "$capacity" | sed -e 's/$/%/')" - -case $BLOCK_BUTTON in - 3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b> -🔋: discharging -♻: stagnant charge -🔌: charging -⚡: charged -- Text color reflects charge left" ;; -esac - |
