ErikReider/SwayNotificationCenter

[Feature] Customisable keybinds in config

开放

#647 创建于 2025年10月3日

 (0 条评论) (7 个反应) (0 位负责人)Vala (98 个派生)auto 404
enhancementhelp wanted

仓库指标

星标
 (2,535 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

SwayNC already has a good keyboard-only user experience. It'd be improved by the ability to change the binds, especially j and k for navigating between entries. I have 2 options in mind:

  • create a conflig flag like keyboard-shortcuts-vim which changes Up/Down to j/k and similar
  • create a config list entry that allows specifying a (optionally partial) set of key overrides over the default keybinds

I prefer the latter and have started implementation but being entirely new to vala it might take me a little bit, so figured I'd open an issue for discussion before I have something ready for PR.

Current idea is to have a KeyboardAction enum, use a Gee.TreeMultiMap<string, KeyboardAction> held in the config instance then in the keyboard callbacks we just check if that key has a relevant action we want to consume.

Think the only nontrivial part is the multimap config parsing, would you accept this being specific to this bind config or would you like it to be generic as in extract_array and extract_hashtable?

贡献者指南