Gnome 3 - dconf / gsettings - how to assign multiple keybindings?
Asked Answered
B

3

9

Goal: Assign both the Super_L or Super_R keys as triggers for the overlay menu.

Environment: Gnome 3.26.2, Fedora 27, Dell XPS 9550, Kinesis Advantage2

Why: For work I use a laptop either by itself or in conjunction with external monitors, keyboard, and mouse. The laptop keyboard has a left super (windows) key and no right super (windows) key. However, the external keyboard has a right super (windows) key but no left super (windows) key.

Currently, I have to open the gnome-tweak-tool or dconf-editor to swap between the Super_L and Super_R key each time I switch between using the laptop in isolation or with my external devices (or perform the gsettings equivalent: gsettings set org.gnome.mutter overlay-key 'Super_{L/R}').

Status: I've attempted to assign both the Super_L and Super_R for the org.gnome.mutter.overlay-key value through both the GUI based dconf-editor tool (as well as through the CLI driven gsettings alternative) utilizing many different syntax strategies, but without success.

A listing of all gsettings can be output through the following command: gsettings list-recursively > gsettings.txt. According to this file, the appropriate syntax for multi-key values is the following: ['value1', 'value2']. However, attempting to set values according to this format (gsettings set org.gnome.mutter overlay-key ['Super_L', 'Super_R']) yields the gsettings usage menu, implying an invalid command format.

I'm less concerned about using the GUI based dconf-editor as ultimately, I'll be using configuration management software to perform the configuration (via gsettings) for me (I utilize Chef to build and configure my laptop).

Question: How can I enable both Super_L or Super_R to trigger the Fedora overlay menu using the gsettings configuration tool?

Formats I've tried which do not work:

  • dconf write /org/gnome/mutter/overlay-key
  • gsettings set org.gnome.mutter overlay-key

with

  • "['Super_L','Super_R']"
  • "['Super_L', 'Super_R']"
  • ['Super_L','Super_R']
  • ['Super_L', 'Super_R']
  • 'Super_L','Super_R'
  • 'Super_L', 'Super_R'

Any tips, hints, or suggestions would be greatly appreciated!

-- Informatician

P.S. - I didn't mention it explicitly, but I did search exhaustively on how to enter multi-valued key bindings via gsettings but was unable to discover an example that I could replicate without error.

References:

Bronson answered 22/11, 2017 at 16:49 Comment(0)
P
2

The follow process got both super buttons working to open the main panel menu (although I'm on Pop!_OS with Gnome v3.38):

Firstly, open Gnome Tweaks (you may need to install it), navigate to Keyboard & Mouse, and set the Overview Shortcut to Left Super.

enter image description here

Next, either use the dconf editor or your terminal to set one of the following (setting both will result in one being ignored):

# Worked on Pop!_OS v20.10 with Gnome v3.38.2
gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['Super_R']"

# OR (don't set both)

# Worked on Pop!_OS v21.04 with Gnome v3.38.5
gsettings set org.gnome.settings-daemon.plugins.media-keys search "['Super_R']"

Note that this will have some implications on shortcuts: at this point, my left-hand super key works when combining it with other characters (e.g.: Super+m to maximize), while the right will always just show the panel main menu (or app search menu), no matter the key combination. You can obviously reverse this using the steps above.

Panlogism answered 21/12, 2020 at 2:0 Comment(0)
M
1

I did it with:

gsettings set org.gnome.shell.keybindings toggle-overview "['Super_R']"
Mangan answered 1/12, 2022 at 13:39 Comment(0)
R
0

I think this doesn't work if the key is configured to be a string type rather than an array of strings:

$ gsettings range org.gnome.settings-daemon.plugins.media-keys volume-up
type s
$ gsettings range org.gnome.settings-daemon.plugins.media-keys custom-keybindings
type as

But that custom-keybindings array can do the trick!

You can get to it in the keyboard shortcuts UI and set another key to turn the volume up with a command like amixer -D pulse sset Master 5000+.

Note that this would be easier if I could use a percent sign, but that doesn't work for some reason, and you instead have to use a big number like 5000. Experiment with it.

(I suspect you can do this with gsettings, but I'm not sure how.)

Rondel answered 21/2, 2020 at 14:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.