repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Merge remote-tracking branch 'bugabinga/trunk' into trunk

ab9b78c379b701c9c41769cc136dcade5ab4eb7f

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

# Conflicts:
#	enable_user_services.nu
#	pi-ext
#	pi/agent/settings.json

Changed files (56)

+1848 / −918 text lines · all files grouped into 32 bars · 1 metadata-only · 2 binary (striped old/new sizes in 64-byte units, not churn) · lines and sizes scale separately

Diff layout

docs/super/inventory/2026-06-14-nugu-theme-current-state.md

Added
new file mode 100644

+335 / −0 text lines

1# Nugu Theme Current-State Inventory — 2026-06-14
2
3Goal: build theme switching system with Nugu as source of truth.
4
5## Source of truth
6
7Nugu source files:
8
9- `nugu/base.toml` — seed colors + intent comments.
10- `nugu/nugu.nu` — palette generation + WCAG validation.
11- `nugu/palette.nu` — reads generated `nugu/output/dark.toml` and `nugu/output/light.toml`.
12- App generators:
13 - `nugu/helix.nu`
14 - `nugu/wezterm.nu`
15 - `nugu/ghostty.nu`
16 - `nugu/hypr.nu`
17 - `nugu/linux_console.nu`
18 - `nugu/mako.nu`
19 - `nugu/ironbar.nu`
20 - `nugu/yazi.nu`
21 - `nugu/aerc.nu`
22 - `nugu/neovim.nu`
23 - `nugu/site.nu`
25Tools observed:
27- `nu 0.113.1`
28- `just 1.52.0`
29- `taplo 0.10.0`
30- `pastel 0.12.0`
32Nugu recipes from `nugu/justfile`:
34- `build` → `nugu/output/dark.toml`, `nugu/output/light.toml`.
35- `check` → format + WCAG validation.
36- `install` → helix + wezterm + ghostty + linux-console + hypr + mako + ironbar + aerc + yazi + nvim.
37- Per-app recipes: `helix`, `wezterm`, `nvim`, `ghostty`, `hypr`, `linux-console`, `mako`, `ironbar`, `yazi`, `aerc`.
39## Tracked generated Nugu outputs
41Tracked generated/theme consumers found by `git ls-files`:
43- `aerc/stylesets/nugu-dark`
44- `aerc/stylesets/nugu-light`
45- `bash/linux-console/nugu-dark.sh`
46- `bash/linux-console/nugu-light.sh`
47- `clipse/nugu.json`
48- `cmus/nugu.theme`
49- `ghostty/themes/nugu-dark`
50- `ghostty/themes/nugu-light`
51- `helix/themes/nugu-dark.toml`
52- `helix/themes/nugu-light.toml`
53- `hypr/generated/nugu.lua`
54- `ironbar/nugu.css`
55- `mako/nugu.conf`
56- `neovim/colors/nugu.lua`
57- `neovim/lua/bugabinga/nugu/init.lua`
58- `neovim/lua/bugabinga/nugu/palette.lua`
59- `wezterm/bugabinga/nugu/init.lua`
60- `wezterm/bugabinga/nugu/palette_dark.lua`
61- `wezterm/bugabinga/nugu/palette_light.lua`
62- `yazi/flavors/nugu-dark.yazi/flavor.toml`
63- `yazi/flavors/nugu-light.yazi/flavor.toml`
65## Current mode state
67Observed state paths:
69- `~/.cache/nugu/mode` exists and contained `dark`.
70- `~/.local/state/nugu/mode` missing.
71- `~/.local/state/nugu/themes/mako.conf` missing.
72- `~/.local/state/nugu/themes/ironbar.css` missing.
73- `~/.local/state/nugu/themes/hyprtoolkit.conf` missing.
75Current cache readers:
77- `hypr/generated/nugu.lua` reads `~/.cache/nugu/mode`.
78- `nugu/hypr.nu` generates that cache path.
79- `wezterm/bugabinga/theme.lua` reads `~/.cache/nugu/mode` before falling back to `wez.gui.get_appearance()`.
81Required contract change: move mode state to `${XDG_STATE_HOME:-~/.local/state}/nugu/mode`; update all cache readers.
83## Consumer inventory
85### Hyprland
87Files:
89- `hypr/generated/nugu.lua`
90- `hypr/modules/appearance.lua`
91- `hypr/modules/rules.lua`
92- `hypr/modules/hypr_osd.lua`
94State:
96- `generated/nugu.lua` contains both dark + light palettes.
97- `generated/nugu.lua` currently reads `~/.cache/nugu/mode`.
98- `modules/appearance.lua` calls `nugu.current()` at config evaluation and supports `M.apply(mode)`.
99- `modules/rules.lua` and `modules/hypr_osd.lua` bind colors at module load; reload/eval needed after switch.
101Reload path:
103- `hyprctl reload config-only` should refresh Lua config and Nugu colors.
105Gaps:
107- No tracked switch entrypoint exists now; old `hypr/scripts/theme.lua` is deleted in current worktree.
108- `hypr/generated/nugu.json` is deleted in current worktree but still referenced by `nugu/justfile` recipe.
110### Mako
112Files:
114- `mako/config`
115- `mako/nugu.conf`
116- `hypr/systemd/mako.service`
118State:
120- `mako/config` includes `~/.config/mako/nugu.conf`.
121- `mako/nugu.conf` is pure Nugu color/style fragment.
122- Behavior/layout remains in `mako/config`.
124Reload path:
126- `makoctl reload` available.
128Gap: current switch would need to rewrite tracked `mako/nugu.conf`; target design should include local-state theme fragment instead.
130### Ironbar
132Files:
134- `ironbar/style.css`
135- `ironbar/nugu.css`
136- `ironbar/config.json`
137- `ironbar/scripts/workspaces-watch.py`
138- `hypr/systemd/ironbar.service`
140State:
142- `ironbar/style.css` imports `nugu.css`.
143- `ironbar/nugu.css` is pure generated CSS vars.
144- `ironbar/config.json` is behavior/layout/modules.
145- `ironbar/scripts/workspaces-watch.py` reads `~/.config/ironbar/nugu.css` directly for colors.
147Reload path:
149- Ironbar docs/help: style changes hot-loaded; `ironbar reload` exists.
150- `ironbar --theme <path>` can select CSS path at start.
152Gaps:
154- Current import points at tracked `ironbar/nugu.css`.
155- `workspaces-watch.py` hard-codes `~/.config/ironbar/nugu.css`; switch design must update it to read local-state CSS vars or avoid direct color parsing.
157### Hyprtoolkit apps
159Files:
161- `hypr/hyprtoolkit.conf`
163State:
165- File contains colors + static appearance variables: rounding, font sizes, fonts, icon theme.
166- Hyprtoolkit package has no `hyprtoolkit` executable/manpage; it is a library used by `hyprlauncher`, `hyprpwcenter`, `hyprshutdown`, etc.
167- `hyprtoolkit 0.5.4` supports `source = <path>`.
168- Source inspection: it watches only main `~/.config/hypr/hyprtoolkit.conf` with `IN_MODIFY | IN_DONT_FOLLOW`; sourced files are parsed but not watched.
170Reload path:
172- Live color reload occurs internally after main config `IN_MODIFY`.
173- To live-switch sourced local-state colors: write sourced file, then rewrite main file bytes unchanged to trigger `IN_MODIFY` without lasting diff.
175Gap: split tracked main file = fallback + static vars + source directive; local-state file = colors only.
177### GTK/Qt/system preference
179State:
181- `org.gnome.desktop.interface color-scheme` exists.
182- Current value observed: `prefer-dark`.
183- Range: `default`, `prefer-dark`, `prefer-light`.
184- Portal services active: `xdg-desktop-portal`, `xdg-desktop-portal-gtk`, `xdg-desktop-portal-hyprland`.
186Reload path:
188- `gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'|'prefer-light'`.
190Gap: no Nugu switch command currently sets it.
192### Ghostty
194Files:
196- `ghostty/config`
197- `ghostty/themes/nugu-dark`
198- `ghostty/themes/nugu-light`
200State:
202- Config uses `theme = light:nugu-light,dark:nugu-dark`.
203- Already dual-theme and should follow system dark/light mode.
205Gap: none beyond setting system color-scheme.
207### WezTerm
209Files:
211- `wezterm/bugabinga/theme.lua`
212- `wezterm/bugabinga/nugu/init.lua`
213- `wezterm/bugabinga/nugu/palette_dark.lua`
214- `wezterm/bugabinga/nugu/palette_light.lua`
216State:
218- Generated palettes exist for both modes.
219- `theme.lua` prefers `~/.cache/nugu/mode`, then falls back to WezTerm GUI appearance.
221Gaps:
223- Update mode reader to local-state.
224- Need reload behavior decision; automatic reload not verified.
226### Neovim
228Files:
230- `neovim/init.lua`
231- `neovim/colors/nugu.lua`
232- `neovim/lua/bugabinga/nugu/palette.lua`
233- `neovim/lua/bugabinga/nugu/init.lua`
235State:
237- Uses colorscheme `nugu`.
238- Palette file contains dark + light GUI palette and TUI palette.
239- Active mode based on `vim.o.background`.
240- Existing autocommand reloads colorscheme on `SIGUSR1`.
242Gap: switch command can optionally signal running Neovim processes later; not required for Hypr desktop shell switch.
244### Helix
246Files:
248- `helix/config.toml`
249- `helix/themes/nugu-dark.toml`
250- `helix/themes/nugu-light.toml`
252State:
254- `helix/config.toml` hard-codes `theme = "nugu-dark"`.
256Gap: no dynamic switch currently.
258### Yazi
260Files:
262- `yazi/theme.toml`
263- `yazi/flavors/nugu-dark.yazi/flavor.toml`
264- `yazi/flavors/nugu-light.yazi/flavor.toml`
266State:
268- Nugu generated flavors are tracked.
269- `yazi/theme.toml` currently uses `noctalia` for both `dark` and `light`, not Nugu.
271Gap: generated Nugu flavors are not active.
273### Aerc
275Files:
277- `aerc/aerc.conf`
278- `aerc/stylesets/nugu-dark`
279- `aerc/stylesets/nugu-light`
281State:
283- `aerc/aerc.conf` hard-codes `styleset-name=nugu-dark`.
285Gap: no dynamic switch currently.
287### Linux console
289Files:
291- `bash/bashrc`
292- `bash/linux-console/nugu-dark.sh`
293- `bash/linux-console/nugu-light.sh`
295State:
297- Bash helper `_nugu_console_theme dark|light|toggle` sources generated shell fragments.
298- Bash startup currently calls `_nugu_console_theme light`.
300Gap: not integrated with global Nugu mode state.
302### Cmus / Clipse / tmux
304Files:
306- `cmus/nugu.theme`
307- `clipse/nugu.json`
308- `tmux/tmux.conf`
310State:
312- Tracked Nugu-related files exist.
313- No dynamic dark/light switch integration observed during this inventory.
315## Dirty work relevant to theme switch
317Observed earlier via `git -C .. status --short --ignore-submodules=dirty`:
319- Modified/deleted Hypr transition files, including deleted old `hypr/scripts/theme.lua` and `hypr/systemd/nugu-theme.service`.
320- `hypr/generated/nugu.json` deleted; `hypr/generated/nugu.lua` still tracked.
321- `ironbar/nugu.css`, `ironbar/style.css`, `ironbar/config.json`, `ironbar/scripts/workspaces-watch.py` modified.
322- `mako/nugu.conf` modified.
323- `nugu/ironbar.nu` modified.
325Do not broad-add. Stage exact files only.
327## Conclusions
3291. Nugu source-of-truth structure already exists and covers target app palettes.
3302. Runtime mode state is split today: Hypr + WezTerm read `~/.cache/nugu/mode`; target contract requires local state.
3313. Hypr/Mako/Ironbar/Hyprtoolkit are the core Hypr desktop shell switch targets.
3324. Ghostty already fits the system-preference model.
3335. Helix/Aerc/Linux console/Yazi are static or manually switchable today; include in longer-term switch contract, but they are not blockers for Hypr desktop shell switching.
3346. Ironbar has an extra direct color consumer: `ironbar/scripts/workspaces-watch.py`; any switch plan must update it.
3357. Local-state runtime theme fragments are currently absent; first implementation must create them before changing service/config includes.

docs/super/plans/2026-06-14-nugu-hypr-theme-switching.md

Added
new file mode 100644

+478 / −0 text lines

