Skip to main content

max / alloy_tui

8.4 KB · 209 lines History Blame Raw
1 # Alloy Sway configuration
2 #
3 # i3-style tiling Wayland session. Translated from the former niri
4 # config on the 2026-07-17 pivot away from the scrolling-tiler model.
5 # Palette on chrome per docs/TOKENS.md.
6 #
7 # HANDOFF (scaffold — refine in Helix):
8 # - Bar: minimal swaybar placeholder below (clock only). Replace with
9 # a real status_command, waybar, or the future alloy console view.
10 # - Launcher: Mod+D is commented out (anyrun was dropped). Bind a TUI
11 # launcher when chosen.
12 # - Palette: client.* colors are a first pass from the niri focus-ring
13 # values — reconcile against docs/TOKENS.md.
14 # - Env vars: GTK/QT/MOZ backend hints live in
15 # ~/.config/environment.d/alloy.conf; verify they reach sway's
16 # children under greetd (see the live-verification GO task).
17 # - Verify on real hardware: swayosd Fn binds, grim screenshots,
18 # per-machine output in /etc/sway/config.d/.
19
20 set $mod Mod4
21 set $term rio
22
23 # -------------------------------------------------------------------
24 # Input
25 # -------------------------------------------------------------------
26 input type:keyboard {
27 xkb_layout us
28 repeat_delay 400
29 repeat_rate 30
30 }
31
32 input type:touchpad {
33 tap enabled
34 natural_scroll enabled
35 pointer_accel 0.2
36 }
37
38 input type:pointer {
39 accel_profile flat
40 }
41
42 # niri warped the cursor to the focused window; sway's nearest is
43 # warping to the focused container center on focus change.
44 mouse_warping container
45 focus_follows_mouse no
46
47 # Cursor theme + size (was niri's XCURSOR_* environment block).
48 seat seat0 xcursor_theme Bibata-Modern-Classic 24
49
50 # -------------------------------------------------------------------
51 # Output — per-machine display config lives in a drop-in so this base
52 # stays generic. Ship an example, commented, like the niri config did.
53 # -------------------------------------------------------------------
54 # output eDP-1 {
55 # mode 1920x1200@60Hz
56 # scale 1.0
57 # }
58 output * bg #f7f4ec solid_color
59 include /etc/sway/config.d/*
60
61 # -------------------------------------------------------------------
62 # Layout / chrome
63 # -------------------------------------------------------------------
64 gaps inner 8
65 gaps outer 0
66 # niri ran border off + a 2px focus-ring; pixel border with no titlebar
67 # is the sway equivalent (also covers the old prefer-no-csd intent).
68 default_border pixel 2
69 default_floating_border pixel 2
70 font pango:IosevkaTerm Nerd Font 10
71
72 # class border background text indicator child_border
73 client.focused #7f786d #7f786d #1a1a1a #7f786d #7f786d
74 client.focused_inactive #dad2c7 #dad2c7 #6b6b6b #dad2c7 #dad2c7
75 client.unfocused #dad2c7 #dad2c7 #6b6b6b #dad2c7 #dad2c7
76 client.urgent #b3543f #b3543f #ffffff #b3543f #b3543f
77
78 # satty floats; everything else tiles (anyrun rule dropped with anyrun).
79 for_window [app_id="satty"] floating enable
80
81 # -------------------------------------------------------------------
82 # Startup
83 # -------------------------------------------------------------------
84 exec mkdir -p ~/Pictures/Screenshots
85 # Clipboard history: two watchers per docs/STACK.md#clipboard-history.
86 exec wl-paste --type text --watch cliphist store
87 exec wl-paste --type image --watch cliphist store
88 # swayosd-server backs the volume/brightness/caps overlays.
89 exec swayosd-server
90
91 # Idle: dim to lock at 5 minutes, displays off at 10, and always lock
92 # before suspend so a closed lid never resumes into a live session.
93 # -w makes swayidle wait for the lock to come up before sleeping.
94 # Lock styling comes from ~/.config/swaylock/config (it sets daemonize).
95 exec swayidle -w \
96 timeout 300 'swaylock -f' \
97 timeout 600 'swaymsg "output * power off"' \
98 resume 'swaymsg "output * power on"' \
99 before-sleep 'swaylock -f'
100
101 # -------------------------------------------------------------------
102 # Binds — session
103 # -------------------------------------------------------------------
104 bindsym $mod+Return exec $term
105 # Multiplexed terminal. zellij is not a Wayland client; it runs inside
106 # $term, so this is the emulator with the multiplexer as its command.
107 bindsym $mod+Shift+Return exec $term -e zellij
108 # Launcher removed with anyrun. Bind a TUI launcher here when chosen,
109 # e.g. bindsym $mod+d exec $term -e <picker>
110 # bindsym $mod+d exec ...
111 bindsym $mod+Ctrl+l exec swaylock
112 bindsym $mod+Shift+e exit
113
114 # Window ops
115 bindsym $mod+q kill
116 bindsym $mod+f fullscreen toggle
117 bindsym $mod+Shift+f fullscreen toggle global
118
119 # Focus (i3 hjkl)
120 bindsym $mod+h focus left
121 bindsym $mod+j focus down
122 bindsym $mod+k focus up
123 bindsym $mod+l focus right
124
125 # Move
126 bindsym $mod+Shift+h move left
127 bindsym $mod+Shift+j move down
128 bindsym $mod+Shift+k move up
129 bindsym $mod+Shift+l move right
130
131 # Layout — sway-native (no niri equivalent; core i3 UX)
132 bindsym $mod+b splith
133 bindsym $mod+v splitv
134 bindsym $mod+w layout tabbed
135 bindsym $mod+s layout stacking
136 bindsym $mod+e layout toggle split
137 bindsym $mod+Shift+space floating toggle
138 bindsym $mod+space focus mode_toggle
139
140 # Resize (was niri's column-width presets)
141 bindsym $mod+r mode "resize"
142 bindsym $mod+minus resize shrink width 10 ppt
143 bindsym $mod+equal resize grow width 10 ppt
144 mode "resize" {
145 bindsym h resize shrink width 10 ppt
146 bindsym l resize grow width 10 ppt
147 bindsym k resize shrink height 10 ppt
148 bindsym j resize grow height 10 ppt
149 bindsym Return mode "default"
150 bindsym Escape mode "default"
151 }
152
153 # Workspaces (kept the named notes/main from niri; media too)
154 bindsym $mod+1 workspace number 1
155 bindsym $mod+2 workspace number 2
156 bindsym $mod+3 workspace number 3
157 bindsym $mod+4 workspace number 4
158 bindsym $mod+n workspace notes
159 bindsym $mod+m workspace main
160 bindsym $mod+Shift+1 move container to workspace number 1
161 bindsym $mod+Shift+2 move container to workspace number 2
162 bindsym $mod+Shift+3 move container to workspace number 3
163 bindsym $mod+Shift+4 move container to workspace number 4
164
165 # -------------------------------------------------------------------
166 # Binds — screenshots (grim; sway has no built-in capture)
167 # -------------------------------------------------------------------
168 set $shot ~/Pictures/Screenshots/screenshot-$(date +%Y%m%d-%H%M%S).png
169 bindsym Print exec grim $shot
170 bindsym Shift+Print exec grim -g "$(slurp)" $shot
171 # Active-window grab needs jq to parse the tree; region-select covers it
172 # for now. To enable, install jq and use:
173 # grim -g "$(swaymsg -t get_tree | jq -r '.. | select(.focused?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"')" $shot
174 bindsym Ctrl+Print exec grim -g "$(slurp)" $shot
175 # Annotate the most recent screenshot with satty.
176 bindsym $mod+Print exec sh -c 'satty --filename "$(ls -t ~/Pictures/Screenshots/*.png | head -1)"'
177
178 # -------------------------------------------------------------------
179 # Binds — volume / brightness / media (swayosd + playerctl)
180 # -------------------------------------------------------------------
181 bindsym XF86AudioRaiseVolume exec swayosd-client --output-volume raise
182 bindsym XF86AudioLowerVolume exec swayosd-client --output-volume lower
183 bindsym XF86AudioMute exec swayosd-client --output-volume mute-toggle
184 bindsym XF86AudioMicMute exec swayosd-client --input-volume mute-toggle
185 bindsym XF86MonBrightnessUp exec swayosd-client --brightness raise
186 bindsym XF86MonBrightnessDown exec swayosd-client --brightness lower
187 bindsym XF86AudioPlay exec playerctl play-pause
188 bindsym XF86AudioPause exec playerctl play-pause
189 bindsym XF86AudioNext exec playerctl next
190 bindsym XF86AudioPrev exec playerctl previous
191 # Caps-lock indicator (needs swayosd-libinput-backend running).
192 bindsym --release Caps_Lock exec swayosd-client --caps-lock
193
194 # -------------------------------------------------------------------
195 # Bar — PLACEHOLDER. Minimal swaybar with a clock; replace with a real
196 # status_command, waybar, or the future alloy console status view.
197 # -------------------------------------------------------------------
198 bar {
199 position top
200 font pango:IosevkaTerm Nerd Font 10
201 status_command while date +'%Y-%m-%d %H:%M'; do sleep 20; done
202 colors {
203 background #f7f4ec
204 statusline #1a1a1a
205 focused_workspace #7f786d #7f786d #1a1a1a
206 inactive_workspace #dad2c7 #dad2c7 #6b6b6b
207 }
208 }
209