Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] make modifier field optional #9

Open
VuiMuich opened this issue Nov 25, 2021 · 3 comments
Open

[enhancement] make modifier field optional #9

VuiMuich opened this issue Nov 25, 2021 · 3 comments

Comments

@VuiMuich
Copy link
Member

.. so it isn't necessary anymore to have awkward empty values in the config.

@SergioRibera
Copy link
Contributor

What do you think about having a default_modifier as a parameter in the configuration and only use it when no modifier is assigned to the keybind?

@VuiMuich
Copy link
Member Author

That would make it impossible to assign keybinds like Brightness buttons etc. to work without the need of a modifier.
But you gave me a great idea: keybinds could be reorganized so the are grouped by the subset of modifiers. So this would almost feel like keymap layers. I'll try to come up with an example later.

@SergioRibera
Copy link
Contributor

I was trying to make a contribution with the idea that I gave you, here I leave it more exemplified, although I would like you to explain me better your idea, it sounds great and maybe I can contribute in some way.

Config(
    default_modifier: ["Mod4", "Shift"],
    keybinds: [
        Keybind(
            command: Execute("st -e htop"),
            key: Key("x"),
        ),
        Keybind(
            command: Executes(["st -e htop", "st -e bpytop"]),
            key: Keys(["x", "m"]),
        ),
        Keybind(
            command: Chord([
                Keybind(
                    command: Execute("st -e htop"),
                    modifier: Some(["Mod4"]),
                    key: Key("c"),
                ),
            ]),
            modifier: Some(["Mod4"]),
            key: Key("c"),
        ),
    ]
)

@SergioRibera SergioRibera mentioned this issue Sep 21, 2022
2 tasks
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

No branches or pull requests

2 participants