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

0

6 Answers 6

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.

7
  • 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 May 23, 2012 at 15:03
  • 1
    Worked for me on Ubuntu 13.04
    – ehsanj
    May 17, 2013 at 14:22
  • This script shows <Alt>F2 but it doesn't show <Alt>F1. Jan 20, 2015 at 4:43
  • 1
    On 16.04 this is not enough. Solution by @andersoyvind works ok. Oct 17, 2017 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, 2022 at 12:46
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
4
  • 1
    After using johanmynhard's method, this one did the trick.
    – nana
    Sep 10, 2013 at 11:02
  • This worked for me
    – kza
    Dec 3, 2014 at 15:21
  • 3
    Works for Ubuntu 16.04 Dec 2, 2016 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, 2017 at 2:05
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...

4
  • 1
    Please edit their answer to fix the that.
    – fosslinux
    Aug 2, 2016 at 3:14
  • Disabling of ALT + F2 not working in Ubuntu 20.04.1 LTS.
    – vmemmap
    Jan 20, 2021 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. Jan 20, 2021 at 16:42
  • Also begin-move for Alt+F7
    – Alexander
    May 11, 2021 at 14:20
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 ''
0
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 "[]"
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .