Skip to content

feature: expose current driftwm bindings through new driftwm msg bindings command - #340

Open
Granitosaurus wants to merge 1 commit into
malbiruk:mainfrom
Granitosaurus:cheatsheet
Open

Granitosaurus wants to merge 1 commit into
malbiruk:mainfrom
Granitosaurus:cheatsheet

Conversation

@Granitosaurus

Copy link
Copy Markdown

I'd like other programs to know what are my driftwm bindings and for that each program has to reparse the config.toml with same parser as driftwm. So better approach here would be to have driftwm itself report it's registered bindings rather than have everyone re-implement the parser.

For this I've added a new command:

❯ : driftwm msg bindings --help
List the effective keybindings: built-in defaults merged with the config.

Prints keyboard, tap and mouse bindings in config syntax; mouse bindings are tagged with the `[mouse.*]` context they live in. Reflects the config as currently loaded, including hot reloads. Gesture and touch bindings are not listed.

`--json` reply: `{"Ok":{"Bindings":{"mod_key":"super","keys":[{"trigger":"super+Return","action":"exec-terminal"}],"taps":[..],"mouse":[..]}}}`.

Usage: driftwm msg bindings [OPTIONS]

Options:
      --json
          Print the raw JSON reply

  -h, --help
          Print help (see a summary with '-h')

External tools (a cheatsheet, a launcher) had no way to learn what is bound:
the merged result of the built-in defaults and the user's config exists only
inside the compositor. The new request returns the keyboard, tap and mouse
bindings in config syntax, sorted, with mouse bindings tagged by context.
Gesture and touch bindings are not included yet.

Display impls for Action, KeyCombo and the mouse types render a binding back
into the config's own spelling; a test parses every default back to prove the
two directions agree.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Granitosaurus
Granitosaurus marked this pull request as ready for review November 11, 2026 09:24
@Granitosaurus

Copy link
Copy Markdown
Author

I'm building a cheatsheet / user assistant app separate from driftwm so this would be super useful

@Granitosaurus Granitosaurus changed the title feature: expose current driftwm bindings through new driftwm msg binding feature: expose current driftwm bindings through new driftwm msg bindings command Nov 11, 2026

This branch has not been deployed

No deployments
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