23

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'.

1
28

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.

5
  • 4
    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 – ehsanullahjan May 17 '13 at 14:22
  • This script shows <Alt>F2 but it doesn't show <Alt>F1. – Dean Schulze Jan 20 '15 at 4: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 8 '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
21

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
6
  • 1
    After using johanmynhard's method, this one did the trick. – nana Sep 10 '13 at 11:02
  • This worked for me – kza Dec 3 '14 at 15:21
  • 3
    Works for Ubuntu 16.04 – Timofey Gorshkov Dec 2 '16 at 10:37
  • 2
    It's worth noting that the "Unity Plugin" is in the desktop section of the CCSM utility. (true as of 8/2017) – Ryan J Aug 10 '17 at 2:05
  • Would it still work in later versions of Ubuntu, e.g. Ubuntu 19.10 (Eoan Ermine)? – Peter Mortensen Apr 1 '20 at 13:58
3

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...

3
  • 1
    Please edit their answer to fix the that. – fosslinux Aug 2 '16 at 3:14
  • Disabling of ALT + F2 not working in Ubuntu 20.04.1 LTS. – Roi Jan 20 at 13:04
  • @r0ei I tested on my 20.04.1 LTS install and it worked. You may have typed the command improperly or there is some extension you installed that ignores that gnome settings. – Alexis Wilke Jan 20 at 16:42
1

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
  • What is it supposed to do? F1 and F2 are not explicitly included. In other words, what will be changed by running this command? Will it disable more than the two keyboard shortcuts? – Peter Mortensen Mar 30 '20 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.