script-linux/statusbar.sh

16 lines
535 B
Bash
Raw Normal View History

2023-12-13 17:57:35 +01:00
#!/bin/bash
2023-12-13 18:06:01 +01:00
while true; do
2023-12-14 18:08:00 +01:00
wifi=$(iwgetid -r)
2023-12-13 17:57:35 +01:00
date=$(date +"%a %d %b. %Y")
hour=$(date +"%H:%M")
battery=$(upower -i $(upower -e | grep BAT) | grep percentage | sed "s/ //g" | cut -d ":" -f2)
volume=$(amixer get Master | grep dB | head -n 1 | cut -f7 -d' ' | sed "s/\[\|\]//g")
brightness=$(echo "100 * $(xrandr --prop --verbose | grep -A10 " connected" | grep Brightness | cut -f2 -d' ')" | bc | sed "s/\.[0-9]$/%/g")
2023-12-14 18:08:00 +01:00
xsetroot -name "| res: $wifi | lum: $brightness | vol: $volume | bat: $battery | $date | $hour |"
2023-12-13 18:06:01 +01:00
sleep 15
done