Cannot assign Spectacle shortcuts to "Print"
Vaudrain opened this issue · 9 comments
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?
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?
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
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.
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:
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
.
Hrm, that is unfortunate. Thank you for the help!
Do you know where might be best to look if I try to troubleshoot further?
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).
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
could it be related to https://bugs.kde.org/show_bug.cgi?id=484682?