waycrate / swhkd

Sxhkd clone for Wayland (works on TTY and X11 too)
https://git.sr.ht/~shinyzenith/swhkd
BSD 2-Clause "Simplified" License
706 stars 48 forks source link

Chords do not work #101

Closed xircon closed 2 years ago

xircon commented 2 years ago

Version Information:

Describe the bug: Chords not working

super + n:  {n,p,d,x}
    {variety -n, variety -p, variety -t, variety --pause && notify-send Paused} 
[2022-03-28T13:43:13Z ERROR swhkd] Config Error: Error parsing config file "/etc/swhkd/swhkdrc". Unknown symbol at line 11.

Expected behavior: Should work as it does in sxhkd.

Actual behavior: See error swhkd does not load.

Shinyzenith commented 2 years ago

This is a known bug, we have implemented chords in the config but daemon doesn't support it yet. Eden, who is working on it is currently sick so it'll be implemented as soon as they're back!

EdenQwQ commented 2 years ago

@xircon would you mind trying out the new branch where we implemented a new feature called modes, which is supposed to work similar to chords but with a greater readability and functionality.

The basic syntax of key modes:

# the default mode is `normal` mode, which is always on the bottom of the mode stack
super + m
    # commands starting with `@` are internal commands. Internal commands can be combined with normal commands with `&&`
    # @enter will push a mode into the mode stack
    @enter music && echo music > .swhkd_mode

mode music # define a mode with the `mode` statement
super + {n,p,space}
    mpc {next,prev,pause}
q
    @escape # an internal command to pop the current mode out of the mode stack
endmode # end a mode definition with `endmode`
xircon commented 2 years ago

Seems to work OK, need to get my head around it, will have some questions :smile: First one:

EdenQwQ commented 2 years ago

Thanks for your tests

Shinyzenith commented 2 years ago

Seems to work OK, need to get my head around it, will have some questions smile First one:

  • @Enter music && echo music > .swhkd_mode This is set, but never unset? The file always contains music.
  • KP_Add & KP_Subtract don't work as keys.

Hi kpsubtract and kpplusminus exists, can you try binding them?

xircon commented 2 years ago

@Shinyzenith - kpminus works for the "-" key (numeric keypad), kpplusminus is valid, but does nothing as do all combinations I invented which all error :smile:

Shinyzenith commented 2 years ago

Chords should work now, if you face any issue then please make a new ticket 😁.