I want to remap my workspace switcher shortcut to a single key, specifically the Page Up/Page Down keys for going to the top/bottom workspace. But Ubuntu will not let me do this using System settings > Keyboard > Shortcuts, giving the following warning:

The shortcut "Page up" cannot be used because it will become impossible to type using this key. Please try with a key such as Control, Alt or Shift at the same time.

Is there any other way to remap shortcuts to a single key? Help is appreciated!


This is actually quite easy using the xbindkeys Install xbindkeys and the xdotool Install xdotool packages. xdotool lets you emulate key presses, and xbindkeys lets you add custom shortcuts.

All the following steps are run in a terminal.

First we will kill the process

killall xbindkeys

Now we put our custom shortcuts in the ~/.xbindkeysrc file

gedit ~/.xbindkeysrc

and we put in the following lines

"xdotool keyup Next && xdotool key ctrl+alt+Down"

"xdotool keyup Prior && xdotool key ctrl+alt+Up"

save and close, and start xbindkeys again by running


It should now work like you wanted, enjoy!

Explanation: Now what does it actually do? Say, you press Page Up, your computer recognizes this as the Prior key (you can check this using xev | grep key and pressing keys). Now before we simulate other keypresses, we should emulate a key release first, that's what the xdotool keyup Prior is for. If it is released successfully then we send the Ctrl+Alt+Up combination and this is what xdotool key ctrl+alt+Up is for.

  • I recommend using touch .xbindkeysrc && xbindkeys -f .xbindkeysrc to create the config file so you don't get any of xbindkeys default bindings. – Seth Feb 1 '13 at 0:32
  • @Seth Thanks nice suggestion, updated the answer. You don't need the -f .xbindkeysrc though, since it is the default. – Gerhard Burger Feb 1 '13 at 10:28

It is possible to remap any navigation command in GNOME and Unity directly with dconf or via command line using gsettings. For PageUp/PageDown moving workspace up/down you could do:

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "['Page_Up']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "['Page_Down']"

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.