diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-03-10 11:11:53 +0530 | 
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-03-10 11:11:53 +0530 | 
| commit | 69abf9e4e25b3c8e3eef954b5b09e6734cfbedf9 (patch) | |
| tree | 9963927769158bb3e57c5d1772fabd29a33261a5 /config/.bar.sh | |
| parent | f9342d23a46f2a5e558810404b0dfa0732bd71b3 (diff) | |
update
Diffstat (limited to 'config/.bar.sh')
| -rwxr-xr-x | config/.bar.sh | 39 | 
1 files changed, 39 insertions, 0 deletions
| diff --git a/config/.bar.sh b/config/.bar.sh new file mode 100755 index 0000000..2b23972 --- /dev/null +++ b/config/.bar.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +wifi() { +  iwgetid -r +} + +battery() { +  c=$(cat /sys/class/power_supply/BAT1/capacity) + +  if [[ $c > 85 ]]; then +    echo "  $c" +  elif [[ $c > 70 ]]; then +    echo "  $c" +  elif [[ $c > 50 ]]; then +    echo "  $c" +  elif [[ $c > 30 ]]; then +    echo "  $c" +  else +    echo "  $c" +  fi +} + +charging() { +  if [[ "$(cat /sys/class/power_supply/BAT1/status)" == "Charging" ]]; then +    echo "+" +  fi +} + +calendar() { +  date +'%a, %d %b %Y |   %H:%M' +} + +volume() { +  pamixer --get-volume +} + +while [[ true ]]; do +  dwlb -status all "| ^lm(alacritty -e nmtui-connect)  $(wifi)^lm() |   $(volume)% | $(battery)%$(charging) |   $(calendar) | λ" +  sleep 1 +done | 
