Giter Site home page Giter Site logo

rbreaves / kinto Goto Github PK

View Code? Open in Web Editor NEW
4.2K 18.0 212.0 2.58 MB

Mac-style shortcut keys for Linux & Windows.

Home Page: http://kinto.sh

License: GNU General Public License v2.0

Shell 14.85% PowerShell 0.43% AutoHotkey 23.07% Python 58.92% VBScript 1.11% Batchfile 1.63%

kinto's Introduction

Kinto.sh

kinto-color-132

GitHub release

- Mac-style shortcut keys for Linux & Windows. -

Seamless copy and paste with all apps and terminals. The zero effort solution.

v1.2 Release - Kinto now includes a system tray and simple wizard to setup the install with minimal effort.

Kinto is powered by xkeysnail for Linux & by Autohotkey for Windows 10 & 11.

Note: VNC is now experimentally supported on Linux w/ the latest releases, but you must compile & install x11vnc. More info can be found here.

Note: If you plan to remote into Linux via VNC, xRDP, Synergy or other remote desktop solutions then remove the current release & try an earlier v1.0.7-3 release. It uses xkb so it'll work with virtual xinput devices. Some v1.1-x releases may offer both, but all v1.2.x releases ended support for xkb. I do plan to bring offical support back for virtual input devices.

Donations

If you like or appreciate this project then please consider donating.

Wishlists Amazon Adafruit eBay

I have received some really great letters with donations & email. I've also posted some of them with redacted first names to kinto.sh.

Also if you would like to send me a keyboard directly then please reach out to me over twitter and send me a DM.

How to install (Linux)

Video Tutorial: Install Kinto.sh for Linux in less than a minute

Linux Requirements

Quick Install Method

Paste the following into your Terminal

/bin/bash -c "$(wget -qO- https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh || curl -fsSL https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh)"

Uninstall

