Fix hyprland, monitor management and waybar after lua switch
This commit is contained in:
22
.config/hypr/scripts/monitors-setup.sh
Executable file
22
.config/hypr/scripts/monitors-setup.sh
Executable 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 &
|
||||
Reference in New Issue
Block a user