Initial full commit for Dell16 Arch
This commit is contained in:
25
.config/hypr/scripts/power-save.sh
Executable file
25
.config/hypr/scripts/power-save.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Chemins (à adapter)
|
||||
VIDEO="$HOME/Videos/wallpaper.mp4"
|
||||
IMAGE="$HOME/Pictures/wallpaper.jpg"
|
||||
|
||||
while true; do
|
||||
# Vérifie si le chargeur est branché (ADP1 ou AC sur Dell)
|
||||
if cat /sys/class/power_supply/AC*/online | grep -q '1'; then
|
||||
# SUR SECTEUR : Lancer l'animation si elle n'est pas là
|
||||
if ! pgrep -x "mpvpaper" > /dev/null; then
|
||||
pkill hyprpaper
|
||||
mpvpaper -o "no-audio --loop" eDP-1 "$VIDEO" &
|
||||
fi
|
||||
else
|
||||
# SUR BATTERIE : Couper l'animation et mettre l'image fixe
|
||||
if pgrep -x "mpvpaper" > /dev/null; then
|
||||
pkill mpvpaper
|
||||
hyprpaper &
|
||||
# Optionnel : baisser les effets Hyprland ici
|
||||
hyprctl reload
|
||||
fi
|
||||
fi
|
||||
sleep 5 # Vérifie toutes les 5 secondes
|
||||
done
|
||||
Reference in New Issue
Block a user