{{- $tags := .chezmoi.config.data.tags -}} -- Special Workspaces hl.workspace_rule({ workspace = "special:passwordmgr", on_created_empty = "uwsm app -- bitwarden-desktop" }) -- Named Workspaces (IDs 1-6, sorted before numbered) hl.workspace_rule({ workspace = "1", default_name = "mail" }) hl.workspace_rule({ workspace = "2", default_name = "comms", monitor = "DP-2", layout = "scrolling", layout_opts = { direction = "down" } }) hl.workspace_rule({ workspace = "3", default_name = "element", monitor = "DP-2", layout = "scrolling", layout_opts = { direction = "down" } }) hl.workspace_rule({ workspace = "4", default_name = "joplin" }) {{- if index $tags "cs2" }} hl.workspace_rule({ workspace = "5", default_name = "steam", layout = "scrolling" }) {{- end }} {{- if index $tags "entertainment" }} hl.workspace_rule({ workspace = "6", default_name = "spotify", monitor = "DP-2", layout = "monocle", on_created_empty = "uwsm app -- spotify-launcher" }) {{- end }} -- Monitor Workspaces {{- range $monitor := .monitors }} {{- range $index, $ws := $monitor.workspaces }} {{- if kindIs "map" $ws }} hl.workspace_rule({ workspace = "{{ $ws.id }}", monitor = "{{ $monitor.name }}", default = {{ if eq $index 0 }}true{{ else }}false{{ end }} {{- if index $ws "name" }}, default_name = "{{ $ws.name }}"{{ end }} {{- if index $ws "layout" }}, layout = "{{ $ws.layout }}"{{ end }} {{- if index $ws "layoutopts" }}, layout_opts = { {{- range $i, $opt := index $ws "layoutopts" }} {{- $parts := splitList ":" $opt }} {{ if $i }}, {{ end }}{{ index $parts 0 }} = "{{ index $parts 1 }}" {{- end }} }{{ end }} }) {{- else }} hl.workspace_rule({ workspace = "{{ $ws }}", monitor = "{{ $monitor.name }}", default = {{ if eq $index 0 }}true{{ else }}false{{ end }} }) {{- end }} {{- end }} {{- end }}