1# Nugu Hypr Theme Switching Implementation Plan
2
3> **For agentic workers:** REQUIRED SUB-SKILL: Use /skill:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
5**Goal:** Build a dark/light theme switch for Hyprland desktop apps with Nugu as palette source of truth and no switch-time dotfiles diffs.
6
7**Architecture:** Nugu generates deterministic dark/light fragments. A Hypr-linked switch script copies selected fragments into `${XDG_STATE_HOME:-~/.local/state}/nugu` and asks live apps to reload. Tracked app configs keep behavior/layout; runtime state contains only mode + color/style fragments.
8
9**Tech Stack:** Nushell generators/scripts, Hyprland Lua config, mako IPC, Ironbar GTK CSS hot reload, GSettings `org.gnome.desktop.interface color-scheme`, hyprtoolkit `source =` + inotify main-file poke.
11**Roadmap:** None
13**Phase:** Single-plan implementation
15**Inventory:** `docs/super/inventory/2026-06-14-nugu-theme-current-state.md`
17**Contract:** `docs/super/specs/2026-06-14-nugu-theme-switch-contract.md`
19---
21## Research facts locked into this plan
23- `makoctl reload` reloads mako config without restart.
24- `ironbar` supports CSS hot reload; `ironbar --theme <path>`/`IRONBAR_CSS` select CSS path.
25- `ironbar style load-css <path>` loads additional hot-reloaded CSS; primary `--theme` is simpler for startup.
26- Hyprland can reload config with `hyprctl reload config-only`.
27- `hyprtoolkit 0.5.4` watches only main config path `~/.config/hypr/hyprtoolkit.conf` with `IN_MODIFY | IN_DONT_FOLLOW`.
28- `hyprtoolkit.conf` supports `source = <path>` but sourced files are not watched.
29- Therefore hyprtoolkit live switch requires: write sourced state file, then trigger `IN_MODIFY` on main config without changing content.
30- Runtime state path must be `$XDG_STATE_HOME/nugu` or `~/.local/state/nugu`, not cache.
32## File structure
34- Modify `nugu/hypr.nu`
35 - Generate Hypr desktop runtime theme fragments for both modes from Nugu palette.
36 - Keep `generated/nugu.lua` mode reader in sync with local-state path.
37- Modify `nugu/justfile`
38 - Extend `hypr` recipe to copy generated runtime fragments into `hypr/generated/runtime/<mode>/`.
39- Create `hypr/scripts/nugu-theme.nu`
40 - Runtime command: `dark | light | toggle | current | status | prepare`.
41 - Writes local-state mode + theme files.
42 - Reloads Hyprland, mako, Ironbar, GTK color-scheme, hyprtoolkit.
43- Modify `mako/config`
44 - Include runtime state theme fragment, not tracked `mako/nugu.conf`.
45- Modify `ironbar/style.css`
46 - Remove direct `@import url("nugu.css")`; base CSS becomes layout/style only.
47- Modify `ironbar/scripts/workspaces-watch.py`
48 - Read Ironbar CSS vars from local-state runtime CSS instead of tracked `ironbar/nugu.css`.
49- Modify `wezterm/bugabinga/theme.lua`
50 - Read Nugu mode from local-state path instead of cache.
51- Modify `hypr/systemd/ironbar.service`
52 - Start Ironbar with runtime CSS path; prepare runtime CSS before start.
53- Modify `hypr/systemd/mako.service`
54 - Prepare runtime mako fragment before start.
55- Modify `hypr/hyprtoolkit.conf`
56 - Keep safe dark fallback values and static appearance variables.
57 - Add `source = ~/.local/state/nugu/themes/hyprtoolkit.conf` at end.
58- Modify `hypr/modules/binds.lua` and `hypr/modules/hypr_osd.lua`
59 - Add one manual toggle bind.
60- Regenerate `hypr/generated/nugu.lua`.
62---
64## Task 1: Update Nugu Hypr generator paths + runtime fragments
66**Files:**
68- Modify: `nugu/hypr.nu`
69- Modify: `nugu/justfile`
70- Generated: `hypr/generated/nugu.lua`
71- Generated: `hypr/generated/runtime/dark/mako.conf`
72- Generated: `hypr/generated/runtime/light/mako.conf`
73- Generated: `hypr/generated/runtime/dark/ironbar-vars.css`
74- Generated: `hypr/generated/runtime/light/ironbar-vars.css`
75- Generated: `hypr/generated/runtime/dark/hyprtoolkit.conf`
76- Generated: `hypr/generated/runtime/light/hyprtoolkit.conf`
78- [ ] Replace generated Lua cache path in `nugu/hypr.nu` with local-state path:
80```nu
81' local state_home = os.getenv("XDG_STATE_HOME") or (os.getenv("HOME") .. "/.local/state")'
82' local path = state_home .. "/nugu/mode"'
83```
85- [ ] Add helpers to `nugu/hypr.nu`:
87```nu
88def strip-hash [s: string] { $s | str replace "#" "" }
89def argb [color: string] { $"0xFF(strip-hash $color)" }
90def rgba [color: string, alpha: string] { $"($color)($alpha)" }
91```
93- [ ] Add exported fragment generators to `nugu/hypr.nu`:
95```nu
96export def mako [mode: string] {
97 let p = (nugu $mode | get palette)
98 $'# Generated by nugu/hypr.nu from Nugu palette.
99background-color=(rgba $p.ui.backdrop "ee")
100text-color=(rgba $p.ui.normal "ff")
101border-color=(rgba $p.ui.accent "ff")
102progress-color=over (rgba $p.ui.focus "ff")
104[urgency=low]
105background-color=(rgba $p.content.backdrop "e6")
106text-color=(rgba $p.content.minor "ff")
107border-color=(rgba $p.ui.unfocus "ff")
108progress-color=over (rgba $p.content.minor "ff")
110[urgency=normal]
111border-color=(rgba $p.ui.accent "ff")
112progress-color=over (rgba $p.ui.focus "ff")
114[urgency=critical]
115background-color=(rgba $p.ui.backdrop "ff")
116text-color=(rgba $p.ui.important_global "ff")
117border-color=(rgba $p.error "ff")
118progress-color=over (rgba $p.error "ff")
120[summary~="[Ee]rror|[Ff]ailed|[Ff]ailure|[Cc]rash"]
121border-color=(rgba $p.error "ff")
122progress-color=over (rgba $p.error "ff")
124[summary~="[Ww]arn|[Ww]arning"]
125border-color=(rgba $p.warning "ff")
126progress-color=over (rgba $p.warning "ff")
128[summary~="[Ii]nfo|[Nn]otice"]
129border-color=(rgba $p.info "ff")
130progress-color=over (rgba $p.info "ff")
131'
132}
134export def ironbar-vars [mode: string] {
135 let p = (nugu $mode | get palette)
136 $'/* Generated by nugu/hypr.nu from Nugu palette. */
137:root {
138 --bg: ($p.ui.backdrop);
139 --bg-transparent: ($p.ui.backdrop)ee;
140 --surface: ($p.ui.minor);
141 --fg: ($p.ui.normal);
142 --accent: ($p.ui.accent);
143 --focus: ($p.ui.focus);
144 --important-global: ($p.ui.important_global);
145 --on-focus: ($p.content.backdrop);
146 --muted: ($p.ui.minor);
147 --unfocus: ($p.ui.unfocus);
148 --error: ($p.error);
149 --warning: ($p.warning);
150 --info: ($p.info);
151 --debug: ($p.debug);
152 --border: ($p.ui.accent);
153}
154'
155}
157export def hyprtoolkit [mode: string] {
158 let p = (nugu $mode | get palette)
159 $'# Generated by nugu/hypr.nu from Nugu palette.
160background = (argb $p.content.backdrop)
161base = (argb $p.ui.backdrop)
162alternate_base = (argb $p.ui.minor)
163text = (argb $p.content.normal)
164bright_text = (argb $p.ui.important_global)
165link_text = (argb $p.info)
166accent = (argb $p.ui.accent)
167accent_secondary = (argb $p.content.important_local)
168'
169}
170```
172- [ ] Extend `nugu/justfile` `hypr` recipe to generate/copy `runtime/{dark,light}/{mako.conf,ironbar-vars.css,hyprtoolkit.conf}`.
174- [ ] Run:
176```bash
177just --justfile nugu/justfile --working-directory nugu hypr
178just --justfile nugu/justfile --working-directory nugu check
179```
181Expected: both exit `0`; runtime generated files exist.
183---
185## Task 2: Add local-state switch command
187**Files:**
189- Create: `hypr/scripts/nugu-theme.nu`
191- [ ] Create script with this behavior:
193```nu
194#!/usr/bin/env nu
196const valid_modes = [dark light]
198def state-root [] {
199 let base = ($env.XDG_STATE_HOME? | default ($env.HOME | path join ".local" "state"))
200 $base | path join "nugu"
201}
203def mode-path [] { state-root | path join "mode" }
204def themes-dir [] { state-root | path join "themes" }
205def generated-dir [] { $env.HOME | path join ".config" "hypr" "generated" "runtime" }
207def read-mode [] {
208 let path = (mode-path)
209 if ($path | path exists) {
210 let mode = (open --raw $path | str trim)
211 if $mode in $valid_modes { $mode } else { "dark" }
212 } else {
213 "dark"
214 }
215}
217def target-mode [mode: string] {
218 if $mode == "toggle" {
219 if (read-mode) == "dark" { "light" } else { "dark" }
220 } else if $mode in $valid_modes {
221 $mode
222 } else if $mode == "current" {
223 read-mode
224 } else {
225 error make { msg: "mode must be dark|light|toggle|current" }
226 }
227}
229def write-text [path: path, text: string] {
230 mkdir ($path | path dirname)
231 $text | save --force --raw $path
232}
234def copy-generated [mode: string, name: string] {
235 let src = (generated-dir | path join $mode $name)
236 if not ($src | path exists) { error make { msg: $"missing generated theme fragment: ($src)" } }
237 open --raw $src
238}
240def write-mode [mode: string] { write-text (mode-path) $"($mode)\n" }
241def write-mako [mode: string] { write-text (themes-dir | path join "mako.conf") (copy-generated $mode "mako.conf") }
242def write-hyprtoolkit [mode: string] { write-text (themes-dir | path join "hyprtoolkit.conf") (copy-generated $mode "hyprtoolkit.conf") }
244def ironbar-base-css-uri [] {
245 let path = ($env.HOME | path join ".config" "ironbar" "style.css")
246 $"file://($path)"
247}
249def write-ironbar [mode: string] {
250 let vars = (copy-generated $mode "ironbar-vars.css")
251 let css = $'@import url("(ironbar-base-css-uri)");
252($vars)'
253 write-text (themes-dir | path join "ironbar.css") $css
254}
256def set-gtk-mode [mode: string] {
257 let scheme = if $mode == "dark" { "prefer-dark" } else { "prefer-light" }
258 ^gsettings set org.gnome.desktop.interface color-scheme $scheme
259}
261def reload-hypr [] { ^hyprctl reload config-only | ignore }
262def reload-mako [] { if (which makoctl | is-not-empty) { ^makoctl reload | ignore } }
263def reload-ironbar [] { if (which ironbar | is-not-empty) { ^ironbar reload | ignore } }
265def poke-hyprtoolkit [] {
266 let path = ($env.HOME | path join ".config" "hypr" "hyprtoolkit.conf")
267 if ($path | path exists) {
268 let data = (open --raw $path)
269 $data | save --force --raw $path
270 }
271}
273def notify [mode: string] {
274 if (which hyprctl | is-empty) { return }
275 let color = if $mode == "dark" { "rgb(d86dd8)" } else { "rgb(922792)" }
276 ^hyprctl notify 5 1200 $color $"nugu ($mode)" | ignore
277}
279export def status [] { read-mode }
281export def prepare [mode = "current"] {
282 let m = (target-mode $mode)
283 write-mode $m
284 write-mako $m
285 write-ironbar $m
286 write-hyprtoolkit $m
287}
289export def main [mode = "toggle"] {
290 let m = (target-mode $mode)
291 prepare $m
292 set-gtk-mode $m
293 reload-hypr
294 reload-mako
295 reload-ironbar
296 poke-hyprtoolkit
297 notify $m
298}
299```
301- [ ] Run:
303```bash
304chmod +x hypr/scripts/nugu-theme.nu
305nu-check --as-script hypr/scripts/nugu-theme.nu
306nu hypr/scripts/nugu-theme.nu prepare current
307nu hypr/scripts/nugu-theme.nu status
308```
310Expected: script checks; state files exist; status prints `dark` or `light`.
312---
314## Task 3: Wire app configs to local-state fragments
316**Files:**
318- Modify: `mako/config`
319- Modify: `ironbar/style.css`
320- Modify: `ironbar/scripts/workspaces-watch.py`
321- Modify: `wezterm/bugabinga/theme.lua`
322- Modify: `hypr/systemd/mako.service`
323- Modify: `hypr/systemd/ironbar.service`
324- Modify: `hypr/hyprtoolkit.conf`
326- [ ] In `mako/config`, replace:
328```conf
329include=~/.config/mako/nugu.conf
330```
332with:
334```conf
335include=~/.local/state/nugu/themes/mako.conf
336```
338- [ ] In `ironbar/style.css`, delete first line:
340```css
341@import url("nugu.css");
342```
344- [ ] In `ironbar/scripts/workspaces-watch.py`, replace tracked CSS path with local state:
346```python
347state_home = Path(os.environ.get("XDG_STATE_HOME", Path.home() / ".local" / "state"))
348path = state_home / "nugu" / "themes" / "ironbar.css"
349```
351- [ ] In `wezterm/bugabinga/theme.lua`, replace cache reader with local-state reader:
353```lua
354local state_home = os.getenv 'XDG_STATE_HOME' or ( wez.home_dir .. '/.local/state' )
355local file = io.open( state_home .. '/nugu/mode', 'r' )
356```
358- [ ] In `hypr/systemd/mako.service`, add before `ExecStart=`:
360```systemd
361ExecStartPre=/usr/bin/nu %h/.config/hypr/scripts/nugu-theme.nu prepare current
362```
364- [ ] In `hypr/systemd/ironbar.service`, add before `ExecStart=`:
366```systemd
367ExecStartPre=/usr/bin/nu %h/.config/hypr/scripts/nugu-theme.nu prepare current
368```
370and start with runtime CSS:
372```systemd
373ExecStart=/usr/bin/ironbar --theme %h/.local/state/nugu/themes/ironbar.css
374```
376- [ ] In `hypr/hyprtoolkit.conf`, keep static settings and end with:
378```conf
379# Runtime Nugu color override. Hyprtoolkit watches this file, not sourced files.
380source = ~/.local/state/nugu/themes/hyprtoolkit.conf
381```
383- [ ] Verify:
385```bash
386nu hypr/scripts/nugu-theme.nu prepare current
387makoctl reload
388ironbar reload
389hyprctl reload config-only
390```
392Expected: commands exit `0` when services/Hyprland are running.
394---
396## Task 4: Add Hyprland toggle bind + OSD
398**Files:**
400- Modify: `hypr/modules/hypr_osd.lua`
401- Modify: `hypr/modules/binds.lua`
403- [ ] In `hypr/modules/hypr_osd.lua`, add before `M.notifications`:
405```lua
406M.theme = {
407 toggle = around("nu ~/.config/hypr/scripts/nugu-theme.nu toggle", notify(ok, 1200, t.ui.accent, "Nugu theme toggled")),
408}
409```
411- [ ] In `hypr/modules/binds.lua`, add after reload bind:
413```lua
414bind(mod .. " + SHIFT + T", osd.theme.toggle, "toggle nugu light/dark")
415```
417- [ ] Run:
419```bash
420lua hypr/tests/commands_test.lua
421lua hypr/tests/hypr_osd_test.lua
422hyprctl reload config-only
423hyprctl configerrors
424```
426Expected: tests pass; no new config error.
428---
430## Task 5: Final verification
432- [ ] Run generator validation:
434```bash
435just --justfile nugu/justfile --working-directory nugu check
436just --justfile nugu/justfile --working-directory nugu hypr
437```
439- [ ] Run diff invariant:
441```bash
442before=$(git status --short --ignore-submodules=dirty)
443nu hypr/scripts/nugu-theme.nu light
444nu hypr/scripts/nugu-theme.nu dark
445after=$(git status --short --ignore-submodules=dirty)
446test "$before" = "$after"
447```
449- [ ] Verify GTK preference:
451```bash
452nu hypr/scripts/nugu-theme.nu light
453gsettings get org.gnome.desktop.interface color-scheme
454nu hypr/scripts/nugu-theme.nu dark
455gsettings get org.gnome.desktop.interface color-scheme
456```
458Expected:
460```text
461'prefer-light'
462'prefer-dark'
463```
465- [ ] Ask user for visual confirmation:
467```bash
468nu ~/.config/hypr/scripts/nugu-theme.nu light
469nu ~/.config/hypr/scripts/nugu-theme.nu dark
470```
472Expected visual result:
474- Hypr borders switch.
475- Mako notifications switch after `makoctl reload`.
476- Ironbar switches without restart.
477- GTK/Qt apps that honor color-scheme switch or pick new preference on repaint.
478- Hyprtoolkit apps already open update color where their widgets use palette color callbacks; static font/rounding changes remain next-launch.

docs/super/specs/2026-06-14-nugu-theme-switch-contract.md

Added
new file mode 100644

