fixed percent icon for shell scripts

This commit is contained in:
Wes
2026-09-09 14:26:23 -04:00
parent e19ce9623c
commit bc9de3c204
2 changed files with 8 additions and 8 deletions

View File

@@ -6,11 +6,11 @@ while true; do
vol="$(pamixer --get-volume)" vol="$(pamixer --get-volume)"
if [ "$vol" -gt "70" ]; then if [ "$vol" -gt "70" ]; then
volicon="🔊" volicon="% 🔊"
elif [ "$vol" -lt "30" ]; then elif [ "$vol" -lt "30" ]; then
volicon="🔈" volicon="% 🔈"
else else
volicon="🔉" volicon="% 🔉"
fi fi
[[ "$vol" = 0 || "$vol" = "" || $(pamixer --get-mute) = "true" ]] && volicon="🔇" && vol="" [[ "$vol" = 0 || "$vol" = "" || $(pamixer --get-mute) = "true" ]] && volicon="🔇" && vol=""
@@ -46,7 +46,7 @@ while true; do
"12") icon="🕛" ;; "12") icon="🕛" ;;
esac esac
xsetroot -name " 🔆 $(brightnessctl | grep -oP '\(\K[0-9]+(?=%\))') \ $volicon$vol% \ $(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 +"%-I:%M %p")" xsetroot -name " 🔆 $(brightnessctl | grep -oP '\(\K[0-9]+(?=%\))') \ $vol$volicon \ $(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 +"%-I:%M %p")"
sleep 1 sleep 1
done done

View File

@@ -5,11 +5,11 @@ micstat=$(pamixer --default-source --get-mute)
vol="$(pamixer --get-volume)" vol="$(pamixer --get-volume)"
if [ "$vol" -gt "70" ]; then if [ "$vol" -gt "70" ]; then
volicon="🔊" volicon="% 🔊"
elif [ "$vol" -lt "30" ]; then elif [ "$vol" -lt "30" ]; then
volicon="🔈" volicon="% 🔈"
else else
volicon="🔉" volicon="% 🔉"
fi fi
[[ "$vol" = 0 || "$vol" = "" || $(pamixer --get-mute) = "true" ]] && volicon="🔇" && vol="" [[ "$vol" = 0 || "$vol" = "" || $(pamixer --get-mute) = "true" ]] && volicon="🔇" && vol=""
@@ -45,4 +45,4 @@ case "$clock" in
"12") icon="🕛" ;; "12") icon="🕛" ;;
esac esac
xsetroot -name " 🔆 $(brightnessctl | grep -oP '\(\K[0-9]+(?=%\))') \ $volicon$vol% \ $(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 +"%-I:%M %p")" xsetroot -name " 🔆 $(brightnessctl | grep -oP '\(\K[0-9]+(?=%\))') \ $vol$volicon \ $(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 +"%-I:%M %p")"