/bin/bash <( wget -qO- https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh || curl -fsSL https://raw.githubusercontent.com/rbreaves/kinto/HEAD/install/linux.sh ) -r

Old Install Method

git clone https://github.com/rbreaves/kinto.git
cd kinto
sudo apt update
sudo apt install python3
./setup.py

Troubleshoot

If the wizard does not appear then either type in "kinto.sh" in your application overview search bar or run this following command.

~/.config/kinto/gui/kinto-gui.py

Issues with Numpad?

Try toggling numlock on & off (clear key on official mac keyboards). If it still does not work then restart the Kinto service and try toggling the numlock/clear key again, it will likely work after that. #369

Uninstall Kinto

./setup.py -r

Other tips

If you want a global menu app similar to what mac users have then I strongly recommend Ubuntu Budgie as it has the Vala Appmenu built in and ready for activation. Short of that Vala-AppMenu can be installed in various distros, mileage will vary. If you try to activate it in the latest 20.xx releases with XFCE then you may need to run the following commands.

sudo apt install xfce4-appmenu-plugin vala-panel-appmenu-common appmenu-gtk2-module appmenu-gtk3-module appmenu-gtk-module-common
xfconf-query -c xsettings -p /Gtk/Modules -n -t string -s "appmenu-gtk-module"

Fractional HiDPI Scaling for Gnome/Budgie w/ x11

https://github.com/rbreaves/betterScale

Use this with autorandr to save your settings as a profile that will auto re-apply when needed.

How to Install (Windows)

Video Tutorial: How to Install Kinto.sh on Windows 10

Windows 10 Requirements

Quick install

Open Powershell as Administrator and copy and paste the following. This will download & extract Kinto, install chocolatey, python3 and then install Kinto.

⚠ NOTE: Please inspect https://raw.githubusercontent.com/rbreaves/kinto/master/install/windows.ps1 and https://chocolatey.org/install.ps1 before running scripts directly. More information about running powershell scripts in this context can be found here.

Set-ExecutionPolicy Bypass -Scope Process -Force
iwr https://raw.githubusercontent.com/rbreaves/kinto/master/install/windows.ps1 -UseBasicParsing | iex

Update system tray to show Kinto icon at all times (optional)

cmd /c "explorer shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}"

Old method

  1. Open Powershell (Right click and Run as Administrator)

  2. clone this repo

git clone https://github.com/rbreaves/kinto.git
cd kinto
  1. Install - Select keyboard type
py setup.py
  1. How to make Kinto stay visible in system tray (optional)

Uninstall Kinto

py setup.py

Select Uninstall

How to use in Remote Desktop Solutions

RDP fully works as long as the entire keyboard input is being captured. RDP had been working for awhile with Windows but as of 2/14/2021 Linux & macOS is now supported. VNC & other protocols may work, but is likely most dependent on how the keyboard input is captured on the computer running the client.

Program Src/Remote Client ⇒ Dst/Remote Server Works? Notes
Official MS RDP (mstsc.exe) ❖Windows ⇒ ❖Windows ✅ Yes Note: Make sure to set all keyboard input to go to remote.
Official MS RDP (mstsc.exe) ❖Windows ⇒ 🍎macOS ✅ Yes Note: Must compile & install xrdp.
Official MS RDC from Store ❖Windows ⇒ ❖Windows ✅ Yes Note: Only when maximized, all modifier keys will not pass in otherwise.
Official MS RDC from Store ❖Windows ⇒ 🍎macOS ✅ Yes Note: Must compile & install xrdp.
RealVNC ❖Windows ⇒ 🐧Linux ✅ Yes Note: Compile & install my forked x11vnc for compatibility.
Official MS RDP (mstsc.exe) ❖Windows ⇒ 🐧Linux ✅ Yes Note: Compile & install my forked x11vnc for compatibility, then setup xrdp like normal & use xrdp 0.9.18+.
Official MS RDC from Store ❖Windows ⇒ 🐧Linux ✅ Yes Note: Compile & install my forked x11vnc for compatibility, then setup xrdp like normal & use xrdp 0.9.18+.
Official MS RDP ChromeOS 87+⇒ ❖Windows ✅ Yes May work on earlier versions as well, if they support Android apps
Remmina 🐧Linux*/ChromeOS 87+⇒ ❖Windows ✅ Yes *Use hover menu to enable "Grab all keyboard events"
FreeRDP 🐧Linux/ChromeOS 87+⇒ ❖Windows ✅ Yes
FreeRDP 🍎macOS⇒ ❖Windows ✅ Yes FreeRDP for macOS
Remote Desktop Manager Free 🍎iOS⇒ ❖Windows ✅ Yes
Jump Desktop (RDP) 🍎macOS*/iOS ⇒ ❖Windows ✅ Yes *Preferences -> Keyboard -> Disable "Key Conversions", Enabled "Send macOS Shortcuts" under Keyboard shortcuts
Jump Desktop (VNC) 🍎macOS⇒ 🐧Linux ✅ Yes Note: Compile & install my forked x11vnc for compatibility & use xrdp 0.9.18+.
RealVNC 🍎macOS⇒ 🐧Linux ✅ Yes Note: Compile & install my forked x11vnc for compatibility.
Official MS RDP 🍎macOS⇒ ❖Windows ❌ No Initial Cmd key press not being passed
Remote Desktop Manager Free 🍎macOS⇒ ❖Windows ❌ No Initial Cmd key press not being passed
Royal TSX Client 🍎macOS⇒ ❖Windows ❌ No Initial Cmd key press not being passed
Official MS RDP 🍎🤖iOS/Android⇒ ❖Windows ❌ No No workaround atm

How to Remap Windows keyboards for remote access to macOS

Quick summary - Swap Alt & Win to conform with Apple keyboard layouts. Sharpkeys for Windows, Setkeycodes for Linux, then install Kinto.sh or change/update the Keyboard Type to Apple in the system tray. https://benreaves.medium.com/macos-to-linux-back-again-c6151200f4dc

FreeRDP for macOS

  1. Install brew.sh.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  1. Install XQuartz (x11/xorg)

brew install --cask xquartz

  1. log off and back on.
  2. Install FreeRDP

brew install freerdp

  1. Disable NLA, if it is enabled on the destination.
  2. Run command to access machine Note: 192.168.x.x = Your IP.

xfreerdp /u:your_username /v:192.168.x.x /cert-ignore /auto-reconnect-max-retries:0 /f +clipboard -decorations

  1. Click on XQuartz -> Preferences and set these checkmarks so that fullscreen can work, may need to quit it and re-run the xfreerdp command from step 6.

More info here https://medium.com/idomongodb/macos-rdp-to-a-windows-machine-1e0f52f777b

Jump Desktop for macOS

Screenshots of how to configure Jump Desktop for macOS users accessing a Windows PC with Kinto installed. I apologize that it is not a free RDP client - BUT it does work, and at $15 it is reasonable if you plan to use it frequently.

Table of Contents

How to install (Linux)

How to install (Windows)

What does this do exactly?

What's different from other remappers?

What does Kinto require?

Shortcut Creation

How to Upgrade/Control Kinto

Troubleshooting

Language Support

Related or Useful Resources

Contributing

More information about Kinto

License

Credits and Contributions

What does this do exactly?

Kinto works for standard Windows, Apple and Chromebook keyboards. The following however describes the dynamic rebinding based on a standard Windows/Mac keyboard.

  • Cursor/word-wise shortcut keys have been added to align with macOS keyboard shortcuts.

GUI

Physical Ctrl Win/Alt Alt/Cmd Spacebar
Virtual Win/Super* Alt RCtrl Spacebar

*Win/Super will properly remap to LCtrl when needed to fully support expected keymaps.

Terminal

Physical Ctrl Win/Alt Alt/Cmd Spacebar
Virtual LCtrl Alt RCtrl Spacebar

Note: RCtrl for terminals is also adding in Shift most of the time, however it depends on the specific terminal in use and will change itself to the expected keymaps of that terminal application.

What's different?

Compared to most other remappers this is a complete system-wide remap of your base level modifier keys, this saves time. You're not going to die a death of a thousand papercuts from trying to support every shortcut key under the sun.

It also retains some of the most commonly used system level shortcut keys, such as Cmd-C/V, Cmd-Tab, and Ctrl-Tab among others. You will keep seamless copy & paste between all apps, ability to switch Windows while still using the physical Cmd/Alt key position; switch tabs in your favorite terminals, code editors, or web browsers. Depending on your OS and/or Desktop Environment you may also be able to switch Virtual Desktop environments the same way as well and other basic system level shortcuts.

If your OS and macOS have similar functionality on the system level, but only differ by a slight difference of a shortcut command then Kinto likely supports it already. If Kinto doesn't have what you need then you can open up a support ticket and it will be added. You can also fork the project to add the fix and I will merge it via a PR you make.

Additionally, if you are using a cross-platform app and if it happens to have a few shortcut keys that differ then that can very easily be added to either the kinto.py or kinto.ahk configuration files which on Windows is located here ~/.kinto/kinto.ahk and on Linux it can be found here ~/.config/kinto/kinto.py. More info can be found here Shortcut Creation

What does Kinto require?

  • Python
  • systemd or sysvinit
  • x11
  • xkeysnail

Kinto for Windows 10 Requirements

Other programs that will be installed when you run ./setup.py

  • Chocolatey
  • Autohotkey
  • Strawberry Perl

Note: Sublime Text users should disable screen rotation hotkeys as they will interfere with multi-cursor and possibly other combos. See https://windowsloop.com/disable-screen-rotation-keyboard-shortcut/ for details.

You may also want to disable the Xbox Game Bar so that Win+G or other shortcuts will not interfere with any of your remaps. Start menu -> Game bar shortcuts -> toggle Off.

Shortcut Creation

Linux Shortcut Creation (Xkeysnail)

Windows Shortcut Creation (Autohotkey)

Linux (Xkeysnail)

GUI Keys

Value Description Mac/Kinto Equivalent
C,Ctrl Control Cmd
M,Alt Alt/Option Alt/Option
Super Win/Super Ctrl

Terminal Keys

Value Description Mac/Kinto Equivalent
RC,RCtrl Right Control → Left & Right Alt/Cmd key Cmd
M,Alt Alt/Option Alt/Option
LC,LCtrl Left Control Ctrl

You can define new keymaps for your specific app via this method. You also do not have to cancel out the original keybinding if you do not need or want to, but you can do so with "pass_through_key".

Defining Keymaps Per App

# Keybindings for Sublime Text
define_keymap(re.compile("Sublime_text"),{
    K("C-h"): pass_through_key,          # cancel replace
    K("Ctrl-Alt-f"): K("Ctrl-h"),        # replace
    K("C-M-v"): [K("C-k"), K("C-v")],    # paste_from_history
}

In the above example I am also showing that you can define a single shortcut to enact multiple shortcut keys if needed by defining an array of shortcuts to trigger.

To make changes you can edit ~/.config/kinto/kinto.py under linux & restart the xkeysnail service via the system tray, app or CLI.

systemd

sudo systemctl restart xkeysnail

sysvinit

sudo -E /etc/init.d/kinto restart

More information can be seen on the readme page of xkeysnail.

Windows (Autohotkey)

This applies to the Windows version of Kinto and how to add additional support for Applications. The configuration file location is ~/.kinto/kinto.ahk and after updating it you will want to right click on the tray icon and click on setting your keyboard type again and it will re-apply the latest changes.

Windows 10 has a couple of ways that you need to be aware of when trying to add a specific application, the typical method of how to add any exe program, but then there is also the newer UWP app format that some applications use which will require a similar but different method, both will be discussed.

Defining Keymaps Per App by EXE Name

You can use the following legend but realize that these remaps reference the Virtual keys in the diagrams mentioned near the beginning of this document, so do not confuse it with the physical key unless they happen to be the same key.

Autohotkey Symbol Virtual key Description
^,Ctrl Control Primary modifier, 1st rock from the spacebar
!,Alt Alt Secondary modifier, 2nd rock from the spacebar
#,Win Win/Super Tertiary modifier, 3rd rock from the spacebar
...
#IfWinActive ahk_exe sublime_text.exe
    #^Up::send !{O}                                         ; Switch file
    #^f::send {F11}                                         ; toggle_full_screen
    ^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up}    ; paste_from_history
    ...
#If
...

With this being Autohotkey you can easily pull knowledge from the Autohotkey forums for just about any issue you may have as well.

Defining Keymaps Per UWP App

#If WinActive("- OneNote ahk_class ApplicationFrameWindow", "OneNote")
...
    ; Add your keymaps here
...
#If

I don't have too many examples on this one, most developers seem to be shying away from UWP. Kinto currently supports "Fluent Terminal" which is a UWP app, but it is also being grouped with other Terminal apps for hotkey remapping. You may take a look at that, but you may also want to try creating a new Autohotkey file and use the Window Spy feature built into Autohotkey to help you discover the full name and class names of any application.

Shortcut Creation (XKB)

The older xkb shortcut method info can be read about in ticket #125.

How to Upgrade Kinto

Simply bring down the latest then you can re-run the setup.py installer, it will stop the service and re-install Kinto.

Note: If you have made any custom changes to ~/.config/kinto then you will need to backup or rename those directories before running an update.

git pull origin master
./setup.py

How to Control Kinto

This info is now superceded by the fact that linux has a full fledge GUI and system tray app that is very easy to use, but I will keep the command line options for those that want to know what they are.

Status

systemd

sudo systemctl status xkeysnail

sysvinit

tail -f /tmp/kinto.log

Stop (your keymap will return to normal)

systemd

sudo systemctl stop xkeysnail

sysvinit

sudo -E /etc/init.d/kinto stop

Start

systemd

sudo systemctl start xkeysnail

sysvinit

sudo -E /etc/init.d/kinto start

Restart

systemd

sudo systemctl restart xkeysnail

sysvinit

sudo -E /etc/init.d/kinto restart

Troubleshooting

Installed successfully, but modifier keys are not properly remapped?

Are you using a VM on macOS? If so you may need to disable automatic remapping of the Cmd key when using Vmware Fusion of Parallels.

Disable Parallels Re-mapping:

  1. Open Parallels and go to Preferences.
  2. Click Keyboard and disable the Virtual machine shortcuts.
  3. Close Preferences.

To disable keyboard mapping:

  1. From Fusion's menu bar, click VMware Fusion > Preferences...
  2. Click Keyboard & Mouse.
  3. Click the Key Mappings tab.
  4. Deselect Enable Key Mapping.

Does not start when you log in or after you reboot?

You may need to manually set your DISPLAY in the systemd service file. Normally it pulls in the proper DISPLAY value but if it doesn't you can try this.

Another possibility is the SELinux could be enabled and needs to be set to permissive. (aka /etc/selinux/config)

To reset the display variable

echo $DISPLAY

# :0.0

You can use the Kinto.sh app or system tray to edit your service file.

kinto.sh gui

  1. Edit -> Edit Service kinto tray
  2. Customize -> Edit Service

or you can use your terminal.

sudo nano /etc/systemd/system/xkeysnail.service

...
[Service]
Type=simple
Restart=always
Environment=DISPLAY=:0.0
...

If you continue to have issues then open a ticket and send me the info.

Language Support

I'd appreciate any help from people with non-US based keyboards, to help ensure that these keymaps and keyswap methods work in all or most languages.

Related or Useful Resources

Xkeysnail by mooz

Yet another keyboard remapping tool for X environment

libinput-gestures Three finger gesture or other type of gestures for desktop switching or other features within a Linux distro. More info here for quickly setting it up. Make sure you logoff after setting your user to access input. https://www.reddit.com/r/GalliumOS/comments/5lgrxe/psa_multitouch_gestures_on_galliumos/

Interception

Another low level key remapper, not as easily configurable as Xkeysnail, but does not rely on X11.

Wincent by Greg Hurrell

Dot files and configurations that may help those that want mac-style shortcut keys that work under Wayland, or w/o x11. Vim #102: macOS keyboard bindings on Linux

mac-precision-touchpad by imbushuo

Windows 10 touchpad to precision touchpad driver

macOS-cursors-for-Windows by antiden

macOS cursors for Windows

QuickLook for Windows by QL-Win

It allows users to peek into a file content in lightning speed by just pressing the Space key

fusuma by iberianpig

Multitouch gestures with libinput driver on Linux

Facetime HD Camera for Linux by patjak

Linux driver for Facetime HD on macbooks

Windows Terminal Preview by Microsoft

The best Terminal app built for Windows hands down. I have tried countless, but this one actually seems to get everything right, despite the lack of a GUI to configure all aspects of the program. Custom configurations have to be done via a json file - but given the performance and feature set I feel like it is a decent trade off.

I will update Kinto to have custom configurations for this specific Terminal in the future. Will make seamless copy & paste, which already works, work even better (Cmd-C can still trigger sigint - but there is a fix for that that involves updating the json config).

PowerToys - Windows only by microsoft

Windows system utilities to maximize productivity

AutoHotKey - Windows only by AutoHotkey

AutoHotkey is a powerful and easy to use scripting language for desktop automation on Windows.

pykeymacs by zhanghai

Emacs style keyboard macros implemented in Python

Dynamic Wallpapers by adi1090x

Simple bash script to set a Dynamic Wallpaper according to certain conditions.

macify-linux by JonChun

Automated setup scripts to transform Linux into macOS. (Uses Kinto for key remaps)

ibus-typing-booster by mike-fabian

ibus-typing-booster is a completion input method for faster typing

twemoji color font by eosrei

Twitter Unicode 12 emoji color SVGinOT font for Linux/MacOS/Windows

iTerm2 Color Schemes by mbadolato

Over 225 terminal color schemes/themes for iTerm/iTerm2. Includes ports to Terminal, Konsole, PuTTY, Xresources, XRDB, Remmina, Termite, XFCE, Tilda, FreeBSD VT, Terminator, Kitty...

espanso by federico-terzi

Cross-platform Text Expander written in Rust

GalliumOS by GalliumOS

Docs, issues, and artwork sources for GalliumOS

eOS-X by ipproductions

Dark & Light Theme w/ OSX controls for Elementary OS

Autorandr by phillipberndt

Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr

Barrier by debauchee (Note: Does not appear to work with Kinto v1.2+, may work w/ Kinto v1.1?)

Open-source KVM software

Synergy Free Binaries by amankhoza

The latest freely available Synergy binaries

Synergy Official by Symless

Latest Official Synergy

Karabiner-Elements by pqrs-org

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.

mbpfan by linux-on-mac

A simple daemon to control fan speed on all MacBook/MacBook Pros (probably all Apple computers) for Linux Kernel 3 and newer

vala-panel by rilian-la-te

Vala rewrite of SimplePanel - GitHub mirror (Global Menu for XFCE)

Contributing

I welcome any and all contributors who want to add something to this project.

You can read the configuration files and the open issue tickets such as #44 Shortcut Translation Tables, #115 Shortcut Creation (xkeysnail), and #348 Missing Shortcuts: Post them here to best understand what's currently happening and how best to contribute.

More information about Kinto

https://medium.com/@benreaves/kinto-v1-0-released-2018e6401d2e https://medium.com/@benreaves/kinto-a-mac-inspired-keyboard-mapping-for-linux-58f731817c0

License

GPL v2

Credits and Contributions

I would just like to thank a few people here directly that have helped me tremendously with completing this project and without their support, direct, indirect or otherwise I would have had difficulty completing this undertaking. I will list these things off in chronological order mostly.

First off I'd like to thank the Stackoverflow and Stackexchange community. I have probably rubbed some mods the wrong way over there, but the people from the community in general are extremely helpful and gracious and without their contributions would have made this much more difficult. The person I'd like to thank most though from over there is Glen Whitney. Without his detailed explaining of how to rebind keys in xkb this would not have come together at all, as every other remapping solution were non-starters as complexity increases. Kinto today no longer uses xkb, but Glen Whitney did provide the basis of a workable method that helped me pursue this method and think it was a worthwhile project to pursue, so for that I thank him.

Secondarily I'd like to thank Christian Eriksson*, as he provided information that kept me up at night.. literally. Even after I implemented a similar bash script to one he had suggested I knew that fully implementing a c/c++ solution was where Kinto needed to head to and his explanation was better than I remember it being now that I have gone back to read it again. He also never provided a full implementation of a c/c++ solution - he did hit on the pain points pretty well of what one would need to do and watch out for. I am not sure where I got the first example code of implementing a c based solution, but he definitely went over it well.

Kui and his gist file** was really the c based solution that I found had the fewest issues to resolve to making it a reliable solution. It didn't account for all failures very well, aka BadWindow issues, but it made for a great foundation on which Kintox11 is built. I cannot thank him enough for putting it out there for others to work with.

Lastly these four people were also very helpful to me as well. @probonopd for being one of the first people to install and use Kinto and gave me the initial feedback to include wordwise support! He also has really great articles*** posted on HackerNews & Medium about UI/UX design. Another person I'd like to thank is @owzim, his feedback allowed me to rapidly iterate and fix several bugs to support additional platforms better. The last two are members of the #ubuntu channel in IRC on freenode, tarzeau ( @alexmyczko ) and sarnold. Alex contributing a proper Makefile, so the project can be packaged properly, and sarnold help me find that IBus could resolve an issue I was having with needing to detect the caret status.

Updated 6/13/2020

I would also like to thank Jonathan Chun for his patience in helping me work through a very difficult problem related to Alt-Tab switching, which led to the current xkeysnail iteration of Kinto for Linux that far exceeds the original xkb implementation. There are also several others that have created issue tickets that have contributed greatly.

If I left anyone out then I apologize, that was not intentional. I am happy to say that this project is at a state of completion. Bug fixes will primarily be the only activity happening going forward and possibly a rewrite for Wayland at some point. Contributions as mentioned above are welcomed, and will be merged into master if they help with the goal of making typing on linux more like a mac.

*https://askubuntu.com/questions/1010276/can-i-act-on-the-event-that-a-window-opens-without-polling

**https://gist.github.com/kui/2622504

***https://medium.com/@probonopd/make-it-simple-linux-desktop-usability-part-1-5fa0fb369b42

kinto's People

Contributors

albertofem avatar alexmyczko avatar debi-ejeta avatar deftdawg avatar fracture91 avatar fratajczak avatar helgecph avatar huzaifahj avatar indrekj avatar jfsso avatar joshgoebel avatar kash-raman avatar kirschem avatar lydell avatar m000 avatar mahoney avatar mamercad avatar naveg avatar olegsmelov avatar prosac avatar rakin406 avatar rbreaves avatar redbearak avatar thebitstick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kinto's Issues

installation issues

./install.py

                  Kint◎
        - F!x the dɑmn kɐyb◎ɑrd. - 

Press Enter to begin...

What type of keyboard are you using? (If Mac and Windows then select Mac)
1) Windows
2) Chromebook
3) Mac
3

