5

Hi so I recently got rid of my MacOS since it was a bit broken and switched to Ubuntu. Love Ubuntu so far but I've struggled to figure out how to make my keyboard act like my old keyboard, my keyboard layout is:

my keyboard layout

I want to also make it so that to change brightness for instance I have to press the function key before the f keys (like fn+f1, fn+f2) and also to do command c and command v instead of pressing ctrl. I did see a few ways in doing this but the solutions I found weren't for the exact keyboard that I have and were slightly different and wouldn't work as intended. Generally I just want my keyboard to act like a macbook keyboard. Thanks in advance.

Still looking for a solution!

Bomsea
  • 53

2 Answers2

4

The general idea about remapping keyboard layout by ready-made clothing. Luckily, Macs have a set of layouts.

sudo dpkg-reconfigure keyboard-configuration

Then you see the Macbook Pro layout, select it and determine whether the mod keys like fn+F1 works as you expected, if not, use the following methods to get what you want.

xev

This command tells you when the key or mouse button was pressed or released. Take a note of the number and identify what code is set to the key.

I will omit the brightness shortcut issue and give the link already tells better than my description, see How to change the shortcut to adjust brightness?
also Macbook Pro backlight control not working on Ubuntu 16.04

To swap the Control key and the Super(Command) key:

sudo apt install gnome-tweak-tool

Open tweak tool and Swap ctrl and super

Then your command (super_L) key is working as control_L thus you can copy and paste with the Mac-like shortcut in real keyboard, but please remember the key is no longer a super_L key, when the instruction is given e.g. use control + any key, you have to remind control key is on the left command key. Enjoy your day!

  • Hi, thanks for the reply. I tried to do this after seeing your response and tried with multiple layouts under Macbook/Macbook Pro but when i do 'xev' there is no detected input for Fn so it doesn't show that i pressed it. – Bomsea Mar 13 '20 at 07:51
2

The easiest way which I found to remap the keys with mac layout was by installing the app Kinto. After the installation, you can use mac os keyboard shortcuts with command key on Linux/Windows

https://github.com/rbreaves/kinto

Installation:

git clone https://github.com/rbreaves/kinto.git
cd kinto
./setup.py

Reference: https://youtu.be/kd4al45XD1g

enter image description here

  • 1
    This seems like a much easier way to do things! Thank you – Bomsea Jun 26 '21 at 14:06
  • It works like a charm. NOTE, you might need to install gnome-shell-extentsion-appindicator and enable TrayIcon. Please follow the instruction at the end of the Kinto install script. – Hui Zheng Feb 05 '22 at 15:29