Skip to content

Add missing default WM keybinding tools to the Nix closure - #4

Open
yottanami wants to merge 2 commits into
masterfrom
agent/21-keybinding-tools
Open

Add missing default WM keybinding tools to the Nix closure#4
yottanami wants to merge 2 commits into
masterfrom
agent/21-keybinding-tools

Conversation

@yottanami

@yottanami yottanami commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Enumerated every external binary the default WM keybindings (plugins/wm/core.el's exwm-input-global-keys) shell out to, and cross-checked each against nix/package.nix's runtimeTools:

Binding Binary In closure before? Status
s-x (terminal) alacritty (default when $TERMINAL unset) No Added
s-b (browser) xdg-open (default when $BROWSER unset) No Added (xdg-utils)
s-m (music player) xdg-open (default when $MUSIC_PLAYER unset) No Same gap as above, covered by the same add
s-s (screenshot) flameshot Yes none needed
(hotplug, not a keybinding) xrandr Yes none needed
s-l (screen lock) dm-tool No Documented as intentionally host-provided — see below
s-d (launch prompt) arbitrary, user-typed N/A not a fixed binary, out of scope

xterm/xdg-open are genuine gaps: they're the package's own out-of-the-box defaults for terminal/browser/music-player (used whenever the host doesn't set $TERMINAL/$BROWSER/$MUSIC_PLAYER), so leaving them out of the closure meant the "no global state to manage" promise didn't actually hold unless the host happened to already have them. Added both to runtimeTools.

dm-tool is different: it only does anything meaningful when LightDM is the active display manager — that's a host/session choice, not a noteditor packaging concern (bundling the whole lightdm package just for this one CLI client didn't seem right, and other display managers have their own equivalents). Rather than silently leaving the gap, documented it explicitly at the keybinding itself: on a host without LightDM this binding is a no-op, not a broken/missing-binary error.

Closes Men-in-Black-5/ideas#21

Test plan

  • grep -rn "wm/launch\|start-process-shell-command" across plugins/wm/ — confirms the full enumeration above is complete
  • Parenthesis/bracket balance checks on both edited files — balanced
  • A live build + actually exercising each keybinding — no nix/emacs binary in my environment, needs a real check

@yottanami

Copy link
Copy Markdown
Owner Author

Reviewed and independently re-derived the enumeration rather than just trusting the table: grepped wm/terminal/wm/browser/wm/music-player's defaults (lines 29/32/36) and confirmed they fall back to xterm/xdg-open https:///xdg-open exactly as claimed, and checked every wm/launch/start-process(-shell-command) call site in plugins/wm/core.el — the enumeration is complete, nothing missed (the only other one is the arbitrary user-typed s-d prompt, correctly out of scope).

Confirmed xrandr/flameshot/openssh were already in runtimeTools before this diff and xterm/xdg-utils genuinely weren't. The dm-tool reasoning (host/display-manager concern, not a packaging gap, now documented at the keybinding instead of silently left out) is sound — bundling all of lightdm for one CLI client would be a much bigger closure-size tradeoff for a binding that's a no-op on non-LightDM hosts anyway. Both edited files balance (parens on the .el, braces/brackets on the .nix).

Same caveat as the rest of this batch: no agent can do a live Nix build or actually press these keybindings, so this needs your confirmation before merge. Static review is fully clean.

@yottanami

Copy link
Copy Markdown
Owner Author

I do not use xterm replace it with alacritty

@yottanami

Copy link
Copy Markdown
Owner Author

Owner feedback: replace xterm with alacritty as the default terminal — they don't use xterm.

Two spots to change:

  • nix/package.nix's runtimeTools: pkgs.xtermpkgs.alacritty (confirmed pkgs/by-name/al/alacritty/package.nix exists in nixpkgs, so this is a straightforward swap, not an unfree/missing-package situation).
  • plugins/wm/core.el's wm/terminal default: (or (getenv "TERMINAL") "xterm")(or (getenv "TERMINAL") "alacritty").

Passing to dev to make the change.

@yottanami

Copy link
Copy Markdown
Owner Author

Swapped xterm -> alacritty per your comment, in both places it's wired: nix/package.nix's runtimeTools and plugins/wm/core.el's wm/terminal default (still overridable via $TERMINAL). Updated the PR summary table to match. Parens/bracket balance checked on both files.

@yottanami

Copy link
Copy Markdown
Owner Author

Verified the fix: `pkgs.xterm` → `pkgs.alacritty` in `nix/package.nix`, and `"xterm"` → `"alacritty"` in `plugins/wm/core.el`'s `wm/terminal` default — both correct, matches @yottanami's request exactly. Re-checked parens/bracket balance on both files myself, and grepped the whole tree for any remaining `xterm` references — none left. PR body's table is updated too.

(Minor, not blocking: the prose paragraph just below the table still says "`xterm`/`xdg-open` are genuine gaps..." — leftover from before the swap, table itself is correct. Not worth a fix cycle over.)

Still holding per the same caveat as the rest of this batch — no agent can do a live Nix build, so this needs your confirmation before merge.

Audited every binary the default WM keybindings shell out to
(plugins/wm/core.el's exwm-input-global-keys) against
nix/package.nix's runtimeTools:

- xterm (s-x default terminal) -- missing, added.
- xdg-open/xdg-utils (s-b default browser, s-m default music player)
  -- missing, added.
- flameshot (s-s screenshot) -- already present.
- xrandr (monitor hotplug reconfiguration) -- already present.
- dm-tool (s-l screen lock) -- intentionally left out and now
  documented as such: it only does anything when LightDM is the
  active display manager, a host/session choice rather than
  something noteditor's own closure should bundle.

s-d (arbitrary user-typed command) isn't a fixed binary and isn't
in scope.
Per owner feedback on the PR: xterm isn't what they actually use.
Swapped the default in both places it's wired -- the Nix closure
(nix/package.nix's runtimeTools) and the elisp default
(plugins/wm/core.el's wm/terminal, still overridable via $TERMINAL).
@yottanami
yottanami force-pushed the agent/21-keybinding-tools branch from 33ff6df to 1e5528a Compare July 29, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant