1. Overview

In Linux, certain keyboard shortcuts sometimes conflict with other system functions or applications. Consequently, this situation can lead to unintended errors or operations. To avoid this, we might want to disable the keybindings associated with the shortcuts to prevent accidental actions and promote ease of use across the system.

In this tutorial, we’ll check out different methods for disabling specific GNOME shortcuts in Linux using the gsettings command, System Settings, and the dconf Editor.

Notably, the examples involve disabling the screenshot shortcut on a Ubuntu 22.04 GNOME desktop.

2. Using the gsettings Command

gsettings is a command-line tool mainly used for configuring different values in the dconf database. Moreover, we can use it to disable specific keyboard shortcuts in a GNOME desktop.

Before doing so, let’s run the gsettings command to get a list of all keybindings in a schema:

$ gsettings list-keys org.gnome.shell.keybindings 
focus-active-notification
open-application-menu
screenshot
screenshot-window
shift-overview-down
shift-overview-up
show-screen-recording-ui
show-screenshot-ui
....

In the above command, we passed the list-keys option to gsettings to display all keys of the org.gnome.shell.keybindings schema.

Now, let’s run the gsettings command to retrieve the keybinding specifically associated with taking a screenshot on our system:

$ gsettings get org.gnome.shell.keybindings screenshot

The above command displays <Shift>Print or Shift+Print as the current screenshot shortcut value:

Viewing Current Screenshot Shortcut Using gsettings Command

Now, let’s use the gsettings command to disable the screenshot keybinding:

$ gsettings set org.gnome.shell.keybindings screenshot '["disabled"]'

Here, we set the value of screenshot keybinding as disabled to disable its shortcut:

Disabling Screenshot Shortcut Using gsettings Command

As a result, we see that pressing Shift+Print no longer triggers the system to take a screenshot.

Similarly, we can check and change other key bindings.

3. Using System Settings

System Settings offers a more user-friendly and intuitive interface to customize several aspects of a GNOME desktop. Additionally, we can use it to disable shortcut keybindings on the system.

To do so, we bring up the Activities menu, type Settings, and open it:

Opening Settings Through Activities Menu

Then, we go to the Keyboard settings from the left-side panel, and click on View and Customise Shortcuts option, under the Keyboard Shortcuts section:

Viewing Customise Keyboard Shortcuts in Linux

Next, we scroll down to find the Screenshots option and click it:

Viewing Screenshot Shortcut in Linux

After that, we click on the Take a screenshot option with the current value as Shift+Print:

Viewing Shortcut for Taking a Screenshot in Linux

Then, we hit the Backspace key to delete the current screenshot shortcut:

Pressing Backspace Key to Remove Shortcut in Linux

After that, we click on the Set button to apply the added changes:

Disabling Screenshot Shortcut in Linux

Now, we see Disabled in front of the Take a screenshot shortcut:

Viewing Disabled Screenshot Shortcut in Linux

Thus, we can see that the GNOME screenshot shortcut is now disabled.

Similarly, we can work with other entries in the list to change or disable them.

4. Using the dconf Editor

In a GNOME desktop environment, dconf Editor is primarily used to directly modify the values of the dconf configuration database.

Similar to other approaches, we can utilize dconf to disable particular shortcuts on the system.

To do so, first, we install the dconf Editor on the system:

$ sudo apt install dconf-editor

After a successful installation, we switch to the Activities menu, type dconf Editor, and open the application:

Opening dconf Editor Through Activities Menu

Then, we navigate to the /org/gnome/shell/keybindings/ path, and click on the screenshot option:

Moving to Screenshot Keybinding in dconf Editor

After that, we disable the Use default value toggle, set ‘[disabled]’ as the Custom value, and click Apply:

Disabling Screenshot Shortcut Through dconf Editor

Thus, the changes reflect the current screenshot shortcut value.

5. Conclusion

In this article, we learned different methods for disabling specific shortcuts in a GNOME desktop. These methods included using the gsettings command, System Settings, and the dconf Editor.

We can use the System Settings to quickly navigate and select the required shortcut that we want to disable. Meanwhile, the gsettings command is used to set the dconf database value of a certain shortcut. Furthermore, the dconf Editor also enables us to perform the same operation through a user-friendly interface.

Ultimately, we can select any of these approaches as per our preferences.

Comments are open for 30 days after publishing a post. For any issues past this date, use the Contact form on the site.