Material Icons.

This commit is contained in:
Bartek Stalewski 2021-07-26 15:56:06 +02:00
parent 9e0d48b35f
commit 4508f38520
13 changed files with 121 additions and 117 deletions

View file

@ -1,19 +1,17 @@
#!/bin/sh
#!/bin/bash
for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator.
[ -n "${capacity+x}" ] && printf " "
# Sets up the status and capacity
case "$(cat "$battery/status")" in
"Full") status="" ;;
"Discharging") status="🔋" ;;
"Charging") status="🔌" ;;
"Not charging") status="🛑" ;;
"Unknown") status="♻️" ;;
"Full") status="\uea0b" ;;
"Discharging") status="\ue1a5" ;;
"Charging") status="\ue63c" ;;
"Not charging") status="\ue1a6" ;;
"Unknown") status="\ue1a3" ;;
esac
capacity=$(cat "$battery/capacity")
# Will make a warn variable if discharging and low
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
# Prints the info
printf "%s %s%d%%" "$status" "$warn" "$capacity"; unset warn
[ "$capacity" -le 20 ] && printf "\ue19c ^c#161616^^b#fd4285^${capacity}%%^d^" || printf "${status} ${capacity}%%"
done && exit 0

View file

@ -1,10 +1,8 @@
#!/bin/sh
#!/bin/bash
if [ "$1" != "mic" ]; then
vol="$(pamixer --get-volume)"
[ $(echo $vol | wc -c) -lt 4 ] && svol=" ${vol}%" || svol="${vol}%"
[ $(pamixer --get-mute) = true ] && echo "🔇 ^c#161616^^b#fd4285^mute^d^" || echo "🔊 ${svol}"
else
device=$(pamixer --list-sources | awk '/Raven/ {print $1}')
[ $(pamixer --source $device --get-mute) = true ] && echo "^c#161616^^b#fd4285^MM^d^" || echo "on"
fi
vol="$(pamixer --get-volume)"
[ $(echo $vol | wc -c) -lt 4 ] && svol=" ${vol}%%" || svol="${vol}%%"
[ $(pamixer --get-mute) = true ] && volinfo="\ue04f ^c#161616^^b#fd4285^mute^d^" || volinfo="\ue050 ${svol}"
device=$(pamixer --list-sources | awk '/Raven/ {print $1}')
[ $(pamixer --source $device --get-mute) = true ] && micinfo="\ue02b ^c#161616^^b#fd4285^MM^d^" || micinfo="\ue02a on"
printf "${volinfo} (${micinfo})"