Skip to content

General improvements over Kinto

RedBearAK edited this page Apr 23, 2024 · 1 revision

Toshy was created after modifying Kinto way too much to integrate the changes back into Kinto easily. Here's a list of things Toshy does differently (maybe better, maybe not) than the Kinto project that it split away from.

  1. Multi-environment support: Moving between different desktop environments and session types (X11/Xorg or Wayland) on the same machine is MUCH easier, due to the use of an "environment" module that feeds information to the config file about what type of environment it is starting up in. This allows some dynamic remaps specific to each type of Linux desktop environment, and without re-running the installer process (at least that is the goal). It also prompts the keymapper to use the correct method to get the window context information for the environment. The keymapper will also prompt the user in verbose logging output if the environment is NOT compatible yet. So if you are like me and enjoy spending time experimenting with different session types and different desktop environments on the same Linux system, Toshy will work much better for that, and will improve over time.

  2. Multi-user support: I believe some changes I've made will facilitate proper multi-user support on the same system. Even in the case of the user invoking a "Switch User" feature in their desktop environment, where the first user's desktop is still running in the background while another user is logged into their own desktop and using the screen (and physical keyboard). This is a very convenient feature even if you aren't actually sharing your computer with another person. There are many reasons why you might want to log into a different user's desktop to test something. Currently this absolutely requires systemd and loginctl.

  3. Python virtual environment. Many distros are taking the advice of Python maintainers and moving to a "managed" Python environment that tries to prevent users from breaking system services that rely on the system-level Python library. Many users are annoyed by this and just use the --break-system-packages option with pip to install Python packages like they've been doing for a long time, but the proper solution to these managed environments is to set up your own Python virtual environment where you can install any Python packages you want without risking damage to the system Python libraries. Toshy sets up a venv during install, so it has no issue installing on distros with managed Python environments.

  4. No modifying sudoers: Certain Linux distros, outside the most popular group of Ubuntu-based, Debian-based, Arch-based and Red Hat/Fedora-related distros, really did not like the way the Kinto installer messes with the sudoers file. The Kinto installer does this to provide the user easier access to certain commands used to control the xkeysnail service. Some of these Linux distros would get b0rked quite badly if you ran the Kinto installer on them. A couple I ran into that had this problem were antiX and Gentoo. Strangely, the close relative of antiX, the very popular MX Linux, did not have the same problem with Kinto that antiX had. The Toshy installer does nothing with sudoers and uses "user" systemd services, or a manual script, and sets up udev rules so that the user doesn't need to run anything with sudo to make the keymapping work. I've already tested Toshy successfully on antiX. Still looking for a user-friendly Gentoo ISO to use for testing, but I have no reason to believe it won't work just as well, once I figure out the native packages needed.

  5. A start on Wayland support. Wayland support is probably always going to be limited, since each different compositor needs a different method to access the focused app window info (class and title/name). To see what is currently working, go to this section of the README.

  6. The Option-key special characters, as described in the README (or I might move that to a Wiki entry too). Two different layouts are available. Or it can be completely disabled.

  7. Automatic categorizing of the keyboard type of the current keyboard device. No more switching of keyboard types from the tray icon menu, or re-running the installer, or being asked to press a certain key on the keyboard during install. Some keyboard devices will need to be added to a Python list in the config to be recognized as the correct type. This will evolve over time from user feedback.

  8. Changing of some settings on-the-fly, without restarting the keymapper process. The tray icon menu and GUI preferences app will allow quickly enabling or disabling certain features, or changing/disabling the special characters layout. The change takes effect right away. (Adding or changing shortcuts in the config file will still require restarting the keymapper, which I've tried to make as easy as possible.)

  9. Modmaps with xwaykeyz (forked from keyszer, which was forked from xkeysnail) are concurrent/cascading rather than mutually exclusive. This enables some of the interesting fixes described in the following items.

  10. Fix for "media" functions on arrow keys. Some laptop keyboards don't have the usual PgUp/PgDn/Home/End navigation functions on the arrow keys, when you hold the Fn key. Instead, they have PlayPause/Stop/Back/Forward, media functions. If you are used to using an Apple portable, this is weird. A modmap in the Toshy config will optionally fix this, making the arrow keys work more like a standard MacBook keyboard. This feature can be enabled from the tray icon or GUI preferences app. It's not enabled by default.

  11. GTK 3 NumPad Fix: This one is starting to become less relevant, with most common GTK apps already moving to GTK 4. But apps that use GTK 3 had a really annoying bug where they wouldn't recognize the "navigation" functions on the keypad keys (what the keypad keys do when NumLock is off) if you tried to use them with a modifier key (i.e., as part of a shortcut). Those key combos would just get ignored. So if you didn't have the equivalent "real" navigation keys anywhere on your keyboard, there was no way to use shortcuts involving things like PgUp/PgDn/Home/End (on the numeric keypad). A modmap in the Toshy config will automatically fix this, if NumLock is off and the "Forced Numpad" feature (below) is disabled.

  12. "Forced Numpad" feature: On PCs, if the keyboard has a numeric keypad, NumLock is typically off, so the keypad doesn't automatically act as a Numpad, instead providing navigation functions until you turn NumLock on. But if you've used macOS for any length of time, you might have noticed that the numeric keypad is always a numeric keypad, and the "Clear" key sends Escape to clear calculator apps. You have to use Fn+Clear to disable NumLock and get to the navigation functions. A modmap in the Toshy config is enabled by default and makes the numeric keypad always a numeric keypad, and turns the NumLock key into a "Clear" key. This can be disabled in the tray icon menu or GUI preferences app, or temporarily disabled with Fn+Clear (on Apple keyboards) or the equivalent of Option+NumLock on PC keyboards (usually this is physical Win+NumLock).

  13. ASCII art section headers: Sections of the config file are labeled with ASCII art designed to be readable on a "minimap" or "overview" sidebar view found in many text editors and code editors, to make finding certain parts of the config file a little easier. There's also a "tag" on each section that can be located easily with a Find search in any text editor.

  14. Enter key to Rename: A custom function makes the Enter key behave pretty much like it does in the Finder, in most Linux file managers. Mainly what this enables is using the Enter key to quickly rename files/folders, while still leaving it usable in text fields like Find and the location bar. Not perfect, but works OK in most cases. [NOTE: If you've never actually used the keyboard to "open" or "run" files/applications from the Finder, you may not realize that the keyboard shortcut for this is just the same keyboard shortcut for opening (or, "drilling down") into folders. It's Cmd+Down arrow. The Enter key has never "opened" things in the Finder in the history of macOS, as far as I know, unlike the way the Enter key has always been used in Windows and Linux file managers.]

  15. Cmd+W Fixes: The config contains an evolving fix for the problem of Cmd+W unexpectedly failing to close a lot of Linux "child" windows and "dialog" windows (that have no binding to Ctrl+W and want either Escape or Alt+F4/Ctrl+Q to close). This can lead to a bad unconscious habit of hitting Cmd+W followed immediately by Cmd+Q (which becomes a problem when you're actually using macOS). The list of windows targeted by this pair of keymaps will grow over time, with input from users encountering the issue of Cmd+W unexpectedly failing to close a window.

  16. File Save/Open Dialogs: A partial fix for shortcut behavior in file save/open dialogs in apps like Firefox, now that WM_NAME (window name/title) is available. This is an addition to the "Finder Mods" that I contributed to Kinto, which are intended to mimic Finder keyboard behavior in most common Linux file manager apps.

  17. Tab Nav Fixes: A collection of tab navigation fixes for various apps with a tabbed UI that don't use the mostly standard Ctrl+PgUp/PgDn shortcuts. The goal is to allow Shift+Cmd+Braces (the left/right square bracket keys) to perform tab navigation in as many Linux applications (with tabbed UIs) as possible, as it does in most Mac applications with a tabbed UI (Finder, web browsers, and so on). Let me know if you use a Linux app where Shift+Cmd+Braces shortcuts are not working for tab navigation while Toshy is enabled. Use xprop WM_CLASS _NET_WM_NAME to obtain the window attributes for matching (if you use X11/Xorg).

  18. Another growing collection of enhancements to various Linux apps to enable shortcuts like Cmd+comma (preferences) and Cmd+I (get info/properties) to work in more apps.

  19. A custom function (matchProps) in the config enables very powerful and complex (or simple) matching on multiple properties at the same time. Application class, window name/title, device name, NumLock and CapsLock LED state can all be combined in any way, and lists can be made of specific combinations of one or more of those properties to match on. This custom function was also crucial in enabling the next item, a fix for using Toshy with Synergy.

  20. Synergy Fix: Support for watching the Synergy log file to automatically disable remapping of keys when the focus is on the screen showing the remote system. Synergy still has the unfortunate problem that it presents no app class or window title, so there was previously no simple way to stop remapping keys in the same way that is done for other remote desktop types of apps. Synergy logs when the cursor and keyboard focus leaves and returns, so watching the log file seems to be a workable solution.

  21. I'll add more if I come up with anything...