summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/batt9
-rwxr-xr-xbin/lt2
2 files changed, 9 insertions, 2 deletions
diff --git a/bin/batt b/bin/batt
index a5eb22f..73273d5 100755
--- a/bin/batt
+++ b/bin/batt
@@ -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%"
diff --git a/bin/lt b/bin/lt
index 48424ef..741c42d 100755
--- a/bin/lt
+++ b/bin/lt
@@ -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"