Massive change to the structure of the tree.

This commit is contained in:
Bartek Stalewski 2025-03-10 23:59:38 +01:00
parent 2fc5f7a514
commit c71934ed3b
No known key found for this signature in database
137 changed files with 51 additions and 266 deletions

View file

@ -0,0 +1,17 @@
#!/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="\uf102" ;;
"Discharging") status="\uf078" ;;
"Charging") status="\uf077" ;;
"Not charging") status="\uf444" ;;
"Unknown") status="\uf128" ;;
esac
capacity=$(cat "$battery/capacity")
# Will make a warn variable if discharging and low
[ "$capacity" -le 20 ] && printf "^c#ffffff^^b#770000^${status} ${capacity}%%^d^" || printf "${status} ${capacity}%%"
done && exit 0

View file

@ -0,0 +1,3 @@
#!/bin/bash
printf "\uf7aa configure your way to check mail!"

View file

@ -0,0 +1,9 @@
#!/bin/bash
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) printf "^c#ffffff^^b#770000^no wifi^d^" ;;
up)
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] \
&& printf "$(iw dev wlan0 info | grep 'ssid ' | cut -d' ' -f2-)" \
|| printf "^c#ffffff^^b#770000^no ip^d^" ;;
esac

View file

@ -0,0 +1,17 @@
#!/bin/bash
if [ "${1}" = "micmute" ]; then
state=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}')
case ${state} in
yes)
echo 0 | doas tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
pactl set-source-mute @DEFAULT_SOURCE@ 0 ;;
no)
echo 1 | doas tee /sys/devices/platform/thinkpad_acpi/leds/platform::micmute/brightness
pactl set-source-mute @DEFAULT_SOURCE@ 1 ;;
esac
kill -44 $(pidof dwmblocks)
else
mic=$(pactl get-source-volume @DEFAULT_SOURCE@ | awk -F' / ' '{print $2}' | tr -d '%')
[ $(pactl get-source-mute @DEFAULT_SOURCE@ | awk -F': ' '{print $2}') = yes ] || [ "$mic" -eq 0 ] && printf "^c#ffffff^^b#770000^ \uf131 ^d^"
fi

View file

@ -0,0 +1,4 @@
#!/bin/bash
vol=$(pactl get-sink-volume @DEFAULT_SINK@ | awk -F' / ' '{print $2}' | tr -d '%')
[ $(pactl get-sink-mute @DEFAULT_SINK@ | awk -F': ' '{print $2}') = yes ] || [ "$vol" -eq 0 ] && printf "^c#ffffff^^b#770000^mute^d^" || printf "${vol}%%"