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

@@ -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"
@@ -37,4 +36,4 @@ monitor_tag = "monitor0"
[fallback_profile]
config_file = "/home/lucas/.config/hyprdynamicmonitors/hyprconfigs/fallback.go.tmpl"
config_file_type = "template"
config_file_type = "template"

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
{{ 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
{{ 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
{{- end}}
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"