Would you like to swap Command back to Super/Win and Ctrl key back to Ctrl when using terminal applications? (y/n)
Note: For a more mac like experience & less issues with terminal based interactions y is recommended.
y
Apple hid_apple driver is not loaded, a keymap that is specific for only Apple keyboards will be used.
Setting up mac_only keyswap as a service.
You can disable and remove the service by using the following command in the Kinto directory.
./uninstall.sh
Failed to connect to bus: No such file or directory
Failed to connect to bus: No such file or directory
Traceback (most recent call last):
File "./install.py", line 176, in
keyboard_detect()
File "./install.py", line 90, in keyboard_detect
subprocess.check_output(keyswapcmd, shell=True).decode('utf-8')
File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '/bin/bash -c "./keyswap_service.sh 1 0 mac_only 0 0 0"' returned non-zero exit status 1.

What could i be doing wrong here?

Constant Crashing of Keyswap service

I know I said I'll stick with Kubuntu... but I couldn't resist and tried out Neon. So sorry for spamming the issues on this repo...

Install Type: Bare Metal
Distro: KDE Neon
DE: KDE
Branch: master

cat /tmp/kinto/caret
1
Mar 30 02:14:17 jchun-desktop bash[14201]: firefox: Firefox
Mar 30 02:14:28 jchun-desktop bash[14201]: gui: Sublime_text
Mar 30 02:14:30 jchun-desktop bash[14201]:      Inkscape
Mar 30 02:15:03 jchun-desktop bash[14201]:      plasmashell
Mar 30 02:15:09 jchun-desktop bash[14201]: X11 error: type=0, serial=501, code=3
Mar 30 02:15:09 jchun-desktop bash[14201]: fail to get top window: 1
Mar 30 02:15:09 jchun-desktop systemd[14674]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 30 02:15:09 jchun-desktop systemd[14674]: keyswap.service: Failed with result 'exit-code'.
Mar 30 02:15:10 jchun-desktop systemd[14674]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 30 02:15:10 jchun-desktop systemd[14674]: keyswap.service: Scheduled restart job, restart counter is at 69.
Mar 30 02:15:10 jchun-desktop systemd[14674]: Stopped keyswap for Terminal and GUI.
Mar 30 02:15:10 jchun-desktop systemd[14674]: Started keyswap for Terminal and GUI.
Mar 30 02:15:10 jchun-desktop bash[14526]: Importing user_config.json...
Mar 30 02:15:10 jchun-desktop bash[14526]: Data from user_config.json imported successfully.
Mar 30 02:15:10 jchun-desktop bash[14526]: Starting keyswap...
Mar 30 02:15:10 jchun-desktop bash[14526]: First window name: Inkscape
Mar 30 02:15:10 jchun-desktop bash[14526]: gui: Inkscape
Mar 30 02:15:10 jchun-desktop bash[14526]:      plasmashell
Mar 30 02:15:13 jchun-desktop bash[14526]: X11 error: type=0, serial=102, code=3
Mar 30 02:15:13 jchun-desktop bash[14526]: fail to get top window: 1
Mar 30 02:15:13 jchun-desktop systemd[14674]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 30 02:15:13 jchun-desktop systemd[14674]: keyswap.service: Failed with result 'exit-code'.
Mar 30 02:15:15 jchun-desktop systemd[14674]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 30 02:15:15 jchun-desktop systemd[14674]: keyswap.service: Scheduled restart job, restart counter is at 70.
Mar 30 02:15:15 jchun-desktop systemd[14674]: Stopped keyswap for Terminal and GUI.
Mar 30 02:15:15 jchun-desktop systemd[14674]: Started keyswap for Terminal and GUI.
Mar 30 02:15:15 jchun-desktop bash[14645]: Importing user_config.json...
Mar 30 02:15:15 jchun-desktop bash[14645]: Data from user_config.json imported successfully.
Mar 30 02:15:15 jchun-desktop bash[14645]: Starting keyswap...
Mar 30 02:15:15 jchun-desktop bash[14645]: First window name: konsole
Mar 30 02:15:15 jchun-desktop bash[14645]: term: konsole
Mar 30 02:15:17 jchun-desktop bash[14645]: gui: Sublime_text
Mar 30 02:15:18 jchun-desktop bash[14645]: term: konsole
Mar 30 02:17:18 jchun-desktop bash[14645]: gui: Sublime_text
Mar 30 02:17:27 jchun-desktop bash[14645]: term: konsole
Mar 30 02:17:31 jchun-desktop bash[14645]: gui: Sublime_text
Mar 30 02:17:33 jchun-desktop bash[14645]: term: konsole
Mar 30 02:17:35 jchun-desktop bash[14645]: gui: Sublime_text
Mar 30 02:17:37 jchun-desktop bash[14645]: term: konsole
Mar 30 02:17:39 jchun-desktop bash[14645]: gui: Sublime_text
Mar 30 02:17:44 jchun-desktop bash[14645]: term: konsole
Mar 30 02:17:55 jchun-desktop bash[14645]: gui: Sublime_text
Mar 30 02:17:56 jchun-desktop bash[14645]: term: konsole
Mar 30 02:18:01 jchun-desktop bash[14645]: gui: Sublime_text
Mar 30 02:18:03 jchun-desktop bash[14645]: term: konsole

The problem

Mar 30 02:15:15 jchun-desktop systemd[14674]: keyswap.service: Scheduled restart job, restart counter is at 70.

Constant crashing of the keyswap service. I' m unable to type anything while it is restarting. It's pretty annoying. I finally have everything exactly the way I want it, and then I found out kinto doesn't like Neon :(

How to File a Bug Report

Template

Install Type: Bare Metal or VM
Distro: Name + Version
DE: Gnome, XFCE, KDE
Branch: master, dev

If applicable include kinto log and the status of your input caret

cat /tmp/kinto/caret
journalctl --user-unit=keyswap.service -b

The Problem

Describe your problem and any steps I might be able to take to reproduce your problem. If it only occurs with using a particular application then please include the name of that app as well (although it should be mentioned in your kinto log as well).

Apple Keyboard not detected

