Toshy v23.06: Mac-like per-app keyboard shortcuts. Now supports Wayland+KDE

I was going to put this in Announcement, but apparently my account is too new or something. The button is grayed out. So I’ll post it here and see if anyone is interested.

I made a project based on Kinto.sh by Ben Reaves (GitHub - rbreaves/kinto: Mac-style shortcut keys for Linux & Windows.), but converted it to using keyszer as the keymapper (instead of xkeysnail) and added a bunch of new features, and the ability to automatically adapt to being run on a number of different desktop environments without needing to mess with the config.

Most importantly, I managed to make the keymapper compatible with KDE on Wayland, not just X11/Xorg. It also works with Wayland+GNOME (which requires a compatible shell extension). And if you’re still on X11/Xorg it still works there, with lots of different desktop environments, including KDE. It is NOT compatible yet with any other desktop environment or window manager running on a Wayland session, besides KDE or GNOME. Special tricks specific to those DEs were required to make it work.

Toshy will install on several different distro types, and minor variants thereof. I’ve tested it now on Arches, Debians/Ubuntus, RHEL clones, and openSUSE Tumbleweed, with KDE as one of the desktops on each. The installer will show you a list of “known” distro names and let you try to override the detected distro name with one from the list, if your distro is unknown to the installer. Use --help on the installer for more on that.

The point of Toshy (and Kinto, from which the base config originated) is to allow the use of macOS-style keyboard shortcuts in a large selection of Linux applications. Ideally, you should be able to plop down a MacBook and a PC laptop running Linux and Toshy next to each other, and at some point start to lose track of which is the real Mac, at least based on how the keyboard shortcuts are reacting. (Getting your Linux DE to look like macOS is up to you, and completely optional. :face_with_monocle: )

There are basic remaps of modifiers that are meant to allow the same physical key locations to be used whether you have Apple, Windows, IBM or Chromebook keyboards, and the general system-wide common keyboard shortcuts like cut/copy/paste will work in all applications. But on top of that are many different keymaps in the config specific to groups of applications (like terminals, or file managers) and also keymaps specific to individual apps, like VSCode.

I can only take credit for the keymaps dealing with Linux file managers, which I contributed to Kinto some time ago, and have kept integrated in the Toshy default config. I called them the “Finder Mods” because they modify several common Linux graphical file managers to behave like the Finder.

Oh, and I kind of implemented the Option and Shift-Option special characters for the whole keyboard (like “é å µ Ü ∆ ¶ § ©” and so on). For two different macOS keyboard layouts.

So, anyone who would like to use Mac-style keyboard shortcuts on Linux, particularly if you are on Wayland+KDE, is welcome to try Toshy, and report all the issues you will no doubt have on the GitHub repo. You can get there with this easy-to-remember URL:

(https://toshy.app)

Which as of now will just redirect you to the GitHub repo:

(GitHub - RedBearAK/toshy: Keymapper config to make Linux work like a 'Tosh!)

The main thing to look out for is that Toshy tries to automatically decide your keyboard type, and this is not always going to succeed due to limited information available from the device name. So you may need to find the name of your keyboard device and place it in a custom list/dictionary in the config file to make it remap the modifiers to the right locations. At the moment there is no way to force Toshy to treat all devices as a specific type, because one of the design goals was the ability to mix and match different types of keyboards at the same time. Which has been working for me in testing.

The CLI command toshy-devices will be available after installing, to show the device names, and if the remapping is working correctly there will also be a specific shortcut that will show a pop-up dialog with the keyboard device name: Shift+Opt+Cmd+I,I (The ‘I’ key must be quickly double-tapped while holding the modifiers to invoke the pop-up.)

I look forward to the inevitable flood of issue reports as real-world usage exposes problems I’ve never even imagined during testing. Here’s hoping they will be mostly minor issues that can be dealt with after reading the FAQ section of the README. Please do attempt to read the README if you have questions or issues.

:crossed_fingers: :crossed_fingers: :crossed_fingers:

5 Likes

FYI for anyone still clicking on this post in 2024, Toshy was updated to support KDE 6 already, and there have been a lot of other little changes since this was originally posted.

2 Likes

Also, and this is completely optional, if you add the the --fancy-pants flag to the installer command, on KDE the installer will take the extra step of setting up a KWin script that makes Alt+Tab task switching group all windows of the same “application”, so that task switching works much more like macOS or GNOME’s default “Switch applications”, instead of switching between all individual windows separately, even if they are related.

This KWin script to group application windows has also been ported to be simultaneously compatible with Plasma 5 and 6 APIs. Should be ready for the stable Plasma 6 release.