From e40f520d635f76d8b2f348d692bca6232ce4c6cd Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Fri, 13 Mar 2026 00:46:34 +0100 Subject: [PATCH] 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 --- dot_config/hypr/hyprland.d/20-workspaces.conf.tmpl | 8 ++++++-- dot_config/hypr/hyprland.d/30-general.conf | 2 ++ dot_config/waybar/config.tmpl | 13 ++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dot_config/hypr/hyprland.d/20-workspaces.conf.tmpl b/dot_config/hypr/hyprland.d/20-workspaces.conf.tmpl index db2ea56..bfdcd1c 100644 --- a/dot_config/hypr/hyprland.d/20-workspaces.conf.tmpl +++ b/dot_config/hypr/hyprland.d/20-workspaces.conf.tmpl @@ -1,5 +1,9 @@ {{- 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 }} + {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/dot_config/hypr/hyprland.d/30-general.conf b/dot_config/hypr/hyprland.d/30-general.conf index c7687a4..0845ca4 100644 --- a/dot_config/hypr/hyprland.d/30-general.conf +++ b/dot_config/hypr/hyprland.d/30-general.conf @@ -36,6 +36,8 @@ cursor { zoom_rigid = false enable_hyprcursor = true sync_gsettings_theme = true + + no_hardware_cursors = true } diff --git a/dot_config/waybar/config.tmpl b/dot_config/waybar/config.tmpl index 2dd36db..e31cb9d 100644 --- a/dot_config/waybar/config.tmpl +++ b/dot_config/waybar/config.tmpl @@ -1,11 +1,10 @@ {{- $tags := .chezmoi.config.data.tags -}} -{{- $primary_output := "eDP-1" -}} -{{- $secondary_output := "" -}} +{{- $waybar_output := "eDP-1" -}} {{- range .monitors -}} - {{- if index . "primary" -}} - {{- $primary_output = .name -}} - {{- else -}} - {{- $secondary_output = .name -}} + {{- if index . "waybar" -}} + {{- $waybar_output = .name -}} + {{- else if index . "primary" -}} + {{- $waybar_output = .name -}} {{- end -}} {{- end -}} {{- $workspace_module := "" -}} @@ -17,7 +16,7 @@ { "layer": "top", "position": "right", - "output": "{{ $secondary_output }}", + "output": "{{ $waybar_output }}", "width": 54, "spacing": 4, "margin-top": 0,