Update colors of every status bar element

This commit is contained in:
Zoe Roux
2022-06-03 14:33:21 +02:00
parent cbc8b2edef
commit 7845a76d09
7 changed files with 24 additions and 24 deletions
+12 -12
View File
@@ -13,33 +13,33 @@ ramp100=
ac_bat= ac_bat=
ac= ac=
if [[ ! $(acpi 2>&1 | grep "No support") ]]; then if [[ ! $(acpi 2>&1 | grep "information unavailable") ]]; then
export bat=$(cat /sys/class/power_supply/BAT*/capacity) export bat=$(cat /sys/class/power_supply/BAT*/capacity)
export status=$(cat /sys/class/power_supply/BAT*/status) export status=$(cat /sys/class/power_supply/BAT*/status)
export plugged=$(cat /sys/class/power_supply/A*/online) export plugged=$(cat /sys/class/power_supply/A*/online)
if [[ $plugged == "1" ]]; then if [[ $plugged == "1" ]]; then
echo -n "^c#ebcb8b^$ac_bat^d^" echo -n "^C3^$ac_bat^d^"
elif [[ $bat -lt 10 ]]; then elif [[ $bat -lt 10 ]]; then
echo -n "^c#ebcb8b^$ramp10^d^" echo -n "^C3^$ramp10^d^"
elif [[ $bat -lt 20 ]]; then elif [[ $bat -lt 20 ]]; then
echo -n "^c#ebcb8b^$ramp20^d^" echo -n "^C3^$ramp20^d^"
elif [[ $bat -lt "30" ]]; then elif [[ $bat -lt "30" ]]; then
echo -n "^c#ebcb8b^$ramp30^d^" echo -n "^C3^$ramp30^d^"
elif [[ $bat -lt "40" ]]; then elif [[ $bat -lt "40" ]]; then
echo -n "^c#ebcb8b^$ramp40^d^" echo -n "^C3^$ramp40^d^"
elif [[ $bat -lt "50" ]]; then elif [[ $bat -lt "50" ]]; then
echo -n "^c#ebcb8b^$ramp50^d^" echo -n "^C3^$ramp50^d^"
elif [[ $bat -lt "60" ]]; then elif [[ $bat -lt "60" ]]; then
echo -n "^c#ebcb8b^$ramp60^d^" echo -n "^C3^$ramp60^d^"
elif [[ $bat -lt "70" ]]; then elif [[ $bat -lt "70" ]]; then
echo -n "^c#ebcb8b^$ramp70^d^" echo -n "^C3^$ramp70^d^"
elif [[ $bat -lt "80" ]]; then elif [[ $bat -lt "80" ]]; then
echo -n "^c#ebcb8b^$ramp80^d^" echo -n "^C3^$ramp80^d^"
elif [[ $bat -lt "90" ]]; then elif [[ $bat -lt "90" ]]; then
echo -n "^c#ebcb8b^$ramp90^d^" echo -n "^C3^$ramp90^d^"
elif [[ $bat -le "100" ]]; then elif [[ $bat -le "100" ]]; then
echo -n "^c#ebcb8b^$ramp100^d^" echo -n "^C3^$ramp100^d^"
fi fi
echo " $bat%" echo " $bat%"
fi fi
+2 -2
View File
@@ -8,9 +8,9 @@ else
device="$(echo info | timeout 1 bluetoothctl | grep 'Name')" device="$(echo info | timeout 1 bluetoothctl | grep 'Name')"
if [ ! "$device" = "" ]; then if [ ! "$device" = "" ]; then
echo "^c#81a1c1^^d^ $(echo "$device" | head -n 1 | xargs | cut -c 7-)" echo "^C14^^d^ $(echo "$device" | head -n 1 | xargs | cut -c 7-)"
else else
echo "^c#81a1c1^^d^" echo "^C14^^d^"
fi fi
fi fi
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
echo -n "^c#ebcb8b^ ^d^ $(grep -o "^[^ ]*" /proc/loadavg)" echo -n "^C3^ ^d^ $(grep -o "^[^ ]*" /proc/loadavg)"
case $BUTTON in case $BUTTON in
1) kitty --class htop htop;; 1) kitty --class htop htop;;
+2 -2
View File
@@ -5,7 +5,7 @@ case $BUTTON in
esac esac
if [ $(dunstctl is-paused) = "true" ]; then if [ $(dunstctl is-paused) = "true" ]; then
echo "^c#88c0d0^ ^d^" echo "^C6^ ^d^"
else else
echo "^c#88c0d0^ ^d^" echo "^C6^ ^d^"
fi fi
+1 -1
View File
@@ -2,7 +2,7 @@
MEM=$(free | grep Mem | awk '{printf("%d", $3/$2 * 100.0)}') MEM=$(free | grep Mem | awk '{printf("%d", $3/$2 * 100.0)}')
echo "^c#a3be8c^ ^d^ $MEM%" echo "^C10^ ^d^ $MEM%"
case $BUTTON in case $BUTTON in
1) kitty --class htop htop;; 1) kitty --class htop htop;;
+2 -2
View File
@@ -15,7 +15,7 @@ case $BUTTON in
esac esac
if [ "$pid" = "" ]; then if [ "$pid" = "" ]; then
echo "^c#ebcb8b^^d^" echo "^C11^^d^"
else else
echo "^c#ebcb8b^^d^" echo "^C11^^d^"
fi fi
+4 -4
View File
@@ -1,20 +1,20 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
case $BUTTON in case $BUTTON in
1) kitty --class pamix pamix ;; 1) pavucontrol ;;
4) pulseaudio-ctl up ;; 4) pulseaudio-ctl up ;;
5) pulseaudio-ctl down ;; 5) pulseaudio-ctl down ;;
esac esac
STATUS=$(pulseaudio-ctl full-status 2> /dev/null) STATUS=$(pulseaudio-ctl full-status 2> /dev/null)
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "^c#abe8c^婢 ^d^ ??%" echo "^C5^婢 ^d^ ??%"
exit 0 exit 0
fi fi
PERCENT=$(echo $STATUS | cut -d' ' -f 1) PERCENT=$(echo $STATUS | cut -d' ' -f 1)
if [[ $(echo $STATUS | cut -d' ' -f 2) == "yes" ]]; then if [[ $(echo $STATUS | cut -d' ' -f 2) == "yes" ]]; then
echo "^c#a3be8c^婢 ^d^ $PERCENT%" echo "^C5^婢 ^d^ $PERCENT%"
else else
echo "^c#a3be8c^墳 ^d^ $PERCENT%" echo "^C5^墳 ^d^ $PERCENT%"
fi fi