swhkd icon indicating copy to clipboard operation
swhkd copied to clipboard

Cannot start under x11 and wayland, an error occurs

Open linux36524 opened this issue 1 year ago • 9 comments

thread 'main' panicked at swhkd/src/config.rs:7:80: called Result::unwrap() on an Err value: Grammar(Error { variant: ParsingError { positives: [command], negatives: [] }, location: Pos(204), line_col: Pos((7, 2)), path: Some("/home/xxx/.config/swhkd/swhkdrc"), line: "button8", continued_line: None, parse_attempts: None }) note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

linux36524 avatar Nov 10 '24 18:11 linux36524

Hi @linux36524 it seems your configuration file is incorrect Cc: @lavafroth

Shinyzenith avatar Nov 11 '24 04:11 Shinyzenith

Hi. It seems you're either attempting to use the key 8 from numeric row or the keypad. If you wish to use the numeric row key, simply use 8 instead of button8. If it is the other one, use kp8. All of the key names are the same as defined in the kernel without the KEY_ prefix.

lavafroth avatar Nov 11 '24 04:11 lavafroth

Hi. It seems you're either attempting to use the key 8 from numeric row or the keypad. If you wish to use the numeric row key, simply use 8 instead of button8. If it is the other one, use kp8. All of the key names are the same as defined in the kernel without the KEY_ prefix.

button8 is the mouse button. This is the configuration of sxhkd, no problem,

button8
	xte 'keydown Alt_L' 'key n' 'keyup Alt_L'

But when ported to swhkd, it is like this, is there anything wrong with writing it this way?

button8
	wtype -M alt n -m alt

linux36524 avatar Nov 12 '24 06:11 linux36524

I'm afraid there is no implementation for the mouse button in swkhd. Let me consult @shinyzenith and check if we want to implement this.

lavafroth avatar Nov 12 '24 06:11 lavafroth

I'm afraid there is no implementation for the mouse button in swkhd. Let me consult @Shinyzenith and check if we want to implement this.

OK, thanks

linux36524 avatar Nov 12 '24 06:11 linux36524

@lavafroth, any decision about this? I'm getting errors when trying to bind button8 or @button9.

kankaristo avatar Jun 17 '25 19:06 kankaristo

I'm willing to bind this but I don't think evdev supports this does it? We are working on a libinput backend which should fix these

Shinyzenith avatar Jun 18 '25 15:06 Shinyzenith

I'm willing to bind this but I don't think evdev supports this does it? We are working on a libinput backend which should fix these

I'm not sure if evdev supports them (I've never really developed anything that uses evdev), but this sway PR seems to hint that it does (button8 == BTN_SIDE and button9 == BTN_EXTRA, if I assumed correctly that those are the evdev names/enums?): https://github.com/swaywm/sway/pull/3313

kankaristo avatar Jun 18 '25 15:06 kankaristo

If button8 is BTN_SIDE and button9 is BTN_EXTRA, we can work on a new branch with these additional values.

lavafroth avatar Jun 18 '25 16:06 lavafroth