Fix hyprland, monitor management and waybar after lua switch

This commit is contained in:
2026-08-29 00:55:17 +02:00
parent 9db0b4dac0
commit be4de88d1a
45 changed files with 593 additions and 388 deletions

View File

@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# === 1. Variables denvironnement pour Hyprland ===
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=Hyprland
# === 2. Configuration dynamique des moniteurs ===
# Ce script choisit le bon fichier config.toml (eco/power) et lance hyprdynamicmonitors
~/.config/hypr/scripts/monitors-setup.sh &
# === 3. Portails XDG (démarrer uniquement sils ne tournent pas) ===
pgrep -x "xdg-desktop-portal-hyprland" >/dev/null || /usr/lib/xdg-desktop-portal-hyprland &
pgrep -x "xdg-desktop-portal-gtk" >/dev/null || /usr/lib/xdg-desktop-portal-gtk &
# === 4. Services graphiques (vérification avant lancement) ===
pgrep -x "waybar" >/dev/null || waybar &
pgrep -x "mako" >/dev/null || mako &
pgrep -x "nm-applet" >/dev/null || nm-applet --indicator &
pgrep -x "blueman-applet" >/dev/null || blueman-applet &
pgrep -x "kdeconnectd" >/dev/null || kdeconnectd &
# === 5. Gestion de la veille (hypridle) ===
if [ -x ~/.config/hypr/scripts/hypridle-launch.sh ]; then
~/.config/hypr/scripts/hypridle-launch.sh &
else
hypridle &
fi
# === 6. Fond décran ===
[ -x ~/.config/hypr/scripts/wallpaper.sh ] && ~/.config/hypr/scripts/wallpaper.sh &
# === 7. Gestion du presse-papiers (cliphist) ===
wl-paste --type text --watch cliphist store &
wl-paste --type image --watch cliphist store &
wl-paste --primary --type text --watch cliphist store &
# === 8. Agent dauthentification Polkit ===
pgrep -x "polkit-kde-authentication-agent-1" >/dev/null || /usr/lib/polkit-kde-authentication-agent-1 &

View File

@@ -0,0 +1,6 @@
#!/bin/bash
if [ -f /run/eco_mode ]; then
exec hypridle -c ~/.config/hypr/hypridle-eco.conf
else
exec hypridle -c ~/.config/hypr/hypridle.conf
fi

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
CONFIG_DIR="$HOME/.config/hyprdynamicmonitors"
# 1. Sélection du fichier de configuration selon le mode d'alimentation
if grep -q "eco_mode=1" /proc/cmdline; then
ln -sf "$CONFIG_DIR/config-eco.toml" "$CONFIG_DIR/config.toml"
else
ln -sf "$CONFIG_DIR/config-power.toml" "$CONFIG_DIR/config.toml"
fi
# 2. Vérifier que le fichier de configuration existe avant de le modifier
if [ -f "$CONFIG_DIR/config.toml" ]; then
sed -i 's/^mode = ".*"/mode = "both"/' "$CONFIG_DIR/config.toml"
else
echo "Erreur : $CONFIG_DIR/config.toml introuvable" >&2
exit 1
fi
# 3. Lancement du démon
hyprdynamicmonitors &