all repos

dotfiles @ 7be8163fe6d918a136fb49aaae3c89414e4c9aac

i use rach linux btw
2 files changed, 14 insertions(+), 0 deletions(-)
hypr: add notification about low bettery
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2024-04-09 13:59:23 +0300
Parent: 6868e9d
A config/hypr/bat.sh
···
        
        1
        +#!/usr/bin/env bash

      
        
        2
        +

      
        
        3
        +# the purpose of the script is to notify when battery percentage is low

      
        
        4
        +

      
        
        5
        +while true; do

      
        
        6
        +    lvl=$(cat /sys/class/power_supply/BAT0/capacity)

      
        
        7
        +    if [ "$lbl" -le 30 ]; then

      
        
        8
        +        notify-send --urgency=CRITICAL "Battery Low" "Consider plugging cable in"

      
        
        9
        +        sleep 1200

      
        
        10
        +    else

      
        
        11
        +        sleep 120

      
        
        12
        +    fi

      
        
        13
        +done

      
M config/hypr/hyprland.conf
···
        17
        17
         exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

      
        18
        18
         exec-once = swayidle -w timeout 120 '$lock' timeout 1200 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on' before-sleep '$lock'

      
        19
        19
         exec-once = wlsunset -S 10:00 -s 19:00

      
        
        20
        +exec-once = ~/.config/hypr/bat.sh

      
        20
        21
         # }}}

      
        21
        22
         # inputs {{{

      
        22
        23
         input {