1
0
Fork 0

Add sway/wofi/foot Wayland desktop stack with per-host toggle

New opt-in feature for x86_64 desktops: sway + wofi + foot + swaybg +
swaylock + swayidle + grim + slurp + waybar + wl-clipboard. mako on
arch, dunst on debian (mako isn't packaged for debian).

Files:
- .chezmoi.yaml.tmpl: added data.sway flag (true on miche/byte/kaiser,
  false on Pis). Override per host with ~/.config/chezmoi/features/sway
  or ~/.config/chezmoi/features/no-sway marker files.
- run_once_40-install-sway.sh.tmpl: installs packages if .sway=true,
  exits 0 otherwise. Sets up the marker file.
- dot_config/{sway,foot,wofi,waybar,mako}/: existing configs from miche.

Per-host toggle workflow:
  # On any box, enable sway:
  touch ~/.config/chezmoi/features/sway
  chezmoi apply

  # On a sway-enabled box, disable it:
  touch ~/.config/chezmoi/features/no-sway
  rm ~/.config/chezmoi/features/sway
  chezmoi apply

Currently sway packages are already installed on miche (existed before
this commit). Byte will get them via the new run_once_40 script.
Pis (rye, crouton) are unaffected — install script early-returns.
This commit is contained in:
Rain 2026-06-22 14:23:56 -04:00
parent fe73bbecba
commit 6bbaa8f2f5
21 changed files with 965 additions and 1 deletions

88
dot_config/foot/foot.ini Normal file
View file

@ -0,0 +1,88 @@
# foot terminal — gruvbox dark, Maple Mono 14pt with Terminus fallback
# Reference: man foot.ini
[main]
font=Maple Mono CN:size=14,Terminus:size=14
font-bold=Maple Mono CN:weight=bold:size=14
font-italic=Maple Mono CN:slant=italic:size=14
font-bold-italic=Maple Mono CN:weight=bold:slant=italic:size=14
font-size-adjustment=0.5
pad=8x8
term=foot
# (Previously set to "foot-extra", but that terminfo is not installed in the
# CachyOS foot package; only foot, foot+base, foot-direct are. Setting
# TERM=foot-extra breaks every ncurses program — htop, nvtop, vim, etc. —
# with "cannot initialize terminal type". "foot" has 256 colors and
# everything modern tools need.)
# kaiser runs zsh as the login shell (SHELL=/bin/fish was misleading — that
# comes from sway's inherited env, not the user's actual shell). Hardcode
# /usr/bin/zsh here. foot does NOT expand $SHELL in the shell= value (it
# passes the literal string to its child), so don't try the sh,-c trick —
# it just makes foot spawn a binary literally named "${SHELL:-/bin/bash}"
# and exit with "No such file or directory".
shell=/usr/bin/zsh
# PTY
# utmphelper is not packaged with foot on this CachyOS build. Leave it unset
# to disable utmp logging for foot sessions; harmless and not required.
# Initial geometry
initial-window-size-chars=120x32
[scrollback]
lines=10000
indicator-position=relative
[cursor]
style=block
blink=yes
blink-rate=500
beam-thickness=2px
[mouse]
hide-when-typing=yes
alternate-scroll-mode=true
[colors-dark]
# Gruvbox dark palette (gruvbox-community) — bg0_h / fg / 16 ANSI
# https://github.com/gruvbox-community/gruvbox
background=1d2021
foreground=ebdbb2
# Slight transparency — 0.90 alpha. Foot 1.27+ uses a separate alpha key
# (in [colors-dark], not 8-digit hex — that was foot 1.24 syntax).
alpha=0.90
# Regular ANSI (0-7)
regular0=282828
regular1=cc241d
regular2=98971a
regular3=d79921
regular4=458588
regular5=b16286
regular6=689d6a
regular7=a89984
# Bright ANSI (8-15)
bright0=928374
bright1=fb4934
bright2=b8bb26
bright3=fabd2f
bright4=83a598
bright5=d3869b
bright6=8ec07c
bright7=ebdbb2
# Selection (FG BG pair)
selection-foreground=1d2021
selection-background=ebdbb2
# Search box (FG BG pairs)
search-box-match=ebdbb2 458588
search-box-no-match=ebdbb2 cc241d
[bell]
urgent=no
notify=no
visual=no
[url]
launch=xdg-open {url}

25
dot_config/foot/patch.py Normal file
View file

@ -0,0 +1,25 @@
from pathlib import Path
p = Path("/home/rain/.config/foot/foot.ini")
text = p.read_text()
old_lines = [
"# foot does not expand env variables in the `shell=` value, so we have to",
"# go through `sh -c` to make the parent's $SHELL take effect. When foot",
"# is launched from a fish session, $SHELL is /bin/fish, and foot runs fish.",
"# When launched from bash, $SHELL is /bin/bash, and foot runs bash. The",
"# default fallback is /bin/bash if $SHELL is unset for any reason.",
'shell=sh,-c,"exec ${SHELL:-/bin/bash} -i"',
]
new_lines = [
"# kaiser runs zsh as the login shell. Hardcode /usr/bin/zsh here.",
"# foot does NOT expand $SHELL in shell= (it passes the literal string",
"# to its child process), so the sh,-c trick makes foot try to exec a",
'# binary literally named "${SHELL:-/bin/bash}" and die with',
'# "No such file or directory". Point shell= at the binary directly.',
"shell=/usr/bin/zsh",
]
old = "\n".join(old_lines)
new = "\n".join(new_lines)
assert old in text, "old block not found in foot.ini"
text = text.replace(old, new, 1)
p.write_text(text)
print("OK, new size:", len(text))