RectangleWin icon indicating copy to clipboard operation
RectangleWin copied to clipboard

[FR] Add a conf.yaml based configuration system

Open phoeagon opened this issue 5 months ago • 0 comments

Create a conf.yaml based configuration system, so that the hotkey bindings are configurable.

I have a tentative implementation at https://github.com/phoeagon/RectangleWin/blob/main/conf.go

Basically, the conf.yaml has the following form:

keybindings:
    - modifier:
        - Ctrl
        - Alt
      key: UP_ARROW
      bindfeature: moveToTop
      
    - modifier:
        - Ctrl
        - Alt
      key: DOWN_ARROW
      bindfeature: moveToBottom

This could be easily parsed using "github.com/golobby/config/v3"

where modifier is some repeated properties of Ctrl, Alt, Win, Shift, Win. key takes in common keys, such as a-z, 0-9, *_ARROW, etc. As a fallback, it could take in current keymap.go's display name for matching.

phoeagon avatar Sep 07 '25 03:09 phoeagon