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

Cannot assign Spectacle shortcuts to "Print" #136

Open
Vaudrain opened this issue Apr 21, 2024 · 9 comments
Open

Cannot assign Spectacle shortcuts to "Print" #136

Vaudrain opened this issue Apr 21, 2024 · 9 comments

Comments

@Vaudrain
Copy link

Been tinkering with my setup for a while and it all seems to be going great! Just ran into one snag.

I am unable to assign any Spectacle shortcuts to "Print", as given as examples in modules/spectacle.nix. If I assign "Print", or any modifier set such as "Meta+Print" or "Shift+Control+Print" to any command (captureActiveWindow, captureCurrentMonitor etc.) it simply ignores it and uses the default value.

This doesn't happen if I use values like "Shift+I" or "Meta+Control+O", so it seems to be an issue with "Print" specifically.

Ideally, I'd like to use the line spectacle.shortcuts.captureRectangularRegion = "Print"; - but it's failing. Is this an issue with how I've been writing my config, or a bug?

@magnouvean
Copy link
Collaborator

magnouvean commented Apr 21, 2024

My guess would be that there are some conflicting keys (that is some other action which is bound to "Print"). That or that "Print" is the wrong value for the print key. If you set it manually, what is shown in kglobalshortcutsrc, and does this differ from what plasma-manager sets?

@Vaudrain
Copy link
Author

Oddly, when I set the value manually the file is regenerated but remains exactly the same. In fact, if I manually change it, then change a Spectacle setting, it returns to that initial state regardless of what the change was.

As for the value, when I set a value like "Meta+Control+O" that shows up. When I set the value to "Print" nothing appears - a blank entry. When I don't set a value, "none" appears. For example:

[services][org.kde.spectacle.desktop]
ActiveWindowScreenShot=none
FullScreenScreenShot=Meta+Control+O
RecordRegion=none
RecordScreen=none
RecordWindow=none
RectangularRegionScreenShot=
WindowUnderCursorScreenShot=none
_launch=none

@magnouvean
Copy link
Collaborator

Then this sounds like the Print key is used for some other action (it seems like launching spectacle). You will need to unbind this key manually in plasma-manager (for example using the shortcuts module) for other keys to be able to be bound to this key. Sadly there is no way for plasma-manager to unbind keys automatically due to how keybindings are handled in kde.

@Vaudrain
Copy link
Author

Alrighty, that sounds reasonable, thank for the help so far! I've tried this, but I'm still running into issues:

shortcuts = {
  "services/org.kde.spectacle.desktop"."_launch" = "Meta+Shift+P";
};

spectacle.shortcuts = {
  captureRectangularRegion = "Print";
};

Is this the correct way to unbind, or does rebinding not also unbind? Notably, this changes the value of _launch in kglobalshortcutsrc, but Print still opens Spectacle rather than the rectangular region selector, and the Spectacle keybinds menu looks to show default values:

image

@magnouvean
Copy link
Collaborator

You have done it correct. There is definitely something weird going on here. I don't really know where the problem is though, if it's a plasma-manager or kde issue with it not liking that some files are changed outside the settings app. There doesn't seem to be a good way of unbinding this key without it being reset for some reason. There are other keys which has had similar problems, namely Ctrl+Alt+T.

@Vaudrain
Copy link
Author

Hrm, that is unfortunate. Thank you for the help!

Do you know where might be best to look if I try to troubleshoot further?

@magnouvean
Copy link
Collaborator

magnouvean commented Apr 22, 2024

I don't really have that many good places to look sadly :(. One thing to note though is that plasma-manager only really manages config-files, which means that for this to work you would need to find what modifications to the config-files you would need to make to unbind "Print". This could potentially be multiple places. I would suggest tracking differences in config-files when you change the key via the settings app (I have done this via git a couple of times for example).

@jilinoleg
Copy link

I can confirm I have a similar issue with Print (it resets every time even if I disable spectacle module) and Meta+R shortcuts (same here, but I set it to one outside of Spectacle module).

I will try troubleshooting it myself too, and write back if I found something new

@ccatterina
Copy link

could it be related to https://bugs.kde.org/show_bug.cgi?id=484682?

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

4 participants