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?

  • lemmyvore@feddit.nl
    link
    fedilink
    English
    arrow-up
    3
    ·
    11 months ago

    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 like keycode 134 = Super_R, where 134 is a physical key code that you get from the tool xev and Super_R is the code for what you want it to do. Also, to make Super_R a modifier you have to say clear Mod4 and add Mod4 = Super_R. Most desktop environment will import .Xmodmap automatically on startup but if they don’t you can run xmodmap ~/.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 then o you get °. Pause then 1 then 2 gives you ½. Pause then a then " gives you ä. You get the idea.