Cleaned up power notifications, added package, ...

This commit is contained in:
Joachim Nielandt 2022-03-11 10:14:27 +01:00
parent 5dbad776a9
commit 0196190666
3 changed files with 13 additions and 4 deletions

View File

@ -56,3 +56,5 @@
(package! groovy-mode)
; allows the terraform files to be properly read
(package! terraform-mode)
; add typescript major mode
(package! typescript-mode)

View File

@ -192,7 +192,7 @@ bindsym $mod+F11 mode "$mode_audio"
set $mode_launch  adefault start-up bnoise-fix cdual dhorizontal etearing
mode "$mode_launch" {
# These are all the default programs launching at startup.
bindsym a exec thunderbird, exec signal-desktop, exec ferdi, exec obsidian mode "default"
bindsym a exec thunderbird, exec signal-desktop, exec ferdi, exec obsidian mode "default", exec teams --no-sandbox, exec slack
# This fixes audio noise (lenovo)
# bindsym b exec sudo hda-verb /dev/snd/hwC*D0 0x1d SET_PIN_WIDGET_CONTROL 0x0, mode "default"
# This bypasses weird xrandr bug, resets to single display, then goes back to triple monitor setup (use autorandr profile here, needs to be set up in advance)

View File

@ -2,12 +2,19 @@
export DISPLAY=:0
CAPACITY=$(cat /sys/class/power_supply/BAT0/capacity)
# perform notifications
if [[ $CAPACITY -lt 20 ]]
then
MSG="Battery low: $CAPACITY%";
else
MSG="Battery high: $CAPACITY%";
/usr/bin/notify-send "$MSG";
fi
/usr/bin/notify-send "$MSG"
# suspend system when battery is low
if [[ $CAPACITY -ge 0 && $CAPACITY -lt 10 ]]
then
MSG="Should suspend now, battery critical: $CAPACITY";
/usr/bin/notify-send "$MSG";
fi