micstat=$(pamixer --default-source --get-mute) [[ $micstat = "false" ]] && micstat="βœ”οΈ" [[ $micstat = "true" ]] && micstat="🚫" vol="$(pamixer --get-volume)%" if [ "$vol" -gt "70" ]; then volicon="πŸ”Š" elif [ "$vol" -lt "30" ]; then volicon="πŸ”ˆ" else volicon="πŸ”‰" fi [[ "$vol" = 0 || "$vol" = "" || $(pamixer --get-mute) = "true" ]] && volicon="πŸ”‡" && vol="" for battery in /sys/class/power_supply/BAT? do # Get its remaining capacity and charge status. capacity=$(cat "$battery"/capacity 2>/dev/null) || break status=$(sed "s/[Dd]ischarging/πŸ”‹/;s/[Nn]ot charging/πŸ›‘/;s/[Cc]harging/πŸ”Œ/;s/[Uu]nknown/♻️/;s/[Ff]ull/|⚑/" "$battery"/status) # If it is discharging and 25% or less, we will add a ❗ as a warning. [ "$capacity" -le 25 ] && [ "$status" = "πŸ”‹" ] && warn="❗" batmsg=$(printf "%s%s%s%s%%" "$status" "$warn" "$capacity") unset warn done clock=$(date '+%I') case "$clock" in "00") icon="πŸ•›" ;; "01") icon="πŸ•" ;; "02") icon="πŸ•‘" ;; "03") icon="πŸ•’" ;; "04") icon="πŸ•“" ;; "05") icon="πŸ•”" ;; "06") icon="πŸ••" ;; "07") icon="πŸ•–" ;; "08") icon="πŸ•—" ;; "09") icon="πŸ•˜" ;; "10") icon="πŸ•™" ;; "11") icon="πŸ•š" ;; "12") icon="πŸ•›" ;; esac xsetroot -name " πŸ”† $(brightnessctl get -P) / $volicon$vol / $micstat🎀 / $(free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fGB/%2.2fGB\n", ( $3 / 1000), ($2 / 1000))}') / $batmsg / $(date '+%a %d %b %Y') $icon $(date '+%R %p')"