I have been using Linux on and off from the first shipped CDs from Ubuntu. Nowadays I mainly use OS X, because my employer provides us with MacBooks I can use in private and I like the UNIX base and I do not have to tinker to get things to work.
I just set up an old Thinkpad for my kids to start their digital journey with Linux Mint and am considering switching my private stuff to a separate computer.
What I really love about OS X is the consistent usage of alt and the command keys. It basically follows the concept: „you want to do something, press Command + …“ and „you want an alternative character? Press alt + …“.
My experience is that Linux key usage was inspired by Windows at first and Windows did not have a Command key.
Would it be hard to get the same behavior as on OS X with a Linux system?
If it helps, the Windows/Linux logic is basically:
- Ctrl key for triggering actions within an application.
- Alt key for navigating the UI of an application via the keyboard.
- Meta/Super/Windows key for triggering actions outside of applications (on the OS level).
Well, and Ctrl, Alt, Shift also serve for alternative characters when you’re typing. And some application or OS shortcuts wildly combine modifiers for more complex keybindings. And of course, some applications just didn’t get the note of how this generally works. I won’t claim, it really follows rules, but yeah, it’s not generally complete chaos either.
I use Toshy https://github.com/RedBearAK/toshy
There’s some small issues with the alt key behaviour in some applications (and workarounds for that), but other than that it works really well for my OS X configured brain.
There are several readily available key modifiers in Linux: Meta, Super and ISO-Level3-Shift. You can map them to keys and use them for various purposes.
What I do is map Meta to the left Windows key, Super to the right Windows key, and ISO-Level3-Shift to AltGr (that one might already be default). You can then use Super and Meta as modifiers to trigger all kinds of actions, like Super+T to open a terminal, Super+F to toggle fullscreen mode for current window, Super+Space to toggle music playback etc.
ISO-Level3-Shift will create diacritics when combined with normal keys, provided you choose the correct keyboard layout. This is useful for being able to type correctly in languages that use diacritics, but to also allow you to use a generic US keyboard so you can do programming for example.
To make these mappings you have to edit or create a file called
.Xmodmap
in your home dir. To bind a keycode to a physical key you say something likekeycode 134 = Super_R
, where 134 is a physical key code that you get from the toolxev
and Super_R is the code for what you want it to do. Also, to make Super_R a modifier you have to sayclear Mod4
andadd Mod4 = Super_R
. Most desktop environment will import.Xmodmap
automatically on startup but if they don’t you can runxmodmap ~/.Xmodmap
.Once you got Super acting like a modifier and bind it to the key you want your desktop environment settings will probably let you define custom shortcuts for anything you want. Please note that there’s usually two different places for such shortcuts, one for generic shortcuts (for launching apps), usually in the keyboard section of preferences, and one where you can tie shortcuts to window functions (like minimize/maximize), usually found in the window section of preferences. Also in the window preferences you can do some cool stuff like use one of these modifiers to drag or resize windows.
Also see if your keyboard preferences let you pick a “compose key”. The Pause key is usually used for this, because it’s not useful for anything else on a graphical desktop. The compose key lets you create diacritics in an “intuitive” way, by combining two keys. If you press Pause then
o
theno
you get°
. Pause then1
then2
gives you½
. Pause thena
then"
gives youä
. You get the idea.Yes, it is definitely possible. How it is achieved largely depends on the desktop environment pr window manager you use.
I use the meta key largely for things related to windows and workspaces. I use the capslock key as the compose key. And, the right alt key for alternative characters. Additionally, there is Ibus for typing a variety of scripts and languages.
If I remember correctly, you can define the modifier key in KDE. Not sure though, you might have to test it out.
That would be the fastest way. Apart from that, it’s very much possible by binding every possible action to different keypresses. That would be long and stenuous.
I think, what you’re describing used to be a thing, but there’s now a somewhat different, more granular way of rebinding keybindings:
However, it should be said that these will only apply within KDE applications. If you’re using third-party stuff, like Firefox, GIMP, VLC etc., they won’t apply.
If you really want to go hard on rebinding all kinds of keys for any application, you can also do things like these:
As cool as both of these are, and as much as I would still generally recommend picking KDE for these kind of customization possibilities, I wouldn’t recommend overdoing either. You won’t be able to use other PCs anymore…
I actually went through and customized all the Plasma keybindings to be more like Mac a couple days ago. It works pretty well, but yeah unfortunately only in KDE applications. And there’s still some stuff you can’t change such as the “extend selection to start/end of word” shortcuts always being set to ctrl+shift+left/right even if you set the “move to start/end of word” keys to option+left/right.