diff options
author | Amin Bandali <bandali@kelar.org> | 2024-02-25 14:02:36 -0500 |
---|---|---|
committer | Amin Bandali <bandali@kelar.org> | 2024-02-25 14:02:36 -0500 |
commit | 89840581fbcc9228f99ca6c448a29d1cd5da2627 (patch) | |
tree | 09dacf9a8c751489b7a1f59439daca788839c6a5 /.local/bin/my-bar | |
parent | c53945415cc97aa6753e4ad46589147c76f6a3dd (diff) | |
download | configs-89840581fbcc9228f99ca6c448a29d1cd5da2627.tar.gz configs-89840581fbcc9228f99ca6c448a29d1cd5da2627.tar.xz configs-89840581fbcc9228f99ca6c448a29d1cd5da2627.zip |
Port my i3 config to sway
Diffstat (limited to '')
-rwxr-xr-x | .local/bin/my-bar | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/.local/bin/my-bar b/.local/bin/my-bar new file mode 100755 index 0000000..18f8a92 --- /dev/null +++ b/.local/bin/my-bar @@ -0,0 +1,20 @@ +#!/bin/sh +while true +do + b0="/sys/class/power_supply/BAT0" + bat="$(cat $b0/capacity)" + # batl="$(cat $b0/capacity_level)" + pm="pamixer --get-volume" + pmm="pamixer --get-mute" + vol="$($pm)" + [ "$($pmm)" = "true" ] && volm='-' || volm='+' + volmic="$($pm --default-source)" + [ "$($pmm --default-source)" = "true" ] && volmicm='-' || volmicm='+' + 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" \ + "$vol" "$volm" "$volmic" "$volmicm" \ + "$load" "$time" + sleep 5 +done |