ITADN

hotkey module half-works

#571OpenRealHypnoticOcelot 创建于 2026-01-29
Related to #526. I've been trying to set up some hotkeys, and I've managed to solve the issue where hotkey keys aren't assigned through the following method: ```nix programs.plasma = { hotkeys.commands."vicinae" = { name = "Vicinae"; key = "Ctrl+Space"; command = "vicinae toggle"; }; shortcuts = { "services/plasma-manager-commands.desktop".vicinae = "Ctrl+Space"; }; }; ``` I don't know how hacky of a fix this is, but it works. Well, kind of! I have a more complicated hotkey, and it's having a lot more issues: ```nix programs.plasma = { hotkeys.commands."mute-microphone" = { name = "Mute Microphone patch for P14S"; key = "Mute Microphone"; command = "\"wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle && brightnessctl -d 'platform::micmute' s \\$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -q MUTED && echo 1 || echo 0)\""; # Funny business with escaping }; shortcuts = { "services/plasma-manager-commands.desktop".mute-microphone = "Microphone Mute"; }; }; ``` Yes, you have to add the quotes around the command, or else `nixos-rebuild` will fail. Same with the double backslash before the $. The issue I'm encountering is that the shortcut won't bind to Microphone Mute by default; I'm not sure if you need to do something special to rebind that key or something, but even when you do rebind it, the shortcut doesn't actually work. The `plasma-manager-commands.desktop` application shows up in the taskbar, but only shows up for a few seconds before disappearing, and doesn't do anything. The command does work if I manually create the hotkey in the Plasma UI, just not when I add it through Plasma Manager. Also, I figure it's probably not intended behavior to require adding escaped quotations around the command. Is there something I'm doing wrong, or is this a plasma-manager issue, or an API limitation?
1 条评论