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

Keychains (as sxhkd supports) panic #287

Open
draxil opened this issue Jan 11, 2025 · 1 comment
Open

Keychains (as sxhkd supports) panic #287

draxil opened this issue Jan 11, 2025 · 1 comment
Assignees

Comments

@draxil
Copy link

draxil commented Jan 11, 2025

Version Information:

  • Distribution Information ( run uname -a )
    Linux heartofgold 6.13.0-rc2-1-MANJARO #1 SMP PREEMPT_DYNAMIC Tue, 10 Dec 2024 02:26:31 +0000 x86_64 GNU/Linux
  • swhkd version ( swhkd -V )
    Simple-Wayland-HotKey-Daemon 1.3.0-dev

Describe the bug:
A keychain config, which works in sxhkd, panics in swhkd:

super + j; f 
      wlrctl window focus firefox 

Expected behavior:
Should parse and allow key chains.

Actual behavior:

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(125), line_col: Pos((10, 10)), path: Some("/home/joe/.config/swhkd/swhkdrc"), line: "super + j; f ", continued_line: None, parse_attempts: None })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted (core dumped)

or if this isn't supported yet (😢), at least a graceful failure.

To Reproduce:

  • add a chain, as above.
  • run swhkd
@manthanabc
Copy link
Contributor

I dont think swhkd supports key chaining

or if this isn't supported yet (😢), at least a graceful failure.

Yeah the panic is unwarranted here, especially given sweet (The parser for swhkd) has pretty cool error messages like

Error: unable to parse config file

Caused by:
     --> /home/manth/swhkdrc:1:19
      |
    1 | super + {g, t, e} a # case insensitive
      |                   ^---
      |
      = expected command

and in this case

Error: unable to parse config file

Caused by:
     --> /home/manth/swhkdrc:1:10
      |
    1 | super + a; f
      |          ^---
      |
      = expected command

For some reason this errors are'nt passed through to swhkd's output, i'll try to find out why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants