add ops function + print battery status

This commit is contained in:
kento2 2026-03-07 18:12:30 +01:00
parent c474a12d4e
commit 5b5df74087

View file

@ -13,6 +13,7 @@ g() { LC_ALL=C grep --exclude "*~" -r -P ${@:?regexp missing} }
sprunge() { cat $@ | curl -sF 'sprunge=<-' http://sprunge.us }
# minimal functions, 02mar
mkcd() { mkdir -p "$1"; cd "$1" }
ops() { a="$(lr -t 'type=f' -t '!mode|1' -A)" && "$EDITOR" "$a" }
set -o emacs
@ -24,4 +25,7 @@ alias pc='pass -c'
alias pe='pass edit'
cdpath="$HOME"
printf '%s +%s+\n' "$(date +%d%b%Y | tr [:upper:] [:lower:])" "$(hostname)"
# date +hostname+ [battery]
printf '%s +%s+ %s\n' \
"$(date +%d%b%Y | tr [:upper:] [:lower:])" "$(hostname)" \
"$((cat /sys/class/power_supply/BAT0/capacity 2>/dev/null && echo %) | tr -d '\n')"