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,30 @@
#!/usr/bin/env bash
set -euo pipefail
CONFIG="$HOME/.config/hyprdynamicmonitors/config.toml"
get_current_mode() {
grep -m1 '^mode = "' "$CONFIG" | sed 's/^mode = "\(.*\)"/\1/'
}
set_mode() {
local new_mode="$1"
sed -i --follow-symlinks 's/^mode = ".*"/mode = "'"$new_mode"'"/' "$CONFIG"
}
current=$(get_current_mode)
case "$current" in
both) next="external" ;;
external) next="laptop" ;;
laptop) next="both" ;;
*) next="both" ;;
esac
set_mode "$next"
# Redémarrage de hyprdynamicmonitors pour appliquer la nouvelle config
pkill -x hyprdynamicmonitors 2>/dev/null || true
hyprdynamicmonitors &
notify-send "Écrans" "Mode : $next"