summaryrefslogtreecommitdiffstats
path: root/.local/bin/b-bar
diff options
context:
space:
mode:
authorAmin Bandali <bandali@kelar.org>2024-04-01 15:21:11 -0400
committerAmin Bandali <bandali@kelar.org>2024-04-01 15:21:11 -0400
commit22a270eba9568af1394a46429f1a379200496cf9 (patch)
tree03a1de7c3719fa58c1c6c3fbefe77a94014592e1 /.local/bin/b-bar
parent1d18d65c2b6260f6e58d1cdf974ccb13d59cbf9d (diff)
downloadconfigs-22a270eba9568af1394a46429f1a379200496cf9.tar.gz
configs-22a270eba9568af1394a46429f1a379200496cf9.tar.xz
configs-22a270eba9568af1394a46429f1a379200496cf9.zip
Break pulse volume code out of bar and into its own script
In part so that it could easily be used in Emacs as well. Also rename pacify-pulseaudio to b-pacify (as in PAcify).
Diffstat (limited to '.local/bin/b-bar')
-rwxr-xr-x.local/bin/b-bar13
1 files changed, 13 insertions, 0 deletions
diff --git a/.local/bin/b-bar b/.local/bin/b-bar
new file mode 100755
index 0000000..e326673
--- /dev/null
+++ b/.local/bin/b-bar
@@ -0,0 +1,13 @@
+#!/bin/sh
+while true
+do
+ b0="/sys/class/power_supply/BAT0"
+ bat="$(cat $b0/capacity)"
+ # batl="$(cat $b0/capacity_level)"
+ vols="$(b-pavols)"
+ load="$(cat /proc/loadavg | cut -d' ' -f1)"
+ time="$(date +'%a, %d %b %Y %R %z')"
+ printf "%s%% | %s | %s | %s\n" \
+ "$bat" "$vols" "$load" "$time"
+ sleep 5
+done