summaryrefslogtreecommitdiffstats
path: root/.local/bin/my-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/my-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/my-bar')
-rwxr-xr-x.local/bin/my-bar20
1 files changed, 0 insertions, 20 deletions
diff --git a/.local/bin/my-bar b/.local/bin/my-bar
deleted file mode 100755
index 8a37d2f..0000000
--- a/.local/bin/my-bar
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-while true
-do
- b0="/sys/class/power_supply/BAT0"
- bat="$(cat $b0/capacity)"
- # batl="$(cat $b0/capacity_level)"
- sinkv="$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Po '\d+(?=%)' | head -n1)"
- sinkm="$(pactl get-sink-mute @DEFAULT_SINK@ | grep -o 'no\|yes')"
- srcv="$(pactl get-source-volume @DEFAULT_SOURCE@ | grep -Po '\d+(?=%)' | head -n1)"
- srcm="$(pactl get-source-mute @DEFAULT_SOURCE@ | grep -o 'no\|yes')"
- [ "$sinkm" = "no" ] && sinkm='+' || sinkm='-'
- [ "$srcm" = "no" ] && srcm='+' || srcm='-'
- load="$(cat /proc/loadavg | cut -d' ' -f1)"
- time="$(date +'%a, %d %b %Y %R %z')"
- printf "%s%% | %s%s,%s%s | %s | %s\n" \
- "$bat" \
- "$sinkv" "$sinkm" "$srcv" "$srcm" \
- "$load" "$time"
- sleep 5
-done