hypr: support per-workspace layout config in workspace template

Allow monitor workspaces in chezmoi.toml to be defined as objects with
optional layout and layoutopts fields, enabling per-workspace layout and
layoutopt rules. Plain int arrays remain supported for monitors with no
per-workspace overrides.

Also commit waybar and cursor config tweaks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 00:46:34 +01:00
parent 246417313e
commit e40f520d63
3 changed files with 14 additions and 9 deletions

View File

@@ -1,5 +1,9 @@
{{- range $monitor := .monitors }} {{- range $monitor := .monitors }}
{{- range $index, $ws := .workspaces }} {{- range $index, $ws := $monitor.workspaces }}
{{- if kindIs "map" $ws }}
workspace = {{ $ws.id }}, monitor:{{ $monitor.name }}{{ if eq $index 0 }}, default:true{{ end }}{{ if index $ws "layout" }}, layout:{{ $ws.layout }}{{ end }}{{ range index $ws "layoutopts" }}, layoutopt:{{ . }}{{ end }}
{{- else }}
workspace = {{ $ws }}, monitor:{{ $monitor.name }}{{ if eq $index 0 }}, default:true{{ end }} workspace = {{ $ws }}, monitor:{{ $monitor.name }}{{ if eq $index 0 }}, default:true{{ end }}
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -36,6 +36,8 @@ cursor {
zoom_rigid = false zoom_rigid = false
enable_hyprcursor = true enable_hyprcursor = true
sync_gsettings_theme = true sync_gsettings_theme = true
no_hardware_cursors = true
} }

View File

@@ -1,11 +1,10 @@
{{- $tags := .chezmoi.config.data.tags -}} {{- $tags := .chezmoi.config.data.tags -}}
{{- $primary_output := "eDP-1" -}} {{- $waybar_output := "eDP-1" -}}
{{- $secondary_output := "" -}}
{{- range .monitors -}} {{- range .monitors -}}
{{- if index . "primary" -}} {{- if index . "waybar" -}}
{{- $primary_output = .name -}} {{- $waybar_output = .name -}}
{{- else -}} {{- else if index . "primary" -}}
{{- $secondary_output = .name -}} {{- $waybar_output = .name -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- $workspace_module := "" -}} {{- $workspace_module := "" -}}
@@ -17,7 +16,7 @@
{ {
"layer": "top", "layer": "top",
"position": "right", "position": "right",
"output": "{{ $secondary_output }}", "output": "{{ $waybar_output }}",
"width": 54, "width": 54,
"spacing": 4, "spacing": 4,
"margin-top": 0, "margin-top": 0,