+279 / −0 text lines

1# Nugu Theme Switch Contract — 2026-06-14
2
3This contract defines target behavior for the Nugu dark/light switch. Nugu remains source of truth for generated app themes.
4
5## Source of truth
6
7Tracked source of truth:
8
9- `nugu/base.toml`
10- `nugu/nugu.nu`
11- `nugu/palette.nu`
12- `nugu/*.nu` app generators
14Tracked generated artifacts are allowed for apps that need installable theme files, but switch-time code must not edit tracked files.
16Forbidden switch-time writes:
18- Any file under `/home/oli/Workspace/dotfiles`.
19- Any symlink target resolving into the dotfiles repo.
20- Any generated artifact under app config dirs if that path is tracked by dorkfiles.
22Allowed switch-time writes:
24- `${XDG_STATE_HOME:-$HOME/.local/state}/nugu/mode`
25- `${XDG_STATE_HOME:-$HOME/.local/state}/nugu/themes/*`
27## Mode values
29Valid modes:
31- `dark`
32- `light`
34Invalid/missing mode fallback:
36- Missing mode → `dark`.
37- Invalid mode content → `dark`; overwrite with valid mode on next switch/prepare.
39Mode file format:
41```text
42<mode>\n
43```
45Example:
47```text
48dark
49```
51## State paths
53Root:
55```text
56${XDG_STATE_HOME:-$HOME/.local/state}/nugu
57```
59Files:
61```text
62mode
63 single-line active mode: dark|light
65themes/mako.conf
66 generated mako color/style fragment only
68themes/ironbar.css
69 generated complete Ironbar runtime CSS:
70 @import tracked base style.css + generated CSS custom properties
72themes/hyprtoolkit.conf
73 generated hyprtoolkit color fragment only
74```
76No behavior/layout/binds/timeouts/modules belong in state theme files.
78## Command surface
80Entrypoint:
82```text
83~/.config/hypr/scripts/nugu-theme.nu
84```
86Required commands:
88```bash
89nu ~/.config/hypr/scripts/nugu-theme.nu dark
90nu ~/.config/hypr/scripts/nugu-theme.nu light
91nu ~/.config/hypr/scripts/nugu-theme.nu toggle
92nu ~/.config/hypr/scripts/nugu-theme.nu current
93nu ~/.config/hypr/scripts/nugu-theme.nu status
94```
96Semantics:
98- `dark`: set mode to dark, write state fragments, apply reload hooks.
99- `light`: set mode to light, write state fragments, apply reload hooks.
100- `toggle`: switch dark ↔ light, write state fragments, apply reload hooks.
101- `current`: read current/fallback mode, write state fragments, apply reload hooks. Used by systemd `ExecStartPre`.
102- `status`: print active mode only; no writes; no reload hooks.
104Recommended internal helper:
106```bash
107nu ~/.config/hypr/scripts/nugu-theme.nu prepare dark
108nu ~/.config/hypr/scripts/nugu-theme.nu prepare light
109nu ~/.config/hypr/scripts/nugu-theme.nu prepare current
110```
112`prepare` writes state files but does not call external reload hooks. It is useful for service startup and tests.
114## Reload hooks
116### GTK / Qt / portal preference
118On `dark`:
120```bash
121gsettings set org.gnome.desktop.interface color-scheme prefer-dark
122```
124On `light`:
126```bash
127gsettings set org.gnome.desktop.interface color-scheme prefer-light
128```
130### Hyprland
132Reload command:
134```bash
135hyprctl reload config-only
136```
138Hyprland colors come from `hypr/generated/nugu.lua`, which must read:
140```text
141${XDG_STATE_HOME:-$HOME/.local/state}/nugu/mode
142```
144### Mako
146Tracked config:
148```text
149mako/config
150```
152Tracked config includes:
154```text
155include=~/.local/state/nugu/themes/mako.conf
156```
158Reload command:
160```bash
161makoctl reload
162```
164No restart unless reload is unavailable or fails for a running daemon.
166### Ironbar
168Tracked base CSS:
170```text
171ironbar/style.css
172```
174Runtime CSS:
176```text
177~/.local/state/nugu/themes/ironbar.css
178```
180Service starts Ironbar with:
182```bash
183ironbar --theme %h/.local/state/nugu/themes/ironbar.css
184```
186Runtime CSS imports tracked base CSS and appends generated `:root` Nugu variables. Ironbar hot-loads style changes; `ironbar reload` is acceptable as explicit nudge.
188Any helper script that parses CSS variables must read local-state runtime CSS, not tracked `ironbar/nugu.css`.
190### Hyprtoolkit apps
192Tracked main config:
194```text
195hypr/hyprtoolkit.conf
196```
198Tracked main config owns fallback colors + static appearance variables and ends with:
200```text
201source = ~/.local/state/nugu/themes/hyprtoolkit.conf
202```
204Runtime fragment owns colors only.
206Because hyprtoolkit watches only the main config path, switch command must:
2081. Write `~/.local/state/nugu/themes/hyprtoolkit.conf`.
2092. Rewrite `~/.config/hypr/hyprtoolkit.conf` with identical bytes to trigger `IN_MODIFY`.
211The identical-byte rewrite must leave `git diff -- hypr/hyprtoolkit.conf` unchanged.
213### Ghostty
215Already matches contract via:
217```text
218theme = light:nugu-light,dark:nugu-dark
219```
221Switch command only needs to set GTK/portal color-scheme.
223### WezTerm
225WezTerm has generated dark/light palettes. Its Nugu mode override must read local-state mode. If mode file is missing, it may fall back to WezTerm GUI appearance.
227### Neovim
229Neovim Nugu palette selects by `vim.o.background`. Live global switching is optional in first Hypr desktop implementation. Existing SIGUSR1 colorscheme reload can be used later.
231### Static/manual consumers
233These are not first-wave blockers:
235- Helix: `helix/config.toml` hard-codes `nugu-dark`.
236- Aerc: `aerc/aerc.conf` hard-codes `nugu-dark`.
237- Linux console: shell helper exists, not tied to global state.
238- Yazi: generated Nugu flavors exist, but active theme currently uses `noctalia`.
239- Cmus / Clipse / tmux: Nugu files exist; no live switch contract yet.
241## Diff invariant
243The switch command must pass:
245```bash
246before=$(git status --short --ignore-submodules=dirty)
247nu hypr/scripts/nugu-theme.nu light
248nu hypr/scripts/nugu-theme.nu dark
249after=$(git status --short --ignore-submodules=dirty)
250test "$before" = "$after"
251```
253## Validation contract
255Generator validation:
257```bash
258just --justfile nugu/justfile --working-directory nugu check
259just --justfile nugu/justfile --working-directory nugu hypr
260```
262Runtime validation:
264```bash
265nu hypr/scripts/nugu-theme.nu status
266nu hypr/scripts/nugu-theme.nu light
267gsettings get org.gnome.desktop.interface color-scheme
268nu hypr/scripts/nugu-theme.nu dark
269gsettings get org.gnome.desktop.interface color-scheme
270```
272Expected GSettings output:
274```text
275'prefer-light'
276'prefer-dark'
277```
279Human visual confirmation remains required for final goal completion.

enable_user_services.nu

Modified

+0 / −1 text lines

1313 [cliphist cliphist cliphist.service]
1414 [wl-clip-persist wl-clip-persist wl-clip-persist.service]
1515 [wezterm-mux-server wezterm-mux-server wezterm-mux-server.service]
16 [nugu-theme lua nugu-theme.service]
1716 [ironbar ironbar ironbar.service]
1817 [ironbar-workspaces python ironbar-workspaces.service]

git/gitconfig

Modified

+1 / −4 text lines

11[alias]
22 a = add --all
3 ap = add --patch
43 ci = commit --all
54 co = checkout
65 bare = clone --bare
98 ra = rebase --abort
109 rc = rebase --continue
1110 st = status --short
12 w = worktree
1311 unstage = reset HEAD --
1412 last = log -1 HEAD
1513 ui = !gitu
1816[core]
1917 attributesfile = .gitattributes
2018 autocrlf = false
19 safecrlf = false
2120 compression = 9
2221 editor = nvim
2322 fscache = true
2423 fsmonitor = true
2524 preloadindex = true
2625 quotepath = false
27 safecrlf = false
2826 symlinks = true
2927 untrackedcache = true
3028 pager = delta
191189[worktree]
192190 guessRemote = true
193 useRelativePaths = true
195192# In order to have host-specific configuration, I include additional settings here.
196193# On each host a different file might be symlinked into '.gitconfig.include'.

git/ignore

Modified

+1 / −0 text lines

11.superpowers/
2.pi/tune/

hypr/.luarc.json

Added
new file mode 100644

+10 / −0 text lines

1{
2 "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3 "workspace": {
4 "library": ["/usr/share/hypr/stubs"],
5 "runtime.version": "LuaJIT"
6 },
7 "diagnostics": {
8 "globals": ["hl"]
9 }
10}

hypr/AGENTS.md

Modified

+0 / −25 text lines

1# AGENTS — Nugu theming
2
3Scope: `hypr/` desktop theming.
4
5Rules:
6- Nugu generators output palette/color fragments only when app supports import/include.
7- Keep app behavior/layout/fonts/spacing in app config dir.
8- Do not duplicate whole app configs in `nugu/`.
9- Use generated fragments:
10 - Ironbar: `ironbar/nugu.css` via `@import url("nugu.css")`
11 - Mako: `mako/nugu.conf` via `include=~/.config/mako/nugu.conf`
12 - Hypr Lua: `hypr/generated/nugu.lua`
13 - Runtime JSON: `hypr/generated/nugu.json`
14- Runtime switcher `hypr/scripts/theme.lua` writes active color fragments under `$XDG_CONFIG_HOME`.
16Hyprtoolkit:
17- Never rewrite `hyprtoolkit.conf` while Hyprtoolkit apps run.
18- Bug: https://github.com/hyprwm/hyprtoolkit/issues/92
19- Static session config only until fixed.
211Nugu semantics:
222- `content.*` = app/content/terminal text surfaces.
233- `ui.*` = chrome/widgets/borders/status bars.
3515Fonts:
3616- Use IBM Plex family exclusively in Hypr desktop configs.
3717- UI sans: `IBM Plex Sans`; mono/status: `IBM Plex Mono`.
39Testing:
40- After theme edits: `NUGU_NO_NOTIFY=1 hypr/scripts/theme.lua dark|light`.
41- Check `systemctl --user is-active mako.service ironbar.service hyprpaper.service`.
42- Screenshot dark/light with `grim`; inspect actual rendered colors, not just CSS.

hypr/hyprland.lua

Modified

+0 / −4 text lines

1-- bugabinga x230 Hyprland
2-- Lua-only compositor config. Generated app configs live beside this tree.
3
41require("modules.env")
5require("modules.permissions")
62require("modules.monitors")
73require("modules.input")
84require("modules.appearance")

hypr/hyprpaper.conf

Deleted
deleted file mode 100644

+0 / −7 text lines

1wallpaper {
2 monitor =
3 path = ~/.config/hypr/wallpapers/nugu-dark.png
4}
5
6splash = false
7ipc = true

hypr/hyprtoolkit.conf

Modified

+0 / −2 text lines

11# Nugu Hyprtoolkit palette.
2# Static for now: live rewrites busy-loop Hyprtoolkit apps.
3# https://github.com/hyprwm/hyprtoolkit/issues/92
53background = 0xFF121212
64base = 0xFF242424

hypr/lib/apps.lua

Deleted
deleted file mode 100644

+0 / −23 text lines

1local tui = require("scripts.tui_tab")
2
3return {
4 terminal = "wezterm connect unix",
5 terminal_class = "wezterm start --always-new-process --class",
6 browser = "firefox",
7 editor = "nvim",
8 launcher = "hyprlauncher",
9 file_manager = function() tui.spawn("yazi") end,
10 bluetooth = function() tui.spawn("bluetui") end,
11 wifi = function() tui.spawn("impala") end,
12 lock = "hyprlock",
13 logout = "hyprshutdown --dry-run",
14 theme_toggle = "lua ~/.config/hypr/scripts/theme.lua toggle",
15 theme_auto = "lua ~/.config/hypr/scripts/theme.lua auto",
16 clipboard = "bash -lc 'cliphist list | hyprlauncher --dmenu | cliphist decode | wl-copy'",
17 screenshot_region = "hyprshot -m region -z",
18 screenshot_window = "hyprshot -m window -z",
19 screenshot_output = "hyprshot -m output -z",
20 screenshot_annotate = "hyprshot -m region -z -- satty --filename",
21 binds_help = "lua ~/.config/hypr/scripts/show_binds.lua",
22 clients_help = "lua ~/.config/hypr/scripts/show_clients.lua",
23}

hypr/modules/appearance.lua

Modified

+71 / −58 text lines

