From d560f7f5e89a62620a8ba35f3dd6676c3006568b Mon Sep 17 00:00:00 2001 From: Collieiscute Date: Tue, 30 Jun 2026 19:56:02 +0800 Subject: [PATCH 1/2] fix: correct Noctalia widget monitor layout --- .../noctalia/20-widgets.generated.toml.tmpl | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/home/dot_config/noctalia/20-widgets.generated.toml.tmpl b/home/dot_config/noctalia/20-widgets.generated.toml.tmpl index 2f62c39..ce4a94b 100644 --- a/home/dot_config/noctalia/20-widgets.generated.toml.tmpl +++ b/home/dot_config/noctalia/20-widgets.generated.toml.tmpl @@ -4,16 +4,28 @@ Keep source portable by deriving those values from monitor roles and ratios. */ -}} {{- $hyprland := and (eq .chezmoi.os "linux") (lookPath "hyprctl") (env "HYPRLAND_INSTANCE_SIGNATURE") (env "XDG_RUNTIME_DIR") -}} {{- if $hyprland -}} -{{- $outputs := (output "hyprctl" "monitors" "-j" | fromJson | jq "map(select(((.disabled // false) == false) and ((.mirrorOf // \"none\") == \"none\"))) | sort_by(.x)" | first) -}} +{{- $outputs := (output "hyprctl" "monitors" "-j" | jq "fromjson | map(select((.disabled != true) and ((.mirrorOf // \"none\") == \"none\"))) | sort_by(.x)" | first) -}} {{- if ge (len $outputs) 3 -}} {{- $center := index $outputs 1 -}} {{- $right := index $outputs 2 -}} {{- $centerName := index $center "name" -}} +{{- $centerTransform := printf "%v" (index $center "transform") -}} +{{- $centerRotated := or (eq $centerTransform "1") (eq $centerTransform "3") (eq $centerTransform "5") (eq $centerTransform "7") -}} {{- $centerWidth := divf (index $center "width") (index $center "scale") -}} {{- $centerHeight := divf (index $center "height") (index $center "scale") -}} +{{- if $centerRotated -}} +{{- $centerWidth = divf (index $center "height") (index $center "scale") -}} +{{- $centerHeight = divf (index $center "width") (index $center "scale") -}} +{{- end -}} {{- $rightName := index $right "name" -}} +{{- $rightTransform := printf "%v" (index $right "transform") -}} +{{- $rightRotated := or (eq $rightTransform "1") (eq $rightTransform "3") (eq $rightTransform "5") (eq $rightTransform "7") -}} {{- $rightWidth := divf (index $right "width") (index $right "scale") -}} {{- $rightHeight := divf (index $right "height") (index $right "scale") -}} +{{- if $rightRotated -}} +{{- $rightWidth = divf (index $right "height") (index $right "scale") -}} +{{- $rightHeight = divf (index $right "width") (index $right "scale") -}} +{{- end -}} {{- $lockClockHeightRatio := 0.1666666667 -}} {{- $lockLoginHeightRatio := divf 70.0 1152.0 -}} {{- $lockGroupGapRatio := divf 40.0 1152.0 -}} @@ -82,8 +94,14 @@ visible = true {{ range $monitor := $outputs }} {{- $monitorName := index $monitor "name" -}} +{{- $monitorTransform := printf "%v" (index $monitor "transform") -}} +{{- $monitorRotated := or (eq $monitorTransform "1") (eq $monitorTransform "3") (eq $monitorTransform "5") (eq $monitorTransform "7") -}} {{- $monitorWidth := divf (index $monitor "width") (index $monitor "scale") -}} {{- $monitorHeight := divf (index $monitor "height") (index $monitor "scale") -}} +{{- if $monitorRotated -}} +{{- $monitorWidth = divf (index $monitor "height") (index $monitor "scale") -}} +{{- $monitorHeight = divf (index $monitor "width") (index $monitor "scale") -}} +{{- end -}} [lockscreen_widgets.widget."lockscreen-login-box@{{ $monitorName }}"] type = "login_box" output = "{{ $monitorName }}" From 28b4ad7a2958c4f13e6ae78368921c3915e8ef3c Mon Sep 17 00:00:00 2001 From: Collieiscute Date: Tue, 30 Jun 2026 21:17:55 +0800 Subject: [PATCH 2/2] fix: keep lockscreen widget coordinates unrotated --- .../noctalia/20-widgets.generated.toml.tmpl | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/home/dot_config/noctalia/20-widgets.generated.toml.tmpl b/home/dot_config/noctalia/20-widgets.generated.toml.tmpl index ce4a94b..6c4e474 100644 --- a/home/dot_config/noctalia/20-widgets.generated.toml.tmpl +++ b/home/dot_config/noctalia/20-widgets.generated.toml.tmpl @@ -9,14 +9,8 @@ Keep source portable by deriving those values from monitor roles and ratios. {{- $center := index $outputs 1 -}} {{- $right := index $outputs 2 -}} {{- $centerName := index $center "name" -}} -{{- $centerTransform := printf "%v" (index $center "transform") -}} -{{- $centerRotated := or (eq $centerTransform "1") (eq $centerTransform "3") (eq $centerTransform "5") (eq $centerTransform "7") -}} {{- $centerWidth := divf (index $center "width") (index $center "scale") -}} {{- $centerHeight := divf (index $center "height") (index $center "scale") -}} -{{- if $centerRotated -}} -{{- $centerWidth = divf (index $center "height") (index $center "scale") -}} -{{- $centerHeight = divf (index $center "width") (index $center "scale") -}} -{{- end -}} {{- $rightName := index $right "name" -}} {{- $rightTransform := printf "%v" (index $right "transform") -}} {{- $rightRotated := or (eq $rightTransform "1") (eq $rightTransform "3") (eq $rightTransform "5") (eq $rightTransform "7") -}} @@ -94,14 +88,8 @@ visible = true {{ range $monitor := $outputs }} {{- $monitorName := index $monitor "name" -}} -{{- $monitorTransform := printf "%v" (index $monitor "transform") -}} -{{- $monitorRotated := or (eq $monitorTransform "1") (eq $monitorTransform "3") (eq $monitorTransform "5") (eq $monitorTransform "7") -}} {{- $monitorWidth := divf (index $monitor "width") (index $monitor "scale") -}} {{- $monitorHeight := divf (index $monitor "height") (index $monitor "scale") -}} -{{- if $monitorRotated -}} -{{- $monitorWidth = divf (index $monitor "height") (index $monitor "scale") -}} -{{- $monitorHeight = divf (index $monitor "width") (index $monitor "scale") -}} -{{- end -}} [lockscreen_widgets.widget."lockscreen-login-box@{{ $monitorName }}"] type = "login_box" output = "{{ $monitorName }}"