I'm using the wireless magic keyboard (full size, british). Doesn't appear that the script correctly picks up the keyboard (hid_apple.conf doesn't even exist)

sam@sam-xps:~/bin$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SYNA2393:00 06CB:7A13 Touchpad          	id=11	[slave  pointer  (2)]
⎜   ↳ PS/2 Synaptics TouchPad                 	id=16	[slave  pointer  (2)]
⎜   ↳ Sam’s Mouse                           	id=18	[slave  pointer  (2)]
⎜   ↳ Logitech G203 Prodigy Gaming Mouse      	id=21	[slave  pointer  (2)]
⎜   ↳ Logitech G203 Prodigy Gaming Mouse Consumer Control	id=22	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Video Bus                               	id=8	[slave  keyboard (3)]
    ↳ Power Button                            	id=9	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=10	[slave  keyboard (3)]
    ↳ Intel HID events                        	id=12	[slave  keyboard (3)]
    ↳ Intel HID 5 button array                	id=13	[slave  keyboard (3)]
    ↳ Dell WMI hotkeys                        	id=14	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=15	[slave  keyboard (3)]
    ↳ Sam’s Keyboard                        	id=17	[slave  keyboard (3)]
    ↳ Logitech G203 Prodigy Gaming Mouse System Control	id=19	[slave  keyboard (3)]
    ↳ Logitech G203 Prodigy Gaming Mouse Keyboard	id=20	[slave  keyboard (3)]
    ↳ Logitech G203 Prodigy Gaming Mouse Consumer Control	id=23	[slave  keyboard (3)]

You can see the keyboard (which was named on a mac) with id=17

Any suggestions to how to force this to be detected as a mac keyboard?

Update kinto

Dear all,

what is the recommended way to update kinto? Reinstall?
What be nice to add that to the readme

Best regards

Uninstall is not working properly

Describe the bug
Uninstall ends with error below and doesn't get rid off kinto completely (tweaks):

$ ./uninstall.sh 
Warning: Stopping keyswap.service, but it can still be activated by:
  keyswap.timer
sed: can't read /home/username/.Xsession: No such file or directory

Expected behavior
Return back to keymap state as before the installation or to the default values.
If tweaks were part of the installation. Uninstall should return them back without need of manually do things like #68.

Install Type: Bare Metal
Distro: 5.3.0-45-generic #37~18.04.1-Ubuntu SMP Fri Mar 27 15:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
DE: Gnome
Branch: master
Commit: c1c473c

Kinto Input Caret Status

1

Kinto Standard Log

-- Logs begin at Wed 2020-04-01 17:33:47 CEST, end at Thu 2020-04-02 11:04:16 CEST. --
apr 02 10:32:30 ThinkPad-T460s systemd[2160]: Started keyswap for Terminal and GUI.
apr 02 10:32:30 ThinkPad-T460s bash[13472]: Importing user_config.json...
apr 02 10:32:30 ThinkPad-T460s bash[13472]: Data from user_config.json imported successfully.
apr 02 10:32:30 ThinkPad-T460s bash[13472]: Starting keyswap...
apr 02 10:32:30 ThinkPad-T460s bash[13472]: First window name: Slack
apr 02 10:32:30 ThinkPad-T460s bash[13472]: gui: Slack
apr 02 10:32:51 ThinkPad-T460s bash[13472]: chrome: Google-chrome
apr 02 10:33:55 ThinkPad-T460s bash[13472]: gui: Slack
apr 02 10:33:57 ThinkPad-T460s bash[13472]: chrome: Google-chrome
apr 02 10:34:02 ThinkPad-T460s bash[13472]: gui: Slack
apr 02 10:34:03 ThinkPad-T460s bash[13472]: chrome: Google-chrome
apr 02 10:37:31 ThinkPad-T460s bash[13472]: term: Gnome-terminal
apr 02 10:37:41 ThinkPad-T460s systemd[2160]: Stopping keyswap for Terminal and GUI...
apr 02 10:37:41 ThinkPad-T460s systemd[2160]: Stopped keyswap for Terminal and GUI.
apr 02 10:39:30 ThinkPad-T460s systemd[2160]: Started keyswap for Terminal and GUI.
apr 02 10:39:30 ThinkPad-T460s bash[13881]: Importing user_config.json...
apr 02 10:39:30 ThinkPad-T460s bash[13881]: Data from user_config.json imported successfully.
apr 02 10:39:30 ThinkPad-T460s bash[13881]: Running init command: gsettings set org.gnome.mutter overlay-key ''
apr 02 10:39:30 ThinkPad-T460s bash[13881]: Starting keyswap...
apr 02 10:39:30 ThinkPad-T460s bash[13881]: First window name: Slack
apr 02 10:39:30 ThinkPad-T460s bash[13881]: gui: Slack
apr 02 10:42:21 ThinkPad-T460s bash[13881]: chrome: Google-chrome
apr 02 10:44:36 ThinkPad-T460s bash[13881]: term: Gnome-terminal
apr 02 10:44:44 ThinkPad-T460s bash[13881]: chrome: Google-chrome
apr 02 10:45:07 ThinkPad-T460s bash[13881]: term: Gnome-terminal
apr 02 10:45:12 ThinkPad-T460s bash[13881]: chrome: Google-chrome
apr 02 10:45:21 ThinkPad-T460s bash[13881]: term: Gnome-terminal
apr 02 10:45:33 ThinkPad-T460s bash[13881]: chrome: Google-chrome
apr 02 10:45:48 ThinkPad-T460s bash[13881]: term: Gnome-terminal
apr 02 10:45:54 ThinkPad-T460s bash[13881]: chrome: Google-chrome
apr 02 10:46:42 ThinkPad-T460s bash[13881]: gui: Slack
apr 02 10:49:26 ThinkPad-T460s bash[13881]: term: Gnome-terminal
apr 02 10:49:34 ThinkPad-T460s systemd[2160]: Stopping keyswap for Terminal and GUI...
apr 02 10:49:34 ThinkPad-T460s systemd[2160]: Stopped keyswap for Terminal and GUI.

Kinto Debug Log (1.0.6-2+)

bash: cd: /home/username/.config/kinto: No such file or directory

Can't refuse to view one-time initialization tweaks

Describe the bug
When the installer asks "One time initialization tweaks are available. Would you like to view them? (Y/n)", you can't refuse it. Hitting "n" proceeds to show you the tweak settings.

Expected behavior
I would expect it to exit the installer immediately. Or perhaps I'm misinterpreting the installer...

Install Type: Bare Metal
Distro: KDE Neon
DE: KDE
Branch: master

Allow capslock and swapescape

Amazing application!
The only really annoy thing thing is that swapescape no longer works:
setxkbmap -option caps:swapescape

I think this has to do with how setxkbmap actually works, but I was wondering if there was a way to:
A) avoid conflicts with setxkbmap
B) allows us to swap capslock and escape key through kinto (I've tried mucking around in the user_config.json but to no avail)

Kinto not starting - Debian 10 1.0.6-4

Describe the bug
1 - Fresh install of Debian 10.3
2 - I follow the installation guide
3- Kinto seems to not be active, although after installing it, the windows key stoped working as it normally does
.

Install Type: Bare Metal or VM
Distro: Debian 10.3
DE: Gnome, XFCE, KDE
Branch: master
Commit: 9a451bd

Kinto Input Caret Status

cat /tmp/kinto/caret

1
Kinto Standard Log

journalctl --user-unit=keyswap.service -b

No logs
Kinto Debug Log (1.0.6-2+)

systemctl --user stop keyswap
cd ~/.config/kinto
./kintox11 --debug

Running in debug mode
Data from user_config.json imported susccesfully
Running init command: gsetting set org.gnome.mutter overlay-key ' '
Starting keyswap...

get focus window
-: event: 0, windows_id: 0
*no focus window, e.type: 0, current_app

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Really Slow on super+tab alt+tab

Edit:
I'm on a ubuntu 19.10 clean install.
Whenever I activate keyswap the computer become barely usable, at least from an UI point of view.
Closing a window takes a couple of seconds from the click.

Is there something I'm missing?
As soon as I stop the service, the whole thing is back to normal.

Original:
As soon as keyswap is active alt+tab and super+tab are less responsive, and at least for me unusable.
The problem is more evident when there're many windows/apps open.

Not working after logout/login

  • OS: Pop!_OS 19.10 x86_64
  • DE: GNOME 3.34.1
  • WM: GNOME Shell

After boot:

01-after-boot

After logout/login:

02-after-logout

After restart of service:

03-after-restart-of-keyswap

The fail also happens after fresh install, only a reboot solves it.

I also tried the current dev, as stated in this issue #11

Keyswap service doesn't work immediately on boot.

Install Type: Bare Metal
Distro: Elementary OS 5.1 Hera
DE: Pantheon
Branch: master

I've noticed that the keyswap stuff doesn't work immediately on first login/boot, and requires me to open up either Firefox or Terminal (elementary terminal) before it starts recognizing the keyswaps. I tried opening up/focusing Telegram (autostarts on boot) and SublimeText3 (doesn't autostart) but it doesn't do anything. However, once I focus/open either Firefox or Terminal (the only ones I've found so far), the keyswap service starts working immediately.

The key combination I'm using to test is cmd+space (alt_key+space) which pulls up Albert.

cat /tmp/kinto/caret
cat: /tmp/kinto/caret: No such file or directory

journalctl

-- Logs begin at Fri 2020-03-27 09:03:30 EDT, end at Fri 2020-03-27 22:43:12 EDT. --
Mar 27 21:38:06 jchun-desktop bash[1400]: ls: cannot access '/home/jchun/.config/ibus/bus': No such file or directory
Mar 27 21:38:06 jchun-desktop bash[1400]: cat: /home/jchun/.config/ibus/bus/: No such file or directory
Mar 27 21:38:06 jchun-desktop systemd[1382]: Started keyswap for Terminal and GUI.
Mar 27 21:38:06 jchun-desktop bash[1400]: Importing user_config.json...
Mar 27 21:38:06 jchun-desktop bash[1400]: Data from user_config.json imported successfully.
Mar 27 21:38:06 jchun-desktop bash[1400]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 27 21:38:06 jchun-desktop bash[1400]: Starting keyswap...
Mar 27 21:38:06 jchun-desktop bash[1400]: First window name: none
Mar 27 21:38:06 jchun-desktop bash[1400]: gui: none
Mar 27 21:38:15 jchun-desktop bash[1400]:      TelegramDesktop
Mar 27 21:38:20 jchun-desktop bash[1400]:      Sublime_text
Mar 27 22:42:16 jchun-desktop bash[1400]:      TelegramDesktop
Mar 27 22:42:21 jchun-desktop bash[1400]: firefox: Firefox
Mar 27 22:42:22 jchun-desktop bash[1400]: file /tmp/kinto/caret does not exist
Mar 27 22:42:23 jchun-desktop bash[1400]: file /tmp/kinto/caret does not exist
Mar 27 22:42:23 jchun-desktop bash[1400]: X11 error: type=0, serial=2303, code=3
Mar 27 22:42:23 jchun-desktop bash[1400]: fail to get top window: 1
Mar 27 22:42:23 jchun-desktop systemd[1382]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 27 22:42:23 jchun-desktop systemd[1382]: keyswap.service: Failed with result 'exit-code'.
Mar 27 22:42:24 jchun-desktop systemd[1382]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 27 22:42:24 jchun-desktop systemd[1382]: keyswap.service: Scheduled restart job, restart counter is at 1.
Mar 27 22:42:24 jchun-desktop systemd[1382]: Stopped keyswap for Terminal and GUI.
Mar 27 22:42:24 jchun-desktop systemd[1382]: Started keyswap for Terminal and GUI.
Mar 27 22:42:24 jchun-desktop bash[2375]: ls: cannot access '/home/jchun/.config/ibus/bus': No such file or directory
Mar 27 22:42:24 jchun-desktop bash[2375]: cat: /home/jchun/.config/ibus/bus/: No such file or directory
Mar 27 22:42:24 jchun-desktop bash[2375]: Importing user_config.json...
Mar 27 22:42:24 jchun-desktop bash[2375]: Data from user_config.json imported successfully.
Mar 27 22:42:24 jchun-desktop bash[2375]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 27 22:42:24 jchun-desktop bash[2375]: Starting keyswap...
Mar 27 22:42:24 jchun-desktop bash[2375]: First window name: Firefox
Mar 27 22:42:24 jchun-desktop bash[2375]: firefox: Firefox
Mar 27 22:42:28 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:30 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:34 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:38 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:41 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:42 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:45 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:50 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:50 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:51 jchun-desktop bash[2375]: term: Io.elementary.terminal
Mar 27 22:42:51 jchun-desktop bash[2375]: firefox: Firefox
Mar 27 22:42:53 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:42:53 jchun-desktop bash[2375]: term: Io.elementary.terminal
Mar 27 22:43:05 jchun-desktop bash[2375]: firefox: Firefox
Mar 27 22:43:07 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:43:08 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:43:09 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:43:10 jchun-desktop bash[2375]: file /tmp/kinto/caret does not exist
Mar 27 22:43:10 jchun-desktop bash[2375]: term: Io.elementary.terminal

Konsole sometimes Ignores input

This issue may occur less under 1.0.6 release, but it may still occur. I believe the issue to be a bug with how xkb or xkbcomp applies the keymap, this bug does not impact other applications from what I can tell.

Issue first reported by @jonchun in this thread. #69

Feature Requests/Roadmap

So this is not really an issue ticket, just something I plan to keep open with feature requests I have been asked about. People are welcome to add more in the comments however.

High Priorities

  • Convert python & autohotkey config files to yaml
  • Add Multi-user support
  • Create a PPA for the app.
  • Get kinto added to official repos.
  • Custom Device Input option for xkeysnail aka Kinto on Linux #275
  • Address any outstanding issues related to xkeysnail #247 #164
  • Add screenshot functionality across distros #117

Medium

  • add blacklisted apps option
  • exclude games option (full screen apps?)
  • Wayland support per DE
  • Programmatic method of adding Application shortcuts to kinto. Will use this separate project as the datasource. https://github.com/rbreaves/Universal-Keys
  • Sticking keys issue on cmd+shift #276
  • Bring back caret detection #164 #59 - Addressed here, needs more testing #497
  • Rewrite the method used to add system level hotkeys to xkeysnail, tie it directly to the DE and what it actually has configured only so that any untested distro has the ability to work out of the box.

Low

  • Create matching GUI installer for Windows
  • Work around fix for those that want Cmd-Left/Right to control back and forward buttons in browsers. (caret focus detection is non-working atm)

Not a Feature but important.


  • Allow for custom F row media keys
  • Trigger Emoji panel same way as macOS for the most part. OS versions, DE, and app differences will make this an incomplete solution even once implemented. *Partially implemented - Windows.
  • Support detecting terminals within an app having focus & changing the keymap live accordingly.
  • Accented Popup Window Language support*
  • Simplify the keyboard setup in Kinto by removing the Win, Mac, and Chrome options. Instead guide the user to press 2 keys that will determine the layout. Not relevant any more
  • Allow for custom remapping of Ctrl, Win/Super and Alt positions during install Not currently planned
  • Add xkeysnail based shortcut keys for specific apps where Kinto may not fully remap to macOS equivalent shortcut keys.
  • Fix minor bug under KDE, Cmd+Tab during Terminal usage will often hang until Shift or Enter is pressed to make the Cmd+Tab prompt go away.
  • Add visible task tray icon so users will know when Kinto is running. Useful for cold reboots and just to have an indicator in general. (I already have icons created, but not in the repo.)
  • Add caret detection for Windows Chrome and Firefox
  • Add udev/hwdb method for apps that ignore xkb remaps and Wayland
  • Translation tables, xkb keycodes and their xkb keylabels, Ubuntu, and macOS shortcuts.
  • Poll user_config.json for any changes so users don't have to restart the service Not relevant
  • Add ability to discover the status of the caret (for typing).**

A table or spreadsheet needs to be created with shortcuts listed and xkb keycodes and labels. Now that the underlying code and base has been created the only thing left to do is to enumerate what all needs to be linked together for as close as 100% coverage possible based on the default shortcuts available. 3rd party apps and additional configuration can be mentioned, but will likely remain outside the scope of Kinto or will simply be inactive until designated 3rd party and optional apps are installed.

* I would really like to add an Accented Popup Window but that one will probably take the most effort and might even be a separate project in of itself, because it will have to actively monitor keyboard input, and I do not want that to be part of Kinto in general. If keyboard input is to be actively monitored then it will be separate. There are methods for detecting when a key is held down, so that with duration and disabling key repeat should be sufficient to trigger a new x11 window with other virtual key options in theory.

** On the keyboard caret issue it is needed to fully support word-wise in browsers while still being able to map the arrow keys to other functions as well. This conflict does not exist on macOS, it is aware of input elements vs the general program.

** Scenario: Firefox - Cmd + Left = Back button or Cmd + Left = Beginning of text line, but right now it is one or the other until I can detect the text input. If anyone has any ideas on how I can do this in x11 then let me know and I will implement it.

***Note: xkeysnail is not currently installed with or used by Kinto, but I believe it would simplify the process of adding support for one off applications that may not align well with the default system level shortcuts that occur for the GUI based apps and terminal apps in general.

Word-wise text-navigation not working

First of all thanks a lot for your work. I struggled for some time how to modify my keymaps and hotkeys to match the mac-style until I found your project which solved it quickly.

But unfortunately word-wise navigation (alt - left-arrow / alt - right arrow on mac) is not working for me. I saw the issue #2 where you already addressed this but it does not work for me.

I'm running Ubuntu 18.04 with x11 on a 2014 MacBook Pro.

Can you help me figure out why it's not working? Thanks!

HELP, working well but i'd like to use key "FN" like superkey

this is the first time that i find something that works very well, the only pity, my new keyboard microsoft has the key "FN" in the place the superkey. I mean superkey is one place to the right, it's a way to use this package to use "FN" key instead suiperkey, I do mainly copy paste on gnome and terminal. thanks

Support for Polish language/characters

Is your feature request related to a problem? Please describe.
I cannot type Polish characters like ą,ć,ś,ę... etc.

Describe the solution you'd like
Add support for Polish language.

Describe alternatives you've considered
n/a

Additional context
How can user help in making this happen?

Delay when lauching guake terminal

Dear all,

thanks for the great tool. I have some issues using it with the guake terminal.

  • The response is quite delayed when using the shortcut (standard F12) for toggle visibility. (2-3sec)
  • I would like to the super (command) key + D to toggle visibility. I can't figure out how to do so.

Using Ubuntu 19.10

kinto messing with espanso

I know it is maybe not an issue on your side, but kinto prevents espanso from expanding text, so I am creating an issue in both repos. If kinto is not running espanso works like expected.

I don't know on which side the issue can be fixed and I really don't expect either of you to fix it, but perhaps one of you can look into it.

Thanks

support italian keyboard apple/windows (3 chars on key)

Is your feature request related to a problem? Please describe.
on ubuntu 18.04 italian, this was the setup:
2. mac type, 1. mac hid driver, 1 gnome-init (default, blank for all others)

on a italian layout, there are four keys with 3 chars mapped:
+*]
èé[
òç@
à°#

without kinto the second char is mapped on "shift + {key}"
without kinto the third char is mapped on "cmd + {key}" or "AltGr + {key}" (respectively on apple or windows keyboard)

after kinto setup I'm not able to type the third char for each key: ] , [ , @ , #

Describe the solution you'd like
keep same combination for keys with 3 chars mapped:
"cmd + {key}" and "AltGr + {key}" should be always mapped on the third char if key is used for 3 chars in current keyboard layout (this should be true for italian layout but also other languages)

Describe alternatives you've considered
describe where fo find configuration to remap third char if key is used for 3 chars

Ctrl-ArrowKeys don't work anymore

As a possibly unintended side effect, Ctrl-ArrowKeys don't work anymore in text entry fields; one now has to use Alt-ArrowKeys. Is this intentional?

Shortcut Translation Tables

Attaching an excel doc for others that may want to identify additional system level shortcuts they'd like to see. Kinto Translation Table.xlsx

Kinto v1.0.7

Kinto GUI
Ctrl = Cmd Position
Super = Ctrl Position

Kinto Term
Ctrl+Shift = Cmd Position
Ctrl = Ctrl Position

Information on how to contribute is in the ReadMe.

Base

Behavior Linux macOS Kinto GUI Kinto Term
Primary Modifier Ctrl Cmd Alt/Cmd -> Ctrl Alt/Cmd -> Ctrl+Shift
Secondary Modifier Alt Alt Win/Alt -> Alt Win/Alt -> Alt
Tertiary Modifier Super (Win) Ctrl Ctrl -> Super Ctrl -> Ctrl

Wordwise

Behavior Linux macOS Kinto GUI Kinto Term
Beginning of Line Home Cmd+Left Ctrl+Left, Ctrl+A (dev) N/A
End of Line End Cmd+Right Ctrl+Right, Ctrl+E (dev) N/A
Left of Word Ctrl+Left Alt+Left Alt+Left N/A
Right of Word Ctrl+Right Alt+Right Alt+Right N/A
Beginning of File Ctrl+Home Cmd+Up Ctrl+Up N/A
End of File Ctrl+End Cmd+Down Ctrl+Down N/A
Delete Delete Fn+Backspace Alt+Backspace N/A

Terminal

Behavior Linux macOS Kinto Term
Page Up PageUp Fn+Up Ctrl+Shift+Up
Page Down PageDown Fn+Down Ctrl+Shift+Down
Home Home Fn+Shift+Up/Left? Ctrl+Shift+Left
End End Fn+Shift+Down/Right? Ctrl+Shift+Right

Browsers

Behavior macOS Chrome Firefox
Go Back Cmd+Left Alt+Left Ctrl+[
Go Forward Cmd+Right Alt+Right Ctrl+]

System Level

Behavior macOS galliumOS (XFCE) Ubuntu 19.10 (Gnome) Pop_OS 19.10 (Gnome) ElementaryOS 5.1 (Gnome) Fedora 31 (Gnome) Manjaro/Arch (KDE)
Show Desktop Cmd+F3 Ctrl+Alt+D Super+d Super+d Super+Down Disabled Super+d
Cycle Applications Cmd+Tab Alt+Tab Alt+Tab Super+Tab, Alt+Tab Alt+Tab Super+Tab, Alt+Tab Alt+Tab
Reverse Cycle Apps Cmd+Shift+Tab Alt+Shift+Tab Alt+Shift+Tab Alt+Shift+Tab Alt+Shift+Tab
Cycle Windows of App Cmd+` Comments* Alt+F6 Alt+F6 Alt+F6 Alt+F6 Alt+`
Reverse Cycle Windows of App Cmd+Shift+` Alt+Shift+F6 Alt+Shift+F6 Alt+Shift+F6 Alt+Shift+`
Close App Cmd+Q/W Alt+F4 Alt+F4 Super+w Alt+F4 Alt+F4 Alt+F4
Maximize App Ctrl+Cmd+F Alt+F10 Alt+F10 Ctrl+Super+Up Super+Up Alt+F10 Super+PgUp
Minimize App Cmd+H Alt+F9 Super+h Super+h Super+h Super+h Super+PgDown
Spotlight Cmd+Space Super+M Control+Shift+Space Control+Shift+Space Super+Space Control+Shift+Space Ctrl+Shift+Space
Change Workspace Ctrl+Left/Right Ctrl+Alt+End/Ctrl+Alt+Home Control+Alt+Left/Right Super+Left/Right Super+Left/Right Control+Alt+Left/Right None

Browsers

Behavior macOS Chrome Firefox
Tab Switching Ctrl+Tab Ctrl+Tab Ctrl+Tab

command not found `options`

postinstall, running the commands, I'm getting an error re: options command not existing on Ubuntu 19.04

zsh: correct 'options' to '_options' [nyae]? n
zsh: command not found: options

Performance has been flaky (not applied after reboot), so I came back to uninstall/reinstall and saw i missed this lasttime.

Googling around I can't readily see what package to install to get an options command... Any advice would be appreciated!

Strange behaviour with Windows keyboard

First of all, kudos! I love this script! :) It worked perfectly on an Ubuntu VM that I was running on a Macbook Pro the other day 🎉

On one of my workstations (Fedora 31), I use Tilix as my main terminal emulator, and to my surprise, after running setup.py Tilix doesn't work as expected.

I picked the following options from the setup script:

Kinto - Type in Linux like it's a Mac.

    1. ❖  Windows 
    2. ⌘  Mac 
    3. ✇  Chromebook 

Please enter your keyboard type (1 - 3) : 1

1. Windows
Description: Standard Windows 104 Keyboards

Please enter your keyboard config (1 - 1) : 1

My keyboard (Pok3r RGB) bottom-row layout is:
Ctrl_L, Super_L, Alt_L, Space, Alt_R, Fn, Menu, Ctrl_R

(Button combos entered below are as printed on my keyboard)

Tilix

  • Alt+C acts as Ctrl+C
  • Ctrl+C just enters 'c'
  • Super+C does nothing
  • Ctrl+Shift+C enters 'C'
  • Alt+Shift+C copies (Alt+Shift+V pastes)

Gnome-terminal also didn't work as expected:

Gnome-terminal

  • Alt+C enters 'c'
  • Ctrl+C enters 'c'
  • Super+C copies (Super+V pastes)

I find this super confusing, so maybe some output from xev will be more helpful :)

On pressing Alt_L, xev reports:

KeyPress event, serial 37, synthetic NO, window 0x8000001,
    root 0x19c, subw 0x0, time 978177417, (12,-10), root:(26,1677),
    state 0x0, keycode 64 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x8000001,
    root 0x19c, subw 0x0, time 978177480, (12,-10), root:(26,1677),
    state 0x4, keycode 64 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

On pressing Super_L, xev reports:

KeyPress event, serial 37, synthetic NO, window 0x8000001,
    root 0x19c, subw 0x0, time 978176288, (12,-10), root:(26,1677),
    state 0x0, keycode 133 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x8000001,
    root 0x19c, subw 0x0, time 978176360, (12,-10), root:(26,1677),
    state 0x8, keycode 133 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

On pressing Ctrl_L, xev reports:

KeyPress event, serial 34, synthetic NO, window 0x8000001,
    root 0x19c, subw 0x0, time 978174870, (12,-10), root:(26,1677),
    state 0x0, keycode 37 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x8000001,
    root 0x19c, subw 0x0, time 978174964, (12,-10), root:(26,1677),
    state 0x40, keycode 37 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

On my keyboard layout, I would've expected Ctrl to stay Ctrl, Super_L to become Option/Alt_L, and Alt_L to become Cmd/Super_L.

Only works on terminal?

Works fine on terminal...

But on the system the keys was switched.

alt works as ctrl

command works as alt

control works as windows

options cmd line missing to enable permanent apple keyboard keyswap

hi! I'm a bit of a Linux noob so bear with me... I've verified the keyswap service is running on 18.04 Ubuntu:

ubuntu@salsa:~/dev/kinto$ systemctl --user status keyswap
 keyswap.service - keyswap for Terminal and GUI
   Loaded: loaded (/home/ubuntu/.config/systemd/user/keyswap.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-12-26 23:18:27 PST; 27min ago
 Main PID: 6740 (bash)
   CGroup: /user.slice/user-1002.slice/[email protected]/keyswap.service
           ├─6740 /bin/bash /home/ubuntu/.config/xactive.sh mac 0 0 0
           ├─6763 xprop -spy -root _NET_ACTIVE_WINDOW
           ├─6764 grep --line-buffered -o 0[xX][a-zA-Z0-9]\+
           └─6765 /bin/bash /home/ubuntu/.config/xactive.sh mac 0 0 0

I can't seem to run these commands at the end of the install because options doesn't exist:

An Apple keyboard with the hid_apple driver was detected.
Please run the following commands to swap alt/option and Command.
Your Kinto keymapping will not work right on Apple keyboards without it.

echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
"options hid_apple swap_opt_cmd=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u -k all

Looking at the options man page, it appears to be part of Tk? I verified I have Tk 8.4 installed. I've poked around quite a bit and can't seem to figure out what package has the options command line.

I ran the commands in the debugging section and it definitely switches to "term to gui" when I go to Chromium and back to "gui to term" when I focus on Terminal.

Thank you for making this

No issue here, just thanks for making this! I was trying to get a Hackintosh setup, but got frustrated and installed Ubuntu instead. Now using Kinto I have a keyboard layout that I'm used to. Happy days 😄

This issue should probably be closed or deleted so it doesn't create noise. Didn't know a better way to say thanks, though :)

Unable to enter "at" symbol

Using this, I can no longer enter the "at" symbol which normally requires me to press RightAlt-Q on a German keyboard. I could not find a way to enter this symbol anymore.

Question - will this work under nixos + KDE plasma?

Hi,

sorry to post question as issue, but I'm wonder if I could use this for my nixos + KDE Plasma setup?

Coming from MacOS I started remapping everything within KDE but then struck a wall with chromium and FF. Just the simple stuff like cmd-c, cmd-v and such. So started google bonanza and struck this repo.

The readme states "Fedora/RHEL/Manjaro/Arch/Debian/Ubuntu based distro 16.04+" so I guess nixos isn't supported…?

IBus Issue under Manjaro Gnome Edition

First reported by @mlbaquerizo #44

This issue prevents wordwise from working correctly under Firefox or Chrome as either xkb or xdotool cannot switch keymaps until the IBus Panel is operating properly.

To set your IBus as the default method you can manually do this and logoff and back on. (I would have merged this as a fix already, but the panel being the other element prevents me from making any updates on this issue.)

Use xim to avoid the Firefox jail.

IBus has been started! If you cannot use IBus, please add below lines in ~/.bashrc, and relogin your desktop.
export GTK_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=xim

You can do your own testing, if you want, by running these two commands out of the caret_status.sh file.

# org.freedesktop.ibus.panel

IBUSADD=$(cat ~/.config/ibus/bus/`ls ~/.config/ibus/bus -1rt | tail -n1` | awk -F'IBUS_ADDRESS=' '{print $2}' | xargs)

dbus-monitor --address $IBUSADD "path='/org/freedesktop/IBus/Panel',interface='org.freedesktop.IBus.Panel',member='FocusOut'" 2> /dev/null | grep --line-buffered -o -P '(?<=object path \"/org/freedesktop/IBus/InputContext_).*(?=[\"])'

A more general command, not involving the panel, but I still can't seem to get any output in the terminal with it either

dbus-monitor --address $IBUSADD "path='/org/freedesktop/IBus',interface='org.freedesktop.IBus'"

org.freedesktop.IBus can be inspected using d-feet, but that hasn't told me much. If anyone has any ideas it would be appreciated and I'll merge the fix in.

https://wiki.archlinux.org/index.php/IBus
ibus/ibus#2018

I am not sure why it looks like Pop_OS has the IBus service running twice, but it does work fine in Pop_OS.

Pop_OS 19.10
Screen Shot 2020-03-11 at 5 14 38 PM

Manjaro Gnome 19.10
Screen Shot 2020-03-11 at 5 15 04 PM

Can't disable kinto

systemctl --user disable keyswap makes systemctl --user status keyswap display "disabled; vendor preset: enabled)," but the keyswap.service is still active on computer reboot.

Doesn't seem to work on Elementary OS

I have Elementary OS (latest, up to date) and two Logitech K750 keyboards. One is windows layout, the other is mac. I used to use the windows one at work for linux, and the other one at home with my mac and my linux when working from home. I just had to create a new layout to swap @ and <, which for some reason were swapped.

I installed your script but it failed:



                      K!nt◎
            - F!x the dɑmn kɐyb◎ɑrd. - 

Press Enter to begin...

What type of system are you using?
    1) Windows
    2) Chromebook
    3) Mac
