mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
hypr: add notification about low bettery
This commit is contained in:
parent
6868e9db51
commit
7be8163fe6
2 changed files with 14 additions and 0 deletions
13
config/hypr/bat.sh
Normal file
13
config/hypr/bat.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# the purpose of the script is to notify when battery percentage is low
|
||||
|
||||
while true; do
|
||||
lvl=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
if [ "$lbl" -le 30 ]; then
|
||||
notify-send --urgency=CRITICAL "Battery Low" "Consider plugging cable in"
|
||||
sleep 1200
|
||||
else
|
||||
sleep 120
|
||||
fi
|
||||
done
|
||||
|
|
@ -17,6 +17,7 @@ exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CUR
|
|||
exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
|
||||
exec-once = swayidle -w timeout 120 '$lock' timeout 1200 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' before-sleep '$lock'
|
||||
exec-once = wlsunset -S 10:00 -s 19:00
|
||||
exec-once = ~/.config/hypr/bat.sh
|
||||
# }}}
|
||||
# inputs {{{
|
||||
input {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue