Compare commits

..

277 Commits

Author SHA1 Message Date
Ben Reaves
7197b5bb39 Merge pull request #111 from rbreaves/dev
- Full Uninstaller Added for All DE's in setup.py
2020-04-13 23:45:30 -05:00
Ben Reaves
543a10884d - Added XFCE full uninstaller 2020-04-13 23:43:52 -05:00
Ben Reaves
6c8bcb8d7c - Added KDE backup and restore hotkeys to uninstaller 2020-04-13 23:08:50 -05:00
Ben Reaves
7ec0b0ad7e Merge pull request #110 from rbreaves/dev
- Improved Uninstaller for Gnome, Opens up KDE keymaps better
2020-04-13 01:31:57 -05:00
Ben Reaves
e885fa0033 - Added Uninstaller for Gnome DE, restore and reset hotkey options. 2020-04-12 23:57:25 -05:00
Ben Reaves
97e6ed076a - Terminal under KDE still back cycles with this fix, will need to contact KDE/Task Switcher maintainer to fix. 2020-04-12 19:55:37 -05:00
Ben Reaves
e3d693cfcd - Resetting KDE maximize window to use Ctrl+Cmd+F & Alt+F10 2020-04-12 19:10:41 -05:00
Ben Reaves
a06d983b97 Merge pull request #109 from rbreaves/master
Not really merging anything
2020-04-12 18:52:36 -05:00
Ben Reaves
eb691d5174 - Correcting logic for detecting kde 2020-04-12 18:47:32 -05:00
Ben Reaves
5922e1b5a9 Merge branch 'dev' - KDE Operations shortcut removed for sublimetext selectall 2020-04-12 16:57:28 -05:00
Ben Reaves
f9e000ef23 - Corrected KDE Operations Menu to no longer conflict on Alt+F3 with Sublimetext selectall 2020-04-12 16:56:46 -05:00
Ben Reaves
eb5e77ffd6 Merge branch 'dev' - Bring back FF to GUI fix 2020-04-12 16:48:10 -05:00
Ben Reaves
8ae3d3b792 Merge branch 'hotfix' into dev 2020-04-12 16:47:02 -05:00
Ben Reaves
e36fa9216b Merge branch 'dev' 2020-04-12 16:43:48 -05:00
Ben Reaves
58d3273f3d Merge branch 'dev' 2020-04-12 17:28:06 -05:00
Ben Reaves
0f6cfb95cc - Updated default keymap descriptions for cleaner install 2020-04-12 17:27:45 -05:00
Ben Reaves
d2e5f25c8d Merge branch 'dev' 2020-04-12 17:02:34 -05:00
Ben Reaves
6529d3b909 - Updated script to start kinto immediately after install 2020-04-12 17:02:01 -05:00
Ben Reaves
eeb87d3434 Merge branch 'dev' 2020-04-12 16:58:51 -05:00
Ben Reaves
fe8b0a2027 - Re-added caps_escape PR to dev 2020-04-12 16:53:37 -05:00
Ben Reaves
4be9043f10 - Corrected new KDE commands for CmdTab app switching 2020-04-12 16:43:33 -05:00
Ben Reaves
65df97e8bf - Fixed Cmd+Tab App Switching for KDE 2020-04-12 16:31:55 -05:00
Ben Reaves
9f3b4b0072 - Added possible fix for maximize in KDE 2020-04-12 14:52:27 -05:00
Ben Reaves
e35e92fdbd - Corrected KDE key remap, but maximize is not fully enabled. It could break Cmd+F under KDE. 2020-04-12 14:26:13 -05:00
Ben Reaves
9c87cb2774 - Fullscreen shortcut removed, glitches Cmd+F 2020-04-12 03:17:07 -05:00
Ben Reaves
3bd45bc627 - Resolved instability issue under KDE and xkb keymaps 2020-04-12 02:43:40 -05:00
Ben Reaves
3b9ce890dc - Corrected merge of setup.py 2020-04-12 00:06:40 -05:00
Ben Reaves
a6688ffc44 - Added comments to mac_gui 2020-04-12 00:00:30 -05:00
Ben Reaves
94128f7dbf - Merged master into dev 2020-04-11 23:40:49 -05:00
Ben Reaves
9a451bd93c Merge pull request #107 from indrekj/caps_escape
Add Caps Lock to Escape modifier
2020-04-11 13:20:11 -05:00
Indrek Juhkam
3dd930d1e5 Add Caps Lock to Escape modifier
There already is "swapescape" which swaps caps lock with escape. I
however don't use Caps Lock and all, and so far have binded it to Escape
on all my systems. I think this can be useful for others as well.
2020-04-11 13:35:52 +03:00
Ben Reaves
462ceb578c Merge pull request #106 from rbreaves/hotfix
- Multithreading added, FF to GUI keymap refresh fix, Hyper term added
2020-04-10 15:43:29 -05:00
Ben Reaves
b958668853 Merge branch 'master' into hotfix 2020-04-10 11:27:42 -05:00
Ben Reaves
1ae333f0ed - Switching btwn FF & GUI apps no longer triggers keymap refresh. Resolves latency #69. 2020-04-10 00:05:55 -05:00
Ben Reaves
0baf62a261 - Added multithreading for on/off input field keymaps 2020-04-09 17:15:16 -05:00
Ben Reaves
f35f75bd30 - Added Hyper for Windows 2020-04-06 03:02:09 -05:00
Ben Reaves
e34ff1c86e Merge pull request #105 from rbreaves/hotfix
- Added Windows Terminal Support
2020-04-06 01:26:01 -05:00
Ben Reaves
89500c97c6 - Added Windows Terminal Support 2020-04-06 01:23:26 -05:00
Ben Reaves
d9225a73ef Merge pull request #104 from rbreaves/hotfix
- Added Ctrl-Z to posix terminals for Windows
2020-04-05 17:40:27 -05:00
Ben Reaves
5f75f66852 - Added Ctrl-Z to posix terminals for Windows 2020-04-05 17:39:28 -05:00
Ben Reaves
7e6011a0a9 Merge pull request #103 from rbreaves/hotfix
- Added ConEmu/Cmder, mintty, and powershell support
2020-04-05 17:05:20 -05:00
Ben Reaves
9608ef95ae - Added ConEmu/Cmder, mintty, and powershell support 2020-04-05 17:04:08 -05:00
Ben Reaves
ab637704de Merge pull request #102 from rbreaves/hotfix
- Remapped Start Menu in Windows to Cmd+Space
2020-04-05 03:06:13 -05:00
Ben Reaves
ed7c68a388 - Remapped Start Menu in Windows to Cmd+Space 2020-04-05 03:05:24 -05:00
Ben Reaves
f8f2df0d65 Merge pull request #101 from rbreaves/hotfix
- Added groupings for Windows ahk script
2020-04-05 00:15:15 -05:00
Ben Reaves
ea70936454 - Added groupings for Windows ahk script 2020-04-05 00:14:18 -05:00
Ben Reaves
4849fb55ac Update README.md 2020-04-04 23:28:00 -05:00
Ben Reaves
fb2f6674ad Merge pull request #100 from rbreaves/hotfix
- Corrected comment
2020-04-04 23:10:14 -05:00
Ben Reaves
dc2f9c332d - Corrected comment 2020-04-04 23:09:30 -05:00
Ben Reaves
42218a3172 Merge pull request #99 from rbreaves/hotfix
- Windows 10, wordwise and close app support
2020-04-04 23:08:37 -05:00
Ben Reaves
6965d81c79 - Windows 10, wordwise and close app support 2020-04-04 23:07:49 -05:00
Ben Reaves
74c66d91cc Merge pull request #98 from rbreaves/hotfix
- Windows 10, proper app switching and in-app tab switching
2020-04-04 22:57:37 -05:00
Ben Reaves
08c02c2b8f - Updated Windows 10 to support proper app switching and in-app tab switching 2020-04-04 22:56:18 -05:00
Ben Reaves
05ead51322 Update README.md 2020-04-04 22:14:00 -05:00
Ben Reaves
deac0cfb0a Update README.md 2020-04-04 22:09:30 -05:00
Ben Reaves
087d7a7d0e Update README.md 2020-04-04 22:08:48 -05:00
Ben Reaves
e755c84b27 Update README.md 2020-04-04 22:07:49 -05:00
Ben Reaves
1a07a55fa9 Update README.md 2020-04-04 22:05:43 -05:00
Ben Reaves
192a640e6c Update README.md 2020-04-04 22:02:27 -05:00
Ben Reaves
ccc081adba Update README.md 2020-04-04 22:00:24 -05:00
Ben Reaves
336d883b03 Merge pull request #97 from rbreaves/hotfix
- Added uninstall option for Windows
2020-04-04 21:36:38 -05:00
Ben Reaves
61e357b5da - Added uninstall option for Windows 2020-04-04 21:35:43 -05:00
Ben Reaves
407f781af0 Merge pull request #96 from rbreaves/hotfix
- Added reg file for keyswap removal
2020-04-04 21:27:06 -05:00
Ben Reaves
4250967d5a - Added reg file for keyswap removal 2020-04-04 21:26:11 -05:00
Ben Reaves
c0785ac045 Merge pull request #95 from rbreaves/hotfix
- Windows 10 & WSL Support Added
2020-04-04 21:19:42 -05:00
Ben Reaves
c57b5a3603 - Updated readme to reflect Windows 10 Support 2020-04-04 21:17:49 -05:00
Ben Reaves
4d423de14b - Added Windows 10 Support 2020-04-04 21:12:16 -05:00
Ben Reaves
ca4f9be6ee - Added sharpkeys config and autohotkey script for mac on Windows parity 2020-04-04 16:29:10 -05:00
Ben Reaves
a144a47836 Merge pull request #93 from rbreaves/hotfix
- Minor changes to NextEvent filter and added capslock options
2020-04-03 17:19:50 -05:00
Ben Reaves
afcb4c3a73 Merge pull request #92 from rbreaves/hotfix
- Minor changes to NextEvent filter and added capslock options
2020-04-03 17:18:40 -05:00
Ben Reaves
2846125c23 - Added more capslock options in response to #91 2020-04-03 17:15:43 -05:00
Ben Reaves
25ce34a2fc - Updated kintox11 to limit window checks to status ConfigureNotify 22 2020-04-02 17:32:39 -05:00
Ben Reaves
e1226afad8 Merge pull request #89 from rbreaves/hotfix
- Partial update for uninstaller
2020-04-02 13:25:45 -05:00
Ben Reaves
ead90abf94 - Partial update for uninstaller 2020-04-02 13:25:03 -05:00
Ben Reaves
5bf6b06917 Merge pull request #88 from indrekj/kitty
Add kitty to terminal emulators list
2020-04-02 10:09:42 -05:00
Indrek Juhkam
e892f045f5 Add kitty to terminal emulators list
See: https://sw.kovidgoyal.net/kitty/
2020-04-02 14:58:47 +03:00
Ben Reaves
00cfd67996 Merge pull request #85 from rbreaves/hotfix
- Updated kintox11 to streamline debug output more
2020-04-01 15:31:02 -05:00
Ben Reaves
c1c473c097 Merge pull request #84 from rbreaves/hotfix
- Updated kintox11 to streamline debug output more
2020-04-01 15:30:24 -05:00
Ben Reaves
969b74adda - Updated kintox11 to streamline debug output more 2020-04-01 15:25:41 -05:00
Ben Reaves
7e6f872983 Update issue templates 2020-04-01 02:38:30 -05:00
Ben Reaves
b50522c5b1 Update issue templates 2020-04-01 02:32:41 -05:00
Ben Reaves
6a887ebdea Update issue templates 2020-04-01 02:27:53 -05:00
Ben Reaves
d7433092ff Update issue templates 2020-04-01 02:25:29 -05:00
Ben Reaves
d670579db8 Update issue templates 2020-04-01 02:21:03 -05:00
Ben Reaves
3389c512e2 - Updated readme to include debug mode 2020-04-01 02:08:47 -05:00
Ben Reaves
703f6131d4 Merge pull request #83 from rbreaves/hotfix
- Added debug parameter
2020-04-01 01:50:57 -05:00
Ben Reaves
f3ab1e043b Merge pull request #82 from rbreaves/hotfix
- Added debug parameter
2020-04-01 01:48:22 -05:00
Ben Reaves
78e537ac71 - Added debug parameter 2020-04-01 01:46:44 -05:00
Ben Reaves
b1851316de - Prep work for proper KDE Plasma 5 hotkey support in KDE Neon 2020-03-30 23:13:35 -05:00
Ben Reaves
812d2a4bcd - Merged hotfixes for konsole fix, ibus, kde-init, and display env 2020-03-30 22:52:36 -05:00
Ben Reaves
997d2dd39f Merge pull request #81 from rbreaves/hotfix
- 3 Fixes, ibus install logic, kde-init, display env set
2020-03-30 22:45:15 -05:00
Ben Reaves
39c40bc315 - 3 Fixes, ibus install logic, kde-init not applying, display will always be set in systemd. 2020-03-30 22:43:21 -05:00
Ben Reaves
16f8b237d5 Merge pull request #78 from rbreaves/hotfix
- Updated defaults.json to resolve konsole intermittent input issue
2020-03-30 21:24:29 -05:00
Ben Reaves
7013d81686 - Updated defaults.json to resolve konsole intermittent input issue 2020-03-30 21:19:52 -05:00
Ben Reaves
daaa1fd352 Merge pull request #76 from rbreaves/hotfix
Updates binary to the latest
2020-03-30 18:55:30 -05:00
Ben Reaves
87ca8e7566 Merge pull request #75 from rbreaves/hotfix
- Recompiled kintox11.c a 2nd time
2020-03-30 18:49:20 -05:00
Ben Reaves
0e4160622f - Recompiled kintox11.c a 2nd time 2020-03-30 18:47:10 -05:00
Ben Reaves
47037d9619 Merge pull request #74 from rbreaves/hotfix
- Recompiled binary with static json-c
2020-03-30 17:25:28 -05:00
Ben Reaves
564360e9fa Merge pull request #73 from rbreaves/hotfix
- Recompiled binary with static json-c
2020-03-30 17:25:02 -05:00
Ben Reaves
91e692c76b - Recompiled binary with static json-c 2020-03-30 17:24:23 -05:00
Ben Reaves
ce31232015 Merge pull request #72 from rbreaves/hotfix
Hotfix
2020-03-30 16:27:20 -05:00
Ben Reaves
6c46696bd4 Merge pull request #71 from rbreaves/hotfix
- Fixed BadWindow errors caused by Destroy and UnmapNotify in Xlib
2020-03-30 16:25:22 -05:00
Ben Reaves
40c8d20513 - Fixed BadWindow errors caused by Destroy and UnmapNotify in Xlib 2020-03-30 16:10:00 -05:00
Ben Reaves
6b6e448e76 Updated readme with arrows to make it more clear. 2020-03-29 01:26:29 -05:00
Ben Reaves
f73a2c8420 Updated readme to include new animation 2020-03-29 00:52:18 -05:00
Ben Reaves
c6605c68cf - Fixes Kinto startup delay on cold boots. Closes #65 2020-03-28 16:04:15 -05:00
Ben Reaves
153c5e7b91 Merge pull request #66 from rbreaves/hotfix
- Fixes Kinto startup delay on cold boots. Closes #65
2020-03-28 15:57:45 -05:00
Ben Reaves
548e248515 - Fixes Kinto startup delay on cold boots. Closes #65 2020-03-28 15:55:33 -05:00
Ben Reaves
4a51232b9d - Cleaning up readme 2020-03-17 16:32:19 -05:00
Ben Reaves
4da8f97bf7 - Reorganized Readme 2020-03-17 16:31:18 -05:00
Ben Reaves
bfd363107d - Updated readme with more info on arch 2020-03-17 16:29:19 -05:00
Ben Reaves
6a2948e8a5 - Updated readme 2020-03-17 16:27:01 -05:00
Ben Reaves
16d5531035 - Updated readme w/ upgrade info. Closes ticket #60 2020-03-12 11:51:28 -05:00
Ben Reaves
5870f6b987 Merge branch 'hotfix' 2020-03-10 13:25:40 -05:00
Ben Reaves
557ba01eac - Merged hotfix for xbkcomp error message 2020-03-10 13:24:56 -05:00
Ben Reaves
fd2234fae4 - Remove xkbcomp error message that has no impact 2020-03-10 11:57:54 -05:00
Ben Reaves
21bfb6faae - Merged hotfix branch with dev 2020-03-09 18:13:56 -05:00
Ben Reaves
b904235653 - Separating xkb types to avoid select-all chrome bug on Super(ctrl)+a 2020-03-09 17:59:46 -05:00
Ben Reaves
36740e4b3e Merge pull request #55 from rbreaves/hotfix
- Adds ibus-setup & Epiphany. Closes issue #53
2020-03-09 12:22:47 -05:00
Ben Reaves
7c74dcca71 - Added package install of ibus for manjaro 2020-03-09 12:14:49 -05:00
Ben Reaves
8827b37ef3 Merge branch 'master' into hotfix 2020-03-09 11:29:14 -05:00
Ben Reaves
6631cd25a9 - Added ibus-setup fix for some distros and added Epiphany to chrome 2020-03-09 11:29:09 -05:00
Ben Reaves
1d59d8d643 - Closes ticket #52, adds Ctrl+a/e begin/end to gui 2020-03-07 14:26:37 -06:00
Ben Reaves
c5ff1f2513 - Revisions to readme 2020-03-06 15:29:02 -06:00
Ben Reaves
f0851a949c - Typo correction 2020-03-06 15:26:07 -06:00
Ben Reaves
332607765e Updated readme, how to add setxkbmap options 2020-03-06 15:24:36 -06:00
Ben Reaves
7e676938ee Merge pull request #51 from rbreaves/hotfix
- Added capslock swap option to mac_gui
2020-03-06 14:23:37 -06:00
Ben Reaves
7a706305c1 - Added capslock swap option to mac_gui 2020-03-06 14:14:46 -06:00
Ben Reaves
df9b8d974e - Fixed workspace switching shortcut for ubuntu and elementaryos 2020-03-06 13:43:51 -06:00
Ben Reaves
e7f0db4107 - Updated readme 2020-03-06 13:14:17 -06:00
Ben Reaves
031eaf7e9f Updated Readme with uninstall info 2020-03-05 23:42:09 -06:00
Ben Reaves
4078094e33 - Updated files for fedora and gnome compatibility 2020-03-02 03:24:00 -06:00
Ben Reaves
c8ab5eb4ba - Fixed tab switching issue under elementary Pantheon Terminal 2020-03-02 02:16:05 -06:00
Ben Reaves
2c1fb05920 - Added ibus-setup since it sometimes needs to be ran if it is not set already, also added elementary epiphany browser. Fixed elementary shortcut install trigger. 2020-03-01 20:15:53 -06:00
Ben Reaves
48b3d3f7bd - Fixed workspace switching shortcut 2020-03-01 18:57:28 -06:00
Ben Reaves
68a2d95b72 - Added removal of workspace left and right shortcuts for pop!_os, workspaces move up and down so the hotkeys go there now 2020-03-01 18:38:50 -06:00
Ben Reaves
89beeb427b - Fixed issue related to the F key trigger Control like behavior when shift is held on terminal. Also updated keymap profiles to be set properly on all installs - chromebook update broke it. 2020-03-01 18:09:24 -06:00
Ryan Reaves
d45b8e29dc - Added multicursor fix, particularly for sublime text 2020-03-01 00:03:04 -06:00
Ryan Reaves
7cb14dfbf3 - Added proper shortcuts for browser tab and app switching, updated installer. Chromebook related, galliumOS, xfce. 2020-02-29 23:37:56 -06:00
Ryan Reaves
19381a5528 - Updated files to support app switching on chromebooks with xfce 2020-02-29 17:48:55 -06:00
Ryan Reaves
4a9ced9478 - Removed Cmd+W from closing an app, should and already closes tabs 2020-02-29 14:33:16 -06:00
Ben Reaves
51e86149bc - Fixed workspace change on pop! os, need to apply to rest 2020-02-29 03:59:01 -06:00
Ben Reaves
f9647a5476 - Added notes about Cmd+H not being enabled and added sublime text replace hotkey 2020-02-29 03:34:44 -06:00
Ben Reaves
92b4315da7 Merge branch 'master' into dev 2020-02-29 03:13:22 -06:00
Ben Reaves
5003d6fa9b - Added all shortcuts but minimize and change workspace due to conflict issues 2020-02-29 03:07:50 -06:00
Ben Reaves
4140a06d53 - Updated mac_gui and setup for app cycle 2020-02-29 00:38:09 -06:00
Ben Reaves
3cf480d724 - Fixed broken wordwise, skip by word. 2020-02-28 23:59:16 -06:00
Ben Reaves
2a467f2a26 - Removed unneeded files 2020-02-28 23:49:41 -06:00
Ben Reaves
d695c3f734 - Added App Cycle tab switcher 2020-02-28 21:57:50 -06:00
Ben Reaves
8c2c53cdcd - Updated setup.py with DE hotkey defaults 2020-02-28 13:26:08 -06:00
Ben Reaves
0f064360a4 - All initial system level shortcuts documented 2020-02-28 00:36:49 -06:00
Ben Reaves
998c9bdf28 - Added more shortcut notes 2020-02-27 23:39:24 -06:00
Ryan Reaves
393f45d1d3 - Added shortcut notes for galliumOS/xfce 2020-02-27 22:59:12 -06:00
Ben Reaves
e8a8c0ed56 - Updated mac_gui and term files to better map keys that only concern shift and/or control. 2020-02-26 20:54:23 -06:00
Ben Reaves
c4db31bdf0 - Added early support for app switching on Gnome 2020-02-26 18:15:46 -06:00
Ryan Reaves
40b521ce09 Merge branch 'hotfix' 2020-02-25 16:40:51 -06:00
Ryan Reaves
c5f1764dfa - Added both x11 checks to further compatibility 2020-02-25 16:39:47 -06:00
Ben Reaves
0196cc323a Merge pull request #46 from rbreaves/hotfix
- Resolved possible issue with Display env variable
2020-02-25 15:58:50 -06:00
Ryan Reaves
c8ca073875 - Resolved possible issue with Display env variable 2020-02-25 15:56:29 -06:00
Ryan Reaves
0e23aae082 - Updated installer to check for x11 more reliably 2020-02-25 15:22:48 -06:00
Ben Reaves
c6292ee34a - Disabled Alt mod keymap on terminals for now, causing issues with numerics 2020-02-25 02:21:22 -06:00
Ben Reaves
470541d5f8 - Added script for detecting OS and updated xactive.sh for debug reasons 2020-02-25 00:12:44 -06:00
Ben Reaves
5152c0ee6e - Corrected backslash for mac_gui 2020-02-24 01:31:50 -06:00
Ben Reaves
9b97bd9ea6 - Updated mac_term for the changes in added GUI and DE support 2020-02-24 00:02:40 -06:00
Ben Reaves
3f4b5241eb - Added 7 more levels for mac_gui symbols, app switching wip, added G remap for sublime text. 2020-02-23 22:49:18 -06:00
Ben Reaves
324e4d83c6 - Added file that contains references to symbol names 2020-02-23 17:16:49 -06:00
Ben Reaves
eb49a4859f - Fixed apt-get to update before installing packages 2020-02-22 22:36:21 -06:00
Ben Reaves
8086a56b7d Merge pull request #43 from rbreaves/dev
- Added giattributes file to set the language of the program to c
2020-02-22 14:11:53 -06:00
Ryan Reaves
bb357f23e6 - Added giattributes file to set the language of the program to c, instead of python. 2020-02-22 14:10:40 -06:00
Ben Reaves
bdf607e907 - Added Manjaro and Arch support to the readme 2020-02-21 23:58:04 -06:00
Ben Reaves
b8eb341d62 Merge pull request #42 from rbreaves/dev
- Added Support for Manjaro and Arch distros using pacman
2020-02-21 23:50:36 -06:00
Ben Reaves
9060cffbff - Added Support for Manjaro and Arch distros using pacman 2020-02-21 23:49:07 -06:00
Ben Reaves
08d8a90555 - Misc readme corrections 2020-02-21 17:26:42 -06:00
Ben Reaves
d7ef767a18 - Corrected typo 2020-02-21 17:19:59 -06:00
Ben Reaves
549e9c3a48 - Updated readme to include mention of Fedora/REHL support 2020-02-21 16:06:48 -06:00
Ben Reaves
1c51db9078 Merge pull request #41 from rbreaves/dev
- Added support for Fedora and rpm/dnf based distros
2020-02-21 15:25:13 -06:00
Ben Reaves
524fe93d1c - Added support for Fedora and rpm/dnf based distros 2020-02-21 15:22:15 -06:00
Ben Reaves
4bb6f89a22 Merge pull request #40 from rbreaves/dev
- Fixes mapping issue on Windows keyboards
2020-02-20 20:52:10 -06:00
Ben Reaves
3185bc068a - Fixes mapping issue on Windows keyboards 2020-02-20 20:36:04 -06:00
Ben Reaves
c2b8304991 Merge pull request #38 from rbreaves/dev
Updating the readme
2020-02-20 17:51:10 -06:00
Ben Reaves
03f4cd5bbe Update fixing the formatting in Readme 2020-02-20 17:48:19 -06:00
Ben Reaves
3b4e02525d - Updated Readme 2020-02-20 17:44:41 -06:00
Ben Reaves
b8b588e727 Updated Readme 2020-02-20 17:42:36 -06:00
Ben Reaves
f77610e6a1 - Updated Readme, includes detailed info on adding keymaps 2020-02-20 17:37:57 -06:00
Ben Reaves
7007cbefc5 - Updated readme with more info on the json config layout as it currently is. 2020-02-20 12:26:33 -06:00
Ben Reaves
2419511da4 - Updated readme and improved formatting of symbols for readability. 2020-02-19 22:12:29 -06:00
Ben Reaves
07f74e478b Merge pull request #37 from rbreaves/dev
Error fix related to mac_term
2020-02-19 16:19:28 -06:00
Ryan Reaves
b038d2a065 Merge branch 'master' into dev 2020-02-19 16:16:23 -06:00
Ryan Reaves
86a92cf836 - Updated mac_term file with proper labels to avoid error 2020-02-19 16:14:58 -06:00
Ben Reaves
38b4521023 Merge pull request #36 from rbreaves/dev
Wordwise selections
2020-02-19 16:07:53 -06:00
Ryan Reaves
2c7f20df63 - Added 5th level to mac gui for wordwise to work with shift for selections 2020-02-19 16:03:09 -06:00
Ryan Reaves
e014c2bc95 - Partially added Cmd+Shift+3/4 Printscreen shortcuts to mac_gui and mac_term 2020-02-19 14:06:02 -06:00
Ben Reaves
3e9b93dcad Merge pull request #35 from rbreaves/dev
- Corrected new Home and End remaps in terminal
2020-02-19 13:08:50 -06:00
Ryan Reaves
d8da8d3b31 - Corrected new Home and End remaps in terminal, accidentally mapped normal arrow keys incorrectly 2020-02-19 13:07:03 -06:00
Ben Reaves
ce99f4da23 Merge pull request #34 from rbreaves/dev
Added PgUp, PgDn, Home, and End to terminal Cmd+Arrow keys
2020-02-19 02:13:03 -06:00
Ben Reaves
5207428abd - Added PgUp, PgDn, Home, and End to terminal keymap on Cmd+Up/Dn/Left/Right 2020-02-19 02:08:46 -06:00
Ryan Reaves
b846b29ff1 - Updated script to report back true if there is no program to end or cleanup 2020-02-19 00:32:38 -06:00
Ryan Reaves
1a482e3c8c - Removed the removal of carets on service restarts, and mention of no carets file found. IBus is optional. 2020-02-18 23:50:45 -06:00
Ryan Reaves
1e0f7259c1 - Updated readme to include a better command to check the systemd log 2020-02-18 22:56:32 -06:00
Ryan Reaves
e6dbd5ea13 - Updated setup.py installer to set the IBus Input Method for the installer if it is not currently set as the default. 2020-02-18 21:20:01 -06:00
Ryan Reaves
6b0f3fc0dd - Updated readme with more troubleshooting tips 2020-02-18 20:24:05 -06:00
Ryan Reaves
c9bf5c1937 - cleanup script needs to be executable or an error will occur if the service has to be restarted for any reason. 2020-02-18 19:22:12 -06:00
Ryan Reaves
0f0c86af0f - Added support for standard version of Chrome for linux, not just Chromium 2020-02-18 19:02:45 -06:00
Ryan Reaves
ce937065c9 - Updated installer, some sort of regression on a copy .xkb directory fix.. Also updated readme 2020-02-18 18:57:44 -06:00
Ben Reaves
acf6bd9317 - Updated readme with credits to people who have contributor to this project over time 2020-02-18 17:30:57 -06:00
Ben Reaves
19d58a3a05 Merge branch 'dev' 2020-02-17 23:35:45 -06:00
Ben Reaves
cf8e78073a - Added Alt+Backspace = Delete key, particularly useful for chromebooks 2020-02-17 23:35:08 -06:00
Ben Reaves
86c5715853 Merge branch 'dev' 2020-02-17 22:01:18 -06:00
Ben Reaves
4e75cfb047 - Updated readme 2020-02-17 22:00:43 -06:00
Ben Reaves
159d2b63f0 - Removed and added comments 2020-02-17 20:52:49 -06:00
Ben Reaves
5a2299d8dc Merge pull request #33 from rbreaves/dev
Full wordwise support for Web Browsers, misc kintox11 optimizations.
2020-02-18 02:29:44 +00:00
Ben Reaves
83ae169fb7 - Added notes about IBus requirement for full wordwise support and added chromium name to json config 2020-02-17 20:22:21 -06:00
Ben Reaves
5c6e42b811 - Fixed caret status script to not over exclude matches 2020-02-17 20:16:53 -06:00
Ben Reaves
cd57efd89b - Added missing type definition 2020-02-17 16:51:19 -06:00
Ben Reaves
28bad9ed42 - Added proper mac_chrome symbols 2020-02-17 16:40:19 -06:00
Ben Reaves
ddfcd57c6b - Fixed setup installer 2020-02-17 16:24:54 -06:00
Ben Reaves
4b4fc7fc3f - Added firefox xbindkeys keymap file for overlaying back and forward buttons over wordwise 2020-02-17 16:20:37 -06:00
Ben Reaves
16c4378c2e - Added some changes to firefox and app requirements for keybinding browsers 2020-02-17 14:46:34 -06:00
Ben Reaves
9dc026695b - Fixed chrome keymap issue with xkb and no looping issues 2020-02-17 13:51:46 -06:00
Ben Reaves
c65d68d816 Merge branch 'master' into dev 2020-02-17 12:52:59 -06:00
Ben Reaves
3983107be5 - Fixed copy issue of xkb files, prevented xkb from overwriting previous directory 2020-02-17 12:51:54 -06:00
Ben Reaves
56391169ff Merge branch 'master' into dev 2020-02-16 20:56:07 -06:00
Ben Reaves
ac5c5f6648 - Added keyboard reset and kill any xbindkeys services running when the kinto keyswap service is stopped via systemctl 2020-02-16 20:54:57 -06:00
Ben Reaves
778d1df1ba - Additional updates that give Firefox and Chrome separate keymap files due to shortcut differences 2020-02-16 20:11:39 -06:00
Ben Reaves
fbe2451a3c - Fixed possible issue where the browser keymap would not fully undo if switched out with another app category 2020-02-16 18:11:57 -06:00
Ben Reaves
5a56ea823f - Added browsers category, input/caret detection, includes xbindkeys, and xautomation for one off fixes 2020-02-16 17:38:50 -06:00
Ben Reaves
5d5d8de92e - Updated kintox11 to filter out dragging windows 2020-02-16 03:33:51 -06:00
Ben Reaves
086ab8bb35 - Added Input Caret check to kintox11, updated json with run_onInput 2020-02-15 22:48:49 -06:00
Ben Reaves
dc016d9270 - Added timeout to blocking XNextEvent for caret/input check 2020-02-15 21:23:53 -06:00
Ben Reaves
8f1795339e - Added script to monitor the status of the input caret 2020-02-15 20:12:10 -06:00
Ben Reaves
4fb65d7025 Merge branch 'dev' 2020-02-15 00:09:17 -06:00
Ben Reaves
93daf8707e - Updated readme to include how to set the keyboard back to normal if the user decides to stop the running service 2020-02-15 00:09:04 -06:00
Ben Reaves
50885a7e78 Merge pull request #31 from rbreaves/dev
- Refactored kintox11 to fix multiple app category bug
2020-02-14 18:46:43 +00:00
Ben Reaves
ea60bb6db5 - Refactored kintox11 to fix multiple app category bug 2020-02-14 12:44:34 -06:00
Ben Reaves
4281d97c3d Merge pull request #30 from alexmyczko/patch-1
Makefile for .c source
2020-02-13 15:16:53 +00:00
Alex Myczko
364536b8ea Update Makefile 2020-02-13 08:33:01 +01:00
Alex Myczko
2585ab9f45 Update Makefile 2020-02-13 08:21:10 +01:00
Alex Myczko
7969bd007d Create Makefile 2020-02-13 08:19:13 +01:00
Ben Reaves
5d135afe5e Merge pull request #29 from rbreaves/dev
- word-wise update
2020-02-13 01:58:51 +00:00
Ben Reaves
a4fa9b225e - word-wise update for Alt+Left/Right to send cursor to begin/end of word while in GUI apps. 2020-02-12 19:53:10 -06:00
Ben Reaves
eac62fb605 - Improved Open Display function to timeout after 60 seconds, fixes possible startup failure on boot for some distros. 2020-02-11 17:36:08 -06:00
Ben Reaves
ab679ddf9d - Improved Open Display function in kintox11 to retry for 1 minute, may be helpful in some distro configs. 2020-02-11 17:29:05 -06:00
Ben Reaves
f4cef736be - Updated kintox11 binary to handle errors better in the get top window function 2020-02-11 15:40:16 -06:00
Ben Reaves
2179176881 - The beginnings of a python based xlib implementation of kintox11 2020-02-06 20:05:47 -06:00
Ben Reaves
26f70ccd31 - Updated kintox11 binary to handle errors better in the get top window function 2020-02-06 16:33:23 -06:00
Ben Reaves
0ff7a42f9b - Updated readme with more troubleshooting tips 2020-02-05 16:29:36 -06:00
Ben Reaves
58da4fcd90 Merge branch 'master' into dev 2020-02-05 16:06:41 -06:00
Ben Reaves
20170f0a7d - Removed the explicit reference to bin bash in the service file, also removed the Environment variable to avoid issues for when Display is not 0. 2020-02-05 16:05:41 -06:00
Ben Reaves
d90829928b Merge pull request #27 from rbreaves/dev
Fixes tweak selection during install
2020-02-05 21:35:03 +00:00
Ben Reaves
6f913538e8 - Fixed tweak selection in python installer 2020-02-05 15:33:51 -06:00
Ben Reaves
7dfbe884ff - Added medium article in readme 2020-02-05 14:11:13 -06:00
Ben Reaves
3a115f91ae Merge branch 'dev' 2020-02-05 14:06:57 -06:00
Ben Reaves
4c218b55bd - Updated uninstaller to remove kinto.desktop from startup 2020-02-05 14:06:37 -06:00
Ben Reaves
94cd3ed907 Merge pull request #26 from rbreaves/dev
Kintox11 binary will now always apply gui keymap on init unless a term app has focus
2020-02-05 19:56:20 +00:00
Ben Reaves
b0bde4fecf Merge branch 'master' into dev 2020-02-05 13:54:20 -06:00
Ben Reaves
b930b96066 - Fixed kintox11 to always apply gui keymap on initialization unless a term app has focus. (aka boot and user logoff/logon) 2020-02-05 13:52:25 -06:00
Ben Reaves
2df4920344 Merge pull request #25 from rbreaves/dev
- Corrected path of systemctl for desktop autostart file
2020-02-05 19:17:40 +00:00
Ben Reaves
ce9c80a02f - Corrected path of systemctl for desktop autostart file 2020-02-05 13:17:13 -06:00
Ben Reaves
e599562ec1 Merge pull request #24 from rbreaves/dev
- Added desktop startup of kinto service
2020-02-05 11:28:15 +00:00
Ben Reaves
b8b81bd907 - Added desktop startup of kinto service 2020-02-05 05:24:40 -06:00
Ben Reaves
22e5462fbc Merge pull request #23 from rbreaves/dev
Updated service
2020-02-05 10:22:55 +00:00
Ben Reaves
72d2007267 - Added restartsec interval on service to 1 second to try and avoid burst limit of systemd 2020-02-05 04:19:44 -06:00
Ben Reaves
3c5b49324c - Removed the creation of the autostart folder 2020-02-05 04:09:20 -06:00
Ben Reaves
3f37ef6e28 - Added back in the enable command for the keyswap service. 2020-02-05 04:01:17 -06:00
Ben Reaves
35cfcce748 Merge pull request #22 from rbreaves/dev
Updated kintox11 binary with better error handling
2020-02-05 09:20:05 +00:00
Ben Reaves
d288048ed4 - Due to updates in kintox11 error handling the services timer is no longer needed, the application will restart properly if it encounters an unrecoverable error on boot, login or any other unexpected event. 2020-02-05 03:01:22 -06:00
Ben Reaves
a30671b08c - Enabled full error handling 2020-02-05 02:47:53 -06:00
Ben Reaves
2f2afecb6d - Added more verbosity to kintox11 and added more functions to increase accuracy of the keyswap on all windows 2020-02-05 02:41:47 -06:00
Ben Reaves
072249d5d4 - Corrected chromebook config file and updated the initialization of the keyswap service file to work when re-running the installer on a currently running version of kinto 2020-02-05 00:12:44 -06:00
Ben Reaves
a6b9b1ffbb Merge pull request #21 from rbreaves/dev
- Fixes login/logout and reboot startup issues
2020-02-05 01:48:19 +00:00
Ben Reaves
d8c516c13c - Fixes login/logout and reboot startup issues, delays the start by 5 seconds 2020-02-04 19:45:39 -06:00
Ben Reaves
b763703d70 Merge pull request #19 from rbreaves/dev
App breaking bug resolved and improved initialization on boot
2020-02-04 22:02:38 +00:00
Ben Reaves
ecaf413fa4 - Removed 5 second restart delay, I think the new changes makes it irrelevant 2020-02-04 15:58:09 -06:00
Ben Reaves
48e01750e5 - Fixed breaking bug exception on how gui apps are initially handled. Also improved the initialization of kintox11. 2020-02-04 15:36:26 -06:00
Ben Reaves
5ec8c076a3 - Added more verbosity to the dynamic app output 2020-02-04 14:48:40 -06:00
Ben Reaves
c620b299bd - Added a more verbose initial startup to kintox11 for easier debugging purposes 2020-02-04 14:41:55 -06:00
Ben Reaves
496cb4d340 - Added O2 optimization to kintox11 binary 2020-02-03 22:52:19 -06:00
47 changed files with 4530 additions and 276 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
*.py linguist-detectable=false
*.json liguist-detectable=false
*.c linguist-detectable=true

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: rbreaves
---
**Describe the bug**
A clear and concise description of what the bug is.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Install Type:** Bare Metal or VM
**Distro:** Name + Version
**DE:** Gnome, XFCE, KDE
**Branch:** master, dev
**Commit:** git rev-parse --short HEAD
**Kinto Input Caret Status**
```
cat /tmp/kinto/caret
```
**Kinto Standard Log**
```
journalctl --user-unit=keyswap.service -b
```
**Kinto Debug Log (1.0.6-2+)**
```
systemctl --user stop keyswap
cd ~/.config/kinto
./kintox11 --debug
```
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: rbreaves
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

10
.github/ISSUE_TEMPLATE/gratitude.md vendored Normal file
View File

@@ -0,0 +1,10 @@
---
name: Gratitude
about: Just wants to give a shout out!
title: ''
labels: gratitude
assignees: rbreaves
---

10
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@@ -0,0 +1,10 @@
---
name: Question
about: Question about Kinto functionality
title: ''
labels: question
assignees: rbreaves
---

View File

@@ -1,32 +1,781 @@
// Template
//
// ONE_LEVEL_CTRL
// Base
// Shift
// Alt
// Shift Alt
// Control
// Shift Control
// Super
// Shift Super
// Control Alt
// Super Control
// Super Alt
// Super Control Alt
//
// replace key <KEY> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [
// Base,
// Alt,
// Shift Alt,
// Control,
// Shift Control,
// Super,
// Shift Super,
// Control Alt,
// Super Control",
// Super Alt,
// Super Control Alt
// ],
// actions[Group1]= [
// NoAction(),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Mod1),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Mod1+Shift),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control+Shift),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super+Shift),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control+Alt),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super+Control),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Super+Mod1),
// RedirectKey(key=<KEY>,modifiers=NewMod,clearmods=Control+Mod1)
// ]
// };
hidden partial modifier_keys
xkb_symbols "swapescape" {
key <CAPS> { [ Escape ] };
key <ESC> { [ Caps_Lock ] };
};
hidden partial modifier_keys
xkb_symbols "caps_escape" {
key <CAPS> { [ Escape ] };
};
hidden partial modifier_keys
xkb_symbols "caps_shiftlock" {
replace key <CAPS> { [ Shift_Lock ] };
modifier_map Shift { Shift_Lock };
};
hidden partial modifier_keys
xkb_symbols "caps_none" {
key <CAPS> { [ VoidSymbol ] };
};
default partial xkb_symbols "mac_levelssym" {
// LEFT to Begin Line
// // Minimize window Cmd + H = Alt + F9
// // 2 caveats
// // 1 Cmd + H may not pass through on VMs
// // 2 may cause conflicts with apps
// replace key <AC06> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [
// h,
// H,
// h,
// H,
// h
// ],
// actions[Group1]= [
// NoAction(),
// NoAction(),
// NoAction(),
// NoAction(),
// RedirectKey(key=<AC06>,modifiers=Super,clearmods=Control)
// ]
// };
// Maximize Window Ctrl + Cmd + F = Alt+F10
// Also maps Option + Cmd + F to Control+H for Replace - Sublime
// AD03=e,E
// AC01=a,A
// Ctrl + A - Beginning of Line
replace key <AC01> {
type[Group1]= "ONE_LEVEL_SUPER",
symbols[Group1]= [
// Base
a,
// Shift
A,
// Super
NoSymbol,
// Shift Super
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<HOME>,clearmods=Super),
RedirectKey(key=<HOME>,clearmods=Super)
]
};
// Ctrl + E - End of Line
replace key <AD03> {
type[Group1]= "ONE_LEVEL_SUPER",
symbols[Group1]= [
// Base
e,
// Shift
E,
// Super
NoSymbol,
// Shift Super
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<END>,clearmods=Super),
RedirectKey(key=<END>,clearmods=Super)
]
};
replace key <AC04> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
// Base
f,
// Shift
F,
// Alt
f,
// Shift Alt
F,
// Control
f,
// Shift Control
F,
// Super
f,
// Shift Super
F,
// Control Alt
h
// Super Control
// ,F10 // Default maximize
// // Nothing // KDE maximize
// Super Alt
// Super Control Alt
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt
NoAction(),
// Shift Alt
NoAction(),
// Control
NoAction(),
// Shift Control
NoAction(),
// Super
NoAction(),
// Shift Super
NoAction(),
// Control Alt
RedirectKey(key=<AC06>,clearmods=Mod1)
// Super Control - Fullscreen
// ,RedirectKey(key=<FK10>,modifiers=Mod1,clearmods=Super+Control) // Default maximize
// // Nothing // KDE maximize
// Super Alt
// Super Control Alt
]
};
// Close App Cmd + Q = Alt + F4
replace key <AD01> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
// Base
q,
// Shift
Q,
// Alt
q,
// Shift Alt
Q,
// Control
F4
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt
NoAction(),
// Shift Alt
NoAction(),
// Control
RedirectKey(key=<FK04>,modifiers=Mod1,clearmods=Control)
]
};
// Show Desktop Cmd + F3 = Super + D
replace key <FK03> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
// Base
F3,
// Shift
F3,
// Alt
F3,
// Shift Alt
F3,
// Control
d
],
actions[Group1]= [
NoAction(),
NoAction(),
NoAction(),
NoAction(),
RedirectKey(key=<AC03>,modifiers=Super,clearmods=Control)
]
};
// Fix the G key for Sublime Text
replace key <AC05> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
// Base
g,
// Shift
G,
// Alt
g,
// Shift Alt
G,
// Control
g,
// Shift Control
G,
// Super
NoSymbol,
// Shift Super
NoSymbol,
// Control Alt
g,
// Super Control
g,
// Super Alt
g,
// Super Control Alt
g
],
actions[Group1]= [
NoAction(),
NoAction(),
// Pass G Normally
RedirectKey(key=<AC05>),
RedirectKey(key=<AC05>),
// Find Next
RedirectKey(key=<FK03>,clearmods=Control),
// Find Previous
RedirectKey(key=<FK03>,clearmods=Control),
// Sublime Goto Line
RedirectKey(key=<AC05>,modifiers=Control,clearmods=Super),
NoAction(),
// Sublime Quick Find
RedirectKey(key=<FK03>,clearmods=Mod1),
// Sublime Select All Matches
RedirectKey(key=<FK03>,modifiers=Mod1,clearmods=Super+Control),
NoAction(),
NoAction()
]
};
// LEFT to Begin Line or Beginning of word
replace key <LEFT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [ Left, Left, NoSymbol ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<HOME>,clearmods=Control)]
symbols[Group1]= [
// Base
Left,
// Shift
Left,
// Alt
Left,
// Shift Alt
Left,
// Control
NoSymbol,
// Shift Control
NoSymbol,
// Super
Left
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt - Wordwise
RedirectKey(key=<LEFT>,mods=Control,clearmods=Mod1),
// Shift Alt
RedirectKey(key=<LEFT>,mods=Control,clearmods=Mod1),
// Control
RedirectKey(key=<HOME>,clearmods=Control),
// Shift Control
RedirectKey(key=<HOME>,clearmods=Control),
// Super - Change workspace
NoAction()
]
};
// Right to End of Line
// Right to End of Line or end of word
replace key <RGHT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [ Right, Right, NoSymbol ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<END>,clearmods=Control)]
symbols[Group1]= [
// Base
Right,
// Shift
Right,
// Alt
Right,
// Shift Alt
Right,
// Control
NoSymbol,
// Shift Control
NoSymbol,
// Super
Right
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt - Wordwise
RedirectKey(key=<RGHT>,mods=Control,clearmods=Mod1),
// Shift Alt
RedirectKey(key=<RGHT>,mods=Control,clearmods=Mod1),
// Control
RedirectKey(key=<END>,clearmods=Control),
// Shift Control
RedirectKey(key=<END>,clearmods=Control),
// Super - Change workspace
NoAction()
]
};
// Up to Mac Home
//Up to Mac Home
replace key <UP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [ Up, Up, NoSymbol ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<HOME>)]
symbols[Group1]= [
// Base
Up,
// Shift
Up,
// Alt
Up,
// Shift Alt
Up,
// Control
NoSymbol,
// Shift Control
NoSymbol,
// Super
Up,
// Shift Super
Up
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt - Wordwise
RedirectKey(key=<UP>,clearmods=Mod1),
// Shift Alt
// RedirectKey(key=<UP>), // Chromebook multicursor
RedirectKey(key=<UP>,clearmods=Mod1), // Default multicursor
// Control
RedirectKey(key=<HOME>),
// Shift Control
RedirectKey(key=<HOME>),
// Super - Wordwise - Sublime?
RedirectKey(key=<PGUP>,clearmods=Super),
// Shift Super
RedirectKey(key=<UP>,modifiers=Mod1,clearmods=Super)
]
};
// Down to Mac End
replace key <DOWN> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
// Base
Down,
// Shift
Down,
// Alt
Down,
// Shift Alt
Down,
// Control
NoSymbol,
// Shift Control
NoSymbol,
// Super
Down,
// Shift Super
Down
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt - Wordwise
RedirectKey(key=<DOWN>,clearmods=Mod1),
// Shift Alt
RedirectKey(key=<DOWN>,clearmods=Mod1),
// Control
RedirectKey(key=<END>),
// Shift Control
RedirectKey(key=<END>),
// Super - Wordwise - Sublime?
RedirectKey(key=<PGDN>,clearmods=Super),
// Shift Super
RedirectKey(key=<DOWN>,modifiers=Mod1,clearmods=Super)
]
};
// Alt BKSP to DELETE
replace key <BKSP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
BackSpace,
BackSpace,
BackSpace
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<DELE>,clearmods=Mod1)
]
};
// // Full Print Screen
// // GalliumOS
// replace key <AE03> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [ 3, 3, 3, F5 ],
// actions[Group1]= [ NoAction(), NoAction(), NoAction(), RedirectKey(key=<FK05>,clearmods=Shift) ]
// };
// // Region Print Screen
// // GalliumOS
// replace key <AE04> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [ 4, 4, 4, F5 ],
// actions[Group1]= [ NoAction(), NoAction(), NoAction(), RedirectKey(key=<FK05>) ]
// };
// // Full Print Screen
// // Standard Ubuntu
// replace key <AE03> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [ 3, 3, 3, F5 ],
// actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<PRSC>,clearmods=Shift+Control) ]
// };
// // Region Print Screen
// // Standard Ubuntu
// replace key <AE04> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [ 4, 4, 4, F5 ],
// actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<PRSC>,clearmods=Control) ]
// };
};
partial xkb_symbols "mac_appcycle_chromebook" {
// Cycle App and In App Tab Switching
replace key <TAB> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Tab,
Tab,
Tab,
Tab,
backslash,
backslash,
NoSymbol,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
// Alt
Redirect(key=<TAB>,mods=Control,clearmods=Mod1),
// Alt + Shift
Redirect(key=<TAB>,mods=Control,clearmods=Mod1),
// Control
Redirect(key=<BKSL>),
// Control+Shift
Redirect(key=<BKSL>),
// Super
NoAction(),
// Super + Shift
NoAction()
]
};
};
partial xkb_symbols "mac_appcycle" {
// Cycle App and In App Tab Switching
key <FK13> { [ F13 ] };
key <FK14> { [ F14 ] };
replace key <TAB> {
type[Group1]= "ONE_LEVEL_CMD",
symbols[Group1]= [
Tab,
Tab,
F14,
F13,
NoSymbol,
NoSymbol
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Control + Shift
Redirect(key=<FK14>),
// Control
Redirect(key=<FK13>,mods=Shift),
// Super
Redirect(key=<TAB>,mods=Control,clearmods=Mod4+Super),
// Super + Shift
Redirect(key=<TAB>,mods=Control,clearmods=Mod4+Super)
]
};
};
partial xkb_symbols "mac_browsers_chromebook" {
// Cycle App and In App Tab Switching
replace key <TAB> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Tab,
Tab,
NoSymbol,
NoSymbol,
backslash,
backslash,
NoSymbol,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
// Alt
Redirect(key=<PGDN>,mods=Control,clearmods=Mod1),
// Alt + Shift
Redirect(key=<PGUP>,mods=Control,clearmods=Mod1+Shift),
// Control
Redirect(key=<BKSL>),
// Control+Shift
Redirect(key=<BKSL>),
// Super
NoAction(),
// Super + Shift
NoAction()
]
};
//Up to Mac Home
replace key <UP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Up,
Up,
Up,
Up,
NoSymbol,
NoSymbol,
Up
],
actions[Group1]= [
NoAction(),
NoAction(),
// Wordwise
RedirectKey(key=<UP>,clearmods=Mod1),
RedirectKey(key=<UP>,clearmods=Mod1),
RedirectKey(key=<HOME>),
RedirectKey(key=<HOME>),
// Wordwise - Sublime?
RedirectKey(key=<PGUP>,clearmods=Super),
RedirectKey(key=<UP>,modifiers=Mod1,clearmods=Super)
]
};
// Down to Mac End
replace key <DOWN> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [ Down, Down, NoSymbol ],
actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<END>)]
symbols[Group1]= [
Down,
Down,
Down,
Down,
NoSymbol,
NoSymbol,
Down
],
actions[Group1]= [
NoAction(),
NoAction(),
// Wordwise
RedirectKey(key=<DOWN>,clearmods=Mod1),
RedirectKey(key=<DOWN>,clearmods=Mod1),
RedirectKey(key=<END>),
RedirectKey(key=<END>),
// Wordwise - Sublime?
RedirectKey(key=<PGDN>,clearmods=Super),
RedirectKey(key=<DOWN>,modifiers=Mod1,clearmods=Super)
]
};
// Alt BKSP to DELETE
replace key <BKSP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
BackSpace,
BackSpace,
BackSpace
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<DELE>,clearmods=Mod1)
]
};
// CTRL BKSP to DELETE
// replace key <BKSP> {
// type[Group1]= "TWO_LEVEL_CTRL",
// symbols[Group1]= [ BackSpace, BackSpace, NoSymbol ],
// actions[Group1]= [ NoAction(), NoAction(), RedirectKey(key=<DELE>,clearmods=Control)]
// };
};
partial xkb_symbols "mac_browsers" {
// Cycle App and In App Tab Switching
key <FK13> { [ F13 ] };
key <FK14> { [ F14 ] };
replace key <TAB> {
type[Group1]= "ONE_LEVEL_CMD",
symbols[Group1]= [
Tab,
Tab,
F14,
F13,
NoSymbol,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
Redirect(key=<FK14>),
Redirect(key=<FK13>),
Redirect(key=<PGDN>,mods=Control,clearmods=Mod4+Super),
Redirect(key=<PGUP>,mods=Control,clearmods=Mod4+Super+Shift)
]
};
//Up to Mac Home
replace key <UP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Up,
Up,
Up,
Up,
NoSymbol,
NoSymbol,
Up
],
actions[Group1]= [
NoAction(),
NoAction(),
// Wordwise
RedirectKey(key=<UP>,clearmods=Mod1),
RedirectKey(key=<UP>,clearmods=Mod1),
RedirectKey(key=<HOME>),
RedirectKey(key=<HOME>),
// Wordwise - Sublime?
RedirectKey(key=<PGUP>,clearmods=Super),
RedirectKey(key=<UP>,modifiers=Mod1,clearmods=Super)
]
};
// Down to Mac End
replace key <DOWN> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Down,
Down,
Down,
Down,
NoSymbol,
NoSymbol,
Down
],
actions[Group1]= [
NoAction(),
NoAction(),
// Wordwise
RedirectKey(key=<DOWN>,clearmods=Mod1),
RedirectKey(key=<DOWN>,clearmods=Mod1),
RedirectKey(key=<END>),
RedirectKey(key=<END>),
// Wordwise - Sublime?
RedirectKey(key=<PGDN>,clearmods=Super),
RedirectKey(key=<DOWN>,modifiers=Mod1,clearmods=Super)
]
};
// Alt BKSP to DELETE
replace key <BKSP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
BackSpace,
BackSpace,
BackSpace
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<DELE>,clearmods=Mod1)
]
};
};
partial xkb_symbols "mac_chrome" {
// Back Button
replace key <LEFT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Left,
Left,
NoSymbol,
NoSymbol,
Left
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt
RedirectKey(key=<FK18>),
// Alt
RedirectKey(key=<FK18>),
// Control
RedirectKey(key=<LEFT>,modifiers=Mod1,clearmods=Control)
]
};
// Forwards Button
replace key <RGHT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
// Base
Right,
// Shift
Right,
// Alt
NoSymbol,
// Shift Alt
NoSymbol,
// Control
Right
],
actions[Group1]= [
// Base
NoAction(),
// Shift
NoAction(),
// Alt
RedirectKey(key=<FK18>),
// Shift Alt
RedirectKey(key=<FK18>),
// Control
RedirectKey(key=<RGHT>,modifiers=Mod1,clearmods=Control)
]
};
};

View File

@@ -1,4 +1,4 @@
default partial xkb_symbols "mac_levelssym" {
default partial xkb_symbols "mac_apple" {
key <LWIN> {
repeat= no,
type= "ONE_LEVEL",
@@ -11,4 +11,200 @@ default partial xkb_symbols "mac_levelssym" {
symbols[Group1]= [ Hyper_R ],
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
};
};
partial xkb_symbols "mac_win" {
key <LALT> {
repeat= no,
type= "ONE_LEVEL",
symbols[Group1]= [ Hyper_L ],
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
};
key <RALT> {
repeat= no,
type= "ONE_LEVEL",
symbols[Group1]= [ Hyper_R ],
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
};
};
partial xkb_symbols "mac_global" {
// // Minimize Window Cmd + H = Alt+F9
// replace key <AC06> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [
// h,
// H,
// H
// ],
// actions[Group1]= [
// NoAction(),
// NoAction(),
// RedirectKey(key=<AC06>,modifiers=Super,clearmods=Control+Shift)
// ]
// };
//
// Some sort of glitch occurs on shifting F while this segment is active
// it is like the Control key is being held down when it isn't.
//
// // Maximize Window Ctrl + Cmd + F = Alt+F10
// replace key <AC04> {
// type[Group1]= "ONE_LEVEL_CTRL",
// symbols[Group1]= [
// f,
// F,
// F
// ],
// actions[Group1]= [
// // Base
// NoAction(),
// // Shift
// NoAction(),
// // Ctrl + Shift
// RedirectKey(key=<FK10>,modifiers=Mod1,clearmods=Control+Shift)
// ]
// };
// Close App Cmd + Q = Alt + F4
replace key <AD01> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
q,
Q,
F4
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<FK04>,modifiers=Mod1,clearmods=Control+Shift)
]
};
// Show Desktop Cmd + F3 = Super + D
replace key <FK03> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
F3,
F3,
D
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<AC03>,modifiers=Super,clearmods=Control+Shift)
]
};
// Cycle App and In App Tab Switching
key <FK13> { [ F13 ] };
key <FK14> { [ F14 ] };
replace key <TAB> {
type[Group1]= "ONE_LEVEL_CMD",
symbols[Group1]= [
Tab,
Tab,
// F13 // Default cmdtab
// F13 // KDE cmdtab
// Right // Elementary ecmdtab
],
actions[Group1]= [
NoAction(),
NoAction(),
// Redirect(key=<FK13>) // Default cmdtab
// Redirect(key=<FK13>) // KDE cmdtab
// Redirect(key=<RGHT>,mods=Control+Shift,clearmods=Mod4+Super) // Elementary cmdtab
]
};
// Page Up
replace key <UP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Up,
Up,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<PGUP>,clearmods=Shift+Control)
]
};
// Page Down
replace key <DOWN> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Down,
Down,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<PGDN>,clearmods=Shift+Control)
]
};
// HOME
replace key <LEFT> {
type[Group1]= "ONE_LEVEL_CMD",
symbols[Group1]= [
Left,
Left,
NoSymbol,
Left
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<HOME>,clearmods=Shift+Control),
RedirectKey(key=<LEFT>,mods=Super,clearmods=Control)
]
};
// END
replace key <RGHT> {
type[Group1]= "ONE_LEVEL_CMD",
symbols[Group1]= [
Right,
Right,
NoSymbol,
Right
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<END>,clearmods=Shift+Control),
RedirectKey(key=<RGHT>,mods=Super,clearmods=Control)
]
};
// Full Print Screen
// Standard Ubuntu
replace key <AE03> {
type[Group1]= "ONE_LEVEL_CMD",
symbols[Group1]= [
3,
numbersign,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<PRSC>,clearmods=Shift+Control)
]
};
// Region Print Screen
// Standard Ubuntu
replace key <AE04> {
type[Group1]= "ONE_LEVEL_CMD",
symbols[Group1]= [
4,
dollar,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<PRSC>,clearmods=Control)
]
};
};

View File

@@ -11,4 +11,90 @@ default partial xkb_symbols "mac_levelssym" {
symbols[Group1]= [ Hyper_R ],
actions[group1]=[ SetMods(modifiers=Shift+Control) ]
};
// Page Up
replace key <UP> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Up,
Up,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<PGUP>,clearmods=Shift+Control)
]
};
// Page Down
replace key <DOWN> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Down,
Down,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<PGDN>,clearmods=Shift+Control)
]
};
// HOME
replace key <LEFT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Left,
Left,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<HOME>,clearmods=Shift+Control)
]
};
// END
replace key <RGHT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Right,
Right,
NoSymbol
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<END>,clearmods=Shift+Control)
]
};
// Full Print Screen
// GalliumOS
replace key <AE03> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
3,
numbersign,
F5
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<FK05>,clearmods=Shift)
]
};
// Region Print Screen
// GalliumOS
replace key <AE04> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
4,
dollar,
F5
],
actions[Group1]= [
NoAction(),
NoAction(),
RedirectKey(key=<FK05>)
]
};
};

View File

@@ -1,20 +1,53 @@
default partial xkb_types "addmac_levels" {
Virtual_modifiers Super;
type "ONE_LEVEL_CTRL" {
modifiers= Shift+Control;
map[Shift]= Level2;
map[Control]= Level3;
map[Shift+Control]= Level3;
level_name[Level1]= "Base";
level_name[Level2]= "Caps";
level_name[Level3]= "With Control";
modifiers = Shift+Mod1+Super+Control;
map[Shift] = Level2;
map[Mod1] = Level3;
map[Shift+Mod1] = Level4;
map[Control] = Level5;
map[Shift+Control] = Level6;
map[Super] = Level7;
map[Shift+Super] = Level8;
map[Mod1+Control] = 9;
map[Super+Control] = 10;
map[Super+Mod1] = 11;
map[Super+Mod1+Control] = 12;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Alt";
level_name[Level4] = "Shift Alt";
level_name[Level5] = "Control";
level_name[Level6] = "Shift Control";
level_name[Level7] = "Super";
level_name[Level8] = "Shift Super";
level_name[9] = "Control Alt";
level_name[10] = "Super Control";
level_name[11] = "Super Alt";
level_name[12] = "Super Control Alt";
};
type "TWO_LEVEL_CTRL" {
modifiers= Shift+Control;
map[Shift]= Level2;
map[Control]= Level3;
map[Shift+Control]= Level3;
level_name[Level1]= "Base";
level_name[Level2]= "Caps";
level_name[Level3]= "With Control";
type "ONE_LEVEL_CMD" {
modifiers = Shift+Control+Super;
map[Shift] = Level2;
map[Shift+Control] = Level3;
map[Control] = Level4;
map[Super] = Level5;
map[Shift+Super] = Level6;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Control Shift";
level_name[Level4] = "Control";
level_name[Level5] = "Super";
level_name[Level6] = "Super Shift";
};
type "ONE_LEVEL_SUPER" {
modifiers = Shift+Super;
map[Shift] = Level2;
map[Super] = Level3;
map[Shift+Super] = Level4;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Super";
level_name[Level4] = "Super Shift";
};
};

53
.xkb/types/mac_term Normal file
View File

@@ -0,0 +1,53 @@
default partial xkb_types "addmac_levels" {
Virtual_modifiers Super;
type "ONE_LEVEL_CTRL" {
modifiers = Shift+Mod1+Super+Control;
map[Shift] = Level2;
map[Shift+Control] = Level3;
// map[Mod1] = Level4;
map[Shift+Mod1] = Level5;
map[Control] = Level6;
map[Super] = Level7;
map[Shift+Super] = Level8;
map[Mod1+Control] = 9;
map[Super+Control] = 10;
map[Super+Mod1] = 11;
map[Super+Mod1+Control] = 12;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Shift Control";
// level_name[Level4] = "Alt";
level_name[Level5] = "Shift Alt";
level_name[Level6] = "Control";
level_name[Level7] = "Super";
level_name[Level8] = "Shift Super";
level_name[9] = "Control Alt";
level_name[10] = "Super Control";
level_name[11] = "Super Alt";
level_name[12] = "Super Control Alt";
};
type "ONE_LEVEL_CMD" {
modifiers = Shift+Control+Super;
map[Shift] = Level2;
map[Shift+Control] = Level3;
map[Control] = Level4;
map[Super] = Level5;
map[Shift+Super] = Level6;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Control Shift";
level_name[Level4] = "Control";
level_name[Level5] = "Super";
level_name[Level6] = "Super Shift";
};
type "ONE_LEVEL_SUPER" {
modifiers = Shift+Super;
map[Shift] = Level2;
map[Super] = Level3;
map[Shift+Super] = Level4;
level_name[Level1] = "Base";
level_name[Level2] = "Shift";
level_name[Level3] = "Super";
level_name[Level4] = "Super Shift";
};
};

460
README.md
View File

@@ -1,29 +1,22 @@
# Kinto
![kinto_carrot](https://user-images.githubusercontent.com/10969616/77842401-4744b500-7157-11ea-854a-d7dec6f9a250.gif)
![alt text](https://raw.githubusercontent.com/rbreaves/kinto/master/Kinto.png)
[![GitHub release](https://img.shields.io/github/release/rbreaves/kinto.svg)](https://github.com/rbreaves/kinto/releases/latest)
![alt text](https://github.com/rbreaves/kinto/blob/master/splash.png)
\- Type in Linux & Windows like it's a Mac. \-
\- Type in Linux like it's a Mac. \-
Cmd = Ctrl+Shift for all terminals.
Note: As of version 1.0 Kinto no longer maps Cmd/Alt to Super while using the Terminal, it is now mapping to Ctrl+Shift by default. Please reset your terminal's keymaps back to their defaults.
Gnome-terminal reset
```
dconf reset -f /org/gnome/terminal/legacy/keybindings/
```
Seamless copy and paste with all apps and terminals. Also the only linux remapper that is aware of your cursor/caret status - meaning it avoids shortcut conflicts within an app versus wordwise shortcuts when a text field is in use.
## 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 keyboard. (Alt location is Cmd for Apple keyboards)
- Normal apps - Alt will be Ctrl, Win/Super will be Alt, Ctrl will be Win/Super
- Normal apps - Alt Ctrl, Win/Super Alt, Ctrl Win/Super
- Terminal apps - Alt will be Ctrl+Shift, Win/Super will be Alt, Ctrl will be Ctrl
- Terminal apps - Alt Ctrl+Shift, Win/Super Alt, Ctrl Ctrl
- Cursor/word-wise shortcut keys have been added to align with macOS keyboard shortcuts.
@@ -32,14 +25,29 @@ Kinto works for standard Windows, Apple and Chromebook keyboards. The following
- Python (initial install only)
- systemd
- x11
- Debian/Ubuntu based distro 16.04+
- IBus*
- Fedora/RHEL/Manjaro/Arch/Debian/Ubuntu based distro 16.04+
If you need kintox11 recompiled for your distro please let me know and I will add a binary for your distro if my binary fails.
Binary is included and will be installed, but you can also compile kintox11.c on your system. You will need to compile and install json-c first as its libraries will be required to compile and run the program.
You can also attempt to compile kintox11.c on your system as well, but you will need to compile and install json-c first as its libraries will be required to compile and run the program.
*IBus is needed to support wordwise during browser app usage as the keymap will need to change slightly depending if the cursor/caret is on screen waiting for input. Setup.py will set it but you can manually set it as well or check your current Input Method.
On most distros you can confirm navigate to your "Language Support" and set "Keyboard input method system:" to IBus for full word-wise support with web browsers.
Wayland support is planned, but not ready yet.
## Kinto for Windows 10 Requirements
- WSL Ubuntu edition
- Powershell - run as Administrator
- Python3
Other programs that will be installed when you run ./setup.py
- Chocolatey
- Autohotkey
Does not have complete parity with the Linux edition, but it does work and can be built on and added to as needed. Modify ./windows/kinto.ahk if you want to add more WSL editions or other terminals.
## How to install
1. clone this repo
@@ -59,6 +67,276 @@ sudo apt install python3
./setup.py
```
To Uninstall Kinto
```
./uninstall.sh
```
## Other Notes Related to Install
**Manjaro with Gnome there are issues.**
Please see this ticket for more information.
https://github.com/rbreaves/kinto/issues/59
https://wiki.archlinux.org/index.php/IBus
**For other Arch based distros.**
Append the following and logoff and back on, but only after running setup.py to install all packages and the kinto service. Please report if there are any difficulties.
nano ~/.bashrc
```
export GTK_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=xim
```
## How to Upgrade Kinto
Simply bring down the latest in either the master branch or dev, but dev is sometimes in flux as new features are being developed. 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 ~/.xkb or ~/.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
Under systemd this is how you control Kinto.
Status
```
systemctl --user status keyswap
```
Stop (your keymap will return to normal)
```
systemctl --user stop keyswap
```
Start
```
systemctl --user start keyswap
```
Restart
```
systemctl --user restart keyswap
```
Enable
```
systemctl --user enable keyswap
```
Disable
```
systemctl --user disable keyswap
```
## How to Add Setxkbmap Option inside Kinto
To summarize you'll need to pull the partial out of the symbols file the option resides in and then add that to the mac_gui file and lastly reference it in the keymap file(s) you want it in.
symbols directory
```
/usr/share/X11/xkb/symbols/
```
symbols file
```
~/.xkb/symbols/mac_gui
```
keymap files
```
~/.xkb/keymap/kbd.mac.gui
~/.xkb/keymap/kbd.mac.term
```
A more detailed explaination is here.
https://github.com/rbreaves/kinto/issues/50#issuecomment-595953373
## How to Add or Change keymaps for Applications
Note: All of the following is already done in Kinto (but may also change as improvements are made). The following is purely for documentation and example sake as they are real examples of how to leverage the json config to support additional keymaps.
**First it is important to understand how Kinto operates.**
1. It listens for any focus/active window changes
2. It applies the proper keymap based on the programs name.
3. It may monitor your caret/cursor input status, if the app is known to cause shortcut conflicts with wordwise
4. It runs anywhere from 1 to 3 commands to fully remap your computer.
Ok great, we've covered the basics, now what are your options on modifying functionality?
It depends.
Do you want to remap keys using xkb or xbindkeys with xdotool, or something else entirely?
The choice is yours, but I'd recommend xbindkeys with xdotool for anyone that doesn't want to spend the time or learn xkb. I prefer xkb but it completely remaps your keyboard and it could break things if done poorly.
**How to Remap using XBindKeys with Xdotool - Firefox**
1. By default Firefox is mapped with the standard gui based xkb config, and only if no input has focus does it then run xbindkeys to map the Cmd+Left/Right arrow key location to the Back and Forwards functionality you'd expect.
2. The xbindkeys script takes into account the xkb mapping being the base because it is actually remapping Home and End to Back and Forwards as there is no real reason to reload an entire xkb layout.
~/.config/kinto/user_config.json
```
...
{
"name": "firefox",
"run": "setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
"run_onInput": "killall xbindkeys > /dev/null 2>&1",
"run_offInput": "killall xbindkeys > /dev/null 2>&1;xbindkeys -f $HOME/.config/kinto/.firefox-nw",
"symbols": "",
"types": "",
"de": [
2
],
"appnames": [
"Firefox"
]
},
...
```
~/.config/kinto/.firefox-nw
```
"xdotool key --delay 0 --clearmodifiers Control_L+bracketleft"
// Alt/Cmd + Left
Home + Release
"xdotool key --delay 0 --clearmodifiers Control_L+bracketright"
// Alt/Cmd + Right
End + Release
# Note additional keymaps can easily be added to this file and I will accept any PR's with keymaps that align with macs
```
Once you have made your changes you can restart the Kinto service and the changes will take affect.
```
systemctl --user restart keyswap
```
Under normal circumstances this keymap would not have worked well had Firefox not included 2 keymap options for going forwards or back. In the next example, Chrome, you will see how to solve this very same problem but in xkb format and it is the only way to fix it for Chrome due to conflicting with wordwise shortcuts.
Also the choice of xdotool over something like xte (xautomation) was explicit, xdotool allows you to hold down a modifier and continue to repeat the action(s) and xte does not.
**How to Remap Using XKB - Chrome**
This gets to be a little more complicated, but this is what you have to do to accomplish the same on the xkb level.
**Summary**
1. Copy ~/.xkb/keymap/kbd.mac.gui and append the name of the app. (e.g. chrome)
2. Edit ~/.xkb/keymap/kbd.mac.gui.chrome
3. Add new keybindings to ~/.xkb/symbols/mac_gui
4. Only edit types if you absolutely need to add another modifier level (~/.xkb/types/mac_gui)
Understand that as you add or modify the ~/.xkb/symbols/ files that these two groups **symbols[Group1]** and **actions[Group1]** will be following the order of the modifier levels that are configured in the related ~/.xkb/types/mac_gui or mac_term file.
Also you will have to discover the proper xkb names for keys and that they will often follow *two different* labels/names. eg RGHT vs Right ... **replace key \<RGHT\>** vs **symbols[Group1]= [ Right, ...**.
A good place to get the proper names/labels are these two files.
```
/usr/share/X11/xkb/symbols/us
/usr/share/X11/xkb/symbols/inet
```
Ok, so here are the detailed instructions.
1. cp ~/.xkb/keymap/kbd.mac.gui ~/.xkb/keymap/kbd.mac.gui.chrome
2. nano ~/.xkb/keymap/kbd.mac.gui.chrome
```
# Change mac_gui(mac_levelssym)
...
xkb_symbols { include "pc+us+us:2+inet(evdev)+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)+mac_gui(mac_levelssym)" };
...
# To +mac_gui(mac_chrome)
xkb_symbols { include "pc+us+us:2+inet(evdev)+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)+mac_gui(mac_chrome)" };
...
};
```
3. Add your new "partial xkb_symbols" via nano ~/.xkb/symbols/mac_gui
```
partial xkb_symbols "mac_chrome" {
// Back Button
replace key <LEFT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Left,
Left,
Left
],
actions[Group1]= [
NoAction(),
RedirectKey(key=<UP>),
RedirectKey(key=<LEFT>,modifiers=Mod1,clearmods=Control)
]
};
// Forwards Button
replace key <RGHT> {
type[Group1]= "ONE_LEVEL_CTRL",
symbols[Group1]= [
Right,
Right,
Right
],
actions[Group1]= [
NoAction(),
RedirectKey(key=<DOWN>),
RedirectKey(key=<RGHT>,modifiers=Mod1,clearmods=Control)
]
};
```
~/.config/kinto/user_config.json
```
{
"name": "chrome",
"run": "setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui.chrome $DISPLAY",
"run_onInput": "xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
"run_offInput": "xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui.chrome $DISPLAY",
"symbols": "",
"types": "",
"de": [
2
],
"appnames": [
"Chromium",
"Chromium-browser",
"Google-chrome"
]
}
```
4. Not making changes to types but it looks like this. It contains 5 levels of modifiers, Base, Alt, Control, Shift+Control, and Shift+Alt. Additional Levels can and may be added later, but please do not change the order of the Levels or existing symbols files will break!! You can add new levels however without issue.
```
default partial xkb_types "addmac_levels" {
type "ONE_LEVEL_CTRL" {
modifiers= Mod1+Control+Shift;
map[Mod1]= Level2;
map[Control]= Level3;
map[Mod1+Control]= Level3;
map[Shift+Control]= Level4;
map[Shift+Mod1] = Level5;
level_name[Level1]= "Base";
level_name[Level2]= "Alt";
level_name[Level3]= "Control";
level_name[Level4]= "Shift with Control";
level_name[Level5] = "Shift Alt";
};
};
```
Once you have made your changes you can restart the Kinto service and the changes will take affect.
```
systemctl --user restart keyswap
```
## JSON config files
Features
@@ -70,20 +348,51 @@ Located at ~/.config/kinto/ you will find user_config.json which will look like
You can also add additional Desktop Environment related tweaks to user_config.json in the install directory as well and the installer will prompt you to install them. You may also fork and submit any json or additional .xkb configurations to me for approval if you believe it makes Linux more like typing on a Mac.
```
{"config":[{
{"config":[
//
// Each config category contains the category name, and references to the de tweaks
// And contains the default run commands plus what behavior they should exhibit for
// input fields on/off focus, if any.
// Symbols and types are not currently used - may later replace the need for static
// files with xkbcomp.
//
// If you use xbindkeys outside of Kinto then you may want to remove xbindkeys from
// this config after setup or rewrite the command to exclude your own xbindkeys.
//
{
"name":"gui",
"run":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
"de":[2],
"appnames":[ "" ],
"run_onInput":"",
"run_offInput": "killall xbindkeys > /dev/null 2>&1",
"symbols":"",
"types":"",
"de":[],
"appnames":[ "" ]
},
{
"name":"term",
"run":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
"de":[2],
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm" ]
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty" ],
"run_onInput":"",
"run_offInput": "killall xbindkeys > /dev/null 2>&1",
"symbols":"",
"types":"",
"de":[],
"appnames":[ "" ]
}],
// Init - Array that references de objects by their ID and runs the "run" command
// when the app initially runs.
"init": [1],
// detypes - DE's with support or planned support
"detypes":["gnome2","gnome3","kde4","kde5","xfce","i3wm"],
// de - tweak objects and initial command to be ran on start.
//
// Intent - init or gui_term, to signify what type of tweak it is.
// run, run_term, run_gui - run is only relevant for init, and the
// other two relate to gui_term and running under those modes.
"de":[{
"id": 1,
"type": ["gnome3"],
@@ -120,40 +429,6 @@ You can also add additional Desktop Environment related tweaks to user_config.js
}
```
## How to Control Kinto
Under systemd this is how you control Kinto.
Status
```
systemctl --user status keyswap
```
Stop
```
systemctl --user stop keyswap
```
Start
```
systemctl --user start keyswap
```
Restart
```
systemctl --user restart keyswap
```
Enable
```
systemctl --user enable keyswap
```
Disable
```
systemctl --user disable keyswap
```
## Learning macOS style hotkeys on Linux
You can use websites like https://www.shortcutfoo.com in Google Chrome while using the terminal style keymap, but Firefox is not compatible due to detecting "cmd" as keycode 224. Chrome detects Win/Super/Cmd as keycode 91 on all OS's.
@@ -165,25 +440,80 @@ systemctl --user stop keyswap && setxkbmap -option;setxkbmap -option altwin:swap
## Troubleshooting
### Does not start when you log in or after you reboot?
1. Check the status
```
systemctl --user status keyswap
```
2. Check the service journal
```
journalctl --user-unit=keyswap.service -b
```
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.
```
echo $DISPLAY
# :0.0
```
nano ~/.config/systemd/user/keyswap.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.
### Keyswap is not occurring, but it was working.
Now that Kinto is using a custom written C program I am not aware of any specific bugs or issues, but you can start here if you having difficulties and please report it if it is reproducible.
1. Restart Kinto
1. Get status
```
systemctl --user status keyswap
```
2. Restart Kinto
```
systemctl --user restart keyswap
```
2. Check the Status of Kinto and open a ticket with the output.
3. Check the Status again and open a ticket if you need to.
```
systemctl --user status keyswap
```
You can also do the following to see if it is an actual issue with kintox11 not running or your service file.
```
cd ~/.config/kinto
./kintox11
```
## Debug
If all else fails you can now run Kinto in debug mode as of 1.0.6-2. The output will become more verbose and I'd recommend running this directly after stopping the service.
```
systemctl --user stop keyswap
cd ~/.config/kinto
./kintox11 --debug
```
## 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.
If you would like to attempt adding additional custom keymaps for other languages then I strongly recommend reading Glen Whitney's post here.
https://superuser.com/questions/385748/binding-superc-superv-to-copy-and-paste
## Notes about Windows 10
Sharpkeys was used to create the layout/reg files to swap the Ctrl, Win and Alt keys. Sharpkeys was not required however because the reg keys were extracted. Autohotkey is used to manage keyswaps needed for terminal usage. Autohotkey is also used to add additional mac like keybinds for Sublime text and can be used for other apps as well.
Microsoft is working on a new Powertoy Keyboard Manager that could be used with an easier to use GUI interface, but this approach should be fully sufficient for a mac like experience and autohotkeys appears to be more than capable enough to handle complex rebinding of any or most mac like shortcuts.
## Contributing
I welcome any and all contributors who want to contribute something to this project.
@@ -194,8 +524,28 @@ https://superuser.com/questions/385748/binding-superc-superv-to-copy-and-paste
## 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.
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 explaination 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.
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

View File

@@ -1,6 +1,6 @@
{"defaultapps":[{
"name":"term",
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm" ]
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty" ]
}],
"defaulttypes":["windows","mac","chromebook"],
"defaults":[{
@@ -9,78 +9,78 @@
"type":"windows",
"active": false,
"description":"Standard Windows 104 Keyboards",
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)",
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_levelssym)",
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)",
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_win)+mac_term(mac_global)",
"xkb_types_gui":"+mac_gui(addmac_levels)",
"xkb_types_term":""
"xkb_types_term":"+mac_term(addmac_levels)"
},
{
"id": 2,
"name":"Mac - hid driver",
"name":"Mac - hid driver (Recommended - Also supports Windows keyboards)",
"type":"mac",
"active": false,
"description":"Standard Mac Keyboards with Apple driver",
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)",
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_levelssym)",
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
"xkb_symbols_gui":"+altwin(ctrl_alt_win)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)",
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term(mac_win)+mac_term(mac_global)",
"xkb_types_gui":"+mac_gui(addmac_levels)",
"xkb_types_term":"",
"xkb_types_term":"+mac_term(addmac_levels)",
"hack": "echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all"
},
{
"id": 3,
"name":"Mac Only",
"name":"Mac Only (VMs & non-official Apple keyboards)",
"type":"mac",
"active": true,
"description":"Standard Mac Keyboards",
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
"xkb_symbols_gui":"+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)+mac_gui(mac_levelssym)",
"xkb_symbols_term":"+altwin(alt_super_win)+mac_term(mac_levelssym)",
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
"xkb_symbols_gui":"+ctrl(swap_lwin_lctl)+ctrl(swap_rwin_rctl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)",
"xkb_symbols_term":"+altwin(alt_super_win)+mac_term(mac_apple)+mac_term(mac_global)",
"xkb_types_gui":"+mac_gui(addmac_levels)",
"xkb_types_term":""
"xkb_types_term":"+mac_term(addmac_levels)"
},
{
"id": 4,
"name":"Chromebook",
"name":"Chromebook (xfce)",
"type":"chromebook",
"active": false,
"description":"Standard Chromebook Keyboards",
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY",
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)",
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)",
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
"xkb_types_gui":"+mac_gui(addmac_levels)",
"xkb_types_term":""
"xkb_types_term":"+mac_term(addmac_levels)"
},
{
"id": 5,
"name":"Chromebook - Windows",
"name":"Chromebook (xfce) - Windows",
"type":"chromebook",
"active": false,
"description":"Chromebook with Windows 104 Keyboard",
"gui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY; setxkbmap -device $usbid -option altwin:ctrl_alt_win",
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
"fallbackgui":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY",
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)",
"gui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen; setxkbmap -device $usbid -option altwin:ctrl_alt_win",
"term":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
"fallbackgui":"xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)",
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
"xkb_types_gui":"+mac_gui(addmac_levels)",
"xkb_types_term":""
"xkb_types_term":"+mac_term(addmac_levels)"
},
{
"id": 6,
"name":"Chromebook - Mac",
"name":"Chromebook (xfce) - Mac",
"type":"chromebook",
"active": false,
"description":"Chromebook with Mac Keyboard",
"gui":"setxkbmap -option;setxkbmap -option ctrl:swap_lwin_lctl; xkbcomp -w0 -i $internalid -I$HOME/.xkb ~/.xkb/keymap/kbd.chromebook.gui $DISPLAY",
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY",
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)",
"gui":"setxkbmap -option;setxkbmap -option ctrl:swap_lwin_lctl; xkbcomp -w0 -i $internalid -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY 2>&1 | grep -v XF86FullScreen",
"term":"setxkbmap -option;xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.term $DISPLAY 2>&1 | grep -v XF86FullScreen",
"xkb_symbols_gui":"+chromebook(swap_lalt_lctrl)+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)",
"xkb_symbols_term":"+altwin(swap_alt_win)+mac_term_chromebook(mac_levelssym)",
"xkb_types_gui":"+mac_gui(addmac_levels)",
"xkb_types_term":""
"xkb_types_term":"+mac_term(addmac_levels)"
}]
}

View File

@@ -1,13 +1,26 @@
#!/bin/bash
swapcmd="\/bin\/bash\ \/home\/`whoami`\/.config\/kinto\/xactive.sh"
systemctl --user stop keyswap >/dev/null 2>&1
systemctl --user disable keyswap >/dev/null 2>&1
systemctl --user stop keyswap.timer >/dev/null 2>&1
systemctl --user disable keyswap.timer >/dev/null 2>&1
mkdir -p ~/.config/systemd/user
mkdir -p ~/.config/autostart
cp ./system-config/keyswap.service ~/.config/systemd/user/keyswap.service
cp ./system-config/keyswap.sh ~/.config/autostart/keyswap.sh
cp ./system-config/kinto.desktop ~/.config/autostart/kinto.desktop
cp ./system-config/keyswap.timer ~/.config/systemd/user/keyswap.timer
cp ./kintox11/binary/kintox11 ~/.config/kinto/kintox11
cp ./system-config/xactive.sh ~/.config/kinto/xactive.sh
cp ./system-config/caret_status.sh ~/.config/kinto/caret_status.sh
cp ./system-config/cleanup.sh ~/.config/kinto/cleanup.sh
cp ./system-config/.firefox-nw ~/.config/kinto/.firefox-nw
sed -i "s/{username}/`whoami`/g" ~/.config/systemd/user/keyswap.service
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/systemd/user/keyswap.service
# if [ "${#DISPLAY}" -gt 2 ]
# then
sed -i "s/#Environment/Environment/g" ~/.config/systemd/user/keyswap.service
# fi
systemctl --user daemon-reload
sed -i "s/ExecStart=/ExecStart=${swapcmd}/g" ~/.config/systemd/user/keyswap.service
systemctl --user enable keyswap
systemctl --user start keyswap
systemctl --user enable keyswap.timer
systemctl --user start keyswap

115
kintopy/kinto.py Normal file
View File

@@ -0,0 +1,115 @@
#!/usr/bin/env python
#
# Kinto - Python implementation of Xlib
#
# Based on code by Stephan Sokolow
# Source: https://gist.github.com/ssokolow/e7c9aae63fb7973e4d64cff969a78ae8
from contextlib import contextmanager
import Xlib
import Xlib.display
# Connect to the X server and get the root window
disp = Xlib.display.Display()
root = disp.screen().root
# Prepare the property names we use so they can be fed into X11 APIs
NET_ACTIVE_WINDOW = disp.intern_atom('_NET_ACTIVE_WINDOW')
NET_WM_NAME = disp.intern_atom('_NET_WM_NAME') # UTF-8
WM_NAME = disp.intern_atom('WM_NAME') # Legacy encoding
NET_WM_CLASS = disp.intern_atom('_NET_WM_CLASS') # UTF-8
WM_CLASS = disp.intern_atom('WM_CLASS')
last_seen = { 'xid': None, 'title': None }
@contextmanager
def window_obj(win_id):
"""Simplify dealing with BadWindow (make it either valid or None)"""
window_obj = None
if win_id:
try:
window_obj = disp.create_resource_object('window', win_id)
except Xlib.error.XError:
pass
yield window_obj
def get_active_window():
"""Return a (window_obj, focus_has_changed) tuple for the active window."""
win_id = root.get_full_property(NET_ACTIVE_WINDOW,Xlib.X.AnyPropertyType).value[0]
focus_changed = (win_id != last_seen['xid'])
if focus_changed:
with window_obj(last_seen['xid']) as old_win:
if old_win:
old_win.change_attributes(event_mask=Xlib.X.NoEventMask)
last_seen['xid'] = win_id
with window_obj(win_id) as new_win:
if new_win:
new_win.change_attributes(event_mask=Xlib.X.PropertyChangeMask)
return win_id, focus_changed
def _get_window_class_inner(win_obj):
for atom in (NET_WM_CLASS, WM_CLASS):
try:
window_class = win_obj.get_full_property(atom, 0)
except UnicodeDecodeError: # Apparently a Debian distro package bug
title = "<could not decode characters>"
else:
if window_class:
win_class = window_class.value.split('\x00')[1]
if isinstance(win_class, bytes):
# Apparently COMPOUND_TEXT is so arcane that this is how
# tools like xprop deal with receiving it these days
win_class = win_class.split('\x00')[1].decode('latin1', 'replace')
return win_class
else:
title = "<unnamed window>"
return "{} (XID: {})".format(title, win_obj.id)
def get_window_class(win_id):
"""Look up the window name for a given X11 window ID"""
if not win_id:
last_seen['title'] = "<no window id>"
return last_seen['title']
title_changed = False
with window_obj(win_id) as wobj:
if wobj:
win_title = _get_window_class_inner(wobj)
title_changed = (win_title != last_seen['title'])
last_seen['title'] = win_title
return last_seen['title'], title_changed
def handle_xevent(event):
# Loop through, ignoring events until we're notified of focus/title change
if event.type != Xlib.X.PropertyNotify:
return
changed = False
if event.atom == NET_ACTIVE_WINDOW:
if get_active_window()[1]:
changed = changed or get_window_class(last_seen['xid'])[1]
elif event.atom in (NET_WM_CLASS, WM_CLASS):
changed = changed or get_window_class(last_seen['xid'])[1]
if changed:
handle_change(last_seen)
def handle_change(new_state):
"""Replace this with whatever you want to actually do"""
print(new_state['title'])
if __name__ == '__main__':
# Listen for _NET_ACTIVE_WINDOW changes
root.change_attributes(event_mask=Xlib.X.PropertyChangeMask)
# Prime last_seen with whatever window was active when we started this
get_window_class(get_active_window()[0])
handle_change(last_seen)
while True: # next_event() sleeps until we get an event
handle_xevent(disp.next_event())

Binary file not shown.

5
kintox11/src/Makefile Normal file
View File

@@ -0,0 +1,5 @@
CFLAGS=-g $(shell pkg-config --cflags json-c xmu)
LDFLAGS=-g $(shell pkg-config --libs json-c xmu)
all:
$(CC) kintox11.c $(CFLAGS) $(LDFLAGS) -lm -lpthread -o kintox11

View File

@@ -10,22 +10,194 @@
//
// To compile with static library json-c
// Make sure archive with object files exist ar -t /usr/local/lib/libjson-c.a
// gcc -L/usr/local/lib/ kintox11.c -ljson-c -lXmu -lXt -lX11 -o kintox11
// gcc -L/usr/local/lib/ kintox11.c -ljson-c -lXmu -lXt -lX11 -O2 -o kintox11
//
#define _GNU_SOURCE 1
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <locale.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <X11/Xlib.h> // `apt-get install libx11-dev`
#include <X11/Xmu/WinUtil.h> // `apt-get install libxmu-dev`
#include <json-c/json.h> // `apt install libjson-c-dev`
#include <sys/select.h>
#include <math.h>
#include <sys/time.h>
#ifdef WIN32
#include <windows.h>
#elif _POSIX_C_SOURCE >= 199309L
#include <time.h> // for nanosleep
#else
#include <unistd.h> // for usleep
#endif
const char *eventNames[34] = {"None","KeyPress","KeyRelease","ButtonPress","ButtonRelease","MotionNotify","EnterNotify","LeaveNotify","FocusIn","FocusOut","KeymapNotify","Expose","GraphicsExpose","NoExpose","VisibilityNotify","CreateNotify","DestroyNotify","UnmapNotify","MapNotify","MapRequest","ReparentNotify","ConfigureNotify","ConfigureRequest","ResizeRequest","CirculateNotify","CirculateRequest","PropertyNotify","SelectionClear","SelectionRequest","SelectionNotify","ColormapNotify","ClientMessage","MappingNotify"};
#define NUM_THREADS 2
typedef struct threadArgs * ThreadArgs;
struct threadArgs{
char *run_onInput;
char *run_offInput;
};
long long timeInMilliseconds(void) {
struct timeval tv;
gettimeofday(&tv,NULL);
return (((long long)tv.tv_sec)*1000)+(tv.tv_usec/1000);
}
bool debug;
bool input_check = 0;
long long int event_ts;
int last_event;
Display* d;
Window w;
XEvent e;
// cross-platform sleep function
void sleep_ms(int milliseconds) {
#ifdef WIN32
Sleep(milliseconds);
#elif _POSIX_C_SOURCE >= 199309L
struct timespec ts;
ts.tv_sec = milliseconds / 1000;
ts.tv_nsec = (milliseconds % 1000) * 1000000;
nanosleep(&ts, NULL);
#else
usleep(milliseconds * 1000);
#endif
}
char *trimwhitespace(char *str){
char *end;
// Trim leading space
while(isspace((unsigned char)*str)) str++;
if(*str == 0) // All spaces?
return str;
// Trim trailing space
end = str + strlen(str) - 1;
while(end > str && isspace((unsigned char)*end)) end--;
// Write new null terminator character
end[1] = '\0';
return str;
}
int check_caret(){
int caretint;
char * fpname;
fpname = malloc(sizeof(char)*20);
strcpy(fpname,"/tmp/kinto/caret");
if( access( fpname, F_OK ) != -1 ) {
char *buffer = NULL;
size_t size = 0;
FILE *fp = fopen(fpname, "r");
fseek(fp, 0, SEEK_END);
size = ftell(fp);
rewind(fp);
buffer = malloc((size + 1) * sizeof(*buffer));
fread(buffer, size, 1, fp);
buffer[size] = '\0';
trimwhitespace(buffer);
caretint = atoi(buffer);
if(caretint == 1){
// printf("caret: %s\n", buffer);
return 1;
}
// printf("found nothing\n");
return 0;
}
else{
// printf("file %s does not exist\n",fpname);
return 0;
}
}
void *inputToggle(void *argStruct) {
ThreadArgs args = argStruct;
char * onInput;
char * offInput;
onInput = malloc(sizeof(char)*400);
offInput = malloc(sizeof(char)*400);
onInput = args->run_onInput;
offInput = args->run_offInput;
Bool ran_onInput = 0;
while(input_check){
if(check_caret() && ran_onInput == 0){
if(debug == true){
printf("run_onInput: %s\n",onInput);
}
system(onInput);
ran_onInput = 1;
}
else if(!check_caret() && ran_onInput == 1){
if(debug == true){
printf("run_offInput: %s\n",offInput);
}
system(offInput);
ran_onInput = 0;
}
sleep_ms(100);
}
pthread_exit(NULL);
}
void *nextPlease(void *threadid) {
long tid;
tid = (long)threadid;
// printf("Next Please Thread ID, %ld\n", tid);
// Reference http://www.rahul.net/kenton/xproto/xevents_errors.html
// event type 17 - DestroyNotify
// event type 18 - UnmapNotify
// event type 22 - ConfigureNotify
// Dismiss the following events by initiating another XNextEvent
XNextEvent(d, &e);
while(e.type != ConfigureNotify || (e.type == ConfigureNotify && last_event == ConfigureNotify && timeInMilliseconds()-event_ts < 419)){
XNextEvent(d, &e);
}
// Unset input thread
input_check = 0;
last_event = e.type;
if(debug == true){
printf(" event: %s %d\n",eventNames[e.type-1],e.type);
printf(" duration: %lldms\n",timeInMilliseconds()-event_ts);
}
event_ts = timeInMilliseconds();
pthread_exit(NULL);
}
char * append(char * string1, char * string2){
char * result = NULL;
asprintf(&result, "%s,%s", string1, string2);
return result;
}
static int wait_fd(int fd, double seconds){
struct timeval tv;
fd_set in_fds;
FD_ZERO(&in_fds);
FD_SET(fd, &in_fds);
tv.tv_sec = trunc(seconds);
tv.tv_usec = (seconds - trunc(seconds))*1000000;
return select(fd+1, &in_fds, 0, 0, &tv);
}
Bool xerror = False;
int in_int(int a[],int size,int item)
{
int in_int(int a[],int size,int item){
int i,pos=-1;
for(i=0;i< size;i++)
{
@@ -48,8 +220,7 @@ int in(const char **arr, int len, char *target) {
return -1;
}
int strcicmp(char const *a, char const *b)
{
int strcicmp(char const *a, char const *b){
for (;; a++, b++) {
int d = tolower((unsigned char)*a) - tolower((unsigned char)*b);
if (d != 0 || !*a)
@@ -58,36 +229,129 @@ int strcicmp(char const *a, char const *b)
}
Display* open_display(){
int i;
Display* d = XOpenDisplay(NULL);
for (i = 0; i < 60; i++) {
if(d == NULL){
printf("fail to open X server display...\n");
}
else{
break;
}
sleep(1);
}
if(d == NULL){
printf("fail to open X server display...\n");
printf("fail to open X server display for 1 minute...\n");
printf("Kintox11 is now exiting...\n");
exit(1);
}
return d;
}
int handle_error(Display* display, XErrorEvent* error){
// printf("X11 error: type=%d, serial=%lu, code=%d\n",
// error->type, error->serial, (int)error->error_code);
// xerror = True;
return 0;
printf("X11 error: type=%d, serial=%lu, code=%d\n",
error->type, error->serial, (int)error->error_code);
xerror = True;
return 1;
}
Window get_focus_window(Display* d){
Window get_focus_window(Display* d, int etype, char const *eventName, char const *current_app, bool debug){
Window w;
int revert_to;
XGetInputFocus(d, &w, &revert_to); // see man
if(debug == true){
printf("\n get focus window\n");
}
if(!(etype == DestroyNotify || etype == UnmapNotify)) {
XGetInputFocus(d, &w, &revert_to); // see man
if(debug == true){
printf(" -%s: event: %d, window_id: %ld\n",current_app,etype,w);
}
}
if(xerror){
printf("Error getting focused window\n");
printf("*Error getting focused window, e.type: %d, current_app: %s\n",etype,current_app);
exit(1);
}else if(w == None){
printf("no focus window\n");
printf("*no focus window, e.type: %d, current_app: %s\n",etype,current_app);
exit(1);
}
return w;
}
// get the top window.
// a top window have the following specifications.
// * the start window is contained the descendent windows.
// * the parent window is the root window.
Window get_top_window(Display* d, Window start, int etype, char const *eventName, char const *current_app, bool debug){
Window w = start;
Window parent = start;
Window root = None;
Window *children;
unsigned int nchildren;
Status s;
char * ws;
char * wstr;
ws = malloc(sizeof(char)*4096);
wstr = malloc(sizeof(char)*100);
// strcpy(wstr,"test,");
if(debug == true){
printf("\n get top window\n");
}
// Checking for Destroy and Unmap Notify events here too
// Sometimes they still get passed through and if so need
// to be ignored or XQueryTree will cause a segmentation fault
while (parent != root && parent != 0 && !(etype == DestroyNotify || etype == UnmapNotify)) {
w = parent;
s = XQueryTree(d, w, &root, &parent, &children, &nchildren); // see man
sprintf(wstr, "%ld", w);
if ((ws != NULL) && (ws[0] == '\0')) {
strcpy(ws,wstr);
}
else{
ws = append(ws, wstr);
}
if (s)
XFree(children);
if(xerror){
printf("*fail to get top window: %ld, e.type: %d, current_app: %s\n",w,etype,current_app);
break;
}
}
if(debug == true){
printf(" -%s: event: %d, window_id: %s\n",current_app,etype,ws);
}
return w;
}
// search a named window (that has a WM_STATE prop)
// on the descendent windows of the argment Window.
Window get_named_window(Display* d, Window start, int etype, char const *eventName, char const *current_app, bool debug){
Window w;
if(debug == true){
printf("\n get named window\n");
}
// printf("getting named window ... ");
w = XmuClientWindow(d, start); // see man
if(debug == true){
printf(" -%s: event: %d, window_id: %ld\n\n",current_app,etype,w);
}
// if(w == start)
// printf("fail\n");
// printf("success (window: %d)\n", (int) w);
return w;
}
const char * str_window_class(Display* d, Window w, char *prior_app ){
Status s;
@@ -113,22 +377,33 @@ const char * str_window_class(Display* d, Window w, char *prior_app ){
}
}
int main(void){
int main(int argc, char *argv[]){
XInitThreads();
if(argc < 2){
debug = false;
}
if(argc > 1 && (strcmp(argv[1], "-d") == 0 || strcmp(argv[1], "--debug") == 0 )){
debug = true;
printf("Running in debug mode\n");
}
FILE *fp;
char buffer[10240];
struct json_object *parsed_json, *config, *config_obj,
*config_obj_name, *config_obj_run, *config_obj_de,
*config_obj_appnames, *appnames_obj, *init, *de,
*de_obj, *de_obj_id, *de_obj_active, *de_obj_run,
*de_obj_runterm,*de_obj_rungui;
*config_obj_name, *config_obj_run, *config_obj_run_oninput,
*config_obj_run_offinput, *config_obj_de, *config_obj_appnames,
*appnames_obj, *init, *de, *de_obj, *de_obj_id, *de_obj_active,
*de_obj_run, *de_obj_runterm,*de_obj_rungui;
int arraylen;
int appnames_len, init_len, de_len, config_de_len;
int system(const char *command);
size_t i,n,r;
printf("Importing user_config.json...\n");
fp = fopen("user_config.json","r");
fread(buffer, 10240, 1, fp);
fclose(fp);
@@ -145,6 +420,8 @@ int main(void){
const char *name_array[arraylen];
const char *run_array[arraylen];
const char *run_oninput_array[arraylen];
const char *run_offinput_array[arraylen];
int init_array[init_len];
int de_id_array[de_len];
@@ -193,10 +470,16 @@ int main(void){
for (i = 0; i < arraylen; i++) {
config_obj = json_object_array_get_idx(config, i);
config_obj_name = json_object_object_get(config_obj, "name");
config_obj_run = json_object_object_get(config_obj, "run");
config_obj_run_oninput = json_object_object_get(config_obj, "run_onInput");
config_obj_run_offinput = json_object_object_get(config_obj, "run_offInput");
name_array[i] = json_object_get_string(config_obj_name);
run_array[i] = json_object_get_string(config_obj_run);
run_oninput_array[i] = json_object_get_string(config_obj_run_oninput);
run_offinput_array[i] = json_object_get_string(config_obj_run_offinput);
// printf("%s\n%s\n", json_object_get_string(config_obj_name), json_object_get_string(config_obj_run));
config_obj_appnames = json_object_object_get(config_obj, "appnames");
@@ -209,13 +492,13 @@ int main(void){
}
else{
appnames_array[i][n] = json_object_get_string(json_object_array_get_idx(config_obj_appnames, n));
// printf("%s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
//printf("%s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
}
}
if(appnames_max > appnames_len){
for (n = appnames_len; n < appnames_max; n++){
appnames_array[i][n] = NULL;
// printf("%s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
//printf("%s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
}
}
@@ -233,6 +516,8 @@ int main(void){
}
}
printf("Data from user_config.json imported successfully.\n");
for (i = 0; i < init_len; i++) {
init_array[i] = json_object_get_int(json_object_array_get_idx(init, i));
@@ -241,8 +526,7 @@ int main(void){
system(de_run_array[de_id_idx]);
}
Display* d;
Window w;
char *name;
// for XmbTextPropertyToTextList
setlocale(LC_ALL, ""); // see man locale
@@ -251,90 +535,156 @@ int main(void){
XSelectInput(d, DefaultRootWindow(d), SubstructureNotifyMask);
XSetErrorHandler(handle_error);
char * run_normal;
char * run_onInput;
char * run_offInput;
char * prior_app;
char * current_app;
char * prior_category;
char * current_category;
run_onInput = malloc(sizeof(char)*400);
run_offInput = malloc(sizeof(char)*400);
run_normal = malloc(sizeof(char)*400);
prior_app = malloc(sizeof(char)*100);
current_app = malloc(sizeof(char)*100);
prior_category = malloc(sizeof(char)*100);
current_category = malloc(sizeof(char)*100);
strcpy(prior_app,"none");
strcpy(prior_category,"none");
int remap_bool = 2;
printf("Starting keyswap...\n");
// get active window
w = get_focus_window(d);
w = get_focus_window(d, 0, eventNames[0], current_app, debug);
w = get_top_window(d, w, 0, eventNames[0], current_app, debug);
w = get_named_window(d, w, 0, eventNames[0], current_app, debug);
// XFetchName(d, w, &name);
// printf("window:%#x name:%s\n", w, name);
printf("First window name: %s \n\n",str_window_class(d, w,prior_app));
int breakouter;
last_event=0;
event_ts = timeInMilliseconds();
for (;;)
{
strcpy(current_app,str_window_class(d, w,prior_app));
int category_idx;
// printf("current: %s\n",current_app);
breakouter = 0;
// printf("%s\n","1");
// printf("%s\n",str_window_class(d, w,prior_app));
if(strcmp(str_window_class(d, w,prior_app),prior_app)){
// printf("%s\n","2");
for(i = 0; i < arraylen; ++i){
if(breakouter == 0){
if(strcmp(name_array[i],"gui")){
// printf("%s\n","3");
for(n = 0; n < appnames_max; ++n){
if (appnames_array[i][n] != NULL){
// printf("%s\n",appnames_array[i][n]);
// If statement for triggering terminal config
if((strcicmp(appnames_array[i][n], str_window_class(d, w,prior_app)) == 0 && (remap_bool == 1 || remap_bool == 2))) {
// printf("1st if %s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
printf("%s\n",name_array[i]);
system(run_array[i]);
for(r = 0; r < config_de_max; r++){
if(config_de_array[i][r] != -1){
int de_id_idx = in_int(de_id_array, de_len, config_de_array[i][r]);
// printf("Running de command: %s\n",de_run_array[de_id_idx]);
system(de_runterm_array[de_id_idx]);
}
}
remap_bool = 0;
fflush(stdout);
breakouter = 1;
break;
} // Else command for ignoring similar app category based on config
else if((strcicmp(appnames_array[i][n], str_window_class(d, w,prior_app)) == 0 && remap_bool == 0)){
// printf("2nd elseif %s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
// printf("%s\n","4");
breakouter = 1;
break;
} // Else command for triggering gui config
else if ((i == arraylen-1 || appnames_array[i][n+1] == NULL) && (remap_bool == 0 || remap_bool == 2)){
char *find = "gui";
int gui_idx = in(name_array, arraylen, find);
if(gui_idx >= 0) {
printf("%s\n",name_array[gui_idx]);
system(run_array[gui_idx]);
}
for(r = 0; r < config_de_max; r++){
if(config_de_array[gui_idx][r] != -1){
int de_id_idx = in_int(de_id_array, de_len, config_de_array[gui_idx][r]);
// printf("Running de command: %s\n",de_run_array[de_id_idx]);
system(de_rungui_array[de_id_idx]);
}
}
// printf("3rd elseif %s i:%ld n:%ld %s\n",name_array[i],i,n,appnames_array[i][n]);
remap_bool = 1;
fflush(stdout);
breakouter = 1;
break;
}
}
}
// Cycle through category name array
// printf("%d\n",arraylen);
for(i = 0; i < arraylen; ++i){
// Cycle through the maximum App name array in each category
for(n = 0; n < appnames_max; ++n){
if (appnames_array[i][n] != NULL){
// printf("%s\n",appnames_array[i][n]);
if(strcicmp(appnames_array[i][n], current_app) == 0){
strcpy(current_category,name_array[i]);
category_idx = i;
// printf("Match found: %s: %s\n",current_category,current_app);
breakouter = 1;
break;
}
}
else{
else if(i == arraylen-1 && breakouter==0){
// printf("No match found, default to gui");
strcpy(current_category,"gui");
category_idx = in(name_array, arraylen, current_category);
// printf("Match found: %s: %s\n",current_category,current_app);
break;
}
else if(appnames_array[i][n] == NULL){
break;
}
if(breakouter==1){
break;
}
}
}
// printf("%s\n","5");
strcpy(prior_app,str_window_class(d, w, prior_app));
if(strcicmp(prior_category, current_category) != 0){
// printf("prior: %s, current: %s\n",prior_category,current_category);
// printf("%d,%d,%d,%d\n",strcicmp(prior_category, "gui"),strcicmp(current_category, "firefox"),strcicmp(current_category, "gui"),strcicmp(prior_category, "firefox"));
// printf("%d,%d\n",(strcicmp(prior_category, "gui") != 0 && strcicmp(prior_category, "firefox") != 0),(strcicmp(current_category, "gui") != 0 && strcicmp(current_category, "firefox") != 0));
printf("%s: %s\n",current_category,current_app);
// Make sure we're not switching between 2 GUI keymaps
// Firefox & Standard GUI apps
// strcicmp returns 0 for matches, <>0 for non-match
if((strcicmp(prior_category, "gui") != 0 && strcicmp(prior_category, "firefox") != 0) || (strcicmp(current_category, "gui") != 0 && strcicmp(current_category, "firefox") != 0)){
if(debug == true){
printf("run: %s\n",run_array[category_idx]);
}
system(run_array[category_idx]);
}
strcpy(run_normal,run_array[category_idx]);
strcpy(run_onInput,run_oninput_array[category_idx]);
strcpy(run_offInput,run_offinput_array[category_idx]);
system(run_offInput);
for(r = 0; r < config_de_max; r++){
if(config_de_array[category_idx][r] != -1){
int de_id_idx = in_int(de_id_array, de_len, config_de_array[category_idx][r]);
if(strcicmp(current_category, "term") == 0){
if(debug == true){
printf("Running de term command: %s\n",de_runterm_array[de_id_idx]);
}
system(de_runterm_array[de_id_idx]);
}
else{
if(debug == true){
printf("Running de gui command: %s\n",de_rungui_array[de_id_idx]);
}
system(de_rungui_array[de_id_idx]);
}
}
}
}
else if(strcicmp(prior_app, current_app) != 0){
int indent = strlen(current_category)+2;
printf("%*c%s\n", indent, ' ',current_app);
}
XEvent e;
XNextEvent(d, &e);
w = get_focus_window(d);
fflush(stdout);
strcpy(prior_app,current_app);
strcpy(prior_category,current_category);
if(strlen(run_onInput) > 0){
input_check = 1;
}
else{
input_check = 0;
}
pthread_t threads[NUM_THREADS];
int rc;
int i;
ThreadArgs args = (ThreadArgs)malloc(sizeof(struct threadArgs));
args->run_onInput = run_onInput;
args->run_offInput = run_offInput;
for( i = 0; i < NUM_THREADS; i++ ) {
if(i==0){
rc = pthread_create(&threads[i], NULL, inputToggle, args);
}
else{
rc = pthread_create(&threads[i], NULL, nextPlease, (void *)&i);
}
if (rc) {
printf("Error:unable to create thread, %d\n", rc);
exit(-1);
}
}
// wait for threads to close before continuing
for (int i = 0; i < NUM_THREADS; i++) {
pthread_join(threads[i], NULL);
}
w = get_focus_window(d, e.type, eventNames[e.type-1], current_app, debug);
w = get_top_window(d, w, e.type, eventNames[e.type-1], current_app, debug);
w = get_named_window(d, w, e.type, eventNames[e.type-1], current_app, debug);
}
}

75
references/shortcuts Normal file
View File

@@ -0,0 +1,75 @@
# GalliumOS Notes
xfconf-query -c xfce4-keyboard-shortcuts -lv | grep "show_desktop_key\|cycle_windows_key\|cycle_reverse_windows_key\|close_window_key\|maximize_window_key\|xfce4-popup-whiskermenu\|move_window_next_workspace_key\|move_window_prev_workspace_key\|hide" | grep -v "default\|<Alt>m"
# Show Desktop
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>d" --create --type string --set "show_desktop_key"
# Undo show desktop
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>d" --reset
# GUI Alt Tab - Window Switching
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt><Shift>Tab" --set "cycle_reverse_windows_key"
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt>Tab" --set "cycle_windows_key"
# Term Alt Tab - Window Switching
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt><Shift>Tab" --set "cycle_windows_key"
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt>Tab" --set "cycle_reverse_windows_key"
# Hide/minimize Window
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>h" --create --type string --set "hide_window_key"
# Spotlight
xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space" --create --type string --set "xfce4-popup-whiskermenu"
# Change workspace to left
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Left" --create --type string --set "move_window_prev_workspace_key"
# Change workspace to right
xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Right" --create --type string --set "move_window_next_workspace_key"
# PopOS
# Close App Alt+F4 (Super+w)
gsettings set org.gnome.desktop.wm.keybindings close "['<Alt>F4','<Super>w']"
# Undo
gsettings set org.gnome.desktop.wm.keybindings close "['<Super>w']"
# Maximize Window
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Alt>F10','<Primary><Super>Up']"
# Undo
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Primary><Super>Up']"
# Ubuntu 19.10
# Change Workspace
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Primary><Alt>Left','<Super>Left']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Primary><Alt>Right','<Super>Right']"
# ElementaryOS
# Show Desktop
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d','<Super>Down']"
# Maximize Window
gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Alt>F10','<Super>Up']"
# Spotlight
gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['<Control><Shift>Space','<Super>Space']"
# Fedora 31
# Show Desktop
gsettings set org.gnome.desktop.wm.keybindings show-desktop "['<Super>d']"
# Change Workspace
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Primary><Alt>Left','<Super>Left']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Primary><Alt>Right','<Super>Right']"
# Manjaro/Arch KDE
# Maximize
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
--key "Maximize Window" "Alt+F10,Meta+PgUp,Maximize Window"
# Minimize
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
--key "Minimize Window" "Meta+h,Meta+PgDown,Minimize Window"
# Switch Desktops
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
--key "Switch to Next Desktop" "Meta+Right,Meta+Right,Switch to Next Desktop"
kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" \
--key "Switch to Previous Desktop" "Meta+Left,Meta+Left,Switch to Previous Desktop"
kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &

1411
references/symbol_names.txt Normal file

File diff suppressed because it is too large Load Diff

426
setup.py
View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python3
import json, time, os
import json, time, os, sys
from shutil import copyfile
from subprocess import PIPE, Popen
from prekinto import *
@@ -15,6 +15,290 @@ def cmdline(command):
)
return process.communicate()[0]
dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
def requirements(pkgm):
print(bcolors.CYELLOW2 + "You need to install some packages, " +run_pkg+ ", for Kinto to fully remap browsers during input focus.\n" + bcolors.ENDC)
print("sudo " + pkgm + " " + run_pkg + "\n")
run_install = yn_choice(bcolors.CYELLOW2 + "Would you like to run it now? (Will require sudo privileges.)\n" + bcolors.ENDC)
if(run_install):
os.system("sudo " + pkgm + run_pkg)
print("\n")
def install_ibus():
print(bcolors.CYELLOW2 + "You need to set IBus as the default Input Method for full word-wise support and re-run this installer.\n" + bcolors.ENDC)
print(bcolors.CYELLOW2 + "Confirm the IBus Setup by saying Yes and then closing the window.\n" + bcolors.ENDC)
print("ibus-setup\n")
print("im-config -n ibus\n")
run_install = yn_choice(bcolors.CYELLOW2 + "Would you like to run it now? (Will require logoff and logon.)\n" + bcolors.ENDC)
if(run_install):
os.system("ibus-setup")
os.system("im-config -n ibus")
print("\n")
input("IBus has been set as the default Input Method.\nPress any key to exit and re-run after logoff & logon...")
sys.exit()
def setShortcuts():
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0]
distroVersion = cmdline("awk -F= '$1==\"VERSION_ID\" { print $2 ;}' /etc/os-release").replace('"','').strip()
print("\nIf Kinto is already running it will be stopped...")
print("If you cancel the installer you can re-run Kinto via\n systemctl --user start keyswap")
cmdline("systemctl --user stop keyswap")
print("\nDetected " + distro + " " + distroVersion.strip() + " DE: " + dename + "\n")
addhotkeys = yn_choice("\nDo you want to apply system level shortcuts?")
if(addhotkeys):
distro = distro.lower()
if dename == "gnome":
cmdline('dconf dump /org/gnome/desktop/wm/keybindings/ > keybindings_`date +"%Y.%m.%d-%s"`.conf')
cmdline('dconf dump /org/gnome/mutter/keybindings/ > mutter_`date +"%Y.%m.%d-%s"`.conf')
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications \"['<Primary>F13','<Primary><Shift>F13','<Alt>Tab']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
if distro == "ubuntu" and dename == "gnome":
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
elif distro == "pop!_os" and dename == "gnome":
cmdline("gsettings set org.gnome.desktop.wm.keybindings close \"['<Alt>F4','<Super>w']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings toggle-maximized \"['<Alt>F10','<Primary><Super>Up']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
elif distro == "elementary" and dename == "gnome":
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications \"['<Primary>F13','<Primary><Shift>F13','<Alt>Tab']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings show-desktop \"['<Super>d','<Super>Down']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings toggle-maximized \"['<Alt>F10','<Super>Up']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Control><Shift>Space','<Super>Space']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Super>Space','<Primary>Space']\"")
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Elementary cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_term')
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_term')
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Elementary cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
elif distro == "galliumos" and dename == "xfce":
print("Applying GalliumOS (xfce) shortcuts...")
cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml')
# Reset Show desktop
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>d" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>d" --create --type string --set "show_desktop_key"')
# Reset App Cycle
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt>Tab" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Alt><Shift>Tab" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary>backslash" --create --type string --set "cycle_windows_key"')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Shift>backslash" --create --type string --set "cycle_reverse_windows_key"')
# cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>h" --create --type string --set "hide_window_key"')
# Don't need to undo other maps for menu
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary>space" --create --type string --set "xfce4-popup-whiskermenu"')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/commands/custom/<Primary><Shift>space" --create --type string --set "xfce4-popup-whiskermenu"')
# Reset move to desktop shortcuts
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Home" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>End" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --reset')
os.system('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --create --type string --set "move_window_prev_workspace_key"')
os.system('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --create --type string --set "move_window_next_workspace_key"')
# Reset Change Workspace
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --reset')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Left" --create --type string --set "left_workspace_key"')
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Super>Right" --create --type string --set "right_workspace_key"')
print("\nYou may need to run these commands manually to make sure they are set, if you want to move windows between desktops.\n")
print(' xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Left" --create --type string --set "move_window_prev_workspace_key"')
print(' xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>Right" --create --type string --set "move_window_next_workspace_key"\n')
elif distro == "fedora" and dename == "gnome":
cmdline("gsettings set org.gnome.desktop.wm.keybindings show-desktop \"['<Super>d']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right ['']")
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-right \"['<Super><Alt>Right']\"")
cmdline("gsettings set org.gnome.mutter.keybindings toggle-tiled-left \"['<Super><Alt>Left']\"")
# org.gnome.mutter.keybindings toggle-tiled-right ['<Super>Right']
# org.gnome.mutter.keybindings toggle-tiled-left ['<Super>Left']
elif dename == "kde":
# cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "krunner.desktop" --key "_launch","Alt+Space\tAlt+F2\tSearch,Alt+Space\tAlt+F2\tSearch,KRunner"')
# Remove Alt+F3 Operations Menu - Sublimetext Select-All
cmdline('cp ~/.config/kwinrc ./kwinrc_`date +"%Y.%m.%d-%s"`')
cmdline('cp ~/.config/kglobalshortcutsrc ./kde_kglobalshortcutsrc_`date +"%Y.%m.%d-%s"`')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Switch to Previous Desktop" "Meta+Left,Meta+Left,Switch to Previous Desktop"')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Operations Menu" "none,Alt+F3,Window Operations Menu"')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows" "Ctrl+Shift+F13,Alt+Tab,Walk Through Windows"')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows (Reverse)" "Ctrl+Shift+F14,Alt+Shift+Backtab,Walk Through Windows (Reverse)"')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Maximize Window" "none,Meta+PgUp,Maximize Window"')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Maximize" "Meta+Ctrl+F,Alt+F10,Maximize Window"')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Minimize Window" "Meta+h,Meta+PgDown,Minimize Window"')
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Switch to Next Desktop" "Meta+Right,Meta+Right,Switch to Next Desktop"')
os.system('kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &')
else:
print('distro: ' + distro + ' de: ' + dename)
print("A supported OS and DE was not found, you may not have full system level shortcuts installed.")
def windows_setup():
keymaps = ["Apple keyboard standard", "Apple keyboard w/ Caps lock as Esc", "Windows keyboard standard", "Windows keyboard w/ Caps lock as Esc","Uninstall"]
for index, item in enumerate(keymaps):
print(" %i. %s" % (index+1, item.capitalize()))
default = 0
while not int(default) in range(1,len(keymaps)+1):
default = int(input("\nPlease enter your desired keymap (1 - " + str(len(keymaps)) + ") : "))
print("")
path= cmdline('echo %cd%')[:-1]
if default == 1:
os.system("regedit " + path + "\\windows\\macbook_winctrl_swap.reg")
elif default == 2:
os.system("regedit " + path + "\\windows\\macbook_winctrl_capsesc_swap.reg")
elif default == 3:
os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg")
elif default == 4:
os.system("regedit " + path + "\\windows\\standard_ctrlalt_capsesc_swap.reg")
elif default == 5:
os.system("regedit " + path + "\\windows\\remove_keyswap.reg")
if default > 0 and default < 5:
print("Will now install chocolatey and autohotkey with elevated privileges...")
print("This install will fail if you are not running with elevated privileges")
os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"')
print("\nWill now install Ubuntu Terminal Theme as default...")
os.system("regedit " + path + "\\windows\\theme_ubuntu.reg")
print("Copying autohotkey combinations for Terminals & Editors...")
os.system("copy /Y " + path + "\\windows\\kinto.ahk \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
print("\nPlease log off and back on for changes to take full effect.")
print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.")
else:
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
def Uninstall():
print("You selected to Uninstall Kinto.\n")
restore = yn_choice("\nYour DE is " + dename + ".\n\nY: Restore hotkeys from backup\nN: Reset OS/DE hotkeys\nWhich option would you prefer?")
print("")
if(restore):
if dename == "gnome":
print("Restoring DE hotkeys...")
wmkeys = cmdline('ls | grep -m1 "keybinding"')
mutterkeys = cmdline('ls | grep -m1 "mutter"')
if len(wmkeys) > 0:
print('dconf load /org/gnome/desktop/wm/keybindings/ < ' + wmkeys)
cmdline('dconf load /org/gnome/desktop/wm/keybindings/ < ' + wmkeys)
else:
print('Gnome Desktop keybindings backup not found...')
if len(mutterkeys) > 0:
print('dconf load /org/gnome/mutter/keybindings/ < ' + mutterkeys)
cmdline('dconf load /org/gnome/mutter/keybindings/ < ' + mutterkeys)
if len(wmkeys) > 0 or len(mutterkeys) > 0:
print("Gnome hotkeys have been successfully restored.")
elif dename == "kde":
print("Restoring DE hotkeys...")
kwinkeys = cmdline('ls | grep -m1 "kwinrc"').strip()
kdekeys = cmdline('ls | grep -m1 "kglobalshortcutsrc"').strip()
cmdline('cp ./' + kdekeys + ' ~/.config/kglobalshortcutsrc')
cmdline('cp ./' + kwinkeys + ' ~/.config/kwinrc')
elif dename == "xfce":
print("Restoring DE hotkeys...")
xfcekeys = cmdline('ls | grep -m1 "xfce4-keyboard"').strip()
cmdline('cp ./' + xfcekeys + ' ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml')
if dename == "gnome" or dename == "kde" or dename == "xfce":
print("./uninstall.sh\n")
cmdline("./uninstall.sh")
print("Done.")
if dename == "kde" or dename == "xfce":
print("Please log off and back on for your original hotkeys to take effect.")
else:
if dename == "gnome":
print("Resetting DE hotkeys...\n")
print("gsettings reset-recursively org.gnome.desktop.wm.keybindings")
cmdline("gsettings reset-recursively org.gnome.desktop.wm.keybindings")
print("gsettings reset-recursively org.gnome.mutter.keybindings")
cmdline("gsettings reset-recursively org.gnome.mutter.keybindings")
elif dename == "kde":
print("Resetting DE hotkeys...\n")
cmdline('mv ~/.config/kwinrc ~/.config/kwinrc.kinto')
cmdline('mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto')
elif dename == "xfce":
print("Resetting DE hotkeys...\n")
cmdline('cp /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml')
if dename == "gnome" or dename == "kde" or dename == "xfce":
print("./uninstall.sh\n")
cmdline("./uninstall.sh")
print("Done.")
if dename == "kde" or dename == "xfce":
print("Please log off and back on for your original DE hotkeys to take effect.")
# check_x11 = cmdline("env | grep -i x11").strip()
check_x11 = cmdline("(env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type) | awk -F= '{print $2}'").strip()
if len(check_x11) == 0:
if os.name != 'nt':
print("You are not using x11, please logout and back in using x11/Xorg")
sys.exit()
else:
print("You are detected as running Windows.")
windows_setup()
sys.exit()
check_xbind = cmdline("which xbindkeys 2>/dev/null").strip()
check_xdotool = cmdline("which xdotool 2>/dev/null").strip()
check_ibus = cmdline("which ibus-setup 2>/dev/null").strip()
pkgm = cmdline("which apt-get 2>/dev/null").strip()
if len(pkgm) == 0:
pkgm = cmdline("which dnf 2>/dev/null").strip()
if len(pkgm) > 0:
pkgm += " check-update;sudo dnf install -y "
else:
pkgm += " install -y "
pkgm += " update; sudo apt-get install -y "
if len(pkgm) == 0:
pkgm = cmdline("which pacman 2>/dev/null").strip()
if len(pkgm) > 0:
pkgm += " -Syy; sudo pacman -S "
if len(pkgm) == 0:
print("No supported package manager found. Exiting...")
sys.exit()
runpkg = 0
run_pkg = ""
if len(check_xbind) > 0 and len(check_xdotool) > 0 and len(check_ibus) > 0:
print("Xbindkeys, xdotool and IBus requirement is installed.")
if len(check_xbind) == 0:
run_pkg = "xbindkeys"
runpkg = 1
if len(check_xdotool) == 0:
run_pkg += " xdotool"
runpkg = 1
if len(check_ibus) == 0:
# may differ with distro, but for now
run_pkg += " ibus"
runpkg = 1
if runpkg != 0:
requirements(pkgm)
if not os.path.exists(homedir + '/.config/ibus/bus') and cmdline("ls ~/.config/ibus/bus -1rt") == "":
install_ibus()
try:
f = open("defaults.json")
except IOError:
print("defaults.json file is missing. Will exit.\n")
exit()
f.close()
try:
f = open("defaults.json")
except IOError:
@@ -33,6 +317,34 @@ if os.path.isdir(homedir + "/.config/kinto") == False:
os.mkdir(homedir + "/.config/kinto")
time.sleep(0.5)
with open('defaults.json') as json_file:
data = json.load(json_file)
color_arr = [bcolors.CBEIGE,bcolors.CRED2,bcolors.CGREEN,bcolors.CYELLOW ]
print("\nKinto - Type in Linux like it's a Mac.\n")
for index, item in enumerate(data['defaulttypes']):
ossym = ""
if item == "windows":
ossym = u'\u2756'
elif item == "mac":
ossym = u'\u2318'
elif item == "chromebook":
ossym = u'\u2707'
print("%s %i. %s %s %s" % (color_arr[index], index+1, ossym, item.capitalize(), bcolors.ENDC))
print("%s %i. Uninstall %s" % (color_arr[3], len(data['defaulttypes'])+1, bcolors.ENDC))
default = 0
while not int(default) in range(1,len(data['defaulttypes'])+2):
default = int(input(bcolors.CYELLOW2 + "\nPlease enter your keyboard type (1 - " + str(len(data['defaulttypes'])) + ") : " + bcolors.ENDC))
print("")
if default == len(data['defaulttypes'])+1:
Uninstall()
exit()
try:
f = open(homedir + "/.config/kinto/user_config.json")
rewrite = yn_choice("~/.config/kinto/user_config.json already exists. Do you want to overwrite it with a new config?")
@@ -47,109 +359,125 @@ except IOError:
finally:
f.close()
with open('defaults.json') as json_file:
data = json.load(json_file)
color_arr = [bcolors.CBLUE,bcolors.CRED,bcolors.CGREEN]
print("\nKinto - Type in Linux like it's a Mac.\n")
for index, item in enumerate(data['defaulttypes']):
ossym = ""
if item == "windows":
ossym = u'\u2756'
elif item == "mac":
ossym = u'\u2318'
elif item == "chromebook":
ossym = u'\u2707'
print("%s %i. %s %s %s" % (color_arr[index], index+1, ossym, item.capitalize(), bcolors.ENDC))
default = 0
while not int(default) in range(1,len(data['defaulttypes'])+1):
default = int(input(bcolors.CYELLOW + "\nPlease enter your keyboard type (1 - " + str(len(data['defaulttypes'])) + ") : " + bcolors.ENDC))
print("")
keyboardconfigs = [obj for obj in data['defaults'] if(obj['type'] == data['defaulttypes'][default-1])]
# for k in keyboardconfigs:
for index, k in enumerate(keyboardconfigs):
print(color_arr[default-1] + bcolors.BOLD + str(index+1) + '. ' + k['name'] + bcolors.ENDC)
print(bcolors.CYELLOW + 'Description: ' + k['description'] + bcolors.ENDC)
print(bcolors.CYELLOW2 + 'Description: ' + k['description'] + bcolors.ENDC)
print("")
defaultkb = 0
while not int(defaultkb) in range(1,len(keyboardconfigs)+1):
defaultkb = int(input(bcolors.CYELLOW + "Please enter your keyboard config (1 - " + str(len(keyboardconfigs)) + ") : " + bcolors.ENDC))
defaultkb = int(input(bcolors.CYELLOW2 + "Please enter your keyboard config (1 - " + str(len(keyboardconfigs)) + ") : " + bcolors.ENDC))
print("")
if 'hack' in keyboardconfigs[defaultkb-1]:
print(bcolors.CYELLOW + "You have selected a keyboard config that needs the following command to be ran.\n" + bcolors.ENDC)
print(bcolors.CYELLOW2 + "You have selected a keyboard config that needs the following command to be ran.\n" + bcolors.ENDC)
print(keyboardconfigs[defaultkb-1]['hack'].replace(";", "\n") + "\n")
runhack = yn_choice(bcolors.CYELLOW + "Would you like to run it now? (Will require sudo privileges. Will exit on No.)" + bcolors.ENDC)
runhack = yn_choice(bcolors.CYELLOW2 + "Would you like to run it now? (Will require sudo privileges. Will exit on No.)" + bcolors.ENDC)
if(runhack):
os.system(keyboardconfigs[defaultkb-1]['hack'])
# Setup the selected keyboards config
os.system("cp -rf ./.xkb ~/.xkb")
os.system("cp -TRv ./.xkb ~/.xkb/")
if os.path.isdir(homedir + "/.xkb/keymap") == False:
os.mkdir(homedir + "/.xkb/keymap")
time.sleep(0.5)
os.system('setxkbmap -option')
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui')
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui.chrome')
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.gui.browsers')
os.system('setxkbmap -print > ~/.xkb/keymap/kbd.mac.term')
time.sleep(0.5)
symbols_gui_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_symbols' | cut -f1 -d:").strip()
types_gui_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_types' | cut -f1 -d:").strip()
symbols_term_line = cmdline("cat ~/.xkb/keymap/kbd.mac.term | grep -n 'xkb_symbols' | cut -f1 -d:").strip()
symbols_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_symbols' | cut -f1 -d:").strip()
types_line = cmdline("cat ~/.xkb/keymap/kbd.mac.gui | grep -n 'xkb_types' | cut -f1 -d:").strip()
cmdline('sed -i '' -e "' + symbols_gui_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
cmdline('sed -i '' -e "' + types_gui_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
cmdline('sed -i '' -e "' + symbols_term_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_term'] + '\\"/2" ~/.xkb/keymap/kbd.mac.term')
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui')
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_term'] + '\\"/2" ~/.xkb/keymap/kbd.mac.term')
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_term'] + '\\"/2" ~/.xkb/keymap/kbd.mac.term')
# Set chrome file accordingly for chromebooks or normal
if default != 3:
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)","+mac_gui(mac_levelssym)+mac_gui(mac_browsers)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.browsers')
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle)","+mac_gui(mac_browsers)+mac_gui(mac_chrome)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.chrome')
else:
# Fix multicursor in mac_gui
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Chromebook multicursor)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default multicursor)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
# Fix browsers
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)","+mac_gui(mac_levelssym)+mac_gui(mac_browsers_chromebook)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.browsers')
cmdline('sed -i '' -e "' + symbols_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_symbols_gui'].replace("+mac_gui(mac_levelssym)+mac_gui(mac_appcycle_chromebook)","+mac_gui(mac_browsers_chromebook)+mac_gui(mac_chrome)") + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.chrome')
if dename == "kde":
# Fix maximize shortcut
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ KDE maximize)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
# term app switching
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ KDE cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_term')
else:
# Fix maximize shortcut
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Default maximize)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
# term app switching
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Default cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_term')
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.browsers')
cmdline('sed -i '' -e "' + types_line + 's/\\"/' + keyboardconfigs[defaultkb-1]['xkb_types_gui'] + '\\"/2" ~/.xkb/keymap/kbd.mac.gui.chrome')
setShortcuts()
user_file = homedir + '/.config/kinto/user_config.json'
with open(user_file, 'r') as f:
user_config = json.load(f)
onetime = yn_choice("One time initialization tweaks are available. Would you like to view them?")
onetime = yn_choice("\nOne time initialization tweaks are available. Would you like to view them?")
print("")
if(onetime):
intents = [obj for obj in user_config['de'] if(obj['intent'] == "init")]
for index, k in enumerate(intents):
print(color_arr[default-1] + bcolors.BOLD + str(index+1) + '. ' + k['name'] + bcolors.ENDC)
print(bcolors.CYELLOW + 'Description: ' + k['description'] + bcolors.ENDC)
print(bcolors.CYELLOW + 'run: ' + k['run'].replace(";", "\n") + bcolors.ENDC + '\n')
print(bcolors.CYELLOW2 + 'Description: ' + k['description'] + bcolors.ENDC)
print(bcolors.CYELLOW2 + 'run: ' + k['run'].replace(";", "\n") + bcolors.ENDC + '\n')
print(bcolors.CYELLOW + "Please enter your init tweak(s) (eg 1 or 1 2 3 - leave blank to skip): " + bcolors.ENDC)
print(bcolors.CYELLOW2 + "Please enter your init tweak(s) (eg 1 or 1 2 3 - leave blank to skip): " + bcolors.ENDC)
defaultinit = [int(i) for i in input().split()]
if len(defaultinit) != 0:
user_config['init'] = defaultinit
user_config['init'] = [intents[defaultinit[0]-1]['id']]
print("\nDynamic shortcut tweaks\n")
intents = [obj for obj in user_config['de'] if(obj['intent'] == "gui_term")]
tweaks = []
tweaks_selected = []
for index, k in enumerate(intents):
print(color_arr[default-1] + bcolors.BOLD + str(index+1) + '. ' + k['name'] + bcolors.ENDC)
print(bcolors.CYELLOW + 'Description: ' + k['description'] + bcolors.ENDC)
print(bcolors.CYELLOW + 'run in gui mode: ' + k['run_gui'].replace(";", "\n") + bcolors.ENDC)
print(bcolors.CYELLOW + 'run in terminal mode: ' + k['run_term'].replace(";", "\n") + bcolors.ENDC + '\n')
print(bcolors.CYELLOW2 + 'Description: ' + k['description'] + bcolors.ENDC)
print(bcolors.CYELLOW2 + 'run in gui mode: ' + k['run_gui'].replace(";", "\n") + bcolors.ENDC)
print(bcolors.CYELLOW2 + 'run in terminal mode: ' + k['run_term'].replace(";", "\n") + bcolors.ENDC + '\n')
tweaks.append(k['id'])
print(bcolors.CYELLOW + "Please enter your dynamic shortcut tweak(s) (eg 1 or 1 2 3 - leave blank to skip): " + bcolors.ENDC)
print(bcolors.CYELLOW2 + "Please enter your dynamic shortcut tweak(s) (eg 1 or 1 2 3 - leave blank to skip): " + bcolors.ENDC)
defaultde = [int(i) for i in input().split()]
if len(defaultde) != 0:
# gui
user_config['config'][0]['de'] = defaultde
# term
user_config['config'][1]['de'] = defaultde
for d in defaultde:
user_config['de'][d-1]['active'] = True
user_config['de'][tweaks[d-1]]['active'] = True
tweaks_selected.append(tweaks[d-1])
if len(defaultde) != 0:
# gui
user_config['config'][0]['de'] = tweaks_selected
# term
user_config['config'][1]['de'] = tweaks_selected
# firefox
user_config['config'][2]['de'] = tweaks_selected
# chrome
user_config['config'][3]['de'] = tweaks_selected
user_config['config'][0]['run'] = keyboardconfigs[defaultkb-1]['gui']
user_config['config'][1]['run'] = keyboardconfigs[defaultkb-1]['term']
user_config['config'][2]['run'] = keyboardconfigs[defaultkb-1]['gui'].replace("kbd.mac.gui","kbd.mac.gui.browsers")
user_config['config'][3]['run'] = keyboardconfigs[defaultkb-1]['gui'].replace("kbd.mac.gui","kbd.mac.gui.chrome")
os.remove(user_file)
with open(user_file, 'w') as f:

7
system-config/.chrome-nw Normal file
View File

@@ -0,0 +1,7 @@
"xdotool key --delay 0 --clearmodifiers Alt+Left"
Control + Left + Release
#Home + release
"xdotool key --delay 0 --clearmodifiers Alt+Right"
Control + Right + Release
#End + release

5
system-config/.chrome-ww Normal file
View File

@@ -0,0 +1,5 @@
"xdotool key --delay 0 --clearmodifiers Home"
Control + Left + Release
"xdotool key --delay 0 --clearmodifiers End"
Control + Right + Release

View File

@@ -0,0 +1,7 @@
#"xte 'keydown Control_L' 'key bracketleft' 'keyup Control_L'"
"xdotool key --delay 0 --clearmodifiers Control_L+bracketleft"
Home + Release
#"xte 'keydown Control_R' 'key bracketright' 'keyup Control_R'"
"xdotool key --delay 0 --clearmodifiers Control_L+bracketright"
End + Release

10
system-config/caret_status.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
mkdir -p /tmp/kinto
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_).*(?=[\"])' |
while read ln
do
printf '%s\n' "$ln" > /tmp/kinto/caret
done

9
system-config/cleanup.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
setxkbmap -option
# force command to run silently and report true
killall xbindkeys > /dev/null 2>&1 || :
# rm /tmp/kinto/caret
gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Shift><Alt>Tab']"

167
system-config/dename.sh Executable file
View File

@@ -0,0 +1,167 @@
#!/bin/bash
function detect_gnome()
{
ps -e | grep -E '^.* gnome-session' > /dev/null
if [ $? -ne 0 ];
then
return 0
fi
VERSION=`gnome-session --version | awk '{print $2}'`
DESKTOP="gnome"
return 1
}
function detect_kde4()
{
ps -e | grep -E '^.* kded4$' > /dev/null
if [ $? -ne 0 ];
then
return 0
else
VERSION=`kded4 --version | grep -m 1 'KDE' | awk -F ':' '{print $2}' | awk '{print $1}'`
DESKTOP="KDE"
return 1
fi
}
function detect_kde()
{
ps -e | grep -E '^.* kded5$' > /dev/null
if [ $? -ne 0 ];
then
return 0
else
VERSION=`kded5 --version | grep -m 1 'KDE' | awk -F ':' '{print $2}' | awk '{print $1}'`
DESKTOP="KDE"
return 1
fi
}
function detect_unity()
{
ps -e | grep -E 'unity-panel' > /dev/null
if [ $? -ne 0 ];
then
return 0
fi
VERSION=`unity --version | awk '{print $2}'`
DESKTOP="unity"
return 1
}
function detect_xfce()
{
ps -e | grep -E '^.* xfce4-session$' > /dev/null
if [ $? -ne 0 ];
then
return 0
fi
VERSION=`xfce4-session --version | grep xfce4-session | awk '{print $2}'`
DESKTOP="xfce"
return 1
}
function detect_cinnamon()
{
ps -e | grep -E '^.* cinnamon$' > /dev/null
if [ $? -ne 0 ];
then
return 0
fi
VERSION=`cinnamon --version | awk '{print $2}'`
DESKTOP="cinnamon"
return 1
}
function detect_mate()
{
ps -e | grep -E '^.* mate-panel$' > /dev/null
if [ $? -ne 0 ];
then
return 0
fi
VERSION=`mate-about --version | awk '{print $4}'`
DESKTOP="mate"
return 1
}
function detect_lxde()
{
ps -e | grep -E '^.* lxsession$' > /dev/null
if [ $? -ne 0 ];
then
return 0
fi
# We can detect LXDE version only thru package manager
which apt-cache > /dev/null 2> /dev/null
if [ $? -ne 0 ];
then
which yum > /dev/null 2> /dev/null
if [ $? -ne 0 ];
then
VERSION='unknown'
else
# For Fedora
VERSION=`yum list lxde-common | grep lxde-common | awk '{print $2}' | awk -F '-' '{print $1}'`
fi
else
# For Lubuntu and Knoppix
VERSION=`apt-cache show lxde-common /| grep 'Version:' | awk '{print $2}' | awk -F '-' '{print $1}'`
fi
DESKTOP="lxde"
return 1
}
function detect_sugar()
{
if [ "$DESKTOP_SESSION" == "sugar" ];
then
VERSION=`python -c "from jarabe import config; print config.version"`
DESKTOP="sugar"
else
return 0
fi
}
DESKTOP="unknown"
if detect_unity;
then
if detect_kde;
then
if detect_kde4;
then
if detect_gnome;
then
if detect_xfce;
then
if detect_cinnamon;
then
if detect_mate;
then
if detect_lxde;
then
detect_sugar
fi
fi
fi
fi
fi
fi
fi
fi
if [ "$1" == '-v' ];
then
echo $VERSION
else
if [ "$1" == '-n' ];
then
echo $DESKTOP
else
echo $DESKTOP $VERSION
fi
fi

View File

@@ -4,12 +4,13 @@ PartOf=graphical-session.target
[Service]
Type=simple
#User={username}
#Group={username}
Environment=DISPLAY=:0
Restart=always
# eg DISPLAY=:0.0
#Environment=DISPLAY={displayid}
RestartSec=1
WorkingDirectory=/home/{username}/.config/kinto
ExecStart=
ExecStart=/bin/bash -c "/home/{username}/.config/kinto/xactive.sh carrots"
ExecStop=/bin/bash /home/{username}/.config/kinto/cleanup.sh
[Install]
WantedBy=default.target

View File

@@ -1,3 +0,0 @@
#/bin/bash
systemctl --user start keyswap

View File

@@ -0,0 +1,11 @@
# keyswap.timer
[Unit]
Description=Runs the keyswap.service 5 seconds after boot up
[Timer]
#OnBootSec=5s
OnActiveSec=5s
Unit=keyswap.service
[Install]
WantedBy=default.target

View File

@@ -0,0 +1,8 @@
[Desktop Entry]
Name=Kinto
GenericName=Kinto
Comment=Make Linux Type Like it's a Mac
Exec=/bin/sleep 5 /usr/bin/systemctl --user start keyswap
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true

View File

@@ -1,3 +1,10 @@
#!/bin/bash
./kintox11
if [ $# -eq 0 ]
then
# No arguments
./kintox11
else
./caret_status.sh &
./kintox11
fi

View File

@@ -1,9 +1,13 @@
#!/bin/bash
systemctl --user stop keyswap
systemctl --user stop keyswap 2>/dev/null
systemctl --user disable keyswap
rm -rf ~/.config/autostart/keyswap.sh
systemctl --user stop keyswap.timer 2>/dev/null
systemctl --user disable keyswap.timer
rm ~/.config/systemd/user/keyswap.service
rm ~/.config/systemd/user/keyswap.timer
rm -rf ~/.config/autostart/kinto.desktop
rm -rf ~/.config/kinto
rm -rf ~/.xkb
sed -i '/xkb/d' ~/.Xsession
systemctl daemon-reload
sed -i '/xkb/d' ~/.Xsession 2>/dev/null

View File

@@ -1,15 +1,43 @@
{"config":[{
"name":"gui",
"run":"",
"run_onInput":"",
"run_offInput": "killall xbindkeys > /dev/null 2>&1",
"symbols":"",
"types":"",
"de":[],
"appnames":[ "" ]
},
{
"name":"term",
"run":"",
"run_onInput":"",
"run_offInput": "killall xbindkeys > /dev/null 2>&1",
"symbols":"",
"types":"",
"de":[],
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm" ]
}],
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty" ]
},
{
"name": "firefox",
"run": "",
"run_onInput": "killall xbindkeys > /dev/null 2>&1",
"run_offInput": "killall xbindkeys > /dev/null 2>&1;xbindkeys -f $HOME/.config/kinto/.firefox-nw",
"symbols": "",
"types": "",
"de": [],
"appnames": [ "Firefox" ]
},
{
"name": "chrome",
"run": "",
"run_onInput": "xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui $DISPLAY",
"run_offInput": "xkbcomp -w0 -I$HOME/.xkb ~/.xkb/keymap/kbd.mac.gui.chrome $DISPLAY",
"symbols": "",
"types": "",
"de": [],
"appnames": [ "Chromium","Chromium-browser","Google-chrome","Epiphany" ]
}],
"init": [],
"detypes":["gnome2","gnome3","kde4","kde5","xfce","i3wm"],
"de":[{

12
windows/autohotkey.ps1 Normal file
View File

@@ -0,0 +1,12 @@
$testchoco = powershell choco -v
if(-not($testchoco)){
Write-Output "Seems Chocolatey is not installed, installing now"
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
}
else{
Write-Output "Chocolatey Version $testchoco is already installed"
}
if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){
choco install autohotkey.install
}

128
windows/kinto.ahk Normal file
View File

@@ -0,0 +1,128 @@
GroupAdd, terminals, ahk_exe ubuntu.exe
GroupAdd, terminals, ahk_exe ConEmu.exe
GroupAdd, terminals, ahk_exe ConEmu64.exe
GroupAdd, terminals, ahk_exe powershell.exe
GroupAdd, terminals, ahk_exe WindowsTerminal.exe
GroupAdd, terminals, ahk_exe Hyper.exe
GroupAdd, posix, ahk_exe ubuntu.exe
GroupAdd, posix, ahk_exe ConEmu.exe
GroupAdd, posix, ahk_exe ConEmu64.exe
GroupAdd, posix, ahk_exe mintty.exe
GroupAdd, ConEmu, ahk_exe ConEmu.exe
GroupAdd, ConEmu, ahk_exe ConEmu64.exe
GroupAdd, ConEmu, ahk_exe WindowsTerminal.exe
GroupAdd, editors, ahk_exe sublime_text.exe
; Cmd+Space Alternative
LWin & vk07::return
LWin::return
RWin & vk07::return
RWin::return
^Space::Send ^{Esc}
; ^Space::run AppName
; Cmd Tab For App Switching
LCtrl & Tab::AltTab
RCtrl & Tab::AltTab
; Ctrl Tab for In-App Tab Switching
LWin & Tab::Send ^{Tab}
RWin & Tab::Send ^{Tab}
; Close Apps
^q::Send !{F4}
; wordwise support
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
^Up::Send ^{Home}
^+Up::Send ^+{Home}
^Down::Send ^{End}
^+Down::Send ^+{End}
^Backspace::Send +{Home}{Delete}
!Backspace::Send ^{Backspace}
!Left::Send ^{Left}
!+Left::Send ^+{Left}
!Right::Send ^{Right}
!+Right::Send ^+{Right}
#IfWinActive ahk_group editors
; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines
#+Up::send {shift up}^!{Up}
#+Down::send {shift up}^!{Down}
; Remap Ctrl+Cmd+G to select all matches
#^g::send !{F3}
#If
#IfWinActive ahk_group terminals
; Copy
^c::Send {LCtrl down}{LShift down}c{LCtrl Up}{LShift Up}
#c::Send {LCtrl down}c{LCtrl Up}
#IfWinNotActive ahk_group ConEmu
; Paste
^v::Send {LCtrl down}{LShift down}v{LCtrl Up}{LShift Up}
#If
#If
#IfWinActive ahk_group posix
; End of Line
#e::Send {LCtrl down}e{LCtrl Up}
^e::return
; Beginning of Line
#a::Send {LCtrl down}a{LCtrl Up}
^a::return
;^l::Send clear{Enter}
;#l::return
; Clear Terminal and Scroll Buffer
^k::Send clear && printf '\e[3J'{Enter}
; Nano editor shortcuts
#k::Send {LCtrl down}k{LCtrl Up}
#x::Send {LCtrl down}x{LCtrl Up}
#o::Send {LCtrl down}o{LCtrl Up}
#r::Send {LCtrl down}r{LCtrl Up}
#w::Send {LCtrl down}w{LCtrl Up}
#\::Send {LCtrl down}\{LCtrl Up}
#u::Send {LCtrl down}u{LCtrl Up}
#j::Send {LCtrl down}j{LCtrl Up}
#t::Send {LCtrl down}t{LCtrl Up}
#_::Send {LCtrl down}_{LCtrl Up}
#z::Send {LCtrl down}z{LCtrl Up}
#If
#IfWinActive ahk_group ConEmu
; Paste
$^v::Send {Shift down}{Insert}{Shift Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If
#IfWinActive ahk_exe mintty.exe
; Copy
$^c::Send {Control down}{Insert}{Control Up}
#c::Send {LCtrl down}c{LCtrl Up}
; Paste
$^v::Send {Shift down}{Insert}{Shift Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If
;Disable win + l key locking (This line must come before any hotkey assignments in the .ahk file)
; Admin privileges required
; Sets Workstation Lock to not occur on Win+L
; RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 1
; Re-enables Workstation lock on Ctrl+Cmd+Q
; Need to Remove Quick Assist and reboot
; Remove-WindowsCapability -online -name App.Support.QuickAssist~~~~0.0.1.0
#^q::
; re-enable locking workstation, then lock it
; RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 0
; DllCall("LockWorkStation")
; Reload script to relock Workstation Lock
; Reload
;return

Binary file not shown.

Binary file not shown.

BIN
windows/macbook_winctrl_swap.skl Executable file

Binary file not shown.

View File

@@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=-

Binary file not shown.

Binary file not shown.

BIN
windows/standard_ctrlalt_swap.skl Executable file

Binary file not shown.

BIN
windows/theme_campbell.reg Normal file

Binary file not shown.

BIN
windows/theme_legacy.reg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
windows/theme_ubuntu.reg Normal file

Binary file not shown.