3

Would you like to swap Command back to Super/Win and Ctrl key back to Ctrl when using terminal applications? (y/n)
Note: For a more mac like experience & less issues with terminal based interactions y is recommended.
y

Looking for keyboards...

Internal Keyboard
Name: AT Translated Set 2 keyboard
ID: 17


USB Keyboard
Name: Microsoft_Microsoft_Nano_Transceiver_1.1
ID: 14
14
14

Setting up mac keyswap as a service.
You can disable and remove the service by using the following commands.
systemctl --user stop keyswap
systemctl --user disable keyswap
rm -rf ~/.config/autostart/keyswap.sh
rm -rf ~/.config/xactive.sh
/bin/bash -c "./keyswap_service.sh 1 0 mac 17 14
14
14 0"
+ swapbehavior=1
+ noswapcmd=0
+ systemtype=mac
+ internalid=17
+ usbid=14
+ chromeswap=
+ [[ 1 == \1 ]]
++ whoami
+ swapcmd='\/bin\/bash\ \/home\/bdu\/.config\/xactive.sh\ mac\ 17\ 14\ '
+ mkdir -p /home/bdu/.config/systemd/user
+ cp ./system-config/keyswap.service /home/bdu/.config/systemd/user/keyswap.service
+ cp ./system-config/keyswap.sh /home/bdu/.config/autostart/keyswap.sh
+ cp ./system-config/xactive.sh /home/bdu/.config/xactive.sh
++ whoami
+ sed -i 's/{username}/bdu/g' /home/bdu/.config/systemd/user/keyswap.service
+ sed -i 's/ExecStart=/ExecStart=\/bin\/bash\ \/home\/bdu\/.config\/xactive.sh\ mac\ 17\ 14\ /g' /home/bdu/.config/systemd/user/keyswap.service
+ systemctl --user enable keyswap
+ systemctl --user start keyswap
/bin/bash: line 1: 14: command not found
/bin/bash: line 2: 14: command not found
Traceback (most recent call last):
  File "./install.py", line 162, in <module>
    keyboard_detect()
  File "./install.py", line 82, in keyboard_detect
    subprocess.check_output(keyswapcmd, shell=True).decode('utf-8')
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '/bin/bash -c "./keyswap_service.sh 1 0 mac 17 14
14
14 0"' returned non-zero exit status 127.

