diff options
| author | Marc Vertes <mvertes@free.fr> | 2023-03-05 12:46:32 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2023-03-05 12:46:32 +0100 |
| commit | 6dc16e1476e55ea34b32bee558d429d7d11d0e9e (patch) | |
| tree | b13dfeb695c9365c1a67e303b524086cf7f65e52 /bin | |
| parent | 320cc91398a17f57da0296ffc64ddcbb64921df1 (diff) | |
update
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/batt | 9 | ||||
| -rwxr-xr-x | bin/lt | 2 |
2 files changed, 9 insertions, 2 deletions
@@ -1,4 +1,9 @@ #!/bin/sh # print battery status -. /sys/class/power_supply/BAT0/uevent && -echo "$POWER_SUPPLY_TYPE $POWER_SUPPLY_STATUS $POWER_SUPPLY_CAPACITY%" +. /sys/class/power_supply/BAT0/uevent +case $POWER_SUPPLY_STATUS in + Discharging) s='↧' ;; + Full) s='¤' ;; + Charging) s='↥' ;; +esac +echo "power $s $POWER_SUPPLY_CAPACITY%" @@ -37,6 +37,7 @@ ca() { pp() { pp_s=$1 pp_b=$2 R1='' while true; do + ! [ "$pp_s" ] && R1='' && break [ "$pp_b" = "$pp_s" ] && break pp_s=${pp_s%/*} [ "$R1" ] && R1=$R1/.. || R1=.. @@ -50,6 +51,7 @@ rp() { ! [ "$rp_c" ] && ca "$1" "$2" && rp_c=$R1 rp_bs=${rp_s#$rp_c/} pp "$rp_d" "$rp_c" && R1=$R1/$rp_bs && R1=${R1#../} + case $R1 in //*) R1=${R1#/};; esac } skip=".git .gitignore .*.swp Makefile README.md" |
