dwm/aji.sh

15 lines
455 B
Bash
Raw Permalink Normal View History

2025-05-13 15:14:35 +07:00
#!/bin/bash
2025-09-02 12:05:45 +07:00
volume=$(awk -F"[][]" '/Left:/ { print $2 }' <(amixer sget Master))
2025-05-13 15:14:35 +07:00
status=$(cat /sys/class/power_supply/BAT1/status)
2025-09-02 12:05:45 +07:00
capacity=$(cat /sys/class/power_supply/BAT1/capacity)
bright=$(echo $(( 100 * $(brightnessctl get) / $(brightnessctl max) ))%)
2025-05-13 15:14:35 +07:00
2025-09-02 12:05:45 +07:00
if [ "$1" == "info" ]; then
xsetroot -name " Bright: $bright | Vol: $volume | $status $capacity% | $(date +'%a, %F %R') "
2025-09-01 10:32:31 +07:00
sleep 4
2025-05-13 15:14:35 +07:00
xsetroot -name " DAP "
else
echo "Invalid argument."
fi