dotfiles/config/.scripts/startup.sh

35 lines
565 B
Bash
Raw Normal View History

2019-08-14 22:05:24 +02:00
#!/bin/bash
function kb_routine {
2019-08-14 22:05:24 +02:00
oldKBD="$KBD";
case "$(xset -q | grep -A 0 'LED' | cut -c59-67)" in
"00000000")
KBD="English (US)" ;;
"00001000")
KBD="Deutsch" ;;
*) KBD="unknown" ;;
esac
if [ "$KBD" != "$oldKBD" ]; then
notify-send "$KBD";
fi
}
function battery_routine {
capacity=$(< /sys/class/power_supply/BAT0/capacity)
if [[ $capacity -lt 5 ]]; then
echo $capacity
fi
}
KBD="";
oldKBD="";
while :
do
kb_routine
battery_routine
2019-08-14 22:05:24 +02:00
sleep 1;
done