aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorNick Moore <nicholasvmoore@gmail.com>2026-11-07 09:20:22 -0600
committerNick Moore <nicholasvmoore@gmail.com>2026-11-07 09:20:22 -0600
commit6c4039aebbe7ec25f47cb4623e44b96373e9e6e5 (patch)
tree6b29ac15408e586c41d6bc91561294709c87a962 /sway
parent34abcb44caf7266ce40063daca05a2a06f1b26c7 (diff)
Track sway (shared + rigel machine overlay), replace fibonacci with dwm-dwindle listener
- sway package: shared config (styling, all muscle-memory binds, no exec lines) including ~/.config/sway/machines/*.conf overlays included LAST; floating_windows + machines/README contract; sway/AGENTS.md doctrine - rigel package: machine overlay (outputs, touchpad, session stack, power bindings) + session scripts now stow-managed; fibonacci.py replaced by a POSIX sh+jq dwindle listener (dwm dwindle geometry, --monitor subscription, mark+move re-home, flock singleton); machines/rigel.conf exec line updated to the new path - validated in a headless nested sway against a literal port of fibonacci.c: five- and seven-window trees plus refocus-before-spawn all match dwm's rects (modulo the bar offset)
Diffstat (limited to 'sway')
-rw-r--r--sway/.config/sway/conf.d/floating_windows1
-rw-r--r--sway/.config/sway/config214
-rw-r--r--sway/.config/sway/machines/README.md14
-rw-r--r--sway/AGENTS.md33
4 files changed, 262 insertions, 0 deletions
diff --git a/sway/.config/sway/conf.d/floating_windows b/sway/.config/sway/conf.d/floating_windows
new file mode 100644
index 0000000..ae9b0b4
--- /dev/null
+++ b/sway/.config/sway/conf.d/floating_windows
@@ -0,0 +1 @@
+for_window [app_id="org.pulseaudio.pavucontrol"] floating enable
diff --git a/sway/.config/sway/config b/sway/.config/sway/config
new file mode 100644
index 0000000..3a15494
--- /dev/null
+++ b/sway/.config/sway/config
@@ -0,0 +1,214 @@
+# =============================================================================
+# Sway configuration (shared across machines)
+# doom-one palette · Terminess (Terminus) Nerd Font
+# $mod = Alt (Mod1) · vim-style hjkl motions · fibonacci/dwindle tiling
+# hot reload: Alt+Shift+R
+# Per-machine hardware/stack/power lives in ~/.config/sway/machines/*.conf
+# (included LAST, so machine files win). That file shapes hardware only —
+# NEVER styling. See AGENTS.md in the dotfiles repo for the split doctrine.
+# =============================================================================
+
+### Variables
+set $mod Mod1
+set $left h
+set $down j
+set $up k
+set $right l
+set $term foot
+set $menu fuzzel --lines=10
+
+### Doom One palette
+set $bg #282c34
+set $bg_alt #21242b
+set $fg #bbc2cf
+set $base3 #3f444a
+set $base5 #5b6268
+set $red #ff6c6b
+set $orange #da8548
+set $green #98be65
+set $yellow #ecbe7b
+set $blue #51afef
+set $magenta #c678dd
+set $violet #a9a1e1
+set $cyan #46d9ff
+
+### Appearance
+font pango:Terminess Nerd Font 11
+
+# border background text indicator child border
+client.focused $blue $bg $fg $blue $blue
+client.focused_inactive $base3 $bg $base5 $base3 $base3
+client.unfocused $base3 $bg $base5 $base3 $base3
+client.urgent $red $bg $fg $red $red
+client.placeholder $bg $bg $fg $bg $bg
+client.background $bg
+
+### Windows
+# retro WM chrome: titlebars on (default_border normal = border + title with
+# the window's name in the pixel font, centered), square corners everywhere
+default_border normal
+default_floating_border normal
+title_align center
+titlebar_padding 4
+
+# 5px margin around the screen, 2px between windows
+gaps inner 2
+gaps outer 5
+
+### Output
+# doom-one wallpaper as the universal fallback. Per-output scale/background
+# rules belong to each machine: ~/.config/sway/machines/<name>.conf
+# (specific `output <name>` rules beat this `output *` fallback).
+output * bg ~/Pictures/wallpaper.jpg fill
+
+### Key bindings
+# Basics
+bindsym $mod+Return exec $term
+bindsym $mod+d exec $menu
+bindsym $mod+Shift+q kill
+bindsym $mod+f fullscreen
+bindsym $mod+Shift+space floating toggle
+bindsym $mod+space focus mode_toggle
+floating_modifier $mod normal
+
+# Focus — vim motions
+bindsym $mod+$left focus left
+bindsym $mod+$down focus down
+bindsym $mod+$up focus up
+bindsym $mod+$right focus right
+bindsym $mod+Left focus left
+bindsym $mod+Down focus down
+bindsym $mod+Up focus up
+bindsym $mod+Right focus right
+
+# Alt+Tab — cycle every window of the current workspace, wrapping
+# ("tiling" = whole-tree traversal; plain "focus next" only cycles the two
+# children of the nearest split container, which dead-ends in fibonacci
+# layouts). Floating windows (e.g. pavucontrol) are skipped.
+bindsym $mod+Tab focus next tiling
+bindsym $mod+Shift+Tab focus prev tiling
+
+# Move focused window — vim motions
+bindsym $mod+Shift+$left move left
+bindsym $mod+Shift+$down move down
+bindsym $mod+Shift+$up move up
+bindsym $mod+Shift+$right move right
+bindsym $mod+Shift+Left move left
+bindsym $mod+Shift+Down move down
+bindsym $mod+Shift+Up move up
+bindsym $mod+Shift+Right move right
+
+# Fibonacci/dwindle tiling: each new tiled window splits opposite to its parent.
+# The parent-relative toggle repeats indefinitely; floating and manual tabbed /
+# stacked layouts are left alone by fibonacci.py.
+default_orientation vertical
+bindsym $mod+b splith
+bindsym $mod+v splitv
+bindsym $mod+s layout stacking
+bindsym $mod+w layout tabbed
+bindsym $mod+e layout toggle split
+
+# Switch to workspace
+bindsym $mod+1 workspace number 1
+bindsym $mod+2 workspace number 2
+bindsym $mod+3 workspace number 3
+bindsym $mod+4 workspace number 4
+bindsym $mod+5 workspace number 5
+bindsym $mod+6 workspace number 6
+bindsym $mod+7 workspace number 7
+bindsym $mod+8 workspace number 8
+bindsym $mod+9 workspace number 9
+bindsym $mod+0 workspace number 10
+
+# Move focused container to workspace
+bindsym $mod+Shift+1 move container to workspace number 1
+bindsym $mod+Shift+2 move container to workspace number 2
+bindsym $mod+Shift+3 move container to workspace number 3
+bindsym $mod+Shift+4 move container to workspace number 4
+bindsym $mod+Shift+5 move container to workspace number 5
+bindsym $mod+Shift+6 move container to workspace number 6
+bindsym $mod+Shift+7 move container to workspace number 7
+bindsym $mod+Shift+8 move container to workspace number 8
+bindsym $mod+Shift+9 move container to workspace number 9
+bindsym $mod+Shift+0 move container to workspace number 10
+
+# Scratchpad
+bindsym $mod+Shift+minus move scratchpad
+bindsym $mod+minus scratchpad show
+
+# Resize mode (vim motions)
+mode "resize" {
+ bindsym $left resize shrink width 10px
+ bindsym $down resize grow height 10px
+ bindsym $up resize shrink height 10px
+ bindsym $right resize grow width 10px
+ bindsym Left resize shrink width 10px
+ bindsym Down resize grow height 10px
+ bindsym Up resize shrink height 10px
+ bindsym Right resize grow width 10px
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+}
+bindsym $mod+r mode "resize"
+
+# Hot reload: sway config + waybar (the supervisor brings it back, so a
+# module crash also resurrects the bar) + mako
+bindsym $mod+Shift+r exec "swaymsg reload; pkill -x waybar; makoctl reload"
+# (Alt+Shift+C also reloads the sway config, sway default)
+bindsym $mod+Shift+c reload
+
+# Exit sway
+bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
+
+### Lock and idle
+# These land in machine overlays — the lock program (veila on rigel), the
+# battery/AC timeout table, and whether a gamepad watcher runs are all
+# machine facts. rigel binds $mod+Escape and starts swayidle from
+# ~/.config/sway/machines/rigel.conf.
+
+# Screenshots (to clipboard)
+bindsym Print exec grim - | wl-copy
+bindsym $mod+Print exec slurp | grim -g - - | wl-copy
+# macOS-style: fullscreen / click-and-drag selection
+bindsym --locked Ctrl+Shift+3 exec grim - | wl-copy
+bindsym --locked Ctrl+Shift+4 exec slurp | grim -g - - | wl-copy
+
+# Volume
+bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
+bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
+bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
+bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
+
+# Media
+bindsym --locked XF86AudioPlay exec playerctl play-pause
+bindsym --locked XF86AudioPause exec playerctl play-pause
+bindsym --locked XF86AudioPrev exec playerctl previous
+bindsym --locked XF86AudioNext exec playerctl next
+bindsym --locked XF86AudioStop exec playerctl stop
+
+# Brightness
+bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
+bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
+
+# Power profile switching is machine-scoped (laptop concern): rigel binds
+# Ctrl+Alt+Shift+1/2/3 in ~/.config/sway/machines/rigel.conf.
+
+# Quality of life
+focus_follows_mouse no
+seat * xcursor_theme Adwaita 24
+
+for_window [app_id="org.pulseaudio.pavucontrol"] floating enable
+
+# LibreWolf prefers client-side decorations (CSD). Sway honors its preference
+# when the window is floated, dropping the sway titlebar and leaving the
+# floating window bare (LibreWolf draws no decorations of its own here).
+# Forcing server-side decorations gives float-and-tile the same sway titlebar.
+for_window [app_id="librewolf"] border normal
+
+# system-managed config (distro)
+include /etc/sway/conf.d/*
+
+# Machine overlays LAST: they may override anything above (specific
+# `output <name>` rules beat `output *`; later bindsym definitions win).
+# Hardware shape, session stack, power behavior only — never styling.
+include ~/.config/sway/machines/*.conf
diff --git a/sway/.config/sway/machines/README.md b/sway/.config/sway/machines/README.md
new file mode 100644
index 0000000..266cedf
--- /dev/null
+++ b/sway/.config/sway/machines/README.md
@@ -0,0 +1,14 @@
+# machines/
+
+One `.conf` per sway machine, loaded LAST by the shared
+`~/.config/sway/config` via `include ~/.config/sway/machines/*.conf`.
+
+Machine files may override anything from the shared config: specific
+`output <name>` rules beat the shared `output *` fallback, and later
+definitions win on bindsym conflicts.
+
+They may contain ONLY hardware shape (outputs, input blocks), that
+machine's session stack (autostart of its own scripts), lock/idle, and
+power behavior — never styling, never the shared palette or key slots for
+muscle memory. Each machine ships its own file via its own repo package
+(see `rigel/.config/sway/machines/rigel.conf` for the pattern).
diff --git a/sway/AGENTS.md b/sway/AGENTS.md
new file mode 100644
index 0000000..bb5532e
--- /dev/null
+++ b/sway/AGENTS.md
@@ -0,0 +1,33 @@
+# sway — Component Context
+
+Parent rules: `../AGENTS.md` (repo root). This package holds the SHARED
+sway config for every sway-using machine.
+
+## The split doctrine
+
+- Tracked `config` = shared, machine-agnostic layer: doom-one palette
+ variables, fonts, borders/gaps/titlebars, window rules, ALL muscle-memory
+ key bindings (vim motions, workspaces, screenshots, volume/media/
+ brightness, resize mode), behavioral QoL. NO exec lines, no machine
+ paths, no output names.
+- Machine overlays: `~/.config/sway/machines/<hostname>.conf`, included
+ LAST — they may override anything above and may ONLY contain hardware
+ shape (outputs, input blocks), that machine's session stack (autostart
+ of its own scripts), lock/idle, and power behavior. NEVER styling. In
+ this repo the pattern is delivered by per-machine packages (currently
+ `../rigel`); see `machines/README.md` for the contract.
+- Sway precedence facts the split relies on: specific `output <name>`
+ rules beat `output *`; later bindsym definitions win; `include` is
+ re-evaluated on every `swaymsg reload`.
+
+## Include depth constraint
+
+Sway's include is one level deep: `machines/*.conf` files are included
+directly by the main config and must NOT themselves contain `include`.
+
+## Session scripts
+
+Referenced autostart scripts are per-machine repo content (rigel package
+ships its supervisor/fibonacci/ppd/veila helpers). The shared config
+contains no exec lines, so a bare `stow sway` on a new machine yields a
+working, safe desktop before that machine's overlay lands.