11local nugu = require("generated.nugu")
2local t = nugu.current()
32local rgba = nugu.rgba
5hl.config({
6 general = {
7 gaps_in = 4,
8 gaps_out = 8,
9 border_size = 2,
10 col = {
11 active_border = { colors = { rgba(t.content.accent, "ee"), rgba(t.content.important_local, "ee") }, angle = 42 },
12 inactive_border = rgba(t.ui.unfocus, "88"),
4local M = {}
5
6function M.apply(mode)
7 local t = mode and assert(nugu.get(mode), "unknown mode: " .. tostring(mode)) or nugu.current()
8
9 hl.config({
10 general = {
11 gaps_in = 4,
12 gaps_out = 8,
13 border_size = 2,
14 col = {
15 active_border = { colors = { rgba(t.content.accent, "ee"), rgba(t.content.important_local, "ee") }, angle = 42 },
16 inactive_border = rgba(t.ui.unfocus, "88"),
17 },
18 resize_on_border = true,
19 allow_tearing = false,
20 layout = "dwindle",
1321 },
14 resize_on_border = true,
15 allow_tearing = false,
16 layout = "dwindle",
17 },
19 decoration = {
20 rounding = 7,
21 rounding_power = 2,
22 active_opacity = 1.0,
23 inactive_opacity = 0.96,
24 shadow = {
25 enabled = true,
26 range = 8,
27 render_power = 2,
28 color = rgba(t.content.backdrop, "cc"),
23 decoration = {
24 rounding = 7,
25 rounding_power = 2,
26 active_opacity = 1.0,
27 inactive_opacity = 0.96,
28 shadow = {
29 enabled = true,
30 range = 8,
31 render_power = 2,
32 color = rgba(t.content.backdrop, "cc"),
33 },
34 blur = {
35 enabled = true,
36 size = 4,
37 passes = 2,
38 vibrancy = 0.12,
39 noise = 0.02,
40 },
2941 },
30 blur = {
31 enabled = true,
32 size = 4,
33 passes = 2,
34 vibrancy = 0.12,
35 noise = 0.02,
43 dwindle = {
44 preserve_split = true,
45 smart_split = true,
3646 },
37 },
39 dwindle = {
40 preserve_split = true,
41 smart_split = true,
42 },
44 master = {
45 new_status = "master",
46 },
48 group = {
49 col = {
50 border_active = rgba(t.content.accent, "ee"),
51 border_inactive = rgba(t.ui.unfocus, "88"),
48 master = {
49 new_status = "master",
5250 },
53 },
55 misc = {
56 force_default_wallpaper = 0,
57 disable_hyprland_logo = true,
58 disable_splash_rendering = true,
59 vrr = 0,
60 },
52 scrolling = {
53 fullscreen_on_one_column = true,
54 },
62 ecosystem = {
63 no_update_news = true,
64 no_donation_nag = true,
65 },
56 group = {
57 col = {
58 border_active = rgba(t.content.accent, "ee"),
59 border_inactive = rgba(t.ui.unfocus, "88"),
60 },
61 },
67 xwayland = {
68 enabled = false,
69 },
70})
63 misc = {
64 force_default_wallpaper = 0,
65 disable_hyprland_logo = true,
66 disable_splash_rendering = true,
67 vrr = 0,
68 },
70 ecosystem = {
71 no_update_news = true,
72 no_donation_nag = true,
73 },
75 xwayland = {
76 enabled = false,
77 },
78 })
79end
81M.apply()
83return M

hypr/modules/apps.lua

Added
new file mode 100644

+36 / −0 text lines

1-- app-graphical.slice: normal GUI apps and short interactive helpers. Browser,
2-- launcher, screenshot tools, clipboard picker. User-facing, but expendable.
3-- background-graphical.slice: long-running noninteractive desktop jobs. Sync,
4-- indexers, preloaders, watchers. Must lose to humans under pressure.
5-- session-graphical.slice: session control plane. Lock/logout, network/audio UI,
6-- battery/status tools. Small, latency-sensitive, bad if killed mid-action.
7-- work.slice: interactive dev work. Terminal, editor, file manager, monitor,
8-- shells and child compilers. Big memory budget, normal priority.
9local app = "uwsm app -s app-graphical.slice -- "
10local session = "uwsm app -s session-graphical.slice -- "
11local work = "uwsm app -s work.slice -- "
13local wezterm = work .. "wezterm start"
15local function tui(slice, name)
16 return slice .. "wezterm start --class " .. name .. " -- " .. name
17end
19return {
20 terminal = wezterm,
21 browser = app .. "firefox",
22 editor = "nvim",
23 launcher = app .. "hyprlauncher",
24 file_manager = tui(work, "yazi"),
25 bluetooth = tui(session, "bluetui"),
26 wifi = tui(session, "impala"),
27 system_monitor = tui(work, "btm"),
28 audio_mixer = tui(session, "wiremix"),
29 battery = session .. "wezterm start --class battery -- nu -c 'loop { clear; upower -i /org/freedesktop/UPower/devices/battery_BAT0; sleep 2sec }'",
30 logout = session .. "hyprshutdown --dry-run",
31 clipboard = app .. "bash -lc 'cliphist list | hyprlauncher --dmenu | cliphist decode | wl-copy'",
32 screenshot_region = app .. "hyprshot -m region -z",
33 screenshot_window = app .. "hyprshot -m window -z",
34 screenshot_output = app .. "hyprshot -m output -z",
35 screenshot_annotate = app .. "hyprshot -m region -z -- satty --filename",
36}

hypr/modules/apps.lua.bak.x230opt

Added
new file mode 100644

+28 / −0 text lines

1local app = "uwsm app -s app-graphical.slice -- "
2local session = "uwsm app -s session-graphical.slice -- "
3local work = "uwsm app -s work.slice -- "
4
5local wezterm = work .. "wezterm start"
6
7local function tui(slice, name)
8 return slice .. "wezterm start --class " .. name .. " -- " .. name
9end
11return {
12 terminal = wezterm,
13 browser = app .. "firefox",
14 editor = "nvim",
15 launcher = app .. "hyprlauncher",
16 file_manager = tui(work, "yazi"),
17 bluetooth = tui(session, "bluetui"),
18 wifi = tui(session, "impala"),
19 system_monitor = tui(work, "btm"),
20 audio_mixer = tui(session, "wiremix"),
21 battery = session .. "wezterm start --class battery -- nu -c 'loop { clear; upower -i /org/freedesktop/UPower/devices/battery_BAT0; sleep 2sec }'",
22 logout = session .. "hyprshutdown --dry-run",
23 clipboard = app .. "bash -lc 'cliphist list | hyprlauncher --dmenu | cliphist decode | wl-copy'",
24 screenshot_region = app .. "hyprshot -m region -z",
25 screenshot_window = app .. "hyprshot -m window -z",
26 screenshot_output = app .. "hyprshot -m output -z",
27 screenshot_annotate = app .. "hyprshot -m region -z -- satty --filename",
28}

hypr/modules/binds.lua

Modified

+52 / −55 text lines

1local apps = require("lib.apps")
1local apps = require("modules.apps")
2local commands = require("modules.commands")
3local osd = require("modules.hypr_osd")
24local workspaces = require("modules.workspaces")
35local mod = "SUPER"
5local function bind(key, cmd, description)
6 local dispatcher = type(cmd) == "function" and cmd or hl.dsp.exec_cmd(cmd)
7 hl.bind(key, dispatcher, { description = description })
7local function bind(key, action, description, opts)
8 opts = opts or {}
9 opts.description = opts.description or description
11 return hl.bind(key, commands.to_dispatcher(action), opts)
812end
1014bind(mod .. " + Return", apps.terminal, "terminal: wezterm")
1115bind(mod .. " + Space", apps.launcher, "launcher: hyprlauncher")
1216bind(mod .. " + B", apps.browser, "browser: firefox")
13-- TUI app binds open in an existing WezTerm default mux workspace window as new tabs.
1417bind(mod .. " + E", apps.file_manager, "files: yazi")
1518bind(mod .. " + N", apps.wifi, "wifi: impala")
1619bind(mod .. " + U", apps.bluetooth, "bluetooth: bluetui")
17hl.bind(mod .. " + Q", hl.dsp.window.close(), { description = "close window" })
18hl.bind(mod .. " + C", hl.dsp.window.close(), { description = "close window" })
20bind(mod .. " + Q", hl.dsp.window.close(), "close window")
1921bind(mod .. " + V", apps.clipboard, "clipboard history")
20bind(mod .. " + ALT + L", apps.lock, "lock")
21bind(mod .. " + ALT + S", "loginctl lock-session && systemctl suspend", "lock + suspend")
22bind(mod .. " + SHIFT + R", "hyprctl reload", "reload hypr")
23bind(mod .. " + SHIFT + T", apps.theme_toggle, "toggle nugu light/dark")
24bind(mod .. " + CTRL + T", apps.theme_auto, "nugu auto mode now")
25bind(mod .. " + Slash", apps.binds_help, "show binds")
26bind(mod .. " + Tab", apps.clients_help, "show clients")
27bind(mod .. " + Escape", "makoctl dismiss --all", "dismiss notifications")
22bind(mod .. " + ALT + L", osd.session.lock, "lock")
23bind(mod .. " + ALT + S", osd.session.suspend, "lock + suspend")
24bind(mod .. " + SHIFT + R", osd.session.reload, "reload hypr")
25bind(mod .. " + Escape", osd.notifications.clear_all, "dismiss notifications")
2826bind("CTRL + ALT + Delete", apps.logout, "graceful hyprland logout")
30hl.bind(mod .. " + H", hl.dsp.focus({ direction = "left" }), { description = "focus left" })
31hl.bind(mod .. " + L", hl.dsp.focus({ direction = "right" }), { description = "focus right" })
32hl.bind(mod .. " + K", hl.dsp.focus({ direction = "up" }), { description = "focus up" })
33hl.bind(mod .. " + J", hl.dsp.focus({ direction = "down" }), { description = "focus down" })
28bind(mod .. " + H", hl.dsp.focus({ direction = "left" }), "focus left")
29bind(mod .. " + L", hl.dsp.focus({ direction = "right" }), "focus right")
30bind(mod .. " + K", hl.dsp.focus({ direction = "up" }), "focus up")
31bind(mod .. " + J", hl.dsp.focus({ direction = "down" }), "focus down")
35hl.bind(mod .. " + SHIFT + H", hl.dsp.window.move({ direction = "left" }), { description = "move left" })
36hl.bind(mod .. " + SHIFT + L", hl.dsp.window.move({ direction = "right" }), { description = "move right" })
37hl.bind(mod .. " + SHIFT + K", hl.dsp.window.move({ direction = "up" }), { description = "move up" })
38hl.bind(mod .. " + SHIFT + J", hl.dsp.window.move({ direction = "down" }), { description = "move down" })
33bind(mod .. " + SHIFT + H", hl.dsp.window.move({ direction = "left" }), "move left")
34bind(mod .. " + SHIFT + L", hl.dsp.window.move({ direction = "right" }), "move right")
35bind(mod .. " + SHIFT + K", hl.dsp.window.move({ direction = "up" }), "move up")
36bind(mod .. " + SHIFT + J", hl.dsp.window.move({ direction = "down" }), "move down")
40hl.bind(mod .. " + CTRL + H", hl.dsp.window.resize({ x = -24, y = 0, relative = true }), { description = "resize left" })
41hl.bind(mod .. " + CTRL + L", hl.dsp.window.resize({ x = 24, y = 0, relative = true }), { description = "resize right" })
42hl.bind(mod .. " + CTRL + K", hl.dsp.window.resize({ x = 0, y = -24, relative = true }), { description = "resize up" })
43hl.bind(mod .. " + CTRL + J", hl.dsp.window.resize({ x = 0, y = 24, relative = true }), { description = "resize down" })
38bind(mod .. " + CTRL + H", hl.dsp.window.resize({ x = -24, y = 0, relative = true }), "resize left")
39bind(mod .. " + CTRL + L", hl.dsp.window.resize({ x = 24, y = 0, relative = true }), "resize right")
40bind(mod .. " + CTRL + K", hl.dsp.window.resize({ x = 0, y = -24, relative = true }), "resize up")
41bind(mod .. " + CTRL + J", hl.dsp.window.resize({ x = 0, y = 24, relative = true }), "resize down")
45hl.bind(mod .. " + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }), { description = "fullscreen" })
46hl.bind(mod .. " + T", hl.dsp.window.float({ action = "toggle" }), { description = "toggle floating" })
47hl.bind(mod .. " + P", hl.dsp.window.pseudo({ action = "toggle" }), { description = "pseudo tile" })
48hl.bind(mod .. " + G", hl.dsp.group.toggle(), { description = "toggle group" })
49hl.bind(mod .. " + SHIFT + G", hl.dsp.group.next(), { description = "next group tab" })
43bind(mod .. " + F", hl.dsp.window.fullscreen({ mode = "fullscreen", action = "toggle" }), "fullscreen")
44bind(mod .. " + T", hl.dsp.window.float({ action = "toggle" }), "toggle floating")
45bind(mod .. " + P", hl.dsp.window.pseudo({ action = "toggle" }), "pseudo tile")
46bind(mod .. " + G", hl.dsp.group.toggle(), "toggle group")
47bind(mod .. " + SHIFT + G", hl.dsp.group.next(), "next group tab")
5149for _, ws in ipairs(workspaces.list) do
52 hl.bind(mod .. " + " .. ws.key, hl.dsp.focus({ workspace = ws.id }), { description = "workspace " .. ws.name })
53 hl.bind(mod .. " + SHIFT + " .. ws.key, hl.dsp.window.move({ workspace = ws.id }), { description = "move to " .. ws.name })
50 bind(mod .. " + " .. ws.key, hl.dsp.focus({ workspace = ws.id }), "workspace " .. ws.name)
51 bind(mod .. " + SHIFT + " .. ws.key, hl.dsp.window.move({ workspace = ws.id }), "move to " .. ws.name)
5452end
56hl.bind(mod .. " + S", hl.dsp.workspace.toggle_special("scratch"), { description = "toggle scratch" })
57hl.bind(mod .. " + SHIFT + V", hl.dsp.window.move({ workspace = "special:scratch" }), { description = "send to scratch" })
58hl.bind(mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
59hl.bind(mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
60hl.bind(mod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true, description = "drag window" })
61hl.bind(mod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true, description = "resize window" })
54bind(mod .. " + SHIFT + V", hl.dsp.window.move({ workspace = "special:scratch" }), "send to scratch")
55bind(mod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }), "workspace next")
56bind(mod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }), "workspace prev")
57bind(mod .. " + mouse:272", hl.dsp.window.drag(), "drag window", { mouse = true })
58bind(mod .. " + mouse:273", hl.dsp.window.resize(), "resize window", { mouse = true })
63hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+"), { locked = true, repeating = true })
64hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"), { locked = true, repeating = true })
65hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true })
66hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true })
67hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true })
68hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true })
69hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), { locked = true })
70hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
71hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), { locked = true })
72hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = true })
60bind("XF86AudioRaiseVolume", osd.controls.volume_up, "volume up", { locked = true, repeating = true })
61bind("XF86AudioLowerVolume", osd.controls.volume_down, "volume down", { locked = true, repeating = true })
62bind("XF86AudioMute", osd.controls.mute, "mute", { locked = true })
63bind("XF86AudioMicMute", osd.controls.mic_mute, "mic mute", { locked = true })
64bind("XF86MonBrightnessUp", osd.controls.brightness_up, "brightness up", { locked = true, repeating = true })
65bind("XF86MonBrightnessDown", osd.controls.brightness_down, "brightness down", { locked = true, repeating = true })
66bind("XF86AudioNext", osd.controls.media_next, "media next", { locked = true })
67bind("XF86AudioPause", osd.controls.media_toggle, "media play/pause", { locked = true })
68bind("XF86AudioPlay", osd.controls.media_toggle, "media play/pause", { locked = true })
69bind("XF86AudioPrev", osd.controls.media_prev, "media prev", { locked = true })
74bind("Print", apps.screenshot_region, "screenshot region")
75bind("SHIFT + Print", apps.screenshot_window, "screenshot window")
76bind("CTRL + Print", apps.screenshot_output, "screenshot output")
77bind(mod .. " + Print", apps.screenshot_annotate, "screenshot annotate")
78bind(mod .. " + SHIFT + Print", "hyprpicker -a", "pick color")
71bind("Print", osd.capture.region(apps.screenshot_region), "screenshot region")
72bind("SHIFT + Print", osd.capture.window(apps.screenshot_window), "screenshot window")
73bind("CTRL + Print", osd.capture.output(apps.screenshot_output), "screenshot output")
74bind(mod .. " + Print", osd.capture.annotate(apps.screenshot_annotate), "screenshot annotate")
75bind(mod .. " + SHIFT + Print", osd.capture.color("hyprpicker -a"), "pick color")

hypr/modules/commands.lua

Added
new file mode 100644

+28 / −0 text lines