I tried to read the install script, the keyswap service script (I just added set -x to see what it does), but nothing worked. The keys were not swapped.

Ran on GalliumOS, no effect

Here's the output of what I ran following the git clone steps and the like. My keyboard is Chromebook. I'm using the built in keyboard (Chromebook keyboard) on my Chromebook so I assume option 3 then option 1 is the correct path to get this thing to behave like a Mac keyboard.

Simple request to just make the Overlay button be the Alt button so I can use my thumb to copy/paste/home/end. Per application bindings sounds fun but I'm willing to skip that for now just so that I can use my thumb.

Kinto - Type in Linux like it's a Mac.

    1. ❖  Windows 
    2. ⌘  Mac 
    3. ✇  Chromebook 

Please enter your keyboard type (1 - 3) : 3

1. Chromebook
Description: Standard Chromebook Keyboards
2. Chromebook - Windows
Description: Chromebook with Windows 104 Keyboard
3. Chromebook - Mac
Description: Chromebook with Mac Keyboard

Please enter your keyboard config (1 - 3) : 1

'./.xkb/symbols/chromebook' -> '/home/chris/.xkb/symbols/chromebook'
'./.xkb/symbols/mac_gui' -> '/home/chris/.xkb/symbols/mac_gui'
'./.xkb/symbols/mac_term' -> '/home/chris/.xkb/symbols/mac_term'
'./.xkb/symbols/mac_term_chromebook' -> '/home/chris/.xkb/symbols/mac_term_chromebook'
'./.xkb/types' -> '/home/chris/.xkb/types'
'./.xkb/types/mac_gui' -> '/home/chris/.xkb/types/mac_gui'
'./.xkb/types/mac_term' -> '/home/chris/.xkb/types/mac_term'
One time initialization tweaks are available. Would you like to view them? (Y/n) y

