Finally working display toggle

This commit is contained in:
2026-08-29 13:54:04 +02:00
parent be4de88d1a
commit 659cbf0145
19 changed files with 120 additions and 117 deletions

View File

@@ -2,7 +2,7 @@
---@module 'hl'
-- === MONITEURS ===
local monitors = require("monitors")
require("monitors")
-- Workspace rules (intégrées directement)
hl.workspace_rule({ workspace = 1, monitor = "eDP-1" })

View File

@@ -1 +0,0 @@
monitor=desc:BOE 0x0B29,2560x1600@120.00,0x0,1.33333333,transform,0,vrr,0

View File

@@ -0,0 +1,6 @@
# Generated with hyprdynamicmonitors freeze.
# mode: "laptop" = interne seul, "external" = externe seul, sinon (both/vide) = les deux
monitor=desc:BOE 0x0B29,disable
monitor=desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000,2560x1440@119.99800,0x0,1.00000000,transform,0,vrr,0

View File

@@ -1,41 +1,5 @@
-- Generated by hyprconf2lua v1.4.0
-- https://github.com/Prateek-squadron/hyprconf2lua
-- Manual review may be needed for complex directives
-- Généré par hyprdynamicmonitors
-- mode: "laptop" = interne seul, "external" = externe seul, sinon = les deux
---@module 'hl'
-- Generated with hyprdynamicmonitors freeze.
-- This is a template that you can edit, it is just a starter that pulled your current monitor setup,
-- adjust as needed.
-- You can use templates here etc, see https://github.com/fiffeek/hyprdynamicmonitors/blob/main/examples/basic/hyprconfigs/template.go.tmpl.
-- Monitors are given arbitrary tags (the "monitor" prefix and the ID coming from hyprland).
-- If you are using tui to edit, leave this at the end of your file (the last monitor config applies)
-- and leave the markers.
-- <<<<< TUI AUTO START
hl.monitor({
output = "desc:BOE 0x0B29",
mode = "2560x1600@120.00",
position = "320x1440",
scale = 1.33333333,
transform = 0,
vrr = 0,
})
hl.monitor({
output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000",
mode = "2560x1440@119.99800",
position = "0x0",
scale = 1.00000000,
transform = 0,
vrr = 0,
})
-- <<<<< TUI AUTO END
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@120.00", position = "320x1440", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", mode = "2560x1440@119.99800", position = "0x0", scale = 1.0, transform = 0, vrr = 0, disabled = false })

View File

@@ -0,0 +1,5 @@
-- Généré par hyprdynamicmonitors
-- mode: "laptop" = interne seul, "external" = externe seul, sinon = les deux
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@120.00", position = "320x1440", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", mode = "2560x1440@119.99800", position = "0x0", scale = 1.0, transform = 0, vrr = 0, disabled = false })

View File

@@ -12,7 +12,7 @@ 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"
sed -i --follow-symlinks 's/^mode = ".*"/mode = "both"/' "$CONFIG_DIR/config.toml"
else
echo "Erreur : $CONFIG_DIR/config.toml introuvable" >&2
exit 1

View File

@@ -1,5 +1,5 @@
[general]
destination = "$HOME/.config/hypr/monitors.conf"
destination = "$HOME/.config/hypr/monitors.lua"
[power_events]
@@ -33,3 +33,7 @@ config_file_type = "template"
[[profiles.solo.conditions.required_monitors]]
description = "BOE 0x0B29"
monitor_tag = "monitor0"
[fallback_profile]
config_file = "/home/lucas/.config/hyprdynamicmonitors/hyprconfigs/fallback-eco.go.tmpl"
config_file_type = "template"

View File

@@ -1,5 +1,5 @@
[general]
destination = "$HOME/.config/hypr/monitors.conf"
destination = "$HOME/.config/hypr/monitors.lua"
[power_events]
@@ -9,14 +9,13 @@ path = "/org/freedesktop/UPower/devices/line_power_AC"
[[power_events.dbus_signal_match_rules]]
object_path = "/org/freedesktop/UPower/devices/line_power_AC"
[profiles.dual]
config_file = "/home/lucas/.config/hyprdynamicmonitors/hyprconfigs/dual.go.tmpl"
config_file_type = "template"
[profiles.dual.conditions]
[profiles.dual.static_template_values]
mode = ""
mode = "both"
[[profiles.dual.conditions.required_monitors]]
description = "BOE 0x0B29"

View File

