Need help setting keybindings for nautilus scripts, scoped to nautilus

I’ve got two nautilus scripts in the ~/.local/share/nautilus/scripts : “Group” and “Ungroup”, for grouping all selected “files & directories” in a new folder (auto named) and ungrouping contents of selected directories in the parent directory, respectively. The scripts works perfectly via the right click menu > scripts.

But I wanna set keybinds for both of these scripts. Ctrl+G for the Group script and Ctrl+Shift+G for the Ungroup script, such that the keybinds are only scoped to nautilus.

I’ve already tried using settings > keyboard > keyboard shortcuts > custom shortcuts to set the keybinds. It works but the keybinds are not scoped to nautilus, and that’s a problem because it hijacks the Ctrl+G and Ctrl+Shift+G keybinds, preventing other apps from using those keybinds.

I’ve also attempted setting keybindings for the nautilus scripts via scripts-accels, which of course didn’t work either.

~/.config/nautilus/scripts-accels content FYR:
(gtk_accel_path “/nautilus/scripts/Group” “G”)
(gtk_accel_path “/nautilus/scripts/Ungroup” “G”)

And that brings me here, to the gods themselves. So any good way to achieve this?


Update: Turns out I was using incorrect keybind syntax in scripts-accels.
This is how it should be:

<Control>g Group
<Control><Shift>g Ungroup

It’s working perfectly now. And most importantly, the keybinds are exclusively scoped to Nautilus!! So the devs had litreally thought about the keybind hijacking part well in advanced huh. Pretty neat :slight_smile: