From 671d0d20403280aab971185493f50d393ec838f6 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sun, 10 Mar 2024 15:05:50 +0530 Subject: update --- dist/bar.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 dist/bar.sh (limited to 'dist/bar.sh') diff --git a/dist/bar.sh b/dist/bar.sh new file mode 100755 index 0000000..2b23972 --- /dev/null +++ b/dist/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 -- cgit v1.2.3