1. gnome-init
Description: Gnome - Remove Superkey Overlay keybinding to Activities Overview
run: gsettings set org.gnome.mutter overlay-key ''

2. kde-init
Description: KDE Plasma 5 - Removes Superkey Overlay from the Launcher Menu
run: kwriteconfig5 --file ~/.config/kwinrc --group ModifierOnlyShortcuts --key Meta ""
qdbus org.kde.KWin /KWin reconfigure

Please enter your init tweak(s) (eg 1 or 1 2 3 - leave blank to skip): 


Dynamic shortcut tweaks

1. Gnome Activities Overview
Description: Cmd+Space activates Activities Overview
run in gui mode: gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['<Ctrl>Space']"
run in terminal mode: gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['<Control><Shift>Space']"

Please enter your dynamic shortcut tweak(s) (eg 1 or 1 2 3 - leave blank to skip): 
1
Saved configuration to ~/.config/kinto/user_config.json

Now running keyswap_service.sh to setup the keyswap service...
Keyswap will be configured to run on user login

You may start, stop, restart or view the status of the service with following commands

systemctl --user start keyswap
systemctl --user stop keyswap
systemctl --user restart keyswap
systemctl --user status keyswap
Created symlink /home/chris/.config/systemd/user/default.target.wants/keyswap.service → /home/chris/.config/systemd/user/keyswap.service.
chris@chromebook:~/Documents/kinto$ sh keyswap_service.sh 
Created symlink /home/chris/.config/systemd/user/default.target.wants/keyswap.service → /home/chris/.config/systemd/user/keyswap.service.
chris@chromebook:~/Documents/kinto$ systemctl --user start keyswap
chris@chromebook:~/Documents/kinto$ systemctl --user restart keyswap

[Dev Branch] Cmd+Tab crashes desktop environment on Elementary OS 5.1

Install Type: Bare Metal
Distro: Elementary OS 5.1 Hera
DE: Pantheon
Branch: dev

I thought I'd give the dev branch a shot as per jonchun/ubuntu2macOS#1. I hit "yes" on the prompt to enable system wide hotkeys (i forget what the exact prompt was). I then remapped my window switcher back to default (real alt+tab) [super key+tab with kinto]. However, my desktop environment seems to crash whenever I try switching Windows. Not sure if I correctly captured everything, but here is the last parts of my journalctl before I swapped back over to the master branch and overwrote alt+tab with ctrl+tab.

Mar 28 17:50:59 jchun-desktop systemd[1420]: Started keyswap for Terminal and GUI.
Mar 28 17:50:59 jchun-desktop bash[30910]: Importing user_config.json...
Mar 28 17:50:59 jchun-desktop bash[30910]: Data from user_config.json imported successfully.
Mar 28 17:50:59 jchun-desktop bash[30910]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 17:50:59 jchun-desktop bash[30910]: Starting keyswap...
Mar 28 17:50:59 jchun-desktop bash[30910]: First window name: Firefox
Mar 28 17:50:59 jchun-desktop bash[30910]: firefox: Firefox
# I think I must have rebooted here into windows dual boot. not sure why journalctl didn't log the reboot.
Mar 28 20:20:43 jchun-desktop bash[30910]: /home/jchun/.config/kinto/xactive.sh: line 12: 30912 Segmentation fault      ./kintox11
Mar 28 20:20:44 jchun-desktop systemd[1420]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 28 20:20:44 jchun-desktop systemd[1420]: keyswap.service: Scheduled restart job, restart counter is at 73.
Mar 28 20:20:44 jchun-desktop systemd[1420]: Stopped keyswap for Terminal and GUI.
Mar 28 20:20:44 jchun-desktop systemd[1420]: Starting keyswap for Terminal and GUI...
Mar 28 20:20:49 jchun-desktop systemd[1420]: Started keyswap for Terminal and GUI.
Mar 28 20:20:50 jchun-desktop bash[31385]: Importing user_config.json...
Mar 28 20:20:50 jchun-desktop bash[31385]: Data from user_config.json imported successfully.
Mar 28 20:20:50 jchun-desktop bash[31385]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 20:20:50 jchun-desktop bash[31385]: Starting keyswap...
Mar 28 20:20:50 jchun-desktop bash[31385]: First window name: Firefox
Mar 28 20:20:50 jchun-desktop bash[31385]: firefox: Firefox
Mar 28 20:23:56 jchun-desktop bash[31385]: gui: TelegramDesktop
Mar 28 20:24:01 jchun-desktop bash[31385]: firefox: Firefox
Mar 28 20:25:26 jchun-desktop bash[31385]: gui: TelegramDesktop
Mar 28 20:25:31 jchun-desktop bash[31385]: firefox: Firefox
Mar 28 20:25:52 jchun-desktop bash[31385]: sh: 1: 1: Too many open files
Mar 28 20:25:52 jchun-desktop bash[31385]: Aborted
Mar 28 20:25:53 jchun-desktop bash[31385]: /home/jchun/.config/kinto/xactive.sh: line 12: 31387 Segmentation fault      ./kintox11
Mar 28 20:25:54 jchun-desktop systemd[1420]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 28 20:25:54 jchun-desktop systemd[1420]: keyswap.service: Scheduled restart job, restart counter is at 74.
Mar 28 20:25:54 jchun-desktop systemd[1420]: Stopped keyswap for Terminal and GUI.
Mar 28 20:25:54 jchun-desktop systemd[1420]: Starting keyswap for Terminal and GUI...
Mar 28 20:25:59 jchun-desktop systemd[1420]: Started keyswap for Terminal and GUI.
Mar 28 20:25:59 jchun-desktop bash[31829]: Importing user_config.json...
Mar 28 20:25:59 jchun-desktop bash[31829]: Data from user_config.json imported successfully.
Mar 28 20:25:59 jchun-desktop bash[31829]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 20:25:59 jchun-desktop bash[31829]: Starting keyswap...
Mar 28 20:25:59 jchun-desktop bash[31829]: First window name: Firefox
Mar 28 20:25:59 jchun-desktop bash[31829]: firefox: Firefox
Mar 28 20:26:09 jchun-desktop bash[31829]: gui: albert
Mar 28 20:26:12 jchun-desktop bash[31829]: X11 error: type=0, serial=82, code=3
Mar 28 20:26:12 jchun-desktop bash[31829]: fail to get top window: 1
Mar 28 20:26:14 jchun-desktop systemd[1420]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 28 20:26:14 jchun-desktop systemd[1420]: keyswap.service: Scheduled restart job, restart counter is at 75.
Mar 28 20:26:14 jchun-desktop systemd[1420]: Stopped keyswap for Terminal and GUI.
Mar 28 20:26:14 jchun-desktop systemd[1420]: Starting keyswap for Terminal and GUI...
Mar 28 20:26:19 jchun-desktop systemd[1420]: Started keyswap for Terminal and GUI.
Mar 28 20:26:19 jchun-desktop bash[31938]: Importing user_config.json...
Mar 28 20:26:19 jchun-desktop bash[31938]: Data from user_config.json imported successfully.
Mar 28 20:26:19 jchun-desktop bash[31938]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 20:26:19 jchun-desktop bash[31938]: Starting keyswap...
Mar 28 20:26:19 jchun-desktop bash[31938]: First window name: Io.elementary.switchboard
Mar 28 20:26:19 jchun-desktop bash[31938]: gui: Io.elementary.switchboard
Mar 28 20:26:31 jchun-desktop bash[31938]: firefox: Firefox
Mar 28 20:26:31 jchun-desktop bash[31938]: gui: Io.elementary.switchboard
Mar 28 20:26:40 jchun-desktop bash[31938]: term: Io.elementary.terminal
Mar 28 20:26:45 jchun-desktop bash[31938]: gui: TelegramDesktop
Mar 28 20:26:48 jchun-desktop bash[31938]: firefox: Firefox
Mar 28 20:26:59 jchun-desktop bash[31938]: term: Io.elementary.terminal
Mar 28 20:27:59 jchun-desktop systemd[1420]: Stopping keyswap for Terminal and GUI...
Mar 28 20:27:59 jchun-desktop systemd[1420]: Stopped keyswap for Terminal and GUI.
Mar 28 20:28:35 jchun-desktop systemd[1420]: Started keyswap for Terminal and GUI.
Mar 28 20:28:35 jchun-desktop bash[955]: Importing user_config.json...
Mar 28 20:28:35 jchun-desktop bash[955]: Data from user_config.json imported successfully.
Mar 28 20:28:35 jchun-desktop bash[955]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 20:28:35 jchun-desktop bash[955]: Starting keyswap...
Mar 28 20:28:35 jchun-desktop bash[955]: First window name: Io.elementary.terminal
Mar 28 20:28:35 jchun-desktop bash[955]: term: Io.elementary.terminal
Mar 28 20:28:39 jchun-desktop bash[955]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Mar 28 20:28:39 jchun-desktop bash[955]:       after 140 requests (140 known processed) with 0 events remaining.
Mar 28 20:28:39 jchun-desktop bash[955]: gui: discord
Mar 28 20:28:39 jchun-desktop bash[955]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Mar 28 20:28:39 jchun-desktop bash[955]:       after 22 requests (22 known processed) with 0 events remaining.
Mar 28 20:28:39 jchun-desktop systemd[1420]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 28 20:28:39 jchun-desktop systemd[1420]: keyswap.service: Failed with result 'exit-code'.
Mar 28 20:28:40 jchun-desktop systemd[1420]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 28 20:28:40 jchun-desktop systemd[1420]: keyswap.service: Scheduled restart job, restart counter is at 1.
Mar 28 20:28:40 jchun-desktop systemd[1420]: Stopped keyswap for Terminal and GUI.
Mar 28 20:28:40 jchun-desktop systemd[1420]: Started keyswap for Terminal and GUI.
Mar 28 20:29:41 jchun-desktop bash[1237]: Invalid MIT-MAGIC-COOKIE-1 keyImporting user_config.json...
Mar 28 20:29:41 jchun-desktop bash[1237]: Data from user_config.json imported successfully.
Mar 28 20:29:41 jchun-desktop bash[1237]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 20:29:41 jchun-desktop bash[1237]: fail to open X server display...
Mar 28 20:29:41 jchun-desktop bash[1237]: fail to open X server display...
Mar 28 20:29:41 jchun-desktop bash[1237]: fail to open X server display for 1 minute...
Mar 28 20:29:41 jchun-desktop bash[1237]: Kintox11 is now exiting...
Mar 28 20:29:41 jchun-desktop systemd[1420]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 28 20:29:41 jchun-desktop systemd[1420]: keyswap.service: Failed with result 'exit-code'.
-- Reboot --
Mar 28 20:30:51 jchun-desktop systemd[1461]: Started keyswap for Terminal and GUI.
Mar 28 20:30:51 jchun-desktop bash[2051]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Mar 28 20:30:51 jchun-desktop bash[2051]:       after 140 requests (140 known processed) with 0 events remaining.
Mar 28 20:30:51 jchun-desktop bash[2051]: Importing user_config.json...
Mar 28 20:30:51 jchun-desktop bash[2051]: Data from user_config.json imported successfully.
Mar 28 20:30:51 jchun-desktop bash[2051]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 20:30:51 jchun-desktop bash[2051]: Starting keyswap...
Mar 28 20:30:51 jchun-desktop bash[2051]: First window name: TelegramDesktop
Mar 28 20:30:51 jchun-desktop bash[2051]: gui: TelegramDesktop
Mar 28 20:30:51 jchun-desktop bash[2051]: XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
Mar 28 20:30:51 jchun-desktop bash[2051]:       after 16 requests (16 known processed) with 0 events remaining.
Mar 28 20:30:51 jchun-desktop systemd[1461]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 28 20:30:51 jchun-desktop systemd[1461]: keyswap.service: Failed with result 'exit-code'.
Mar 28 20:30:52 jchun-desktop systemd[1461]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 28 20:30:52 jchun-desktop systemd[1461]: keyswap.service: Scheduled restart job, restart counter is at 1.
Mar 28 20:30:52 jchun-desktop systemd[1461]: Stopped keyswap for Terminal and GUI.
Mar 28 20:30:52 jchun-desktop systemd[1461]: Started keyswap for Terminal and GUI.
Mar 28 21:28:47 jchun-desktop bash[2149]: Invalid MIT-MAGIC-COOKIE-1 keyImporting user_config.json...
Mar 28 21:28:47 jchun-desktop bash[2149]: Data from user_config.json imported successfully.
Mar 28 21:28:47 jchun-desktop bash[2149]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 21:28:47 jchun-desktop bash[2149]: fail to open X server display...
Mar 28 21:28:47 jchun-desktop bash[2149]: fail to open X server display...
Mar 28 21:28:47 jchun-desktop bash[2149]: fail to open X server display for 1 minute...
Mar 28 21:28:47 jchun-desktop bash[2149]: Kintox11 is now exiting...
Mar 28 21:28:47 jchun-desktop systemd[1461]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 28 21:28:47 jchun-desktop systemd[1461]: keyswap.service: Failed with result 'exit-code'.
Mar 28 21:28:48 jchun-desktop systemd[1461]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 28 21:28:48 jchun-desktop systemd[1461]: keyswap.service: Scheduled restart job, restart counter is at 2.
Mar 28 21:28:48 jchun-desktop systemd[1461]: Stopped keyswap for Terminal and GUI.
Mar 28 21:28:48 jchun-desktop systemd[1461]: Started keyswap for Terminal and GUI.
Mar 28 21:28:48 jchun-desktop bash[2972]: Importing user_config.json...
Mar 28 21:28:48 jchun-desktop bash[2972]: Data from user_config.json imported successfully.
Mar 28 21:28:48 jchun-desktop bash[2972]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 21:28:48 jchun-desktop bash[2972]: Starting keyswap...
Mar 28 21:28:48 jchun-desktop bash[2972]: First window name: Io.elementary.terminal
Mar 28 21:28:48 jchun-desktop bash[2972]: term: Io.elementary.terminal
Mar 28 21:29:41 jchun-desktop bash[2972]: X11 error: type=0, serial=51, code=3
Mar 28 21:29:41 jchun-desktop bash[2972]: fail to get top window: 1
Mar 28 21:29:41 jchun-desktop systemd[1461]: keyswap.service: Main process exited, code=exited, status=1/FAILURE
Mar 28 21:29:41 jchun-desktop systemd[1461]: keyswap.service: Failed with result 'exit-code'.
Mar 28 21:29:42 jchun-desktop systemd[1461]: keyswap.service: Service hold-off time over, scheduling restart.
Mar 28 21:29:42 jchun-desktop systemd[1461]: keyswap.service: Scheduled restart job, restart counter is at 3.
Mar 28 21:29:42 jchun-desktop systemd[1461]: Stopped keyswap for Terminal and GUI.
Mar 28 21:29:42 jchun-desktop systemd[1461]: Started keyswap for Terminal and GUI.
Mar 28 21:29:42 jchun-desktop bash[4186]: Importing user_config.json...
Mar 28 21:29:42 jchun-desktop bash[4186]: Data from user_config.json imported successfully.
Mar 28 21:29:42 jchun-desktop bash[4186]: Running init command: gsettings set org.gnome.mutter overlay-key ''
Mar 28 21:29:42 jchun-desktop bash[4186]: Starting keyswap...
Mar 28 21:29:42 jchun-desktop bash[4186]: First window name: Io.elementary.terminal
Mar 28 21:29:42 jchun-desktop bash[4186]: term: Io.elementary.terminal

