Conversation
|
Thank you, sounds interesting! 🙂 Could you maybe extract the feature for Regarding the config file, I find the approach interesting, but it also feels a bit complicated. Do you think it would also be viable if |
|
Apologies for the delay, have been traveling. re: re: config file - I'm still thinking this through, sharing my notes below. FWIW - This config dance is a bit unfortunate, but I don't know that it's that complicated. We're just appending to the existing config, we don't have to do any complex rewriting. I don't write much python - is there some other way this could be structured to keep it clean? I think there are real benefits to having notes
|
But what happens if the user has already some keybindings defined? We probably can't simply append, we need to parse the file and filter them out. Can we use the same names or do we need some translation? What happens when Suddenly, I'm not convinced yet ;) What I can definitely see is to add understand hotkeys received from |
Add keybinding support for fuzzel
Fuzzel supports custom keybindings via
custom-1throughcustom-19in its config, returning exit codes 10+ when triggered. This wires that up so--keybindingsand--menu-keybindingswork with fuzzel.Approach
Fuzzel doesn't accept keybinding config via CLI flags (unlike rofi's
-kb-custom-N), so we generate a temporary config file at runtime. The config is generated once per keybinding list and cached for the lifetime of the process, cleaned up viaatexit.The generated config contains:
include=— fuzzel doesn't support nested includes)[dmenu]section forcingexit-immediately-if-empty=noso the target submenu behaves correctly for entries with no fields[key-bindings]section mapping shortcuts tocustom-N, with unused slots set tononeEntry selection uses fuzzel's
--indexmode, outputting the selected line number rather than text. This avoids fuzzel's trailing whitespace stripping breaking entry lookup for entries with empty usernames.Other details
--fuzzel-configis a dedicated flag (rather than using--selector-args) because we read and transform the config file contents rather than just forwarding it to fuzzelAlt+→Mod1+,Super+→Mod4+) in__convert_shortcutso users can use the same format as rofi--mesgwhenshow_help_messageis setbemenu(notfuzzel) doesn't support keybindingsAI
Assisted by Claude Code. I worked on, reviewed, and tested these changes throughout.