1local apps = require("modules.apps")
2
3local M = {}
4
5function M.to_dispatcher(action)
6 if type(action) == "string" then
7 return hl.dsp.exec_cmd(action)
8 end
9 return action
10end
12function M.exec(command)
13 return hl.dispatch(hl.dsp.exec_cmd(command))
14end
16function M.app(name)
17 return M.exec(assert(apps[name], name))
18end
20function M.workspace(id)
21 return hl.dispatch(hl.dsp.focus({ workspace = id }))
22end
24function M.move_to_workspace(id)
25 return hl.dispatch(hl.dsp.window.move({ workspace = id }))
26end
28return M

hypr/modules/hypr_osd.lua

Added
new file mode 100644

+114 / −0 text lines

1local nugu = require("generated.nugu")
2local t = nugu.current()
3
4local M = {}
5
6local function squote(value)
7 return "'" .. tostring(value):gsub("'", "'\"'\"'") .. "'"
8end
9
10local function dquote(value)
11 return '"' .. tostring(value):gsub('\\', '\\\\'):gsub('"', '\\"') .. '"'
12end
14local function notify(icon, ms, color, message)
15 return table.concat({
16 "hyprctl notify",
17 tostring(icon),
18 tostring(ms),
19 squote(nugu.rgb(color)),
20 squote(message),
21 }, " ")
22end
24local function notify_live(icon, ms, color, message)
25 return table.concat({
26 "hyprctl notify",
27 tostring(icon),
28 tostring(ms),
29 squote(nugu.rgb(color)),
30 dquote(message),
31 }, " ")
32end
34local function sh(command)
35 return "bash -lc " .. squote(command)
36end
38local function after(command, notice)
39 return sh(command .. " && " .. notice)
40end
42local function around(command, notice)
43 return sh(command .. "; " .. notice)
44end
46local ok = 5
47local info = 1
48local hint = 2
50M.session = {
51 reload = after("hyprctl reload", notify(ok, 1200, t.ui.accent, "Hyprland reloaded")),
52 lock = around(notify(info, 900, t.ui.focus, "Locking"), "hyprlock"),
53 suspend = around(notify(info, 900, t.ui.focus, "Suspending"), "loginctl lock-session && systemctl suspend"),
54}
56M.notifications = {
57 clear_all = sh("makoctl dismiss --all; hyprctl dismissnotify"),
58}
60M.capture = {
61 region = function(command)
62 return after(command, notify(ok, 1400, t.ui.accent, "Region captured"))
63 end,
64 window = function(command)
65 return after(command, notify(ok, 1400, t.ui.accent, "Window captured"))
66 end,
67 output = function(command)
68 return after(command, notify(ok, 1400, t.ui.accent, "Output captured"))
69 end,
70 annotate = function(command)
71 return after(command, notify(ok, 1400, t.ui.accent, "Screenshot annotated"))
72 end,
73 color = function(command)
74 return after(command, notify(ok, 1200, t.ui.accent, "Color copied"))
75 end,
76}
78M.controls = {
79 volume_up = around(
80 "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+; "
81 .. "level=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/^Volume: //')",
82 notify_live(info, 700, t.ui.focus, "Volume $level")
83 ),
84 volume_down = around(
85 "wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-; "
86 .. "level=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/^Volume: //')",
87 notify_live(info, 700, t.ui.focus, "Volume $level")
88 ),
89 mute = around(
90 "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle; "
91 .. "state=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | "
92 .. "grep -q '\\[MUTED\\]' && echo muted || echo live)",
93 notify_live(info, 900, t.ui.focus, "Audio $state")
94 ),
95 mic_mute = around(
96 "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle; "
97 .. "state=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | "
98 .. "grep -q '\\[MUTED\\]' && echo muted || echo live)",
99 notify_live(info, 900, t.ui.focus, "Mic $state")
100 ),
101 brightness_up = around(
102 "brightnessctl -e4 -n2 set 5%+; level=$(brightnessctl -m | awk -F, '{print $4}')",
103 notify_live(hint, 700, t.warning, "Brightness $level")
104 ),
105 brightness_down = around(
106 "brightnessctl -e4 -n2 set 5%-; level=$(brightnessctl -m | awk -F, '{print $4}')",
107 notify_live(hint, 700, t.warning, "Brightness $level")
108 ),
109 media_next = after("playerctl next", notify(info, 900, t.info, "Next track")),
110 media_toggle = after("playerctl play-pause", notify(info, 900, t.info, "Play/pause")),
111 media_prev = after("playerctl previous", notify(info, 900, t.info, "Previous track")),
112}
114return M

hypr/modules/input.lua

Modified

+0 / −2 text lines

1717 },
1818 },
1919})
21hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })

hypr/modules/monitors.lua

Modified

+7 / −1 text lines

77 scale = 1,
88 icc = "/home/oli/.config/icc/thinkpad_x230.icc",
99})
10hl.monitor({ output = "", mode = "preferred", position = "auto", scale = 1 })
11hl.monitor({
12 output = "",
13 mode = "preferred",
14 position = "auto",
15 scale = 1
16})

hypr/modules/permissions.lua

Deleted
deleted file mode 100644

+0 / −5 text lines

1-- Explicitly allow the small trusted local tools this rice binds.
2-- Permission changes may require a fresh Hyprland session.
3hl.permission("/usr/(bin|local/bin)/grim", "screencopy", "allow")
4hl.permission("/usr/(bin|local/bin)/hyprshot", "screencopy", "allow")
5hl.permission("/usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland", "screencopy", "allow")

hypr/modules/rules.lua

Modified

+1 / −3 text lines

88})
1010hl.window_rule({ match = { class = "^(firefox|org.mozilla.firefox)$" }, workspace = "1" })
11hl.window_rule({ match = { class = "^(firefox|org.mozilla.firefox)$" }, opacity = "0.98 0.96" })
1312hl.window_rule({ match = { class = "^(wezterm|org.wezfurlong.wezterm)$" }, workspace = "3" })
1413hl.window_rule({ match = { class = "^yazi$" }, workspace = "3" })
1615hl.window_rule({ match = { class = "^(mpv|com.github.celluloid_player.Celluloid)$" }, workspace = "5" })
1716hl.window_rule({ match = { class = "^(mpv|com.github.celluloid_player.Celluloid)$" }, immediate = true })
19hl.window_rule({ match = { class = "^(pavucontrol|blueman-manager|nm-connection-editor)$" }, float = true, center = true })
20hl.window_rule({ match = { class = "^(org.gnome.Nautilus|thunar)$", title = "^(Open|Save).*" }, float = true, center = true })
2118hl.window_rule({ match = { class = "(pinentry-)(.*)" }, stay_focused = true })
2320hl.window_rule({ match = { float = true }, border_color = nugu.rgba(t.ui.accent, "dd") })
2421hl.window_rule({ match = { fullscreen = true }, border_size = 0, rounding = 0 })
2523hl.window_rule({ match = { float = false, workspace = "w[tv1]s[false]" }, border_size = 0, rounding = 0 })
2624hl.window_rule({ match = { float = false, workspace = "f[1]s[false]" }, border_size = 0, rounding = 0 })

hypr/modules/workspaces.lua

Modified

+2 / −5 text lines

66 { key = "3", id = "3", name = "term" },
77 { key = "4", id = "4", name = "chat" },
88 { key = "5", id = "5", name = "media" },
9 { key = "9", id = "9", name = "misc" },
109}
1211for _, ws in ipairs(M.list) do
1312 hl.workspace_rule({ workspace = ws.id, monitor = "LVDS-1" })
1413end
16hl.workspace_rule({ workspace = "1", default = true })
17hl.workspace_rule({ workspace = "special:scratch", on_created_empty = "wezterm start --always-new-process" })
18hl.workspace_rule({ workspace = "w[tv1]s[false]", gaps_out = 0, gaps_in = 0 })
19hl.workspace_rule({ workspace = "f[1]s[false]", gaps_out = 0, gaps_in = 0 })
15hl.workspace_rule({ workspace = "2", layout = "scrolling", layout_opts = { direction = "right" } })
16hl.workspace_rule({ workspace = "3", layout = "scrolling", layout_opts = { direction = "right" } })
2118return M

hypr/scripts/common.lua

Deleted
deleted file mode 100644

+0 / −37 text lines

1local M = {}
2
3function M.trim(value)
4 return (value or ""):gsub("^%s+", ""):gsub("%s+$", "")
5end
6
7function M.shell_quote(value)
8 value = tostring(value)
9 return "'" .. value:gsub("'", "'\\''") .. "'"
10end
12function M.read_command(command)
13 local pipe = io.popen(command .. " 2>/dev/null")
14 if not pipe then return "" end
15 local output = pipe:read("*a") or ""
16 pipe:close()
17 return output
18end
20function M.choose(lines)
21 if #lines == 0 then return nil end
23 local path = os.tmpname()
24 local file = assert(io.open(path, "w"))
25 for _, line in ipairs(lines) do
26 file:write(line, "\n")
27 end
28 file:close()
30 local selected = M.trim(M.read_command("hyprlauncher --dmenu < " .. M.shell_quote(path)))
31 os.remove(path)
33 if selected == "" then return nil end
34 return selected
35end
37return M

hypr/scripts/cycle_clients.lua

Deleted
deleted file mode 100644

+0 / −73 text lines

