kando-menu / kando

🥧 The Cross-Platform Pie Menu.
https://ko-fi.com/schneegans
Other
3.1k stars 89 forks source link

shortcut value in menus.json disallows opening menu in hyprland #671

Closed HenrySteinmetz closed 3 weeks ago

HenrySteinmetz commented 3 weeks ago

Short Summary

While trying to add a shortcut to hyprland for my first kando menu I just couldn't get it to work: first I tried it the way it was described in the documentation - that didn't work - then I asked myself why the shorcut should be global in the firstplace and why it can't just be a regular one instead. But then I created a second test menu and it worked, even without the global shortcut. To understand why this happens I then checked the menus.json file to see the differences and found that my test menu didn't have the shortcut value set, so I tried just removing it for the actual menu I wanted to use and it now works just fine.

Steps to Reproduce the Issue

  1. Create a menu that has the shortcut json attribute set (this seems to always be true for the default menu)
  2. Add a bind to Hyprland that is not global (my bind: "bind = CTRL, Space, exec, kando --menu control")
  3. Try the shortcut

Kando Version

1.4.0

Installation Method

Via a package manger

Desktop Environment

Hyprland

Environment Version

Arch linux kernel 6.10.10-arch1-1 with hyprland version 0.42.2

Additional Information

I am referring to this part of the menus.json file image

Schneegans commented 3 weeks ago

Hi there! I failed to reproduce this on my end. Also, I am a bit confused by your terminology. If you put something in your Hyprland config like "bind = CTRL, Space, exec, kando --menu control", this is a global shortcut. "Global" means that the shortcut will be registered at compositor level and will execute the given command regardless of the application which is currently focused.

There are two ways you can open a Kando menu on Hyprland:

  1. Via the menu's shortcut ID: bind = CTRL, Space, global, kando:example-menu
  2. Via the menu's name: bind = CTRL, Space, exec, kando --menu "Example Menu"

The effect should be the same, both are global shortcuts. However, the first is usually preferred as it is faster. Here, Hyprland directly talks to the running instance of Kando while in the second variant a new instance of Kando is started which then has to talk to the first running instance.

For me, both variants work regardless of the menu configuration. Are you sure you tested this the right way without any typos? Also, are you sure you used the menu names and the shortcut IDs in the right places?

HenrySteinmetz commented 3 weeks ago

Thank you for your clarification, but I still get this issue when changing the shortcut value back manually. This only happens when using the shortcut without the global flag and this is probably a really stupid way to bind this. I just stumbled across this bug because my "debugging skills" led me towards just creating the bind myself instead of just figuring out how to use the documented one. If you still can't reproduce the bug maybe just clarify that the bind with the global keyword is much faster and that not doing it that way can lead to problems.