Compare commits

...

83 Commits
1.1-2 ... 1.1-6

Author SHA1 Message Date
Ben Reaves
f0404299ac Update README.md 2020-06-12 03:10:27 -05:00
Ben Reaves
894c7b7a69 Update README.md 2020-06-12 02:23:35 -05:00
Ben Reaves
bcabd5d65b Update README.md 2020-06-12 02:20:43 -05:00
Ben Reaves
ffab720b50 Update README.md 2020-06-12 02:18:59 -05:00
Ben Reaves
57d430ae36 Updated readme 2020-06-12 01:38:17 -05:00
Ben Reaves
49613ec470 Merge pull request #208 from rbreaves/windows
- Improved Windows UX, Added System Tray, Kinto icon assets
2020-06-12 01:29:31 -05:00
Ben Reaves
7c1f92db5b - Kinto system tray preview added to readme 2020-06-12 01:29:13 -05:00
Ben Reaves
329e821440 - Improved Windows UX, Added System Tray, Kinto icon assets 2020-06-12 01:18:40 -05:00
Ben Reaves
046eaa05cd Revert "- Proof of concept cheatsheet feature"
This reverts commit cbb60668e3.
2020-06-12 01:16:52 -05:00
Ben Reaves
7c0a431472 Updated readme with logo revision 2020-06-11 03:13:57 -05:00
Ben Reaves
1b2e7ab57b Updated readme with cleaner logo 2020-06-11 03:04:43 -05:00
Ben Reaves
ea78de7909 Updated readme with new logo 2020-06-09 22:13:39 -05:00
Ben Reaves
dae728d04a Merge pull request #205 from japert/issue-204-non-canonical-homedir
Allow non-canonical homedirs in setup.
2020-06-09 17:15:45 -05:00
Janis Peukert
6578065024 Allow non-canonical homedirs in setup. 2020-06-09 13:01:54 -07:00
Ben Reaves
8f22bc63ff - Fixes on paste in terminals for windows 2020-06-08 12:23:50 -05:00
Ben Reaves
1ed7fa5f73 - renamed file and added shortcuts 2020-06-08 02:01:17 -05:00
Ben Reaves
c9f7b81796 - Fixed back tab after new Alt-Tab fix 2020-06-07 19:22:39 -05:00
Ben Reaves
3143f11d4b Merge branch 'dev' 2020-06-07 15:36:53 -05:00
Ben Reaves
520ea7683b - Fixed a mismapped fullscreen toggle for st3 2020-06-07 15:35:49 -05:00
Ben Reaves
ba1471e397 - Additional refinements for Apple and Win keyboards for ahk 2020-06-07 15:29:05 -05:00
Ben Reaves
a00998b1e3 - WIP autohotkey update negates need for logoff/reg modification 2020-06-06 21:29:33 -05:00
Ben Reaves
cbb60668e3 - Proof of concept cheatsheet feature 2020-06-06 03:29:47 -05:00
Ben Reaves
1a0c99a763 Merge pull request #197 from rbreaves/dev
- xkb & windows 10 shortcut fixes
2020-06-01 19:24:48 -05:00
Ben Reaves
0275669be1 - Fixed pasting & various shortcut issues under Windows 10 2020-06-01 19:22:19 -05:00
Ben Reaves
3899fcf596 - Fixed potential problem in the xkb setup 2020-05-31 20:14:26 -05:00
Ben Reaves
f3df35662b Merge pull request #196 from rbreaves/dev
- Added Windows 10 Emoji Panel Ctrl-Cmd-Spacebar
2020-05-31 16:40:18 -05:00
Ben Reaves
20c93600e1 - Added Windows 10 Emoji Panel Ctrl-Cmd-Spacebar 2020-05-31 16:37:01 -05:00
Ben Reaves
1ab00452b0 Merge pull request #195 from rbreaves/dev
- Fixes RCtrl key on Left Cmd position for Windows using VMs & VS Code remaps. Recloses #191
2020-05-30 19:47:49 -05:00
Ben Reaves
c0bfec035f - Fixes RCtrl key on Left Cmd position for Windows using VMs & VS Code remaps. Recloses #191 2020-05-30 19:46:11 -05:00
Ben Reaves
712b2e0e69 Merge pull request #194 from rbreaves/dev
- Fixed shortcuts by re-ordering code (windows)
2020-05-30 00:12:20 -05:00
Ben Reaves
eb576a6217 - Fixed shortcuts by re-ordering code (windows) 2020-05-30 00:10:03 -05:00
Ben Reaves
06180c3517 Update issue templates 2020-05-29 16:15:02 -05:00
Ben Reaves
8b07fb9037 Merge pull request #193 from rbreaves/dev
- Sublime text remaps in VS Code now optional (linux). Closes #191
2020-05-29 16:07:52 -05:00
Ben Reaves
b34dc4e928 - Sublime text remaps in VS Code now optional (linux). Closes #191 2020-05-29 16:06:40 -05:00
Ben Reaves
7a07382d30 Merge pull request #190 from rbreaves/dev
- Added cmd-t/w - open/close tabs to win terminals
2020-05-29 15:35:20 -05:00
Ben Reaves
2ffe639024 - Resolves multi-language support under xkeysnail. Closes #192. 2020-05-29 15:33:53 -05:00
Ben Reaves
8dc05e7ace Update README.md 2020-05-27 15:08:37 -05:00
Ben Reaves
4c5cb36503 - Added cmd-t/w - open/close tabs to win terminals 2020-05-27 02:38:14 -05:00
Ben Reaves
8fdaaf592d Merge pull request #189 from rbreaves/dev
- Added support for Windows 10 Hosts w/ Kinto & running Linux VMs
2020-05-26 22:03:57 -07:00
Ben Reaves
6b4c697dd0 - Added support for Windows 10 Hosts w/ Kinto & running Linux VMs 2020-05-27 00:02:41 -05:00
Ben Reaves
e2a767fbec Merge pull request #188 from rbreaves/dev
- Added proper Ctrl/Alt + Backspace behavior for Linux remap. Closes #187
2020-05-23 16:06:40 -05:00
Ben Reaves
7fe9230b5f - Added proper Ctrl/Alt + Backspace behavior for Linux remap. Closes #187 2020-05-23 16:02:32 -05:00
Ben Reaves
1d088b2e1d Typo correction 2020-05-20 01:29:14 -05:00
Ben Reaves
e63d8ee5b5 Merge pull request #184 from rbreaves/dev
- Adding basic hotkey functions for apps
2020-05-18 14:23:47 -05:00
Ben Reaves
e3d42651b7 - Adding basic hotkey functions for apps 2020-05-18 14:21:31 -05:00
Ben Reaves
42c04d062e Merge pull request #183 from rbreaves/dev
Extension of #182 merge and added mate support
2020-05-18 14:09:51 -05:00
Ben Reaves
ca54bf89d6 - Part of #182 merge, brings back Ctrl-a/e functionality for GUI apps. 2020-05-18 14:03:43 -05:00
Ben Reaves
772413a9c3 Merge pull request #182 from Mahoney-forks/fix-ctl-a-beginning-of-line
Make toggle-application-view shortcut more mac like
2020-05-18 13:44:20 -05:00
Robert Elliot
bbd7b3fc93 Make toggle-application-view shortcut more mac like
Toggle-application-view defaults to `<Super-a>` (virtual)/`<Ctrl-a>` (physical)
This clashed with using `<Ctrl-a>` for move cursor to beginning of line (OS/X).
`LaunchB` seems the closes OS/X analogue - FN-F4.
2020-05-18 11:40:57 +01:00
Ben Reaves
98120062eb - Added linux mint and mate support 2020-05-16 02:52:25 -05:00
Ben Reaves
637a8fecaa Merge pull request #178 from rbreaves/dev
- Improved xfce4 support, added xfce4-terminal. Fixed xkeysnail issue.
2020-05-16 01:03:40 -05:00
Ben Reaves
ad53b7034d - Improved support for xfce4 with Ubuntu, xubuntu, voyager. Fixed In-app switching bug. 2020-05-15 20:49:48 -05:00
Ben Reaves
896c6fd6a1 - Added xfce4-terminal 2020-05-15 20:19:15 -05:00
Ben Reaves
dbaf02f884 Merge pull request #177 from rbreaves/dev
- Setup fixes for xkeynail install
2020-05-15 13:45:15 -05:00
Ben Reaves
79857af79c - Setup fixes for xkeynail install 2020-05-15 13:43:21 -05:00
Ben Reaves
53206855f4 Merge pull request #174 from rbreaves/dev
- Budgie patch for App Switching. Also fixes Ctrl-Tab regression.
2020-05-14 23:52:14 -05:00
Ben Reaves
6298c6c9cc - xkeysnail modifier key persistance regression temp fix. 2020-05-14 20:56:55 -05:00
Ben Reaves
318efcc3fd - Adds additional tab switching to Code/ium. Closes #173 2020-05-14 18:19:03 -05:00
Ben Reaves
2567f5006e - Added support for Ubuntu Budgie. Fixed App Switching bug. 2020-05-13 16:17:57 -05:00
Ben Reaves
fd648d3850 - Added Tilix, default terminal in Ubuntu Budgie 2020-05-12 17:26:13 -05:00
Ben Reaves
ac34350392 Merge pull request #171 from rbreaves/dev
- Added mate-terminal to kinto
2020-05-11 21:55:32 -05:00
Ben Reaves
8df691a52d - Added mate-terminal to kinto 2020-05-11 21:54:05 -05:00
Ben Reaves
11f8e33fdf Merge pull request #170 from rbreaves/dev
- Fixes manjaro install issue (gcc). closes #168.
2020-05-11 19:48:51 -05:00
Ben Reaves
7de111726b - Fixes install issue of kinto xkeysnail implementation on manjaro. Adds gcc check, closes #168. 2020-05-11 19:30:19 -05:00
Ben Reaves
5a12521b58 Merge pull request #165 from rbreaves/dev
- Added optional sublime to vs code keymaps to menu, improved ctrltab for windows
2020-05-10 12:48:02 -05:00
Ben Reaves
ad196c4d6b - Added ST3 keymap match all for VS Code on chromebooks 2020-05-10 02:27:01 -05:00
Ben Reaves
17a877c693 - Improved CtrlTab to work with more apps under Windows 10 2020-05-08 18:24:07 -05:00
Ben Reaves
0c3e03a81b Merge pull request #160 from rbreaves/documentation
- Updated readme to include Fluent Terminal for Windows
2020-05-08 15:00:22 -05:00
Ben Reaves
163117d4fb - Updated readme to include Fluent Terminal for Windows 2020-05-08 14:35:16 -05:00
Ben Reaves
4c8ae68027 - Adds some optional ST3 keymaps to VS Code on Windows (#159)
* - Added commented out sublime text keymaps for VS Code under Windows

* - Added cmd.exe to kinto.ahk for Windows

* - Added support for Fluent Terminal on Windows

* - Firefox paste fix for Windows

* - Added Sublime hotkeys to VS Code to setup for windows

* - Added refresh of environment variables after possible package installs on Windows
2020-05-08 14:18:56 -05:00
Ben Reaves
ed771f4ae4 - Added refresh of environment variables after possible package installs on Windows 2020-05-08 14:12:35 -05:00
Ben Reaves
9d5c7b6230 - Added Sublime hotkeys to VS Code to setup for windows 2020-05-08 14:06:35 -05:00
Ben Reaves
b85b786dcc - Firefox paste fix for Windows 2020-05-08 03:46:34 -05:00
Ben Reaves
7904be6d5c - Added support for Fluent Terminal on Windows 2020-05-08 03:26:11 -05:00
Ben Reaves
df5d2d8c0e - Added cmd.exe to kinto.ahk for Windows 2020-05-08 02:47:00 -05:00
Ben Reaves
a556f1afa9 - Added commented out sublime text keymaps for VS Code under Windows 2020-05-07 22:24:23 -05:00
Ben Reaves
61fe293af8 Merge pull request #158 from rbreaves/dev
- Improved setup.py, added full and region screenshots for Windows
2020-05-07 20:23:31 -05:00
Ben Reaves
3ac264ea99 - Added full and region screenshots to Windows. Updated setup.py for Windows. 2020-05-07 20:16:40 -05:00
Ben Reaves
32111fe5a4 Merge pull request #157 from rbreaves/documentation
- Readme updated with ToC and resources
2020-05-07 16:51:18 -05:00
Ben Reaves
dff590e7df Merge pull request #156 from rbreaves/documentation
- Readme updated with ToC and resources
2020-05-07 16:50:29 -05:00
Ben Reaves
bc27f3c205 - Readme updated with ToC and resources 2020-05-07 16:48:03 -05:00
Ben Reaves
4c820d9f67 Merge branch 'dev' 2020-05-07 13:11:04 -05:00
Ben Reaves
8e6f1962e0 - Added fix for proper restoration of all mutter related keybinds 2020-05-07 13:10:37 -05:00
22 changed files with 752 additions and 246 deletions

View File

@@ -19,21 +19,16 @@ A clear and concise description of what you expected to happen.
**Branch:** master, dev
**Commit:** git rev-parse --short HEAD
**Kinto Input Caret Status**
```
cat /tmp/kinto/caret
Logs and status if relevant
```
# xkeysnail
sudo systemctl status xkeysnail
sudo journalctl --unit=xkeysnail.service -b
**Kinto Standard Log**
```
# xkb
systemctl --user status keyswap
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.

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@
.DS_Store
__pycache__/
xkeysnail/
keybindings_*
mutter_*

153
README.md
View File

@@ -1,8 +1,7 @@
# Kinto
![kinto_carrot](https://user-images.githubusercontent.com/10969616/77842401-4744b500-7157-11ea-854a-d7dec6f9a250.gif)
![kinto-color-132](https://user-images.githubusercontent.com/10969616/84361571-7d5bd780-ab91-11ea-81bc-4d3a2ca51c4e.png)
![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)
@@ -10,16 +9,56 @@
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. (xkeysnail implementation of Kinto has caret checking disabled in master for now.)
## Table of Contents
[What does this do exactly?](#What-does-this-do-exactly)
[What does Kinto require?](#What-does-Kinto-require)
[How to install](#How-to-install)
[Shortcut Creation (Xkeysnail)](#Shortcut-Creation-Xkeysnail)
[Other Notes Related to Install](#Other-Notes-Related-to-Install)
[How to Upgrade/Control Kinto](#How-to-Upgrade-Kinto)
[Troubleshooting](#Troubleshooting)
[Language Support](#Language-Support)
[Related or Useful Resources](#Related-or-Useful-Resources)
[Contributing](#Contributing)
[More information about Kinto](#More-information-about-Kinto)
[License](#License)
[Credits and Contributions](#Credits-and-Contributions)
## What does this do exactly?
Kinto works for standard Windows, Apple and Chromebook keyboards. The following however describes the dynamic rebinding based on a standard Windows keyboard. (Alt location is Cmd for Apple keyboards)
- Normal apps - Alt → Ctrl, Win/Super → Alt, Ctrl → Win/Super
- Terminal apps - Alt → Ctrl+Shift, Win/Super → Alt, Ctrl → Ctrl
Kinto works for standard Windows, Apple and Chromebook keyboards. The following however describes the dynamic rebinding based on a standard Windows/Mac keyboard.
- Cursor/word-wise shortcut keys have been added to align with macOS keyboard shortcuts.
**GUI**
|**Physical**| Ctrl | Win/Alt | Alt/Cmd | Spacebar|
|---|---|---|---|---|
|**Virtual**| Win/Super* | Alt | RCtrl |Spacebar|
*Win/Super will properly remap to LCtrl when needed to fully support expected keymaps.
**Terminal**
|**Physical**| Ctrl | Win/Alt | Alt/Cmd | Spacebar|
|---|---|---|---|---|
|**Virtual**| LCtrl | Alt | RCtrl |Spacebar|
Does Kinto have to have specific keymaps for individual apps?
I'd say 90+% of the time no, but every OS has their default conventions that sometimes run afoul to macs. For this reason you can easily edit kinto.py or kinto.ahk to support the few shortcut keys Kinto may miss. If you do add additional support please consider forking this project and sharing your new keymaps with the rest of us!
## What does Kinto require?
- Python (initial install only)
@@ -36,7 +75,7 @@ On most distros you can confirm navigate to your "Language Support" and set "Key
Wayland support is planned, but not ready yet.
## Kinto for Windows 10 Requirements
### Kinto for Windows 10 Requirements
- WSL Ubuntu edition
- Powershell - run as Administrator
@@ -46,7 +85,15 @@ 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.
Note: Sublime Text users should disable screen rotation hotkeys as they will interfere with multi-cursor and possibly other combos. See https://windowsloop.com/disable-screen-rotation-keyboard-shortcut/ for details.
Does not have complete parity with the Linux edition, but it is getting very close now. Only lacks some Sublime Text 3 remaps at this point.
Users can now hotswap between Apple and Windows based keyboards without having to logoff and back on, and Windows is currently the only implementation with a system tray (but this feature is coming to Budgie, XFCE, Mate, Gnome, and lastly KDE).
<img src="https://user-images.githubusercontent.com/10969616/84471498-100c7d00-ac4b-11ea-972d-60c1907831ec.png" width="50%">
<img src="https://user-images.githubusercontent.com/10969616/84471501-10a51380-ac4b-11ea-9e0e-c19a7ebfad6d.png" width="50%">
## How to install
@@ -191,7 +238,6 @@ systemctl --user disable keyswap
sudo systemctl disable xkeysnail
```
## 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.
@@ -321,10 +367,91 @@ I'd appreciate any help from people with non-US based keyboards, to help ensure
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.
## Related or Useful Resources
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.
[Xkeysnail](https://github.com/mooz/xkeysnail) by mooz
Yet another keyboard remapping tool for X environment
[fusuma](https://github.com/iberianpig/fusuma) by iberianpig
Multitouch gestures with libinput driver on Linux
[Fluent Terminal - Windows only](https://github.com/felixse/FluentTerminal) by felixse
A Terminal Emulator based on UWP and web technologies.
[PowerToys - Windows only](https://github.com/microsoft/PowerToys) by microsoft
Windows system utilities to maximize productivity
[AutoHotKey - Windows only](https://github.com/AutoHotkey/AutoHotkey) by AutoHotkey
AutoHotkey is a powerful and easy to use scripting language for desktop automation on Windows.
[pykeymacs](https://github.com/zhanghai/pykeymacs) by zhanghai
Emacs style keyboard macros implemented in Python
[Dynamic Wallpapers](https://github.com/adi1090x/dynamic-wallpaper) by adi1090x
Simple bash script to set a Dynamic Wallpaper according to certain conditions.
[macify-linux](https://github.com/Jonchun/macify-linux) by JonChun
Automated setup scripts to transform Linux into macOS. (Uses Kinto for key remaps)
[ibus-typing-booster](https://github.com/mike-fabian/ibus-typing-booster) by mike-fabian
ibus-typing-booster is a completion input method for faster typing
[twemoji color font](https://github.com/eosrei/twemoji-color-font) by eosrei
Twitter Unicode 12 emoji color SVGinOT font for Linux/MacOS/Windows
[iTerm2 Color Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes) by mbadolato
Over 225 terminal color schemes/themes for iTerm/iTerm2. Includes ports to Terminal, Konsole, PuTTY, Xresources, XRDB, Remmina, Termite, XFCE, Tilda, FreeBSD VT, Terminator, Kitty...
[espanso](https://github.com/federico-terzi/espanso) by federico-terzi
Cross-platform Text Expander written in Rust
[GalliumOS](https://github.com/GalliumOS/galliumos-distro) by GalliumOS
Docs, issues, and artwork sources for GalliumOS
[eOS-X](https://github.com/ipproductions/eOS-X) by ipproductions
Dark & Light Theme w/ OSX controls for Elementary OS
[Autorandr](https://github.com/phillipberndt/autorandr) by phillipberndt
Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
[Barrier](https://github.com/debauchee/barrier) by debauchee
Open-source KVM software
[Synergy Free Binaries](https://github.com/amankhoza/synergy-binaries) by amankhoza
The latest freely available Synergy binaries
[Synergy Official](https://symless.com/) by Symless
Latest Official Synergy
[Karabiner-Elements](https://github.com/pqrs-org/Karabiner-Elements) by pqrs-org
Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
[mbpfan](https://github.com/linux-on-mac/mbpfan) by linux-on-mac
A simple daemon to control fan speed on all MacBook/MacBook Pros (probably all Apple computers) for Linux Kernel 3 and newer
[vala-panel](https://github.com/rilian-la-te/vala-panel) by rilian-la-te
Vala rewrite of SimplePanel - GitHub mirror (Global Menu for XFCE)
## Contributing

BIN
assets/kinto-black.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
assets/kinto-color.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

BIN
assets/kinto-white.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

200
setup.py
View File

@@ -6,6 +6,51 @@ from prekinto import *
homedir = os.path.expanduser("~")
def windows_setup():
keymaps = ["Apple keyboard standard", "Windows keyboard standard","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("")
# Short DOS path notation
path= cmdline('echo %cd%')[:-1]
print("Copying autohotkey combinations for Terminals & Editors...")
os.system("copy /Y " + path + "\\windows\\kinto.ahk " + path + "\\windows\\kinto-new.ahk")
if default == 1:
os.system('perl -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" ./windows/kinto-new.ahk')
# os.system("regedit " + path + "\\windows\\macbook_winctrl_swap.reg")
elif default == 2:
os.system('perl -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" ./windows/kinto-new.ahk')
# os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg")
elif default == 3:
os.system("regedit " + path + "\\windows\\remove_keyswap.reg")
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
if default > 0 and default < 3:
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"')
os.system('refreshenv')
print("\nWill now install Ubuntu Terminal Theme as default...")
os.system("regedit " + path + "\\windows\\theme_ubuntu.reg")
if(stvscode):
os.system('perl -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" ./windows/kinto-new.ahk')
os.system('copy /Y ' + path + '\\windows\\kinto-start.vbs "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('mklink "%userprofile%\\Start Menu\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('cp '+ path + '\\windows\\NoShell.vbs "%userprofile%\\.kinto\\NoShell.vbs"')
os.system('cp '+ path + '\\windows\\toggle_kb.bat "%userprofile%\\.kinto\\toggle_kb.bat"')
os.system('cp '+ path + '\\windows\\kinto-new.ahk "%userprofile%\\.kinto\\kinto.ahk"')
os.system('robocopy '+ path + '\\assets "%userprofile%\\.kinto\\assets" /E')
os.system("del /f .\\windows\\kinto-new.ahk")
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
os.system("%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs")
# # 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 cmdline(command):
process = Popen(
args=command,
@@ -14,9 +59,24 @@ def cmdline(command):
shell=True
)
return process.communicate()[0]
# 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("\nYou are detected as running Windows.")
windows_setup()
sys.exit()
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0]
dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
run_pkg = ""
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")
@@ -59,7 +119,7 @@ def setShortcuts():
addhotkeys = yn_choice("\nDo you want to apply system level shortcuts?")
if(addhotkeys):
distro = distro.lower()
if dename == "gnome":
if dename == "gnome" or dename == "mate":
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')
if(kintotype == 1):
@@ -70,8 +130,10 @@ def setShortcuts():
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']\"")
cmdline("gsettings set org.gnome.mutter overlay-key ''")
if distro == "ubuntu" and dename == "gnome":
cmdline("gsettings set org.gnome.shell.keybindings toggle-application-view \"['LaunchB']\"")
if dename != "mate":
cmdline("gsettings set org.gnome.mutter overlay-key ''")
if (distro == "ubuntu" and dename == "gnome") or (distro == "linux" and dename == "mate") or (distro == "ubuntu" and dename == "mate"):
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 ['']")
@@ -103,7 +165,9 @@ def setShortcuts():
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":
# elif distro == "budgie" and dename == "gnome":
# print("Apply budgie shortcuts here")
elif (distro == "galliumos" and dename == "xfce") or (distro == "ubuntu" 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
@@ -178,38 +242,6 @@ def setShortcuts():
cmdline('sleep 1 && rm -f ./tempkb.conf;rm -f ./tempmt.conf')
# cmdline('dconf update')
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?")
@@ -218,7 +250,7 @@ def Uninstall():
if dename == "gnome":
print("Restoring DE hotkeys...")
wmkeys = cmdline('ls | grep -m1 "keybinding"')
mutterkeys = cmdline('ls | grep -m1 "mutter"')
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)
@@ -270,64 +302,55 @@ def Uninstall():
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()
def kintoImpOne():
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()
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:
print("You are detected as running Windows.")
windows_setup()
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()
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()
runpkg = 0
global run_pkg
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(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 len(pkgm) == 0:
pkgm = cmdline("which pacman 2>/dev/null").strip()
if len(pkgm) > 0:
pkgm += " -Syy; sudo pacman -S "
if runpkg != 0:
print(runpkg)
requirements(pkgm)
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()
if not os.path.exists(homedir + '/.config/ibus/bus') and cmdline("ls ~/.config/ibus/bus -1rt") == "":
install_ibus()
try:
f = open("defaults.json")
@@ -373,6 +396,7 @@ if(kintotype == 1):
subprocess.check_call(shlex.split("./xkeysnail_service.sh"))
if os.path.isdir(homedir + "/.config/kinto") == True:
setShortcuts()
subprocess.check_call(shlex.split("./xkeysnail_service.sh budgieUpdate"))
exit()
if(kintotype == 3):
@@ -383,6 +407,8 @@ if(kintotype == 4):
Uninstall()
exit()
kintoImpOne()
for index, item in enumerate(data['defaulttypes']):
ossym = ""
if item == "windows":

View File

@@ -0,0 +1 @@
3cd35e15350ca7dac0c3cbfce1c661f7 /usr/bin/budgie-daemon

View File

@@ -0,0 +1 @@
8660c2f8e0a9d3cff896254f6c0f9159 /usr/bin/budgie-desktop

View File

@@ -8,9 +8,9 @@ Restart=always
# eg DISPLAY=:0.0
#Environment=DISPLAY={displayid}
RestartSec=1
WorkingDirectory=/home/{username}/.config/kinto
ExecStart=/bin/bash -c "/home/{username}/.config/kinto/xactive.sh carrots"
ExecStop=/bin/bash /home/{username}/.config/kinto/cleanup.sh
WorkingDirectory={homedir}/.config/kinto
ExecStart=/bin/bash -c "{homedir}/.config/kinto/xactive.sh carrots"
ExecStop=/bin/bash {homedir}/.config/kinto/cleanup.sh
[Install]
WantedBy=default.target

View File

@@ -3,13 +3,13 @@
if pkgmgr="$( which apt-get )" 2> /dev/null; then
echo "Debian"
$pkgmgr update
$pkgmgr --yes --force-yes install "$1"
$pkgmgr --yes --force-yes install $1
elif pkgmgr="$( which dnf )" 2> /dev/null; then
echo "dnf"
$pkgmgr check-update; $pkgmgr install -y "$1"
$pkgmgr check-update; $pkgmgr install -y $1
elif pkgmgr="$( which pacman )" 2> /dev/null; then
echo "Arch-based"
$pkgmgr -Syy;yes | $pkgmgr -S "$1"
$pkgmgr -Syy;yes | $pkgmgr -S $1
else
echo "Package manager not found, please install $1" >&2
exit 1

View File

@@ -16,7 +16,7 @@
"symbols":"",
"types":"",
"de":[],
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty" ]
"appnames":[ "Gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal" ]
},
{
"name": "firefox",

14
windows/NoShell.vbs Normal file
View File

@@ -0,0 +1,14 @@
If WScript.Arguments.Count >= 1 Then
ReDim arr(WScript.Arguments.Count-1)
prog = WScript.Arguments(0)
For i = 1 To WScript.Arguments.Count-1
Arg = WScript.Arguments(i)
If InStr(Arg, " ") > 1 Then Arg = """" & Arg & """"
arr(i) = Arg
Next
RunCmd = Join(arr)
' CreateObject("Wscript.Shell").Run RunCmd, 0, True
Set oShell = CreateObject("Shell.Application")
oShell.ShellExecute prog, RunCmd, , "runas", 0
End If

View File

@@ -10,3 +10,6 @@ else{
if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){
choco install autohotkey.install
}
if(-not(test-path "C:\Strawberry\")){
choco install strawberryperl
}

7
windows/kinto-start.vbs Normal file
View File

@@ -0,0 +1,7 @@
Set oShell = CreateObject("Shell.Application")
Set wShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
path = wShell.ExpandEnvironmentStrings("%userprofile%")
strFolder = fso.BuildPath(path, "\.kinto\kinto.ahk")
oShell.ShellExecute "C:\Program Files\AutoHotkey\AutoHotkey.exe", strFolder, , "runas", 0

View File

@@ -1,39 +1,167 @@
#SingleInstance force
#NoEnv
#Persistent
I_Icon = %A_ScriptDir%\assets\kinto-white.ico
IfExist, %I_Icon%
Menu, Tray, Icon, %I_Icon%
; Set Tray menu
; Menu, Tray, Standard
Menu, Tray, NoStandard ; to remove default menu
Menu, Tray, Add, Set Windows Keyboard, winkb
Menu, Tray, Add, Set Apple Keyboard, mackb
Menu, Tray, Add, Suspend Kinto, tray_suspend
Menu, Tray, Add, Returns to Desktop, min
Menu, Tray, Add
Menu, Tray, Add, Close, Exit
Menu, Tray, Click, 1
Menu, Tray, Tip, Kinto
winkb(){
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat win, %A_ScriptDir%
}
mackb(){
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat mac, %A_ScriptDir%
}
min(){
; Refocus last active Window
Send {LAlt down}{tab}{LAlt up}
}
tray_suspend(){
suspend toggle
if (a_isSuspended = 1){
menu, tray, check , Suspend Kinto
}
else{
menu, tray, unCheck, Suspend Kinto
}
; Refocus last active Window
Send {LAlt down}{tab}{LAlt up}
}
Exit() {
ExitApp
}
SetTitleMatchMode, 2
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, terminals, ahk_exe Cmd.exe
GroupAdd, terminals, ahk_exe Terminus.exe
GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, posix, ahk_exe ubuntu.exe
GroupAdd, posix, ahk_exe ConEmu.exe
GroupAdd, posix, ahk_exe ConEmu64.exe
GroupAdd, posix, ahk_exe Hyper.exe
GroupAdd, posix, ahk_exe mintty.exe
GroupAdd, terminals, ahk_exe Terminus.exe
GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow
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
GroupAdd, editors, ahk_exe VSCodium.exe
GroupAdd, editors, ahk_exe Code.exe
; Cmd+Space Alternative
LWin & vk07::return
LWin::return
RWin & vk07::return
RWin::return
^Space::Send ^{Esc}
; ^Space::run AppName
GroupAdd, vscode, ahk_exe VSCodium.exe
GroupAdd, vscode, ahk_exe Code.exe
; 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}
GroupAdd, vstudio, ahk_exe devenv.exe
; Close Apps
; New AltTab and CtrlTab fix
*tab::
{
; Tertiary
if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) {
; Secondary
; Send {LCtrl down}{Secondary up}{tab}
; Send {LCtrl down}{LWin up}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers
KeyWait, tab
; Tertiary
} else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) {
; Secondary
; Send {LCtrl down}{Secondary up}{LShift down}{tab}
; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers
KeyWait, tab
; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
Send {LAlt down}{tab}
KeyWait, tab
; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
Send {LAlt down}{LShift down}{tab}
KeyWait, tab
; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
return
; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
return
} else {
send {Blind}{tab}
}
return
}
tab::Send {tab}
+tab::Send {Shift down}{tab}{Shift up}
; Basic Remap
;
; Primary::LCtrl
; Secondary::LAlt
; Tertiary::LWin
; $LAlt::LCtrl ; WinModifiers
; $RAlt::RCtrl ; WinModifiers
; $LWin::LAlt ; WinModifiers
; $LCtrl::LWin ; WinModifiers
; $LWin::LCtrl ; MacModifiers
; $RWin::RCtrl ; MacModifiers
; $LCtrl::LWin ; MacModifiers
; Hack to disable start menu on winkey
; Static
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; temporary hack to ensure keys don't get stuck
; impacts Alt-Tab fix
; Primary
; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
; Close Apps
^q::Send !{F4}
; Emoji Panel
#^Space::Send {LWin down};{LWin up}
; Full Screenshot
^+3::Send {PrintScreen}
; Region Screenshot
^+4::Send #+{S}
; wordwise support
$^Left::Send {Home}
$^+Left::Send +{Home}
@@ -50,79 +178,114 @@ $^+Right::Send +{End}
!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}
; Cmd+Space Alternative
^Space::Send ^{Esc}
; Remap Ctrl+Cmd+G to select all matches
#^g::send !{F3}
; ; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode ; ST2CODE
; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines
#+Up::send ^!{Up} ; ST2CODE
#+Down::send ^!{Down} ; ST2CODE
; Remap Ctrl+Cmd+G to select all matches
#^g::send ^+{L} ; ST2CODE
#If ; ST2CODE
#IfWinActive ahk_exe sublime_text.exe
; 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
; Copy
^c::
SetKeyDelay -1
Send {Blind}{LShift down}{c DownTemp}
return
^c up::
SetKeyDelay -1
Send {Blind}{c Up}{LShift Up}
return
; Sigints - interrupt
$#c::Send {Ctrl down}c{Ctrl up}
; Paste
^v::
If WinActive("ahk_group posix"){
Send {Blind}{Shift down}v{Shift up}
}
else{
Send {Blind}v
}
return
#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
; Open/Close Tab for those that support it
$^t::
If not WinActive("ahk_group ConEmu"){
Send {LCtrl down}{LShift down}t{LCtrl Up}{LShift Up}
}
else{
Send ^t
}
return
#IfWinActive ahk_group ConEmu
; Paste
$^v::Send {Shift down}{Insert}{Shift Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If
$^w::
If not WinActive("ahk_group ConEmu"){
Send {LCtrl down}{LShift down}w{LCtrl Up}{LShift Up}
}
else{
Send ^w
}
return
#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
; End of Line
^e::
SetKeyDelay -1
Send {Blind}{e DownTemp}
return
;Disable win + l key locking (This line must come before any hotkey assignments in the .ahk file)
^e up::
SetKeyDelay -1
Send {Blind}{e Up}
return
; 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
; Beginning of Line
^a::
SetKeyDelay -1
Send {Blind}{a DownTemp}
return
; 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
^a up::
SetKeyDelay -1
Send {Blind}{a Up}
return
^l::Send clear{Enter}
; #l::return
; Clear Terminal and Scroll Buffer
^k::Send clear && printf '\e[3J'{Enter}
; Nano editor shortcuts
#g::Send {LCtrl down}g{LCtrl Up}
#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}
#y::Send {LCtrl down}y{LCtrl Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If

22
windows/toggle_kb.bat Normal file
View File

@@ -0,0 +1,22 @@
@echo off
IF "%1"=="mac" goto mac
IF "%1"=="win" goto win
echo Not found.
goto commonexit
:win
perl -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
perl -pi -e "s/^(?!;)(.*)(; MacModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk"
goto commonexit
:mac
perl -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
perl -pi -e "s/^(?!;)(.*)(; WinModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk"
goto commonexit
:commonexit
exit

View File

@@ -3,10 +3,16 @@
import re
from xkeysnail.transform import *
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty"]
# Use the following for testing terminal keymaps
# terminals = [ "", ... ]
# xbindkeys -mk
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal"]
terminals = [term.casefold() for term in terminals]
termStr = "|".join(str(x) for x in terminals)
mscodes = ["code","vscodium"]
codeStr = "|".join(str(x) for x in mscodes)
# [Global modemap] Change modifier keys as in xmodmap
define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{
# # Chromebook
@@ -23,6 +29,9 @@ define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac
# # KintoWin
# Key.LEFT_CTRL: Key.RIGHT_CTRL, # KintoWin
# # Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# Key.LEFT_CTRL: Key.LEFT_META, # Mac
@@ -36,7 +45,7 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
# # Left Ctrl Stays Left Ctrl
# Key.LEFT_META: Key.LEFT_ALT, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook
# # Right Meta does not exist on chromebooks
@@ -44,10 +53,14 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_CTRL, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac
# # KintoWin
# Key.LEFT_CTRL: Key.RIGHT_CTRL, # KintoWin
# Key.LEFT_META: Key.LEFT_CTRL, # KintoWin
# # Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# # Left Ctrl Stays Left Ctrl
@@ -64,25 +77,30 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{
})
define_keymap(None,{
# Basic App hotkey functions
K("RC-Q"): K("Alt-F4"),
K("RC-H"): K("Alt-F9"),
# Cmd Tab - App Switching Default
K("RC-Tab"): K("RC-F13"), # Default
K("RC-Shift-Tab"): K("RC-Shift-F13"), # Default
K("RC-Grave"): K("M-F6"), # Default
K("RC-Shift-Grave"): K("M-Shift-F6"), # Default
# K("RC-Tab"): K("RC-backslash"), # Chromebook
# K("RC-Shift-Tab"): K("RC-Shift-backslash"), # Chromebook
# K("RC-Grave"): K("RC-Shift-backslash"), # Chromebook
K("RC-Tab"): K("RC-F13"), # Default not-xfce4
K("RC-Shift-Tab"): K("RC-Shift-F13"), # Default not-xfce4
K("RC-Grave"): K("M-F6"), # Default not-xfce4
K("RC-Shift-Grave"): K("M-Shift-F6"), # Default not-xfce4
# K("RC-Tab"): K("RC-backslash"), # xfce4
# K("RC-Shift-Tab"): K("RC-Shift-backslash"), # xfce4
# K("RC-Grave"): K("RC-Shift-backslash"), # xfce4
# In-App Tab switching
# K("M-Tab"): K("C-Tab"), # Chromebook - In-App Tab switching
# K("M-Shift-Tab"): K("C-Shift-Tab"), # Chromebook - In-App Tab switching
# K("M-Grave") : K("C-Shift-Tab"), # Chromebook - In-App Tab switching
K("Super-Tab"): K("LC-Tab"), # Default
K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default
K("Super-Tab"): K("LC-Tab"), # Default not-chromebook
K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default not-chromebook
# Wordwise
K("RC-Left"): K("Home"), # Beginning of Line
K("Super-a"): K("Home"), # Beginning of Line
K("RC-Shift-Left"): K("Shift-Home"), # Select all to Beginning of Line
K("RC-Right"): K("End"), # End of Line
K("Super-e"): K("End"), # End of Line
K("RC-Shift-Right"): K("Shift-End"), # Select all to End of Line
# K("RC-Left"): K("C-LEFT_BRACE"), # Firefox-nw - Back
# K("RC-Right"): K("C-RIGHT_BRACE"), # Firefox-nw - Forward
@@ -92,12 +110,16 @@ define_keymap(None,{
K("RC-Shift-Up"): K("C-Shift-Home"), # Select all to Beginning of File
K("RC-Down"): K("C-End"), # End of File
K("RC-Shift-Down"): K("C-Shift-End"), # Select all to End of File
K("M-Backspace"): K("Delete"), # Delete
# K("M-Backspace"): K("Delete"), # Chromebook - Delete
K("Super-Backspace"): K("C-Backspace"), # Default not-chromebook - Delete Left Word of Cursor
K("Super-Delete"): K("C-Delete"), # Default not-chromebook - Delete Right Word of Cursor
K("Alt-Backspace"): K("C-Backspace"), # Default not-chromebook - Delete Left Word of Cursor
K("Alt-Delete"): K("C-Delete"), # Default not-chromebook - Delete Right Word of Cursor
# K(""): pass_through_key, # cancel
# K(""): K(""), #
})
define_keymap(lambda wm_class: wm_class.casefold() not in ("code"),{
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
# Wordwise remaining - for Everything but VS Code
K("M-Left"): K("C-Left"), # Left of Word
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
@@ -120,7 +142,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in ("code"),{
})
# Keybindings for VS Code
define_keymap(re.compile("code", re.IGNORECASE),{
define_keymap(re.compile(codeStr, re.IGNORECASE),{
# Wordwise remaining - for VS Code
# Alt-F19 hack fixes Alt menu activation
K("M-Left"): [K("M-F19"),K("C-Left")], # Left of Word
@@ -128,6 +150,11 @@ define_keymap(re.compile("code", re.IGNORECASE),{
K("M-Shift-Left"): [K("M-F19"),K("C-Shift-Left")], # Select Left of Word
K("M-Shift-Right"): [K("M-F19"),K("C-Shift-Right")], # Select Right of Word
# K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
# K("C-PAGE_UP"): pass_through_key, # cancel prev_view
K("C-M-Left"): K("C-PAGE_UP"), # next_view
K("C-M-Right"): K("C-PAGE_DOWN"), # prev_view
# VS Code Shortcuts
K("C-g"): pass_through_key, # cancel Go to Line...
K("Super-g"): K("C-g"), # Go to Line...
@@ -140,9 +167,10 @@ define_keymap(re.compile("code", re.IGNORECASE),{
K("C-g"): K("f3"), # find_next
K("Shift-f3"): pass_through_key, # cancel find_prev
K("C-Shift-g"): K("Shift-f3"), # find_prev
K("Super-C-g"): K("C-f2"), # Sublime - find_all_under
K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up
K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down
# K("Super-C-g"): K("C-f2"), # Default - Sublime - find_all_under
# K("C-M-g"): K("C-f2"), # Chromebook - Sublime - find_all_under
# K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up - Sublime
# K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down - Sublime
# K(""): pass_through_key, # cancel
# K(""): K(""), #
}, "Code")
@@ -150,7 +178,7 @@ define_keymap(re.compile("code", re.IGNORECASE),{
# Keybindings for Sublime Text
define_keymap(re.compile("Sublime_text", re.IGNORECASE),{
K("C-Super-up"): K("M-o"), # Switch file
K("C-M-f"): K("f11"), # toggle_full_screen
K("Super-RC-f"): K("f11"), # toggle_full_screen
K("C-M-v"): [K("C-k"), K("C-v")], # paste_from_history
K("C-up"): pass_through_key, # cancel scroll_lines up
K("Super-M-up"): K("C-up"), # scroll_lines up
@@ -240,7 +268,6 @@ define_keymap(re.compile(termStr, re.IGNORECASE),{
K("RC-MINUS"): K("C-Shift-MINUS"),
K("RC-EQUAL"): K("C-Shift-EQUAL"),
K("RC-BACKSPACE"): K("C-Shift-BACKSPACE"),
K("RC-Q"): K("C-Shift-Q"),
K("RC-W"): K("C-Shift-W"),
K("RC-E"): K("C-Shift-E"),
K("RC-R"): K("C-Shift-R"),

View File

@@ -1,14 +1,13 @@
#!/bin/bash
if [ -f /home/{username}/.config/systemd/user/keyswap.timer ]; then
if [ -f {homedir}/.config/systemd/user/keyswap.timer ]; then
systemctl --user stop keyswap.timer >/dev/null 2>&1
systemctl --user disable keyswap.timer >/dev/null 2>&1
fi
if [ -f /home/{username}/.config/systemd/user/keyswap.service ]; then
if [ -f {homedir}/.config/systemd/user/keyswap.service ]; then
systemctl --user stop keyswap >/dev/null 2>&1
systemctl --user disable keyswap >/dev/null 2>&1
fi
# export DISPLAY={displayid};/usr/bin/xhost +SI:localuser:root
mkdir -p /tmp/kinto/xkeysnail
cp /home/{username}/.config/kinto/kinto.py /tmp/kinto/xkeysnail/kinto.py
cp {homedir}/.config/kinto/kinto.py /tmp/kinto/xkeysnail/kinto.py

View File

@@ -4,12 +4,12 @@ Description=xkeysnail
[Service]
Type=simple
KillMode=process
ExecStartPre=/bin/bash -c "{xhost} +SI:localuser:root && /sbin/runuser -l {username} -c /home/{username}/.config/kinto/prexk.sh"
ExecStart=/usr/bin/sudo /bin/bash -c '{experimental-caret}/home/{username}/.config/kinto/xkeystart.sh /tmp/kinto/xkeysnail/kinto.py'
ExecStartPre=/bin/bash -c "{xhost} +SI:localuser:root && /sbin/runuser -l {username} -c {homedir}/.config/kinto/prexk.sh"
ExecStart=/usr/bin/sudo /bin/bash -c '{experimental-caret}{homedir}/.config/kinto/xkeystart.sh /tmp/kinto/xkeysnail/kinto.py'
ExecStop=/bin/bash -c 'me=$$;ps -ef | grep \'[t]mp/kinto\' | awk -v me=$me \'$2 != me {print $2}\' | xargs kill;/usr/bin/killall dbus-monitor;/usr/bin/killall xkeysnail;{kill-caret}'
Restart=on-failure
RestartSec=3
Environment=DISPLAY={displayid}
[Install]
WantedBy=graphical.target
WantedBy=graphical.target

View File

@@ -5,10 +5,10 @@
typeset -l distro
distro=$(awk -F= '$1=="NAME" { print $2 ;}' /etc/os-release)
typeset -l dename
dename=$(./system-config/dename.sh | cut -d " " -f1)
function uninstall {
typeset -l dename
dename=$(./system-config/dename.sh | cut -d " " -f1)
while true; do
read -rep $'\nPress R to restore your original shortcuts.\nPress F to reset to factory shortcuts. (f/r)\n' yn
@@ -44,7 +44,7 @@ function uninstall {
if [ "$dename" == "gnome" ]; then
echo "Restoring DE hotkeys..."
wmkeys=$(ls | grep -m1 "keybinding")
mutterkeys=$(ls | grep -m1 "mutter")
mutterkeys=$(ls | grep -m1 "mutter_")
if [[ ${#wmkeys} > 0 ]]; then
echo "dconf load /org/gnome/desktop/wm/keybindings/ < $wmkeys"
dconf load /org/gnome/desktop/wm/keybindings/ < "$wmkeys"
@@ -72,25 +72,108 @@ function uninstall {
fi
}
function budgieUninstall {
if [ -f /usr/bin/budgie-desktop ];then
read -n 1 -s -r -p "Your system may log you off immediately during the restoration of budgie-daemon. Press any key to continue..."
bdmd5="$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')"
oldbdmd5=$(md5sum ./budgie-daemon_10.5.1.bak | awk '{ print $1 }')
if [ "$bdmd5" != "$oldbdmd5" ]; then
echo -e "\nReplacing budgie-daemon with backup..."
sudo pkill budgie-daemon && sudo cp ./budgie-daemon_10.5.1.bak /usr/bin/budgie-daemon
else
echo -e "\nBudgie-daemon is already an original."
fi
fi
}
function budgieUpdate {
# Check for budgie and install App Switching hack
if [ -f /usr/bin/budgie-desktop ];then
while true; do
read -rep $'Would you like to update Budgie to support proper App Switching? (y/n)\n(Your system will immediately log you out after this runs.)\n' yn
case $yn in
[Yy]* ) yn="y"; break;;
[Nn]* ) yn="n";break;;
* ) echo "Please answer yes or no.";;
esac
done
if [ "$yn" == "y" ]; then
budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)"
if [ "$budgieVersion" == "10.5.1" ]; then
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
fi
bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')
newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
if [ "$bdmd5" != "$newbdmd5" ]; then
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
echo "Updated Budgie to use App Switching Patch"
else
echo "Budgie-daemon already patched, skipping replacement."
fi
else
echo "Your Budgie version was $budgieVersion and the patch is for 10.5.1."
while true; do
read -rep $'Would you like to replace it any ways? (y/n)\n(A backup will be made)\n' yn
case $yn in
[Yy]* ) yn="y"; break;;
[Nn]* ) yn="n";break;;
* ) echo "Please answer yes or no.";;
esac
done
if [ "$yn" == "y" ]; then
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
fi
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
echo "Updated Budgie to use App Switching Patch"
fi
fi
fi
fi
}
if [ $# -eq 0 ]; then
echo "Install Kinto - xkeysnail (udev)"
echo " 1) Windows & Mac (HID driver)"
echo " 2) Mac Only & VMs on Macbooks"
echo " 3) Chromebook"
# echo " 4) Uninstall"
echo " 4) Windows w/ Kinto - aka Linux VM"
# echo " 5) Uninstall"
read n
set "$n"
fi
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
# multi-language
rightalt=false
# VS code remap
vssublime=false
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
while true; do
read -rep $'\nDo you want multi-language support (the right Alt key will not remap)? (y/N)\n' yn
case $yn in
[Yy]* ) rightalt=true; break;;
* ) break;;
esac
done
while true; do
read -rep $'\nWould you like to give VS Code Sublime Text keymaps? (y/N)\n' yn
case $yn in
[Yy]* ) vssublime=true; break;;
* ) break;;
esac
done
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" == "dev" ] || [ "$branch" == "alpha" ];then
while true; do
read -rep $'\nExperimental Support for Firefox/Chrome Back/Forward hotkeys (Cmd+Left/Right)?\n(Keys could get stuck, switch windows or press ctrl &/or super to release) (y/n)\n' yn
case $yn in
[Yy]* ) exp='/sbin/runuser -l {username} -c "export DISPLAY={displayid};/home/{username}/.config/kinto/caret_status_xkey.sh\&";'; expsh='"/home/{username}/.config/kinto/caret_status_xkey.sh"'; break;;
[Yy]* ) exp='/sbin/runuser -l {username} -c "export DISPLAY={displayid};{homedir}/.config/kinto/caret_status_xkey.sh\&";'; expsh='"{homedir}/.config/kinto/caret_status_xkey.sh"'; break;;
[Nn]* ) exp=" "; expsh=" " break;;
# * ) echo "Please answer yes or no.";;
esac
@@ -110,24 +193,28 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
sudo ./system-config/unipkg.sh python3-pip
fi
if ! [ -x "$(command -v python3-config)" ]; then
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ]; then
if [ "$distro" == "ubuntu" ] || [ "$distro" == "debian" ] || [ "$distro" == '"linux mint"' ]; then
pydev="python3-dev"
elif [ "$distro" == "fedora" ]; then
pydev="python3-devel"
fi
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ]; then
if [ "$distro" == "gnome" ] || [ "$distro" == "fedora" ] || [ "$distro" == "debian" ] || [ "$distro" == '"linux mint"' ]; then
echo "Will need to install $pydev..."
sudo ./system-config/unipkg.sh "$pydev"
fi
fi
if ! [ -x "$(command -v xhost)" ]; then
if ! [ -x "$(command -v xhost)" ] || ! [ -x "$(command -v gcc)" ]; then
if [ "$distro" == "\"manjaro linux\"" ]; then
sudo ./system-config/unipkg.sh xorg-xhost
sudo ./system-config/unipkg.sh "xorg-xhost gcc"
fi
fi
if [ "$distro" == '"linux mint"' ]; then
pip3 install setuptools
fi
# echo "Transferring files..."
mkdir -p ~/.config/kinto
# KDE xhost fix
mkdir -p ~/.kde/Autostart
echo -e '#!/bin/sh\rxhost +SI:localuser:root' > ~/.kde/Autostart/kintohost.sh
@@ -150,31 +237,50 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
sed -i "s#{kill-caret}#$expsh#g" ./xkeysnail-config/xkeysnail.service.new
fi
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s#{xhost}#`which xhost`#g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s/{username}/`whoami`/g" ./xkeysnail-config/limitedadmins.new
sed -i "s#{homedir}#`echo "$HOME"`#g" ./xkeysnail-config/limitedadmins.new
sed -i "s#{systemctl}#`which systemctl`#g" ./xkeysnail-config/limitedadmins.new
sudo chown root:root ./xkeysnail-config/limitedadmins.new
sudo mv ./xkeysnail-config/limitedadmins.new /etc/sudoers.d/limitedadmins
sed -i "s#{systemctl}#`which systemctl`#g" ~/.config/autostart/xkeysnail.desktop
sed -i "s#{xhost}#`which xhost`#g" ~/.config/autostart/xkeysnail.desktop
sed -i "s/{username}/`whoami`/g" ~/.config/kinto/prexk.sh
sed -i "s#{homedir}#`echo "$HOME"`#g" ~/.config/kinto/prexk.sh
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ./xkeysnail-config/xkeysnail.service.new
sed -i "s/{displayid}/`echo "$DISPLAY"`/g" ~/.config/kinto/prexk.sh
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
echo "Expected argument was not provided"
if $vssublime ; then
perl -pi -e "s/(# )(.*)(- Sublime)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
fi
if [[ $1 == "1" || $1 == "winmac" ]]; then
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
perl -pi -e "s/(# )(.*)(# WinMac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
if [[ $dename == "xfce" ]]; then
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
fi
elif [[ $1 == "2" || $1 == "mac" ]]; then
perl -pi -e "s/(# )(.*)(# Mac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
if [[ $dename == "xfce" ]]; then
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
fi
elif [[ $1 == "3" || $1 == "chromebook" ]]; then
perl -pi -e "s/(# )(.*)(# Chromebook)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
elif [[ $1 == "4" || $1 == "kintowin" ]]; then
perl -pi -e "s/(# )(.*)(# KintoWin)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
fi
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
if $rightalt ; then
perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
# if [ "$distro" == "fedora" ];then
sudo rm /etc/systemd/system/xkeysnail.service
@@ -189,17 +295,20 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Created soft symlink..." || echo "Failed to create soft symlink..."
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Created soft symlink for graphical target..." || echo "Failed to create soft symlink for graphical target..."
xhost +SI:localuser:root
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git || git pull --depth 10
cd xkeysnail
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
giturl=$(git ls-remote --get-url)
if [ "$geturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
if [ "$giturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
echo -e "\nreplacing xkeysnail with fork...\n"
cd ..
rm -rf ./xkeysnail
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git
cd xkeysnail
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
fi
git pull origin master
sudo pip3 install --upgrade .
cd ..
sudo systemctl daemon-reload
sudo systemctl --state=not-found --all | grep xkeysnail
if [ "$distro" == "fedora" ];then
@@ -242,9 +351,14 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
echo "You can run 'sudo systemctl status xkeysnail' for more info"
echo "You can also run 'sudo journalctl -u xkeysnail'"
fi
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
echo "Expected argument was not provided"
else
echo ""
if $vssublime ; then
echo -e "\e[1m\e[32mEnabled\e[0m VS Code Sublime Text remap."
fi
if $rightalt ; then
echo -e "\e[1m\e[32mEnabled\e[0m mutli-language support."
fi
elif [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo "Uninstalling Kinto - xkeysnail (udev)"
uninstall
# Undo Apple keyboard cmd & alt swap
@@ -263,5 +377,10 @@ else
sudo rm /usr/lib/systemd/system/xkeysnail.service
sudo systemctl daemon-reload
sudo systemctl --state=not-found --all | grep xkeysnail
budgieUninstall
exit 0
fi
elif [[ $1 == "5" || $1 == "budgieUpdate" ]]; then
budgieUpdate
else
echo "Expected argument was not provided"
fi