Initial full commit for Dell16 Arch
This commit is contained in:
32
.config/hypr/scripts/display-mode.sh
Executable file
32
.config/hypr/scripts/display-mode.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
STATE_FILE="/tmp/hypr_display_mode"
|
||||
INTERNAL="eDP-1"
|
||||
EXTERNAL=$(hyprctl monitors all -j | jq -r '.[].name' | grep -v "$INTERNAL" | head -1)
|
||||
CURRENT=$(cat "$STATE_FILE" 2>/dev/null || echo "both")
|
||||
|
||||
if [ -z "$EXTERNAL" ]; then
|
||||
notify-send "Display" "Aucun écran externe détecté" -t 2000
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case "$CURRENT" in
|
||||
"both")
|
||||
hyprctl keyword monitor "$INTERNAL, disable"
|
||||
echo "external" > "$STATE_FILE"
|
||||
notify-send "Display" "Externe uniquement ($EXTERNAL)" -t 2000
|
||||
;;
|
||||
"external")
|
||||
hyprctl keyword monitor "$EXTERNAL, disable"
|
||||
hyprctl keyword monitor "$INTERNAL, 2560x1600@120.0, 0x0, 1.33"
|
||||
echo "internal" > "$STATE_FILE"
|
||||
notify-send "Display" "Interne uniquement" -t 2000
|
||||
;;
|
||||
"internal")
|
||||
hyprctl keyword monitor "$INTERNAL, 2560x1600@120.0, 1995x1440, 1.33"
|
||||
sleep 0.5
|
||||
hyprctl keyword monitor "$EXTERNAL, 2560x1440@120.0, 1697x0, 1"
|
||||
echo "both" > "$STATE_FILE"
|
||||
notify-send "Display" "Double écran" -t 2000
|
||||
;;
|
||||
esac
|
||||
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
|
||||
7
.config/hypr/scripts/suspend.sh
Executable file
7
.config/hypr/scripts/suspend.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
hyprlock &
|
||||
sleep 0.5
|
||||
systemctl suspend
|
||||
sleep 1
|
||||
hyprctl dispatch dpms on
|
||||
hyprctl reload
|
||||
6
.config/hypr/scripts/wallpaper.sh
Executable file
6
.config/hypr/scripts/wallpaper.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
if grep -q "eco_mode=1" /proc/cmdline; then
|
||||
swaybg -c 000000 &
|
||||
else
|
||||
swaybg -i ~/Pictures/wallpaper.jpg -m fill &
|
||||
fi
|
||||
Reference in New Issue
Block a user