Clarity on problems with KDE Window Switching

You mention here that there are issues with getting KDE alt+tabbing to work like it does on macOS.

However, that has not been my experience at all on KDE Neon. Here is a screenshot of my settings for the Task Switcher. (In the Alternative tab, I also have Ctrl+Shift+Tab set).
Screenshot_20200330_231730
I'm guessing that with your black magic, you can probably remap my Ctrl+Tab and Ctrl+Shift+tab to Ctrl+F11 or something similar to in Gnome so that I don't have to set up 2 hotkeys for the same thing.

This works nearly exactly like it does on macOS for me so I'm happy with it, but I'm opening this for further clarity on what issues you've had so that I can either start thinking of a workaround or considering whether or not I will personally run into it in the future. I'm sure that it might help others in the future who are trying to decide between using kinto with KDE vs Gnome as well.

Switch keyboard layout

Hello, how can I change the keyboard layout from us to ru on capslock? When I install kinto everything works except switching the layout.
If possible, could you post a full guide.
Thanks.

Missing file during installation and trouble with remapping

Hi there, thank you for for effort with this super useful key remapping!

I have run into two issues:

  1. I get a missing file error when running the install script, specifically cp: cannot create regular file '/home/nick/.config/autostart/keyswap.sh': No such file or directory. Here is the install script output if that helps:
➜ ./install.py          


                      K!nt◎
            - F!x the dɑmn kɐyb◎ɑrd. - 

Press Enter to begin...

What type of keyboard are you using? (If Mac and Windows then select Mac)
    1) Windows
    2) Chromebook
    3) Mac
3

Would you like to swap Command back to Super/Win and Ctrl key back to Ctrl when using terminal applications? (y/n)
Note: For a more mac like experience & less issues with terminal based interactions y is recommended.
y
Setting up mac keyswap as a service.
You can disable and remove the service by using the following command in the Kinto directory.
./uninstall.sh
cp: cannot create regular file '/home/nick/.config/autostart/keyswap.sh': No such file or directory
Created symlink /home/nick/.config/systemd/user/default.target.wants/keyswap.service → /home/nick/.config/systemd/user/keyswap.service.

An Apple keyboard with the hid_apple driver was detected.
Please run the following commands to swap alt/option and Command.
Your Kinto keymapping will not work right on Apple keyboards without it.

echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
options hid_apple swap_opt_cmd=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
update-initramfs -u -k all

The above was easily fixed with mkdir -p ~/.config/autostart/ and rerunning the install script again.

However this brings us to problem 2.

  1. The keys are not remapping correctly in mac gui environments, like firefox etc. In the gui environments, Ctrl is still Ctrl, Cmd seems to be Alt, and Alt seems to be Cmd.

I made sure that the service was running in the background, and still no dice. I then did some debugging and ran the following:

$ systemctl --user disable keyswap
$ systemctl --user stop keyswap
$ ~/.config/xactive.sh mac 12 0 none

I notice that when I go into xterm, the output from the above says internal gui to term but when I switch to firefox, the output says:

Error:            
  Can't find file "mac_gui" for types include
  Exiting
  Abandoning keytypes file "(null)"

Any Ideas?

PS. Let me know if I can provide anymore details :)

Failed to start keyswap for Terminal and GUI #7 follow up

Hi @rbreaves ,

This is the follow up from clost issue #7

I did the sudo apt install x11-utils the return indicates x11-utils is already the newest version (7.7+4).

Then I execute the cmd got following response with the most recent repo.

rickd-ubuntu% /bin/bash /home/rickd/.config/xactive.sh mac_only 0 0 0
xprop: error: Invalid window id format: 0x0.
1
internal term to gui
0
internal gui to term
xprop: error: Invalid window id format: 0x0.
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
1
internal term to gui
0
internal gui to term
0
internal gui to term
0
internal gui to term
xprop: error: Invalid window id format: 0x0.

Besides, I'd like to confirm for the install script.

What type of keyboard are you using? (If Mac and Windows then select Mac)
1) Windows
2) Chromebook
3) Mac

Does 1. Windows indicates the windows keyboard layout such as regular office keyboard(108 keys. e,g, amazon keyboard)?
If Im using such kind of keyboard, I should select Windows.

Besides,
image

Thanks!

Kinto sometimes starts before Display variable has populated

If this occurs then this error will happen, on reboot or startup.

bash[1307]: Invalid MIT-MAGIC-COOKIE-1 keyCannot open display ":0"

running this command resolves it, but need to add more code to delay the start of the script or check variables and slowly loop if an invalid value is returned.

systemctl --user restart keyswap

[question] Dead keys in super button for tildes

Hi there, great work! works great on Manjaro Gnome.
The altgr (right key after the space) was the dead key by default in english (macintosh) distribution keyboard. You press it altgr + e , vowel and you gain an accented e (é) the altgr + n (ñ) and so on.

Wondering if I can put the dead key in super key with that behaviour? Thank you!

manjaro-gnome 19.0.2: setup.py -- im-config command not found

When running setup.py in manjaro-gnome 19.0.2 after first logoff and logon

Xbindkeys, and xdotool requirement is installed.
You need to set IBus as the default Input Method for full word-wise support and re-run this installer.

im-config -n ibus

Would you like to run it now? (Will require logoff and logon.)
 (Y/n) y
sh: im-config: command not found


IBus has been set as the default Input Method.

A success message is displayed at the end even though im-config was not run (since it's not installed).

Should there be a step in setup.py to install im-config? Or am I good to run install?

Can it be disabled for specific applications?

First of all, thank you for this great tool!

My issue is that I use TMUX and all my mappings in my config are set to Alt (or Meta), and since this key is swapped, I get conflicts in terminal under certain conditions.

I'm wondering if I can disable kinto just for terminal but keep it running for all other applications?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.