@@ -1,40 +0,0 @@
[general]
destination = "$HOME/.config/hypr/monitors.conf"
[power_events]
[power_events.dbus_query_object]
path = "/org/freedesktop/UPower/devices/line_power_AC"
[[power_events.dbus_signal_match_rules]]
object_path = "/org/freedesktop/UPower/devices/line_power_AC"
[profiles.dual]
config_file = "/home/lucas/.config/hyprdynamicmonitors/hyprconfigs/dual.go.tmpl"
config_file_type = "template"
[profiles.dual.conditions]
[profiles.dual.static_template_values]
mode = "both"
[[profiles.dual.conditions.required_monitors]]
description = "BOE 0x0B29"
monitor_tag = "monitor0"
[[profiles.dual.conditions.required_monitors]]
description = "Shenzhen KTC Technology Group H27T7P-2 0000000000000"
monitor_tag = "monitor1"
[profiles.solo]
config_file = "/home/lucas/.config/hyprdynamicmonitors/hyprconfigs/solo.go.tmpl"
config_file_type = "template"
[profiles.solo.conditions]
[[profiles.solo.conditions.required_monitors]]
description = "BOE 0x0B29"
monitor_tag = "monitor0"
[fallback_profile]
config_file = "/home/lucas/.config/hyprdynamicmonitors/hyprconfigs/fallback.go.tmpl"
config_file_type = "template"

View File

@@ -0,0 +1 @@
/home/lucas/.config/hyprdynamicmonitors/config-power.toml

View File

@@ -1,14 +1,12 @@
# Generated with hyprdynamicmonitors freeze.
# mode: "laptop" = interne seul, "external" = externe seul, sinon (both/vide) = les deux
-- Généré par hyprdynamicmonitors
-- mode: "laptop" = interne seul, "external" = externe seul, sinon = les deux
{{ if eq .mode "laptop" }}
monitor=desc:BOE 0x0B29,2560x1600@48.00,0x0,1.33333333,transform,0,vrr,0
monitor=desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000,disable
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@48.00", position = "0x0", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", disabled = true })
{{ else if eq .mode "external" }}
monitor=desc:BOE 0x0B29,disable
monitor=desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000,2560x1440@119.99800,0x0,1.00000000,transform,0,vrr,0
hl.monitor({ output = "desc:BOE 0x0B29", disabled = true })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", mode = "2560x1440@119.99800", position = "0x0", scale = 1.0, transform = 0, vrr = 0, disabled = false })
{{ else }}
# <<<<< TUI AUTO START
monitor=desc:BOE 0x0B29,2560x1600@48.00,320x1440,1.33333333,transform,0,vrr,0
monitor=desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000,2560x1440@119.99800,0x0,1.00000000,transform,0,vrr,0
# <<<<< TUI AUTO END
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@48.00", position = "320x1440", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", mode = "2560x1440@119.99800", position = "0x0", scale = 1.0, transform = 0, vrr = 0, disabled = false })
{{ end }}

View File

@@ -1,14 +1,12 @@
# Generated with hyprdynamicmonitors freeze.
# mode: "laptop" = interne seul, "external" = externe seul, sinon (both/vide) = les deux
-- Généré par hyprdynamicmonitors
-- mode: "laptop" = interne seul, "external" = externe seul, sinon = les deux
{{ if eq .mode "laptop" }}
monitor=desc:BOE 0x0B29,2560x1600@120.00,0x0,1.33333333,transform,0,vrr,0
monitor=desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000,disable
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@120.00", position = "0x0", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", disabled = true })
{{ else if eq .mode "external" }}
monitor=desc:BOE 0x0B29,disable
monitor=desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000,2560x1440@119.99800,0x0,1.00000000,transform,0,vrr,0
hl.monitor({ output = "desc:BOE 0x0B29", disabled = true })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", mode = "2560x1440@119.99800", position = "0x0", scale = 1.0, transform = 0, vrr = 0, disabled = false })
{{ else }}
# <<<<< TUI AUTO START
monitor=desc:BOE 0x0B29,2560x1600@120.00,320x1440,1.33333333,transform,0,vrr,0
monitor=desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000,2560x1440@119.99800,0x0,1.00000000,transform,0,vrr,0
# <<<<< TUI AUTO END
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@120.00", position = "320x1440", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })
hl.monitor({ output = "desc:Shenzhen KTC Technology Group H27T7P-2 0000000000000", mode = "2560x1440@119.99800", position = "0x0", scale = 1.0, transform = 0, vrr = 0, disabled = false })
{{ end }}

View File

@@ -0,0 +1,7 @@
{{- range .Monitors}}
{{- if eq .Name "eDP-1"}}
hl.monitor({ output = "eDP-1", mode = "2560x1600@48.00", position = "320x1440", scale = 1.3333334, disabled = false })
{{- else}}
hl.monitor({ output = "{{.Name}}", mode = "preferred", position = "auto", scale = 1, disabled = false })
{{- end}}
{{- end}}

View File

