How to make keyboard work like OSX System Wide?

I switch back and forth between two computers constantly:

  • OSX Snow Leopard
  • Ubuntu 10.10

I'd like to be able to make Ubuntu use the same keyboard shortcuts as OSX System Wide, for the following keyboard sequences only (ie I don't want to make Ctrl act like Super)

  • Super+C -> Copy

  • Super+V -> Paste

  • Super+T -> Open a new tab in whatever browser I'm in.

  • Super+W -> Close a tab in whatever browser I'm in.

So in short, is there anyway for me to map just these keyboard sequences to the following, system wide ?

  • Super+C -> Ctrl+C
  • Super+V -> Ctrl+V
  • Super+T -> Ctrl+T
  • Super+W -> Ctrl+W

I know there are ways for me to do this for vim, and Firefox, and I'm sure specifically for most applications... but I would prefer to have to do this just once and have it work that way system wide!

I'm using a standard PC keyboard, that is "Generic 105 key (intl) PC" on Ubuntu. I'm also using the same keyboard on my Mac mini.


Solution 1:

If you install the xautomation package, you can add a command in System/Preferences/Keyboard Shortcuts/Custom like:

xte "keyup Meta_L" "keyup c" "keydown Control_L" "key c" "keyup Control_L"

and map that to Meta-C.


Alternative Solution:

Install AutoKey (apt-get install autokey-gtk) and set a phrase to:

Phrase Text: <ctrl>+C (actually type out the <ctrl>+ here)
Paste Using: Keyboard
Abbreviation: None
Hotkey: <super>+v
Window Filter: None

Solution 2:

Since Ubuntu 14 you can use GNOME Tweaks:

sudo apt install gnome-tweaks # formerly gnome-tweak-tool

Then, look for Tweak Tool > Keyboard & Mouse > Additional Layout Options > Alt/Win key behavior.

And check: Ctrl is mapped to Win keys and usual Ctrl keys.

screenshot

Solution 3:

There is a way to map Ctrl to Win/Super key:

  1. go to system->preferences->keyboard,

  2. open tab Layouts,

  3. click Options...,

  4. open Alt/Win key behavior,

  5. and select Control is mapped to Win keys

And for console there is a forum post how to do that here.

For more digging check general Linux keyboard HOWTO here.

regards

Solution 4:

Some of the above solutions are old and not working with Ubuntu 18.04. Here is an updated answer

  1. Install gnome-tweaks if not installed in the system

    sudo apt-get install gnome-tweaks

  2. Open the list of applications by pressing Show Applications on at the left bottom.

  3. Note that this will only change the behavior of WINDOWS key to CMD key and keeps CTRL key as same as before (you will have 2 CTRL keys). If you don't like this, skip step 4 and go to step 5

  4. Look for Tweaks application --> Keyboard and Mouse --> Additional Layout options --> Alt/Win behavior --> Select Control is mapped to Win keys and the usual Ctrl Keys.

  5. Skip this step if you completed step 4. This step will swap Windows key Behaviour to Ctrl and vice versa. Look for Tweaks application --> Keyboard and Mouse --> Additional Layout options --> Ctrl Position --> Select Swap Left Win with Left Ctrl

  6. One more thing I miss from macOS is the ability to switch windows with CMD+Tab (In this case Windows+Tab). To achieve this go to Settings --> Keyboard --> Look for Switch Windows under navigation section --> Double Click it and press Windows+Tab when pop up appears