1#!/usr/bin/env lua
2
3local source = debug.getinfo(1, "S").source:gsub("^@", "")
4local script_dir = source:match("(.+)/[^/]+$") or "."
5local hypr_dir = script_dir:match("(.+)/[^/]+$") or "."
6package.path = hypr_dir .. "/?.lua;" .. hypr_dir .. "/?/init.lua;" .. package.path
7
8local common = require("scripts.common")
9
10local function focus(address)
11 if not address:match("^0x") then address = "0x" .. address end
12 local expr = "hl.dispatch(hl.dsp.focus({ window = " .. string.format("%q", "address:" .. address) .. " }))"
13 os.execute("hyprctl -q eval " .. common.shell_quote(expr))
14end
16local function parse_active()
17 return common.read_command("hyprctl activewindow"):match("^Window%s+(%S+)%s+%-%>")
18end
20local function parse_clients()
21 local clients = {}
22 local current
24 for line in common.read_command("hyprctl clients"):gmatch("[^\n]+") do
25 local address, title = line:match("^Window%s+(%S+)%s+%-%>%s+(.+):$")
26 if address then
27 current = { address = address, title = title, class = "", workspace = 0, mapped = true, hidden = false }
28 clients[#clients + 1] = current
29 elseif current then
30 local key, value = line:match("^%s*([%w_]+):%s*(.*)$")
31 if key == "class" then
32 current.class = value
33 elseif key == "workspace" then
34 current.workspace = tonumber(value:match("^(%-?%d+)")) or 0
35 elseif key == "mapped" then
36 current.mapped = value == "1"
37 elseif key == "hidden" then
38 current.hidden = value == "1"
39 end
40 end
41 end
43 local filtered = {}
44 for _, client in ipairs(clients) do
45 if client.mapped and not client.hidden then filtered[#filtered + 1] = client end
46 end
48 table.sort(filtered, function(a, b)
49 if a.workspace ~= b.workspace then return a.workspace < b.workspace end
50 if a.class ~= b.class then return a.class < b.class end
51 if a.title ~= b.title then return a.title < b.title end
52 return a.address < b.address
53 end)
55 return filtered
56end
58local direction = arg[1] == "prev" and -1 or 1
59local clients = parse_clients()
60if #clients < 2 then os.exit(0) end
62local active = parse_active()
63local index = 1
65for i, client in ipairs(clients) do
66 if client.address == active then
67 index = i
68 break
69 end
70end
72local next_index = ((index - 1 + direction) % #clients) + 1
73focus(clients[next_index].address)

hypr/scripts/show_binds.lua

Deleted
deleted file mode 100644

+0 / −77 text lines

1#!/usr/bin/env lua
2
3local source = debug.getinfo(1, "S").source:gsub("^@", "")
4local script_dir = source:match("(.+)/[^/]+$") or "."
5local hypr_dir = script_dir:match("(.+)/[^/]+$") or "."
6package.path = hypr_dir .. "/?.lua;" .. hypr_dir .. "/?/init.lua;" .. package.path
7
8local common = require("scripts.common")
9
10local modifier_bits = {
11 { bit = 64, name = "SUPER" },
12 { bit = 1, name = "SHIFT" },
13 { bit = 4, name = "CTRL" },
14 { bit = 8, name = "ALT" },
15}
17local function has_bit(value, bit)
18 return value % (bit * 2) >= bit
19end
21local function mods(mask)
22 local out = {}
23 for _, mod in ipairs(modifier_bits) do
24 if has_bit(mask, mod.bit) then out[#out + 1] = mod.name end
25 end
26 if #out == 0 then return "None" end
27 return table.concat(out, "+")
28end
30local function format_key(key)
31 if key:match("^mouse:") then return key:gsub("^mouse:", "MOUSE_") end
32 return key:upper()
33end
35local binds = {}
36local current
38for line in common.read_command("hyprctl binds"):gmatch("[^\n]+") do
39 if line:match("^bind") then
40 current = { modmask = 0, key = "?", dispatcher = "", arg = "", description = "" }
41 table.insert(binds, current)
42 elseif current then
43 local key, value = line:match("^%s*([%w_]+):%s*(.*)$")
44 if key == "modmask" then
45 current.modmask = tonumber(value) or 0
46 elseif key == "key" then
47 current.key = value
48 elseif key == "dispatcher" then
49 current.dispatcher = value
50 elseif key == "arg" then
51 current.arg = value
52 elseif key == "description" then
53 current.description = value
54 end
55 end
56end
58local labels = {}
59local by_label = {}
61for _, bind in ipairs(binds) do
62 local label = string.format("%s + %s -> %s", mods(bind.modmask), format_key(bind.key), bind.description ~= "" and bind.description or bind.dispatcher)
63 labels[#labels + 1] = label
64 by_label[label] = bind
65end
67local selected = common.choose(labels)
68if not selected then os.exit(0) end
70local bind = by_label[selected]
71if not bind then os.exit(1) end
73if bind.dispatcher == "exec" and bind.arg ~= "" then
74 os.execute(bind.arg .. " &")
75elseif bind.dispatcher ~= "" and bind.dispatcher ~= "__lua" then
76 os.execute("hyprctl dispatch " .. common.shell_quote(bind.dispatcher) .. " " .. common.shell_quote(bind.arg))
77end

hypr/scripts/show_clients.lua

Deleted
deleted file mode 100644

+0 / −48 text lines

1#!/usr/bin/env lua
2
3local source = debug.getinfo(1, "S").source:gsub("^@", "")
4local script_dir = source:match("(.+)/[^/]+$") or "."
5local hypr_dir = script_dir:match("(.+)/[^/]+$") or "."
6package.path = hypr_dir .. "/?.lua;" .. hypr_dir .. "/?/init.lua;" .. package.path
7
8local common = require("scripts.common")
9
10local clients = {}
11local current
13for line in common.read_command("hyprctl clients"):gmatch("[^\n]+") do
14 local address, title = line:match("^Window%s+(%S+)%s+%-%>%s+(.+):$")
15 if address then
16 current = { address = address, title = title, class = "?", workspace = "?" }
17 table.insert(clients, current)
18 elseif current then
19 local key, value = line:match("^%s*([%w_]+):%s*(.*)$")
20 if key == "class" then
21 current.class = value
22 elseif key == "workspace" then
23 current.workspace = value:match("%((.-)%)") or value:match("^(%S+)") or "?"
24 end
25 end
26end
28local labels = {}
29local by_label = {}
31for _, client in ipairs(clients) do
32 local label = string.format("%s: %s (%s)", client.class, client.title, client.workspace)
33 labels[#labels + 1] = label
34 by_label[label] = client
35end
37local selected = common.choose(labels)
38if not selected then os.exit(0) end
40local client = by_label[selected]
41if not client then os.exit(1) end
43local address = client.address
44if not address:match("^0x") then address = "0x" .. address end
46local target = "address:" .. address
47local expr = "hl.dispatch(hl.dsp.focus({ window = " .. string.format("%q", target) .. " }))"
48os.execute("hyprctl -q eval " .. common.shell_quote(expr))

hypr/scripts/theme.lua

Deleted
deleted file mode 100644

+0 / −212 text lines

1#!/usr/bin/env lua
2
3local source = debug.getinfo(1, "S").source:gsub("^@", "")
4local script_dir = source:match("(.+)/[^/]+$") or "."
5local hypr_dir = script_dir:match("(.+)/[^/]+$") or "."
6package.path = hypr_dir .. "/?.lua;" .. hypr_dir .. "/?/init.lua;" .. package.path
7
8local nugu = require("generated.nugu")
9
10local function trim(value)
11 return (value or ""):gsub("^%s+", ""):gsub("%s+$", "")
12end
14local function shell_quote(value)
15 value = tostring(value)
16 return "'" .. value:gsub("'", "'\\''") .. "'"
17end
19local function run(command)
20 os.execute(command .. " >/dev/null 2>&1")
21end
23local function mkdir(path)
24 run("mkdir -p " .. shell_quote(path))
25end
27local function read_file(path)
28 local file = io.open(path, "r")
29 if not file then return nil end
30 local data = file:read("*a")
31 file:close()
32 return data
33end
35local function write_file(path, content)
36 local file = assert(io.open(path, "w"))
37 file:write(content)
38 file:close()
39end
41local home = assert(os.getenv("HOME"), "HOME unset")
42local config_home = os.getenv("XDG_CONFIG_HOME") or home .. "/.config"
43local cache_dir = home .. "/.cache/nugu"
44local mode_file = cache_dir .. "/mode"
45local auto_file = cache_dir .. "/auto"
47local function active_mode()
48 local mode = trim(read_file(mode_file))
49 if mode == "light" then return "light" end
50 return "dark"
51end
53local function auto_mode()
54 local hour = tonumber(os.date("%H")) or 0
55 if hour >= 7 and hour < 19 then return "light" end
56 return "dark"
57end
59local function auto_enabled()
60 local value = read_file(auto_file)
61 return value == nil or trim(value) ~= "0"
62end
64local function set_auto(enabled)
65 mkdir(cache_dir)
66 write_file(auto_file, enabled and "1" or "0")
67end
69local function write_desktop_color_scheme(mode)
70 local scheme = mode == "dark" and "prefer-dark" or "prefer-light"
71 run("gsettings set org.gnome.desktop.interface color-scheme " .. shell_quote(scheme))
72end
74local function write_mako(p)
75 local dir = config_home .. "/mako"
76 mkdir(dir)
77 write_file(dir .. "/nugu.conf", string.format([[# Generated by hypr/scripts/theme.lua from Nugu palette.
78background-color=%see
79text-color=%sff
80border-color=%sff
81progress-color=over %sff
83[urgency=low]
84background-color=%se6
85text-color=%sff
86border-color=%sff
87progress-color=over %sff
89[urgency=normal]
90border-color=%sff
91progress-color=over %sff
93[urgency=critical]
94background-color=%sff
95text-color=%sff
96border-color=%sff
97progress-color=over %sff
99[summary~="[Ee]rror|[Ff]ailed|[Ff]ailure|[Cc]rash"]
100border-color=%sff
101progress-color=over %sff
103[summary~="[Ww]arn|[Ww]arning"]
104border-color=%sff
105progress-color=over %sff
107[summary~="[Ii]nfo|[Nn]otice"]
108border-color=%sff
109progress-color=over %sff
110]],
111 p.ui.backdrop, p.ui.normal, p.ui.accent, p.ui.focus,
112 p.content.backdrop, p.content.minor, p.ui.unfocus, p.content.minor,
113 p.ui.accent, p.ui.focus,
114 p.ui.backdrop, p.ui.important_global, p.error, p.error,
115 p.error, p.error,
116 p.warning, p.warning,
117 p.info, p.info))
118end
120local function write_ironbar(p)
121 local dir = config_home .. "/ironbar"
122 mkdir(dir)
123 write_file(dir .. "/nugu.css", string.format([[/* Generated by hypr/scripts/theme.lua from Nugu palette. */
124:root {
125 --bg: %s;
126 --bg-transparent: %see;
127 --surface: %s;
128 --fg: %s;
129 --accent: %s;
130 --focus: %s;
131 --on-focus: %s;
132 --muted: %s;
133 --unfocus: %s;
134 --error: %s;
135 --warning: %s;
136 --info: %s;
137 --debug: %s;
138 --border: %s;
139}
140]],
141 p.ui.backdrop,
142 p.ui.backdrop,
143 p.ui.minor,
144 p.ui.normal,
145 p.ui.accent,
146 p.ui.focus,
147 p.content.backdrop,
148 p.ui.minor,
149 p.ui.unfocus,
150 p.error,
151 p.warning,
152 p.info,
153 p.debug,
154 p.ui.accent))
155end
157local function apply_mode(mode)
158 mkdir(cache_dir)
159 write_file(mode_file, mode)
161 local p = assert(nugu.get(mode), "unknown mode: " .. tostring(mode))
162 write_desktop_color_scheme(mode)
163 write_mako(p)
164 write_ironbar(p)
166 run("hyprctl hyprpaper wallpaper " .. shell_quote(",~/.config/hypr/wallpapers/nugu-" .. mode .. ".png"))
167 run("hyprctl reload")
168 if os.getenv("NUGU_NO_RESTART_MAKO") ~= "1" then
169 run("systemctl --user restart mako.service")
170 end
171 run("systemctl --user restart ironbar.service")
172 if os.getenv("NUGU_NO_NOTIFY") ~= "1" then
173 run("notify-send --expire-time 1500 nugu " .. shell_quote(mode .. " mode"))
174 end
175end
177local function next_mode()
178 return active_mode() == "dark" and "light" or "dark"
179end
181local function watch()
182 while true do
183 if auto_enabled() then
184 local target = auto_mode()
185 if target ~= active_mode() then apply_mode(target) end
186 end
187 os.execute("sleep 300")
188 end
189end
191local mode = arg[1] or "toggle"
193if mode == "dark" or mode == "light" or mode == "toggle" then
194 set_auto(false)
195elseif mode == "auto" then
196 set_auto(true)
197end
199if mode == "dark" or mode == "light" then
200 apply_mode(mode)
201elseif mode == "toggle" then
202 apply_mode(next_mode())
203elseif mode == "auto" then
204 apply_mode(auto_mode())
205elseif mode == "current" then
206 apply_mode(active_mode())
207elseif mode == "watch" then
208 watch()
209else
210 io.stderr:write("mode must be dark|light|toggle|auto|current|watch\n")
211 os.exit(1)
212end

hypr/scripts/tui_tab.lua

Deleted
deleted file mode 100644

+0 / −36 text lines

1local M = {}
2
3local function shell_quote(value)
4 value = tostring(value)
5 return "'" .. value:gsub("'", "'\\''") .. "'"
6end
7
8local function trim(value)
9 return (value or ""):gsub("^%s+", ""):gsub("%s+$", "")
10end
12local function run(command)
13 local pipe = io.popen(command .. " 2>/dev/null")
14 if not pipe then return nil end
16 local output = pipe:read("*a")
17 pipe:close()
19 return trim(output)
20end
22function M.spawn(...)
23 local args = { ... }
24 if #args == 0 then return end
26 for i, arg in ipairs(args) do
27 args[i] = shell_quote(arg)
28 end
30 local pane_id = run("wezterm cli --prefer-mux spawn -- " .. table.concat(args, " "))
31 if pane_id and pane_id:match("^%d+$") then
32 hl.exec_cmd("wezterm cli --prefer-mux activate-pane --pane-id " .. shell_quote(pane_id))
33 end
34end
36return M

hypr/systemd/ironbar.service

Modified

+1 / −3 text lines

11[Unit]
22Description=Ironbar Wayland status bar
33PartOf=graphical-session.target
4After=graphical-session.target nugu-theme.service
5Wants=nugu-theme.service
4After=graphical-session.target
76[Service]
8Environment=GSK_RENDERER=cairo
97ExecStart=/usr/bin/ironbar
108Restart=on-failure
119RestartSec=2

hypr/systemd/mako.service

Modified

+0 / −3 text lines

44After=graphical-session.target
66[Service]
7Environment=NUGU_NO_RESTART_MAKO=1
8Environment=NUGU_NO_NOTIFY=1
9ExecStartPre=/usr/bin/lua %h/.config/hypr/scripts/theme.lua current
107ExecStart=/usr/bin/mako --config %h/.config/mako/config
118Restart=on-failure
129RestartSec=2

hypr/systemd/nugu-theme.service

Deleted
deleted file mode 100644

+0 / −13 text lines

1[Unit]
2Description=Nugu automatic light/dark desktop mode
3PartOf=graphical-session.target
4After=graphical-session.target hyprpaper.service
5Wants=hyprpaper.service
6
7[Service]
8ExecStart=/usr/bin/lua %h/.config/hypr/scripts/theme.lua watch
9Restart=on-failure
10RestartSec=10
12[Install]
13WantedBy=graphical-session.target

hypr/tests/commands_test.lua

Added
new file mode 100644

+61 / −0 text lines

1package.path = "./?.lua;./?/init.lua;" .. package.path
2
3local calls = {}
4
5hl = {
6 dsp = {
7 exec_cmd = function(command)
8 table.insert(calls, { "exec_cmd", command })
9 return { kind = "exec", command = command }
10 end,
11 focus = function(opts)
12 table.insert(calls, { "focus", opts.workspace })
13 return { kind = "focus", workspace = opts.workspace }
14 end,
15 window = {
16 move = function(opts)
17 table.insert(calls, { "move", opts.workspace })
18 return { kind = "move", workspace = opts.workspace }
19 end,
20 },
21 },
22 dispatch = function(dispatcher)
23 table.insert(calls, { "dispatch", dispatcher.kind, dispatcher.command or dispatcher.workspace })
24 return "dispatched"
25 end,
26}
28local commands = require("modules.commands")
30assert(commands.to_dispatcher("firefox").command == "firefox")
31assert(commands.to_dispatcher("firefox").kind == "exec")
33local dispatcher = { kind = "raw" }
34assert(commands.to_dispatcher(dispatcher) == dispatcher)
36assert(commands.app("wifi") == "dispatched")
37assert(calls[#calls][1] == "dispatch")
38assert(calls[#calls][2] == "exec")
39assert(calls[#calls][3] == "wezterm start --class impala -- impala")
41assert(commands.app("battery") == "dispatched")
42assert(calls[#calls][1] == "dispatch")
43assert(calls[#calls][2] == "exec")
44assert(calls[#calls][3]:find("wezterm start --class battery -- nu -c", 1, true))
45assert(calls[#calls][3]:find("upower -i /org/freedesktop/UPower/devices/battery_BAT0", 1, true))
47assert(commands.workspace("3") == "dispatched")
48assert(calls[#calls][1] == "dispatch")
49assert(calls[#calls][2] == "focus")
50assert(calls[#calls][3] == "3")
52assert(commands.move_to_workspace("4") == "dispatched")
53assert(calls[#calls][1] == "dispatch")
54assert(calls[#calls][2] == "move")
55assert(calls[#calls][3] == "4")
57local ok, err = pcall(commands.app, "missing")
58assert(not ok)
59assert(tostring(err):find("missing", 1, true))
61print("commands ok")

hypr/tests/hypr_osd_test.lua

Added
new file mode 100644

+17 / −0 text lines

1package.path = "./?.lua;./?/init.lua;" .. package.path
2
3local osd = require("modules.hypr_osd")
4
5local function assert_contains(haystack, needle)
6 assert(haystack:find(needle, 1, true), haystack .. " does not contain " .. needle)
7end
8
9assert_contains(osd.session.reload, "hyprctl reload")
10assert_contains(osd.session.reload, "hyprctl notify 5")
11assert_contains(osd.capture.region("hyprshot -m region -z"), "Region captured")
12assert_contains(osd.controls.volume_up, "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+")
13assert_contains(osd.controls.volume_up, "Volume")
14assert_contains(osd.notifications.clear_all, "makoctl dismiss --all")
15assert_contains(osd.notifications.clear_all, "hyprctl dismissnotify")
17print("hypr_osd ok")

hypr/wallpapers/nugu-dark.png

Deleted
deleted file mode 100644

Binary size (old → new): 9858 → 0 bytes.

hypr/wallpapers/nugu-light.png

Deleted
deleted file mode 100644

Binary size (old → new): 131656 → 0 bytes.

ironbar/PLAN.md

Modified

+4 / −4 text lines

105105- Prefer mux-backed WezTerm tabs for TUI apps over standalone terminal windows.
106106- Prefer implementation logic in Lua over shell snippets; shell command strings are acceptable only at process boundary.
107107- Prefer `require(...)` modules over `dofile(...)` in normal config and shared helpers.
108- Shared TUI launch logic lives in Hypr Lua: `hypr/scripts/tui_tab.lua`.
109- Hypr binds call it via `require("scripts.tui_tab")`; Ironbar actions bridge through `hyprctl eval 'require("scripts.tui_tab").spawn(...)'` so both use the same implementation.
110- TUI launcher should spawn into WezTerm mux and activate the new pane/tab.
108- Hypr binds call direct Lua functions or `hl.dsp.exec_cmd(...)`; no external Lua VM.
109- Ironbar actions cross the process boundary with `hyprctl dispatch exec ...` only.
110- TUI launchers open named WezTerm windows via `wezterm start --class <app> -- <app>`.
111111- Keep app-specific service/config files in app dirs when possible, e.g. WezTerm systemd unit under `wezterm/systemd/`.
112112- Avoid fighting ugly GTK popups when a better TUI exists; use Ironbar as status/launcher if builtin popup is poor.
226226- Ironbar builtin `bluetooth` module used only for bar status.
227227- Builtin Bluetooth popup disabled; GTK switch popup looked bad even after CSS work.
228228- Left/middle click opens `bluetui` through shared Hypr Lua TUI launcher:
229 - `hyprctl eval 'require("scripts.tui_tab").spawn("bluetui")'`
229 - `hyprctl dispatch exec 'wezterm start --class bluetui -- bluetui'`
230230- Bar label uses fixed semantic Bluetooth battery icon, not dynamic percentage icon:
231231 - `󰥈 {device_battery_percent}%`
232232- `icon_theme` switched from missing `Papirus` to installed `Adwaita`; broken device image fixed.

ironbar/config.json

Modified

+28 / −19 text lines

44 "height": 30,
55 "popup_autohide": true,
66 "popup_gap": 4,
7 "ironvar_defaults": {
8 "ws1": "1 󰖟",
9 "ws2": "2 󰅨",
10 "ws3": "3 󰆍",
11 "ws4": "4 󰭹",
12 "ws5": "5 󰎆",
13 "ws9": "9 󰉋"
14 },
715 "start": [
816 {
917 "type": "custom",
1725 "type": "button",
1826 "class": "workspace-item",
1927 "label": "#ws1",
20 "on_click": "!hyprctl eval 'hl.dispatch(hl.dsp.focus({ workspace = \"1\" }))'"
28 "on_click": "!hyprctl eval 'require(\"modules.commands\").workspace(\"1\")'"
2129 },
2230 {
2331 "type": "button",
2432 "class": "workspace-item",
2533 "label": "#ws2",
26 "on_click": "!hyprctl eval 'hl.dispatch(hl.dsp.focus({ workspace = \"2\" }))'"
34 "on_click": "!hyprctl eval 'require(\"modules.commands\").workspace(\"2\")'"
2735 },
2836 {
2937 "type": "button",
3038 "class": "workspace-item",
3139 "label": "#ws3",
32 "on_click": "!hyprctl eval 'hl.dispatch(hl.dsp.focus({ workspace = \"3\" }))'"
40 "on_click": "!hyprctl eval 'require(\"modules.commands\").workspace(\"3\")'"
3341 },
3442 {
3543 "type": "button",
3644 "class": "workspace-item",
3745 "label": "#ws4",
38 "on_click": "!hyprctl eval 'hl.dispatch(hl.dsp.focus({ workspace = \"4\" }))'"
46 "on_click": "!hyprctl eval 'require(\"modules.commands\").workspace(\"4\")'"
3947 },
4048 {
4149 "type": "button",
4250 "class": "workspace-item",
4351 "label": "#ws5",
44 "on_click": "!hyprctl eval 'hl.dispatch(hl.dsp.focus({ workspace = \"5\" }))'"
52 "on_click": "!hyprctl eval 'require(\"modules.commands\").workspace(\"5\")'"
4553 },
4654 {
4755 "type": "button",
4856 "class": "workspace-item",
4957 "label": "#ws9",
50 "on_click": "!hyprctl eval 'hl.dispatch(hl.dsp.focus({ workspace = \"9\" }))'"
58 "on_click": "!hyprctl eval 'require(\"modules.commands\").workspace(\"9\")'"
5159 }
5260 ]
5361 }
102110 "cmd": "~/.config/ironbar/scripts/wifi-status.sh",
103111 "mode": "poll",
104112 "interval": 30000,
105 "on_click_left": "hyprctl eval 'require(\"scripts.tui_tab\").spawn(\"impala\")'",
106 "on_click_middle": "hyprctl eval 'require(\"scripts.tui_tab\").spawn(\"impala\")'",
113 "on_click_left": "hyprctl eval 'require(\"modules.commands\").app(\"wifi\")'",
114 "on_click_middle": "hyprctl eval 'require(\"modules.commands\").app(\"wifi\")'",
107115 "tooltip": "WiFi: left/middle opens impala"
108116 },
109117 {
116124 "connected_battery": "󰂱 {device_battery_percent}%"
117125 },
118126 "disable_popup": true,
119 "on_click_left": "hyprctl eval 'require(\"scripts.tui_tab\").spawn(\"bluetui\")'",
120 "on_click_middle": "hyprctl eval 'require(\"scripts.tui_tab\").spawn(\"bluetui\")'",
127 "on_click_left": "hyprctl eval 'require(\"modules.commands\").app(\"bluetooth\")'",
128 "on_click_middle": "hyprctl eval 'require(\"modules.commands\").app(\"bluetooth\")'",
121129 "tooltip": "Bluetooth: left/middle opens bluetui"
122130 },
123131 {
130138 "interval": {
131139 "cpu": 2
132140 },
133 "on_click_left": "hyprctl eval 'require(\"scripts.tui_tab\").spawn(\"btm\")'",
134 "on_click_middle": "hyprctl eval 'require(\"scripts.tui_tab\").spawn(\"btm\")'",
141 "on_click_left": "hyprctl eval 'require(\"modules.commands\").app(\"system_monitor\")'",
142 "on_click_middle": "hyprctl eval 'require(\"modules.commands\").app(\"system_monitor\")'",
135143 "tooltip": "System monitor: left/middle opens btm"
136144 },
137145 {
139147 "on_scroll_up": "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 2%+",
140148 "on_scroll_down": "wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-",
141149 "on_click_right": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
142 "on_click_middle": "hyprctl eval 'require(\"scripts.tui_tab\").spawn(\"wiremix\")'",
150 "on_click_middle": "hyprctl eval 'require(\"modules.commands\").app(\"audio_mixer\")'",
143151 "smooth_scroll_speed": 1.0,
144152 "show_sources": false,
145153 "tooltip": "Volume: scroll adjusts, right mutes, middle opens wiremix"
146154 },
147155 {
148156 "type": "brightness",
149 "format": "{percentage}%",
150 "icon_label": "display-brightness-symbolic",
157 "format": "󰃠 {percentage}%",
151158 "mode": {
152159 "type": "systemd",
153160 "subsystem": "backlight",
158165 },
159166 {
160167 "type": "battery",
161 "format": "{percentage}%",
162 "icon_size": 10,
168 "format": "󰁹 {percentage}%",
169 "show_icon": false,
163170 "show_if": "ls /sys/class/power_supply/ | grep -q '^BAT'",
164171 "profiles": {
165172 "warning": {
173180 "format": "󰂎 {percentage}%"
174181 }
175182 },
176 "tooltip": "Battery: left opens details"
183 "on_click_left": "hyprctl eval 'require(\"modules.commands\").app(\"battery\")'",
184 "on_click_middle": "hyprctl eval 'require(\"modules.commands\").app(\"battery\")'",
185 "tooltip": "Battery: left/middle opens upower"
177186 },
178187 {
179188 "type": "inhibit",
180189 "durations": ["00:30:00", "01:00:00", "02:00:00", "inf"],
181 "default_duration": "00:30:00",
190 "default_duration": "inf",
182191 "format_on": "󰅶 {duration}",
183192 "format_off": "󰛊 {duration}",
184193 "tooltip": "Inhibit: left toggles, right cycles duration"

ironbar/nugu.css

Modified

+2 / −1 text lines

1/* Generated by hypr/scripts/theme.nu from Nugu palette. */
1/* Generated by Hyprland Lua from Nugu palette. */
22:root {
33 --bg: #242424;
44 --bg-transparent: #242424ee;
66 --fg: #dbdbdb;
77 --accent: #d86dd8;
88 --focus: #9aabae;
9 --important-global: #f3effb;
910 --on-focus: #121212;
1011 --muted: #9d9d9d;
1112 --unfocus: #6f6f6f;

ironbar/scripts/workspaces-watch.py

Modified

+7 / −9 text lines

8888def markup(ws_id: str, icon: str, active: str, occupied: set[str], colors: dict[str, str]) -> str:
89 label = f"{ws_id} {icon}"
8990 if ws_id == active:
90 return '<span foreground="{}" background="{}" font_weight="bold"> {} </span>'.format(
91 colors["on-focus"],
92 colors["focus"],
93 icon,
94 )
91 return '<span foreground="{}">{}</span>'.format(colors["important-global"], label)
9592 if ws_id in occupied:
96 return '<span foreground="{}">{}</span>'.format(colors["fg"], icon)
97 return '<span foreground="{}">{}</span>'.format(colors["muted"], icon)
93 return '<span foreground="{}">{}</span>'.format(colors["fg"], label)
94 return '<span foreground="{}">{}</span>'.format(colors["muted"], label)
10097def hypr_state() -> tuple[str, set[str]]:
106103def set_var(name: str, value: str) -> None:
107104 if last_vars.get(name) == value:
108105 return
109 subprocess.run(("ironbar", "var", "set", name, value), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
110 last_vars[name] = value
106 result = subprocess.run(("ironbar", "var", "set", name, value), stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, check=False)
107 if result.returncode == 0:
108 last_vars[name] = value
113111def update() -> None:

ironbar/style.css

Modified

+213 / −92 text lines

88* {
99 font-family: 'IBM Plex Mono';
1010 font-size: var(--font-size);
11 font-feature-settings: "tnum";
1112 border: none;
1213 box-shadow: none;
1314 background-image: none;
6162.nugu-workspaces .workspace-item {
6263 min-height: 0;
64 min-width: 16px;
6365 margin: 0 2px;
64 padding: 1px 5px;
66 padding: 1px 4px;
6567 color: var(--muted);
68.nugu-workspaces .workspace-item:hover {
69 background: var(--accent);
70 color: var(--on-focus);
71}
7370.bindmode {
7471 margin-left: 8px;
7572 padding: 1px 7px;
9188.volume {
92 margin: 0 7px;
89 min-width: 52px;
90 margin: 0 3px;
91}
93.volume .muted {
94 color: var(--accent);
9597.popup-volume {
122124 color: var(--on-focus);
125.popup-volume .btn-mute {
126 color: var(--fg);
127}
129.popup-volume .btn-mute:hover,
130.popup-volume .btn-mute:checked {
131 background: var(--accent);
132 color: var(--on-focus);
133}
135127popover listview,
136128popover list,
137129popover row,
267259.brightness {
268 margin: 0 7px;
260 min-width: 52px;
261 margin: 0 3px;
269262 color: var(--fg);
272265.battery {
273 margin: 0 7px;
266 min-width: 52px;
267 margin: 0 3px;
274268 color: var(--fg);
296290.inhibit {
297 margin: 0 7px 0 12px;
291 min-width: 58px;
292 margin: 0 3px 0 6px;
298293 color: var(--muted);
393388.popup-clipboard {
394389 padding: 8px;
390 background-color: var(--bg-transparent);
391 color: var(--fg);
392}
394.popup-clipboard *,
395.popup-clipboard .item,
396.popup-clipboard .item label,
397.popup-clipboard .item .btn,
398.popup-clipboard .item .btn *,
399.popup-clipboard .item .btn-remove,
400.popup-clipboard .item .btn-remove * {
401 color: var(--fg);
397404.popup-clipboard .item {
398405 padding: 4px 8px;
399406 border-radius: var(--radius);
400 color: var(--fg);
407 background: transparent;
403.popup-clipboard .item label {
404 color: var(--fg);
410.popup-clipboard .item .btn,
411.popup-clipboard .item .btn-remove {
412 background: transparent;
407.popup-clipboard .item:hover {
415.popup-clipboard .item:hover,
416.popup-clipboard .item:hover .btn,
417.popup-clipboard .item:hover .btn-remove {
408418 background-color: var(--accent);
409419 color: var(--on-focus);
412.popup-clipboard .item:hover label {
422.popup-clipboard .item:hover *,
423.popup-clipboard .item:hover .btn *,
424.popup-clipboard .item:hover .btn-remove * {
425 color: var(--on-focus);
426}
428.popup-clipboard .item .btn:checked,
429.popup-clipboard .item .btn:active,
430.popup-clipboard .item .btn-remove:active {
431 background-color: var(--focus);
432 color: var(--on-focus);
433}
435.popup-clipboard .item .btn:checked *,
436.popup-clipboard .item .btn:active *,
437.popup-clipboard .item .btn-remove:active * {
413438 color: var(--on-focus);
416441.mako-status {
417 margin: 0 7px 0 12px;
442 min-width: 30px;
443 margin: 0 3px 0 6px;
418444 color: var(--fg);
421447.wifi {
422 margin: 0 7px;
448 margin: 0 3px;
423449 color: var(--fg);
426452.bluetooth {
427 margin: 0 7px;
453 min-width: 18px;
454 margin: 0 3px;
455}
457.bluetooth.connected {
458 min-width: 50px;
430461.bluetooth.disabled,
443474.tray {
444 margin: 0 7px 0 12px;
475 margin: 0 3px 0 6px;
447478.tray popover contents {
457488 color: var(--muted);
460.power-menu button:hover,
461.power-menu #power-btn:hover {
462 background: var(--accent);
463 color: var(--on-focus);
464}
466491.power-menu button:checked,
467492.power-menu button:focus,
468493.power-menu #power-btn:checked,
471496 color: var(--muted);
499.power-menu button:hover,
500.power-menu button:focus:hover,
501.power-menu button:checked:hover,
502.power-menu #power-btn:hover,
503.power-menu #power-btn:focus:hover,
504.power-menu #power-btn:checked:hover {
505 background: var(--accent);
506 color: var(--on-focus);
507}
474509.popup-power-menu {
475510 padding: 12px;
476511 background-color: var(--bg-transparent);
522557.sysinfo {
523 margin: 0 7px 0 16px;
558 min-width: 54px;
559 margin: 0 3px 0 8px;
526562.sysinfo > .item + .item {
527563 margin-left: 8px;
530.music:hover,
531.clipboard:hover,
532.mako-status:hover,
533.wifi:hover,
534.bluetooth:hover,
535.tray:hover,
536.sysinfo:hover,
537.volume:hover,
538.brightness:hover,
539.battery:hover,
540.inhibit:hover,
541.clock:hover {
542 background: var(--accent);
543 color: var(--on-focus);
544 border-radius: var(--radius);
545}
547.music:hover label,
548.clipboard:hover label,
549.mako-status:hover label,
550.wifi:hover label,
551.bluetooth:hover label,
552.tray:hover label,
553.sysinfo:hover label,
554.volume:hover label,
555.brightness:hover label,
556.battery:hover label,
557.inhibit:hover label,
558.clock:hover label {
559 color: var(--on-focus);
560}
562566.music:checked,
563567.music:focus,
564568.clipboard:checked,
575579.sysinfo:focus,
576580.volume:checked,
577581.volume:focus,
578.volume button:checked,
579.volume button:focus,
580582.brightness:checked,
581583.brightness:focus,
582584.battery:checked,
587589 color: var(--fg);
590.music:checked label,
591.music:focus label,
592.clipboard:checked label,
593.clipboard:focus label,
594.mako-status:checked label,
595.mako-status:focus label,
596.wifi:checked label,
597.wifi:focus label,
598.bluetooth:checked label,
599.bluetooth:focus label,
600.tray:checked label,
601.tray:focus label,
602.sysinfo:checked label,
603.sysinfo:focus label,
604.volume:checked label,
605.volume:focus label,
606.brightness:checked label,
607.brightness:focus label,
608.battery:checked label,
609.battery:focus label,
610.clock:checked label,
611.clock:focus label {
592.music:checked *,
593.music:focus *,
594.clipboard:checked *,
595.clipboard:focus *,
596.mako-status:checked *,
597.mako-status:focus *,
598.wifi:checked *,
599.wifi:focus *,
600.bluetooth:checked *,
601.bluetooth:focus *,
602.tray:checked *,
603.tray:focus *,
604.sysinfo:checked *,
605.sysinfo:focus *,
606.volume:checked *,
607.volume:focus *,
608.brightness:checked *,
609.brightness:focus *,
610.battery:checked *,
611.battery:focus *,
612.clock:checked *,
613.clock:focus * {
612614 color: var(--fg);
617.music:hover,
618.music:focus:hover,
619.music:checked:hover,
620.clipboard:hover,
621.clipboard:focus:hover,
622.clipboard:checked:hover,
623.mako-status:hover,
624.mako-status:focus:hover,
625.mako-status:checked:hover,
626.wifi:hover,
627.wifi:focus:hover,
628.wifi:checked:hover,
629.bluetooth:hover,
630.bluetooth:focus:hover,
631.bluetooth:checked:hover,
632.tray:hover,
633.tray:focus:hover,
634.tray:checked:hover,
635.sysinfo:hover,
636.sysinfo:focus:hover,
637.sysinfo:checked:hover,
638.volume:hover,
639.volume:focus:hover,
640.volume:checked:hover,
641.brightness:hover,
642.brightness:focus:hover,
643.brightness:checked:hover,
644.battery:hover,
645.battery:focus:hover,
646.battery:checked:hover,
647.inhibit:hover,
648.inhibit:focus:hover,
649.inhibit:checked:hover,
650.clock:hover,
651.clock:focus:hover,
652.clock:checked:hover {
653 background: var(--accent);
654 color: var(--on-focus);
655 border-radius: var(--radius);
656}
658.music:hover *,
659.music:focus:hover *,
660.music:checked:hover *,
661.clipboard:hover *,
662.clipboard:focus:hover *,
663.clipboard:checked:hover *,
664.mako-status:hover *,
665.mako-status:focus:hover *,
666.mako-status:checked:hover *,
667.wifi:hover *,
668.wifi:focus:hover *,
669.wifi:checked:hover *,
670.bluetooth:hover *,
671.bluetooth:focus:hover *,
672.bluetooth:checked:hover *,
673.tray:hover *,
674.tray:focus:hover *,
675.tray:checked:hover *,
676.sysinfo:hover *,
677.sysinfo:focus:hover *,
678.sysinfo:checked:hover *,
679.volume:hover *,
680.volume:focus:hover *,
681.volume:checked:hover *,
682.brightness:hover *,
683.brightness:focus:hover *,
684.brightness:checked:hover *,
685.battery:hover *,
686.battery:focus:hover *,
687.battery:checked:hover *,
688.inhibit:hover *,
689.inhibit:focus:hover *,
690.inhibit:checked:hover *,
691.clock:hover *,
692.clock:focus:hover *,
693.clock:checked:hover * {
694 color: var(--on-focus);
695}
697.popup-volume .btn-mute,
698.popup-volume .btn-mute label,
699.popup-volume .btn-mute image,
700.popup-volume .btn-mute * {
701 background: transparent;
702 color: var(--fg);
703}
705.popup-volume .btn-mute:checked,
706.popup-volume .btn-mute:checked label,
707.popup-volume .btn-mute:checked image,
708.popup-volume .btn-mute:checked * {
709 background: transparent;
710 color: var(--accent);
711}
713.popup-volume .btn-mute:hover,
714.popup-volume .btn-mute:active,
715.popup-volume .btn-mute:checked:hover,
716.popup-volume .btn-mute:checked:active {
717 background: var(--accent);
718 color: var(--on-focus);
719}
721.popup-volume .btn-mute:hover label,
722.popup-volume .btn-mute:hover image,
723.popup-volume .btn-mute:hover *,
724.popup-volume .btn-mute:active label,
725.popup-volume .btn-mute:active image,
726.popup-volume .btn-mute:active *,
727.popup-volume .btn-mute:checked:hover label,
728.popup-volume .btn-mute:checked:hover image,
729.popup-volume .btn-mute:checked:hover *,
730.popup-volume .btn-mute:checked:active label,
731.popup-volume .btn-mute:checked:active image,
732.popup-volume .btn-mute:checked:active * {
733 color: var(--on-focus);
734}
615736.popup {
616737 padding: 8px;

mako/nugu.conf

Modified

+1 / −1 text lines

1# Generated by hypr/scripts/theme.nu from Nugu palette.
1# Generated by Hyprland Lua from Nugu palette.
22background-color=#242424ee
33text-color=#dbdbdbff
44border-color=#d86dd8ff

nugu/ironbar.nu

Modified

+1 / −0 text lines

1616 --fg: ($p.ui.normal);
1717 --accent: ($p.ui.accent);
1818 --focus: ($p.ui.focus);
19 --important-global: ($p.ui.important_global);
1920 --on-focus: ($on_focus);
2021 --muted: ($p.ui.minor);
2122 --unfocus: ($p.ui.unfocus);

nushell/modules/git.nu

Modified

+15 / −13 text lines

463463 public-migration $migration
466# Bootstrap checkout.
467export def --env co [
468 source: string = "." # URL/path, or `.` to migrate current checkout
466# Bootstrap a new bare+worktree layout from a URL/path.
467export def --env "wt clone" [
468 source: string # URL/path
469469 name?: string # repo/root name
470 --branch (-b): string = "" # branch to check out; default remote/current HEAD
471 --dir (-d): path = "." # parent dir for fresh checkout
472 --plan # with `co .`: preview only
470 --branch (-b): string = "" # branch to check out; default remote HEAD
471 --dir (-d): path = "." # parent dir
472] {
473 co-fresh $source $name $branch $dir
474}
476# Migrate the current checkout into a sibling bare+worktree layout.
477export def --env "wt migrate" [
478 name?: string # repo/root name
479 --branch (-b): string = "" # branch to check out; default current branch
480 --plan # preview only
473481 --dirty: string = $DIRTY_REFUSE # `refuse` | `copy`
474482] {
475 if $source == "." {
476 co-current $name $branch $plan $dirty
477 } else {
478 if $plan { error make {msg: "--plan only applies to `co .`"} }
479 if $dirty != $DIRTY_REFUSE { error make {msg: "--dirty only applies to `co .`"} }
480 co-fresh $source $name $branch $dir
481 }
483 co-current $name $branch $plan $dirty
484486# Summary.

pi-ext

Modified

Link change (old → new): 75a8dfd28c23d1551f8181c3bd286dfebd75b734 → e3489ee81f19f0b72c761e50df075ad948a24e71.

pi/agent/settings.json

Modified

+4 / −9 text lines

77 ],
88 "theme": "terminal",
99 "enabledModels": [
10 "openai-codex/gpt-5.5",
11 "kimi-coding/kimi-for-coding",
12 "zai/glm-5.1",
13 "zai/glm-5-turbo",
14 "minimax/MiniMax-M2.7-highspeed",
1510 "minimax/MiniMax-M3",
16 "minimax/MiniMax-M2.5-highspeed"
11 "openai-codex/gpt-5.5"
1712 ],
18 "defaultProvider": "minimax",
19 "defaultModel": "MiniMax-M3",
13 "defaultProvider": "openai-codex",
14 "defaultModel": "gpt-5.5",
2015 "defaultThinkingLevel": "high",
2116 "quietStartup": true,
2217 "collapseChangelog": true,
8479 ]
8580 }
8681 }
87}
82}No final newline

systemd/user/app-graphical.slice.d/10-x230-resources.conf

Added
new file mode 100644

+5 / −0 text lines

1[Slice]
2CPUWeight=100
3IOWeight=100
4MemoryLow=512M
5MemoryHigh=10G

systemd/user/background-graphical.slice.d/10-x230-resources.conf

Added
new file mode 100644

+5 / −0 text lines

1[Slice]
2CPUWeight=25
3IOWeight=25
4MemoryHigh=2G
5MemoryMax=4G

systemd/user/session-graphical.slice.d/10-x230-resources.conf

Added
new file mode 100644

+4 / −0 text lines

1[Slice]
2CPUWeight=1000
3IOWeight=1000
4MemoryLow=768M

systemd/user/work.slice

Modified

+13 / −4 text lines

1[Unit]
2Description=Interactive development work slice
3PartOf=graphical-session.target
4After=graphical-session.target
5Conflicts=wayland-session-shutdown.target
6Before=wayland-session-shutdown.target
7
18[Slice]
2MemoryHigh=24G
3MemoryMax=28G
4CPUWeight=50
5IOWeight=50
9CPUWeight=100
10IOWeight=100
11MemoryLow=1G
12MemoryHigh=12G
13MemoryMax=14G
14MemorySwapMax=8G

wezterm/bugabinga/exec_domains.lua

Deleted
deleted file mode 100644

+0 / −49 text lines

1local wez = require 'wezterm'
2
3local function append_all(dst, src)
4 for _, value in ipairs(src) do
5 table.insert(dst, value)
6 end
7end
8
9local function scoped_domain(name, label, properties)
10 return wez.exec_domain(name, function(cmd)
11 local args = cmd.args or { 'nu', '--login' }
12 local env = cmd.set_environment_variables or {}
13 env.WEZTERM_EXEC_DOMAIN = name
14 cmd.set_environment_variables = env
15 local unit = 'wezterm-' .. name:gsub('[^%w_.-]', '-') .. '-' .. tostring(env.WEZTERM_PANE or os.time())
16 local wrapped = {
17 'systemd-run',
18 '--user',
19 '--scope',
20 '--same-dir',
21 '--collect',
22 '--quiet',
23 '--unit=' .. unit,
24 '--description=WezTerm ' .. name,
25 }
27 for _, property in ipairs(properties) do
28 table.insert(wrapped, '-p')
29 table.insert(wrapped, property)
30 end
32 append_all(wrapped, args)
33 cmd.args = wrapped
34 return cmd
35 end, label)
36end
38return function(cfg)
39 if not wez.target_triple:find( 'linux', 1, true ) then return end
41 cfg.exec_domains = {
42 scoped_domain('scope:build', 'scope:build CPU 25% MEM max 256M', {
43 'CPUQuota=25%',
44 'MemoryMax=256M',
45 'MemorySwapMax=0',
46 'OOMPolicy=stop',
47 }),
48 }
49end

wezterm/bugabinga/key_binds.lua

Modified

+0 / −5 text lines

158158 cwd = wez.home_dir,
159159 },
160160 },
161 {
162 key = 'b',
163 mods = 'LEADER',
164 action = wez.action.SpawnCommandInNewTab { domain = { DomainName = 'scope:build', }, },
165 },
166161 {
167162 key = 'B',
168163 mods = 'LEADER|SHIFT',

wezterm/bugabinga/mux.lua

Modified

+0 / −2 text lines

99 no_serve_automatically = true,
1010 },
1111 }
13 cfg.default_gui_startup_args = { 'connect', 'unix' }
1412end

wezterm/wezterm.lua

Modified

+0 / −1 text lines

1111require 'bugabinga.status' ( cfg )
1212require 'bugabinga.launch' ( cfg )
1313require 'bugabinga.wsl' ( cfg )
14require 'bugabinga.exec_domains' ( cfg )
1615-- logs key presses
1716-- cfg.debug_key_events = true,

x230.symlinks

Modified

+15 / −3 text lines

3131git/gitconfig.bugabinga
3232~/.config/git/.gitconfig.include
34git/ignore
35~/.config/git/ignore
3437gh
3538~/.config/gh
100103hypr/systemd/wl-clip-persist.service
101104~/.config/systemd/user/wl-clip-persist.service
103hypr/systemd/nugu-theme.service
104~/.config/systemd/user/nugu-theme.service
106106hypr/systemd/ironbar.service
107107~/.config/systemd/user/ironbar.service
109109hypr/systemd/ironbar-workspaces.service
110110~/.config/systemd/user/ironbar-workspaces.service
112systemd/user/session-graphical.slice.d/10-x230-resources.conf
113~/.config/systemd/user/session-graphical.slice.d/10-x230-resources.conf
115systemd/user/app-graphical.slice.d/10-x230-resources.conf
116~/.config/systemd/user/app-graphical.slice.d/10-x230-resources.conf
118systemd/user/background-graphical.slice.d/10-x230-resources.conf
119~/.config/systemd/user/background-graphical.slice.d/10-x230-resources.conf
121systemd/user/work.slice
122~/.config/systemd/user/work.slice
112124wezterm/systemd/wezterm-mux-server.service
113125~/.config/systemd/user/wezterm-mux-server.service

yazi/package.toml

Modified

+9 / −9 text lines

11[[plugin.deps]]
22use = "yazi-rs/plugins:full-border"
3rev = "c2c16c8"
3rev = "598cdb6"
44hash = "7b625412411be411153886894d9acaf"
66[[plugin.deps]]
77use = "yazi-rs/plugins:toggle-pane"
8rev = "c2c16c8"
8rev = "598cdb6"
99hash = "9c7987da2d2a2120dac33abb64132004"
1111[[plugin.deps]]
1212use = "yazi-rs/plugins:smart-enter"
13rev = "c2c16c8"
13rev = "598cdb6"
1414hash = "187cc58ba7ac3befd49c342129e6f1b6"
1616[[plugin.deps]]
1717use = "yazi-rs/plugins:smart-filter"
18rev = "c2c16c8"
18rev = "598cdb6"
1919hash = "c887903a63a2ff520081b6d90a4b3392"
2121[[plugin.deps]]
2222use = "yazi-rs/plugins:smart-paste"
23rev = "c2c16c8"
23rev = "598cdb6"
2424hash = "3f8d49413bc8691b4c652eb417a20178"
2626[[plugin.deps]]
2727use = "yazi-rs/plugins:git"
28rev = "c2c16c8"
28rev = "598cdb6"
2929hash = "88e56a64b7ce7c4314427452343fef17"
3131[[plugin.deps]]
3232use = "yazi-rs/plugins:chmod"
33rev = "c2c16c8"
33rev = "598cdb6"
3434hash = "f0c8c378184d5f8abd1b095a443d336d"
3636[[plugin.deps]]
3737use = "yazi-rs/plugins:diff"
38rev = "c2c16c8"
38rev = "598cdb6"
3939hash = "8b1af6b5a69797ee951f2a80ce570818"
4141[[plugin.deps]]
4242use = "yazi-rs/plugins:piper"
43rev = "c2c16c8"
43rev = "598cdb6"
4444hash = "d99cfbc3812e7738505f9e4bedb759cd"
4646[[plugin.deps]]