27

I can assign Alt + F1 and Alt + F2 to any function I like in the keyboard configuration window, but it's not being used.

Alt + F1 is always 'dash home' and Alt + F2 is always 'run'.

remco hosman
  • 271
  • 1
  • 3
  • 3

6 Answers6

30

I sat with the same issue after upgrading to Ubuntu 12.04 (Precise Pangolin) and installing GNOME Shell. I tried to disable Alt + F1 from wherever I could, to no avail.

As I was about to give up, I found this gist: https://gist.github.com/2402448

gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "[]" # disable Alt+F1

Credits go to Jan Musinsky.

  • 6
    Indeed works for Alt-F1. I found the following way to list built-in keybindings: for k in \gsettings list-keys org.gnome.desktop.wm.keybindings`; do echo $k = `gsettings get org.gnome.desktop.wm.keybindings $k`; done` – Jesse Glick May 23 '12 at 15:03
  • 1
    Worked for me on Ubuntu 13.04 – ehsanj May 17 '13 at 14:22
  • This script shows F2 but it doesn't show F1. – Dean Schulze Jan 20 '15 at 04:43
  • gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "[]" will clear Super+S also, which is default in Ubuntu 14.04, so be careful. – skyreua Jul 08 '16 at 10:14
  • 1
    On 16.04 this is not enough. Solution by @andersoyvind works ok. – Vladislav Rastrusny Oct 17 '17 at 12:10
  • 1
    For <Alt>F2 it seems to be set in org.gnome.desktop.wm.keywindings panel-run-dialog in Ubuntu 20.04, and maybe later versions too. – miyalys Jan 18 '22 at 12:46
  • For GNOME Shell 41.4 (gnome-shell --version) clearing panel-main-menu no longer works, but this works:

    gsettings set org.gnome.shell.extensions.apps-menu apps-menu-toggle-menu "[]" # disable Alt+F1

    – Kluyg May 12 '22 at 19:11
22

With the Ubuntu Unity plugin installed, the musinsky gist snippet in the terminal wasn't enough.

Disable it using CompizConfig Settings Manager:

sudo apt-get install compizconfig-settings-manager
sudo apt-get install compiz-plugins-extra
ccsm

In section "Desktop" (third item on the left), click on "Ubuntu Unity Plugin". In tab "General" (the default), click the edit pencil for "Key to execute a command" (the fourth item), blank out (delete) the content, and press OK.

General tab

  • Key to show the HUD - disable
  • Key to execute a command - disable

Launcher tab

  • Key to give keyboard focus to Launcher - disable
andersoyvind
  • 461
  • 3
  • 5
6

Although johanmynhardt gave us the right answer for the Alt + F1, he did not tell us what it was for Alt + F2. With the for loop as shown by Jesse Glick in a comment, I figured out the Alt + F2 command. Like this to remove both keys:

gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "[]" # Disable Alt + F1
gsettings set org.gnome.desktop.wm.keybindings panel-run-dialog "[]" # Disable Alt + F2

The way to find the valid keys (panel-main-menu an panel-run-dialog in the above examples) is to use the list-keys command line option of gsettings. Be ready to get a pretty long list.

The following are all the system defined keybindings for 20.04:

switch-group
begin-resize
switch-to-workspace-7
begin-move
move-to-side-w
move-to-corner-nw
move-to-workspace-10
move-to-workspace-6
move-to-workspace-right
always-on-top
toggle-maximized
move-to-workspace-left
switch-to-workspace-8
cycle-panels
move-to-workspace-11
lower
move-to-workspace-7
toggle-above
move-to-workspace-down
switch-panels
minimize
cycle-windows
switch-to-workspace-9
move-to-workspace-12
toggle-on-all-workspaces
switch-input-source
move-to-workspace-8
move-to-side-n
maximize-horizontally
activate-window-menu
set-spew-mark
switch-windows-backward
maximize-vertically
move-to-corner-sw
move-to-workspace-9
maximize
panel-main-menu
close
move-to-monitor-up
raise-or-lower
move-to-side-e
cycle-windows-backward
switch-to-workspace-1
move-to-monitor-right
switch-windows
panel-run-dialog
switch-panels-backward
unmaximize
switch-to-workspace-2
switch-applications
switch-to-workspace-last
move-to-workspace-1
move-to-corner-ne
switch-to-workspace-3
switch-to-workspace-up
move-to-side-s
show-desktop
move-to-center
move-to-workspace-2
switch-to-workspace-left
switch-to-workspace-right
raise
move-to-corner-se
switch-to-workspace-10
switch-to-workspace-4
toggle-shaded
cycle-group-backward
move-to-workspace-3
switch-to-workspace-down
cycle-panels-backward
move-to-monitor-left
switch-applications-backward
switch-to-workspace-11
switch-input-source-backward
switch-to-workspace-5
move-to-workspace-4
move-to-monitor-down
toggle-fullscreen
switch-to-workspace-6
switch-to-workspace-12
cycle-group
move-to-workspace-up
move-to-workspace-last
switch-group-backward
move-to-workspace-5

I still see a panel-run-dialog entry, I tested on my install and it worked as expected. After I ran the set command shown above, the Alt + F2 stopped working...

Alexis Wilke
  • 2,707
2

On Ubuntu 16.04 you can do it using the following command:

gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ keyboard-focus ''
1

Instead of using gsettings, we can use UI: dconf-editor screenshot

The shortcuts are stored in /org/gnome/desktop/wm/keybindings/ path

Note how for /org/gnome/desktop/wm/keybindings/panel-main-menu it says

DEPRECATED: This key is deprecated and ignored.

Indeed clearing Alt+F1 using either gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "[]" or by editing /org/gnome/desktop/wm/keybindings/panel-main-menu in dconf-editor no longer works.

The setting now lives in /org/gnome/shell/extensions/apps-menu/apps-menu-toggle-menu in dconf-editor, changing it there to [] fixed it for me: screenshot

Or you can disable it using gsettings:

gsettings set org.gnome.shell.extensions.apps-menu apps-menu-toggle-menu "[]"
Kluyg
  • 111
0

To disable Alt+F2:

  1. Press Alt + F2

  2. Type: gsettings set org.gnome.desktop.wm.keybindings panel-run-dialog "[]"

enter image description here

bruno
  • 105