Skip to content

Commit 822f4ed

Browse files
committed
Config: Rename is_interactive/is_headless to has_gui
Merge the two equivalent flags into a single has_gui flag. Rename the packages.yml list key from interactive to gui to match.
1 parent 92631ca commit 822f4ed

11 files changed

Lines changed: 18 additions & 40 deletions

CLAUDE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ Available in `.tmpl` files (defined in `home/.chezmoi.toml.tmpl`):
3232
| Variable | Description |
3333
|----------|-------------|
3434
| `.is_macos` / `.is_linux` | OS detection |
35-
| `.is_interactive` | Machine with direct user interaction (all macOS, specific Linux hosts) |
36-
| `.is_headless` | No GUI (Linux servers, opposite of interactive) |
35+
| `.has_gui` | Has graphical environment (all macOS, specific Linux hosts) |
3736
| `.is_work` | Work machine vs personal |
3837
| `.email`, `.fname`, `.ghuser` | Personal info from 1Password |
3938
| `.copy_command` | Clipboard command (`pbcopy` or `xsel`) |

home/.chezmoi.toml.tmpl

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,39 +36,18 @@ Machine information
3636
{{- end -}}
3737

3838
{{- /*
39-
Interactive hosts are hosts I interact directly with, rather than through other
40-
machines.
39+
GUI hosts have a graphical environment (all macOS, specific Linux hosts).
4140
*/ -}}
4241

43-
{{- $interactive_hosts := list "nexon" -}}
44-
{{- $is_interactive := false -}}
42+
{{- $gui_hosts := list "nexon" -}}
43+
{{- $has_gui := false -}}
4544

4645
{{- if $is_macos -}}
47-
{{- $is_interactive = true -}}
46+
{{- $has_gui = true -}}
4847
{{- else -}}
49-
{{- range $interactive_hosts -}}
48+
{{- range $gui_hosts -}}
5049
{{- if eq . $.chezmoi.hostname -}}
51-
{{- $is_interactive = true -}}
52-
{{- break -}}
53-
{{- end -}}
54-
{{- end -}}
55-
{{- end }}
56-
57-
{{- /*
58-
Headless detection - systems that should NOT have GUI packages
59-
*/ -}}
60-
61-
{{- $headful_hosts := list "nexon" -}}
62-
{{- $is_headless := true -}}
63-
64-
{{- /* Never headless on macOS */ -}}
65-
{{- if $is_macos -}}
66-
{{- $is_headless = false -}}
67-
{{- else -}}
68-
{{- /* Check if hostname is in explicit headful hosts list */ -}}
69-
{{- range $headful_hosts -}}
70-
{{- if eq . $.chezmoi.hostname -}}
71-
{{- $is_headless = false -}}
50+
{{- $has_gui = true -}}
7251
{{- break -}}
7352
{{- end -}}
7453
{{- end -}}
@@ -110,8 +89,7 @@ Personal information
11089
email = {{ $email | quote }}
11190
fname = {{ $full_name | quote }}
11291
ghuser = {{ $ghuser | quote }}
113-
is_interactive = {{ $is_interactive }}
114-
is_headless = {{ $is_headless }}
92+
has_gui = {{ $has_gui }}
11593
is_macos = {{ $is_macos }}
11694
is_linux = {{ $is_linux }}
11795
is_work = {{ $is_work }}

home/.chezmoidata/packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ packages:
3535
- lowdown
3636
- shdoc-ng
3737
- git-this-bread
38-
interactive:
38+
gui:
3939
- jordanbaird-ice
4040
- nf-fantasque-sans-mono
4141
- vscode

home/.chezmoiignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Library/
2323
.Xresources
2424
{{ end }}
2525

26-
{{ if not .is_interactive }}
26+
{{ if not .has_gui }}
2727
.config/espanso/
2828
{{ end }}
2929

home/.chezmoiscripts/run_before_005_validate_data_packages.sh.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{{- end -}}
1616
{{- $os_packages := get .packages .chezmoi.os -}}
1717
{{- $packages := $os_packages.all -}}
18-
{{- if and .is_interactive (hasKey $os_packages "interactive") -}}
18+
{{- if and .has_gui (hasKey $os_packages "gui") -}}
1919
{{- $packages = concat $packages $os_packages.interactive -}}
2020
{{- end -}}
2121
{{- /* Also validate install_tools entries */ -}}

home/.chezmoiscripts/run_once_after_050-remove-espanso-config.sh.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ if and .is_interactive .is_macos -}}
1+
{{ if and .has_gui .is_macos -}}
22
#!/usr/bin/env bash
33

44
# {{ template "dotfiles_bashlib.sh" . }}

home/.chezmoiscripts/run_onchange_after_035-install-packages.sh.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- $os_packages := get .packages .chezmoi.os -}}
22
{{- $package_names := $os_packages.all -}}
3-
{{- if and .is_interactive (hasKey $os_packages "interactive") -}}
3+
{{- if and .has_gui (hasKey $os_packages "gui") -}}
44
{{- $package_names = concat $package_names $os_packages.interactive -}}
55
{{- end -}}
66
{{- includeTemplate "install_packages.sh.tmpl" (dict

home/.chezmoiscripts/run_onchange_after_040-install-vscode-extensions.sh.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .is_interactive -}}
1+
{{- if .has_gui -}}
22
#!/usr/bin/env bash
33

44
# {{ template "dotfiles_bashlib.sh" . }}

home/.chezmoiscripts/run_onchange_after_typos_propagation.py.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .is_interactive -}}
1+
{{- if .has_gui -}}
22
#!/usr/bin/env -S uv --quiet run --script
33
# /// script
44
# requires-python = ">=3.13"

home/.chezmoitemplates/install_packages.sh.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
chezmoi — chezmoi data (for OS detection)
88
is_macos — boolean
99
is_linux — boolean
10+
has_gui — boolean
1011
*/ -}}
1112
{{- $chezmoi := .chezmoi -}}
1213
{{- $specs := .softwarePackages -}}

0 commit comments

Comments
 (0)