2023-09-12 09:09:06 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-09-12 09:17:45 +04:00
|
|
|
blue=#0000ff
|
|
|
|
|
2023-09-12 09:09:06 +04:00
|
|
|
battery() {
|
2023-09-12 10:06:53 +04:00
|
|
|
get_capacity="$(cat /sys/class/power_supply/BAT1/capacity)"
|
2023-09-12 11:00:02 +04:00
|
|
|
get_status="$(cat /sys/class/power_supply/BAT1/status)"
|
|
|
|
case "$get_status" in
|
2023-09-12 12:39:27 +04:00
|
|
|
Charging) printf " $get_capacity" ;;
|
|
|
|
Discharging) printf " $get_capacity" ;;
|
2023-09-12 11:00:02 +04:00
|
|
|
esac
|
2023-09-12 09:09:06 +04:00
|
|
|
}
|
|
|
|
|
2023-09-12 09:17:45 +04:00
|
|
|
audio() {
|
|
|
|
get_vol=$(pamixer --get-volume-human)
|
|
|
|
if [ $get_vol = 'muted' ]; then
|
2023-09-12 12:39:27 +04:00
|
|
|
printf " Muted"
|
2023-09-12 09:17:45 +04:00
|
|
|
else
|
2023-09-12 12:39:27 +04:00
|
|
|
printf " $get_vol"
|
2023-09-12 09:17:45 +04:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-09-19 10:08:25 +04:00
|
|
|
clock() {
|
2023-09-19 10:35:37 +04:00
|
|
|
printf "$(date '+%H:%M') "
|
2023-09-19 10:08:25 +04:00
|
|
|
}
|
|
|
|
|
2023-09-12 09:09:06 +04:00
|
|
|
while true; do
|
2023-09-19 10:08:25 +04:00
|
|
|
xsetroot -name " $(clock) $(audio) $(battery) "
|
2023-09-12 10:43:03 +04:00
|
|
|
sleep 1
|
2023-09-12 09:09:06 +04:00
|
|
|
done
|