@@ -1,7 +1,7 @@
{{- range .Monitors}}
{{- if eq .Name "eDP-1"}}
monitor=eDP-1,2560x1600@120,320x1440,1.3333334
hl.monitor({ output = "eDP-1", mode = "2560x1600@120", position = "320x1440", scale = 1.3333334, disabled = false })
{{- else}}
monitor={{.Name}},preferred,auto,1
hl.monitor({ output = "{{.Name}}", mode = "preferred", position = "auto", scale = 1, disabled = false })
{{- end}}
{{- end}}

View File

@@ -1 +1 @@
monitor=desc:BOE 0x0B29,2560x1600@48.00,0x0,1.33333333,transform,0,vrr,0
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@48.00", position = "0x0", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })

View File

@@ -1 +1 @@
monitor=desc:BOE 0x0B29,2560x1600@120.00,0x0,1.33333333,transform,0,vrr,0
hl.monitor({ output = "desc:BOE 0x0B29", mode = "2560x1600@120.00", position = "0x0", scale = 1.33333333, transform = 0, vrr = 0, disabled = false })

View File

@@ -24,7 +24,8 @@ esac
set_mode "$next"
# Redémarrage de hyprdynamicmonitors pour appliquer la nouvelle config
pkill -x hyprdynamicmonitors 2>/dev/null || true
hyprdynamicmonitors &
pkill -f -x hyprdynamicmonitors 2>/dev/null || true
sleep 0.2
hyprdynamicmonitors >/dev/null 2>&1 &
notify-send "Écrans" "Mode : $next"

29
scripts/hdm-audit.sh Executable file
View File

@@ -0,0 +1,29 @@
for f in \
~/.config/hypr/hyprland.lua \
~/.config/hypr/monitors.lua \
~/.config/hypr/scripts/autostart.sh \
~/.config/hypr/scripts/hypridle-launch.sh \
~/.config/hypr/scripts/monitors-setup.sh \
~/.config/hyprdynamicmonitors/config.toml \
~/.config/hyprdynamicmonitors/config-eco.toml \
~/.config/hyprdynamicmonitors/config-power.toml \
~/.config/hyprdynamicmonitors/hyprconfigs/dual.go.tmpl \
~/.config/hyprdynamicmonitors/hyprconfigs/dual-eco.go.tmpl \
~/.config/hyprdynamicmonitors/hyprconfigs/solo.go.tmpl \
~/.config/hyprdynamicmonitors/hyprconfigs/solo-eco.go.tmpl \
~/.config/hyprdynamicmonitors/hyprconfigs/fallback.go.tmpl \
~/.config/hyprdynamicmonitors/hyprconfigs/fallback-eco.go.tmpl \
~/.config/hyprdynamicmonitors/scripts/display-manager.sh \
~/.config/hyprdynamicmonitors/scripts/display-toggle.sh \
; do
echo "===== $f ====="
if [ -L "$f" ]; then
echo "(symlink -> $(readlink -f "$f"))"
fi
if [ -f "$f" ]; then
cat "$f"
else
echo "[fichier absent]"
fi
echo
done > hdm-audit.txt

View File

@@ -149,6 +149,7 @@ qt6-5compat
qt6-wayland
refind
refind-theme-catppuccin-git
reflector
rofi
rsgain
rtpmidid-bin
@@ -184,6 +185,7 @@ ventoy-bin
vesktop-bin
vibe-audio-visualizer-git
viewnior
vim
virt-manager
vscodium-bin
vulkan-intel

30
scripts/update/checkup.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/sh
# Inspection manuelle. Ne modifie rien.
s() { printf '\n=== %s ===\n' "$1"; }
s "Espace"
df -h / /home /boot 2>/dev/null
paccache -dk1 2>&1 | tail -1
journalctl --disk-usage
du -sh ~/.cache/* 2>/dev/null | sort -h | tail -5
s "Paquets"
printf 'installés: %s (explicites: %s)\n' "$(pacman -Qq | wc -l)" "$(pacman -Qqe | wc -l)"
echo "-- orphelins --"; pacman -Qtdq
echo "-- AUR passés en dépôt officiel --"
comm -12 "$(pacman -Qqm | sort > /tmp/.ck1; echo /tmp/.ck1)" \
"$(pacman -Slq | sort > /tmp/.ck2; echo /tmp/.ck2)"
rm -f /tmp/.ck1 /tmp/.ck2
s "Configs en attente"
pacdiff -o
s "Services"
systemctl --failed --no-legend
systemctl --user --failed --no-legend
systemd-analyze blame 2>/dev/null | head -5
s "Disque"
systemctl is-enabled fstrim.timer
lsblk -Dnro NAME,TYPE,DISC-GRAN | awk '$2=="crypt"'
sudo nvme smart-log /dev/nvme0n1 2>/dev/null | grep -E 'percentage_used|media_errors|unsafe'