Compare commits
158 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1e46a4dc74 | ||
![]() |
7aeb3dc44c | ||
![]() |
6968e08f2f | ||
![]() |
40ea2b6175 | ||
![]() |
367d55b04b | ||
![]() |
2864ae409a | ||
![]() |
e477848b59 | ||
![]() |
26dacc7984 | ||
![]() |
a3d8ac782a | ||
![]() |
acd0b8031e | ||
![]() |
9543eba753 | ||
![]() |
738aee9465 | ||
![]() |
dc826b8454 | ||
![]() |
8bd6ed242f | ||
![]() |
d96e238550 | ||
![]() |
e1948dcb08 | ||
![]() |
7e0680ff75 | ||
![]() |
a46bb911c9 | ||
![]() |
f4cad2a1e3 | ||
![]() |
ba10ff6ced | ||
![]() |
089fe469a5 | ||
![]() |
f39323071a | ||
![]() |
85d6653261 | ||
![]() |
c7c063ada5 | ||
![]() |
6a866dec54 | ||
![]() |
d52d8cc34f | ||
![]() |
70774c3431 | ||
![]() |
da22daf1f3 | ||
![]() |
918f4bbf94 | ||
![]() |
065dad7ce3 | ||
![]() |
032c317c7e | ||
![]() |
80735aefaa | ||
![]() |
39bd27ec25 | ||
![]() |
f57b02849a | ||
![]() |
da98afe154 | ||
![]() |
bbb1429c8e | ||
![]() |
9a1e66620b | ||
![]() |
d527347bdc | ||
![]() |
efc772d687 | ||
![]() |
7fcd94fda5 | ||
![]() |
5a46aad268 | ||
![]() |
c66dcbca9a | ||
![]() |
72bedf856d | ||
![]() |
3d9d2524a2 | ||
![]() |
8848f8cbea | ||
![]() |
f5318c9807 | ||
![]() |
de42816a01 | ||
![]() |
1acc948fbc | ||
![]() |
7174904434 | ||
![]() |
b5ab41de9d | ||
![]() |
86582466cf | ||
![]() |
cc05da2f59 | ||
![]() |
2b9598c84f | ||
![]() |
7f9ccabf77 | ||
![]() |
2249c4538d | ||
![]() |
fb630a7d33 | ||
![]() |
28e5141079 | ||
![]() |
d29579e0a5 | ||
![]() |
dcd8191bfb | ||
![]() |
5b4269fc1f | ||
![]() |
1fc62a54da | ||
![]() |
4c8d8412b8 | ||
![]() |
6cb66a6b72 | ||
![]() |
7c36021642 | ||
![]() |
3622eeb279 | ||
![]() |
a82632fc63 | ||
![]() |
3d55b232a9 | ||
![]() |
d68ca6226c | ||
![]() |
9d5ac9142b | ||
![]() |
87a4c6934d | ||
![]() |
7b67a4988e | ||
![]() |
f0404299ac | ||
![]() |
894c7b7a69 | ||
![]() |
bcabd5d65b | ||
![]() |
ffab720b50 | ||
![]() |
57d430ae36 | ||
![]() |
49613ec470 | ||
![]() |
7c1f92db5b | ||
![]() |
329e821440 | ||
![]() |
046eaa05cd | ||
![]() |
7c0a431472 | ||
![]() |
1b2e7ab57b | ||
![]() |
ea78de7909 | ||
![]() |
dae728d04a | ||
![]() |
6578065024 | ||
![]() |
8f22bc63ff | ||
![]() |
1ed7fa5f73 | ||
![]() |
c9f7b81796 | ||
![]() |
4f259481f4 | ||
![]() |
3143f11d4b | ||
![]() |
520ea7683b | ||
![]() |
ba1471e397 | ||
![]() |
a00998b1e3 | ||
![]() |
cbb60668e3 | ||
![]() |
1a0c99a763 | ||
![]() |
0275669be1 | ||
![]() |
e741989128 | ||
![]() |
0adc44907c | ||
![]() |
7a2aac9d79 | ||
![]() |
3899fcf596 | ||
![]() |
f3df35662b | ||
![]() |
20c93600e1 | ||
![]() |
1ab00452b0 | ||
![]() |
c0bfec035f | ||
![]() |
712b2e0e69 | ||
![]() |
eb576a6217 | ||
![]() |
06180c3517 | ||
![]() |
8b07fb9037 | ||
![]() |
b34dc4e928 | ||
![]() |
7a07382d30 | ||
![]() |
2ffe639024 | ||
![]() |
8dc05e7ace | ||
![]() |
4c5cb36503 | ||
![]() |
8fdaaf592d | ||
![]() |
6b4c697dd0 | ||
![]() |
e2a767fbec | ||
![]() |
7fe9230b5f | ||
![]() |
1d088b2e1d | ||
![]() |
e63d8ee5b5 | ||
![]() |
e3d42651b7 | ||
![]() |
42c04d062e | ||
![]() |
ca54bf89d6 | ||
![]() |
772413a9c3 | ||
![]() |
bbd7b3fc93 | ||
![]() |
98120062eb | ||
![]() |
637a8fecaa | ||
![]() |
ad53b7034d | ||
![]() |
896c6fd6a1 | ||
![]() |
dbaf02f884 | ||
![]() |
79857af79c | ||
![]() |
53206855f4 | ||
![]() |
6298c6c9cc | ||
![]() |
318efcc3fd | ||
![]() |
2567f5006e | ||
![]() |
fd648d3850 | ||
![]() |
ac34350392 | ||
![]() |
8df691a52d | ||
![]() |
11f8e33fdf | ||
![]() |
7de111726b | ||
![]() |
5a12521b58 | ||
![]() |
ad196c4d6b | ||
![]() |
17a877c693 | ||
![]() |
0c3e03a81b | ||
![]() |
163117d4fb | ||
![]() |
4c8ae68027 | ||
![]() |
ed771f4ae4 | ||
![]() |
9d5c7b6230 | ||
![]() |
b85b786dcc | ||
![]() |
7904be6d5c | ||
![]() |
df5d2d8c0e | ||
![]() |
a556f1afa9 | ||
![]() |
61fe293af8 | ||
![]() |
3ac264ea99 | ||
![]() |
32111fe5a4 | ||
![]() |
dff590e7df | ||
![]() |
bc27f3c205 | ||
![]() |
4c820d9f67 | ||
![]() |
8e6f1962e0 |
17
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -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
@@ -2,3 +2,5 @@
|
||||
.DS_Store
|
||||
__pycache__/
|
||||
xkeysnail/
|
||||
keybindings_*
|
||||
mutter_*
|
||||
|
283
README.md
@@ -1,28 +1,77 @@
|
||||
# Kinto
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
[](https://github.com/rbreaves/kinto/releases/latest)
|
||||
|
||||
\- Type in Linux & Windows like it's a Mac. \-
|
||||
|
||||
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.)
|
||||
Seamless copy and paste with all apps and terminals. The zero effort solution.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
[What does this do exactly?](#What-does-this-do-exactly)
|
||||
|
||||
[What's different from other remappers?](#Whats-different)
|
||||
|
||||
[What does Kinto require?](#What-does-Kinto-require)
|
||||
|
||||
[How to install (Linux)](#How-to-install-Linux)
|
||||
|
||||
[How to install (Windows)](#How-to-install-Windows)
|
||||
|
||||
[Shortcut Creation](#Shortcut-Creation)
|
||||
|
||||
[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|
|
||||
|
||||
## What's different?
|
||||
|
||||
Compared to most other remappers ***this is a complete system-wide remap of your base level modifier keys*** , this saves time. You're not going to die a death of thousand papercuts from trying to support every shortcut key under the sun.
|
||||
|
||||
It also retains some of the most commonly used system level shortcut keys, such as Cmd-C/V, Cmd-Tab, and Ctrl-Tab among others. You will keep seamless copy & paste between all apps, ability to switch Windows while still using the physical Cmd/Alt key position; switch tabs in your favorite terminals, code editors, or web browsers. Depending on your OS and/or Desktop Environment you may also be able to switch Virtual Desktop environments the same way as well and other basic system level shortcuts.
|
||||
|
||||
If your OS and macOS have similar functionality on the system level, but only differ by a slight difference of a shortcut command then Kinto likely supports it already. If Kinto doesn't have what you need then you can open up a support ticket and it will be added. You can also fork the project to add the fix and I will merge it via a PR you make.
|
||||
|
||||
Additionally, if you are using a cross-platform app and if it happens to have a few shortcut keys that differ then that can very easily be added to either the kinto.py or kinto.ahk configuration files which on Windows is located here `~/.kinto/kinto.ahk` and on Linux it can be found here `~/.config/kinto/kinto.py`. More info can be found here [Shortcut Creation (Xkeysnail)](#Shortcut-Creation-Xkeysnail) for Linux.
|
||||
|
||||
## What does Kinto require?
|
||||
|
||||
- Python (initial install only)
|
||||
- Python
|
||||
- systemd
|
||||
- x11
|
||||
- IBus*
|
||||
@@ -36,23 +85,31 @@ 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
|
||||
- [Git for Windows](https://git-scm.com/download/win)
|
||||
- Powershell - run as Administrator
|
||||
- Python3
|
||||
- [Python3](https://www.python.org/downloads/windows/)
|
||||
|
||||
Other programs that will be installed when you run ./setup.py
|
||||
- Chocolatey
|
||||
- Autohotkey
|
||||
- Strawberry Perl
|
||||
|
||||
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.
|
||||
|
||||
## How to install
|
||||
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 (Linux)
|
||||
|
||||
1. clone this repo
|
||||
```
|
||||
git clone https://github.com/rbreaves/kinto.git
|
||||
cd kinto
|
||||
```
|
||||
2. Install python3 (If needed)
|
||||
|
||||
@@ -73,7 +130,43 @@ To Uninstall Kinto
|
||||
./setup.py
|
||||
```
|
||||
|
||||
## Shortcut Creation (Xkeysnail)
|
||||
## How to Install (Windows)
|
||||
|
||||
Video Tutorial: [How to Install Kinto.sh on Windows 10](https://youtu.be/sRk8A8krz40)
|
||||
|
||||
1. Open Powershell (Right click and Run as Administrator)
|
||||
|
||||
2. clone this repo
|
||||
```
|
||||
git clone https://github.com/rbreaves/kinto.git
|
||||
cd kinto
|
||||
```
|
||||
3. Install - Select keyboard type
|
||||
```
|
||||
py setup.py
|
||||
```
|
||||
|
||||
4. How to make Kinto stay visible in system tray (optional)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195077-2f338c00-b295-11ea-8aa3-e6aa06a9a279.png" width="50%" height="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195079-30fd4f80-b295-11ea-8bcd-257990b77dcb.png" width="50%" height="50%">
|
||||
<img src="https://user-images.githubusercontent.com/10969616/85195082-322e7c80-b295-11ea-8c81-320dab424c3c.png" width="50%" height="50%">
|
||||
|
||||
To Uninstall Kinto - Select Uninstall
|
||||
|
||||
```
|
||||
py setup.py
|
||||
```
|
||||
## Shortcut Creation
|
||||
|
||||
Note: A new project, [Universal Keys](https://github.com/rbreaves/Universal-Keys), has been created that will be updated to contain all current remaps - plus many more. Once that is done, Kinto will be updated to programmatically pull the latest keymaps from simple csv comma delimited files & will build out key remaps from there. This will also allow for more types of remaps within an application category, Sublime Text 3 to VS Code or VS Code to Sublime Text 3, Photoshop to Gimp, Gimp to Photoshop, etc & it will ensure that xkeysnail (linux) & autohotkey (windows) are pulling from the same data set.
|
||||
|
||||
[Linux Shortcut Creation (Xkeysnail)](#Linux-Xkeysnail)
|
||||
|
||||
[Windows Shortcut Creation (Autohotkey)](#Windows-Autohotkey)
|
||||
|
||||
|
||||
## Linux (Xkeysnail)
|
||||
|
||||
**GUI Keys**
|
||||
| Value| Description|Mac/Kinto Equivalent|
|
||||
@@ -111,6 +204,46 @@ sudo systemctl restart xkeysnail
|
||||
|
||||
More information can be seen on the readme page of [xkeysnail](https://github.com/mooz/xkeysnail).
|
||||
|
||||
## Windows (Autohotkey)
|
||||
|
||||
This applies to the Windows version of Kinto and how to add additional support for Applications. The configuration file location is `~/.kinto/kinto.ahk` and after updating it you will want to right click on the tray icon and click on setting your keyboard type again and it will re-apply the latest changes.
|
||||
|
||||
Windows 10 has a couple of ways that you need to be aware of when trying to add a specific application, the typical method of how to add any exe program, but then there is also the newer UWP app format that some applications use which will require a similar but different method, both will be discussed.
|
||||
|
||||
### Defining Keymaps Per App by EXE Name
|
||||
You can use the following legend **but** realize that these remaps reference the Virtual keys in the diagrams mentioned near the beginning of this document, so **do not** confuse it with the physical key unless they happen to be the same key.
|
||||
|
||||
|Autohotkey Symbol|Virtual key|Description|
|
||||
|---|---|---|
|
||||
|^,Ctrl|Control|Primary modifier, 1st rock from the spacebar|
|
||||
|!,Alt|Alt|Secondary modifier, 2nd rock from the spacebar|
|
||||
|#,Win|Win/Super|Tertiary modifier, 3rd rock from the spacebar|
|
||||
|
||||
```
|
||||
...
|
||||
#IfWinActive ahk_exe sublime_text.exe
|
||||
#^Up::send !{O} ; Switch file
|
||||
#^f::send {F11} ; toggle_full_screen
|
||||
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history
|
||||
...
|
||||
#If
|
||||
...
|
||||
```
|
||||
|
||||
With this being Autohotkey you can easily pull knowledge from the Autohotkey forums for just about any issue you may have as well.
|
||||
|
||||
### Defining Keymaps Per UWP App
|
||||
|
||||
```
|
||||
#If WinActive("- OneNote ahk_class ApplicationFrameWindow", "OneNote")
|
||||
...
|
||||
; Add your keymaps here
|
||||
...
|
||||
#If
|
||||
```
|
||||
|
||||
I don't have too many examples on this one, most developers seem to be shying away from UWP. Kinto currently supports "Fluent Terminal" which is a UWP app, but it is also being grouped with other Terminal apps for hotkey remapping. You may take a look at that, but you may also want to try creating a new Autohotkey file and use the Window Spy feature built into Autohotkey to help you discover the full name and class names of any application.
|
||||
|
||||
## Shortcut Creation (XKB)
|
||||
The older xkb shortcut method info can be read about in ticket [#125](https://github.com/rbreaves/kinto/issues/125).
|
||||
|
||||
@@ -191,7 +324,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.
|
||||
@@ -203,6 +335,21 @@ systemctl --user stop keyswap && setxkbmap -option;setxkbmap -option altwin:swap
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Installed successfully, but modifier keys are not properly remapped?
|
||||
|
||||
Are you using a VM on macOS? If so you may need to disable automatic remapping of the Cmd key when using Vmware Fusion of Parallels.
|
||||
|
||||
Disable Parallels Re-mapping:
|
||||
1) Open Parallels and go to Preferences.
|
||||
2) Click Keyboard and disable the Virtual machine shortcuts.
|
||||
3) Close Preferences.
|
||||
|
||||
To disable keyboard mapping:
|
||||
1) From Fusion's menu bar, click VMware Fusion > Preferences...
|
||||
2) Click Keyboard & Mouse.
|
||||
3) Click the Key Mappings tab.
|
||||
4) Deselect Enable Key Mapping.
|
||||
|
||||
### Does not start when you log in or after you reboot?
|
||||
|
||||
Kinto (xkb/x11) = keyswap
|
||||
@@ -278,7 +425,7 @@ cd ~/.config/kinto
|
||||
./kintox11
|
||||
```
|
||||
|
||||
## Debug
|
||||
## Debug (Linux - xkb method only)
|
||||
|
||||
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.
|
||||
|
||||
@@ -321,10 +468,100 @@ 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
|
||||
|
||||
[mac-precision-touchpad](https://github.com/imbushuo/mac-precision-touchpad) by imbushuo
|
||||
|
||||
Windows 10 touchpad to precision touchpad driver
|
||||
|
||||
[fusuma](https://github.com/iberianpig/fusuma) by iberianpig
|
||||
|
||||
Multitouch gestures with libinput driver on Linux
|
||||
|
||||
[Facetime HD Camera for Linux](https://github.com/patjak/bcwc_pcie) by patjak
|
||||
|
||||
Linux driver for Facetime HD on macbooks
|
||||
|
||||
[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
|
||||
|
||||
@@ -347,7 +584,7 @@ GPL v2
|
||||
|
||||
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.
|
||||
First off I'd like to thank the Stackoverflow and Stackexchange community. I have probably rubbed some mods the wrong way over there, but the people from the community in general are extremely helpful and gracious and without their contributions would have made this much more difficult. The person I'd like to thank most though from over there is Glen Whitney. Without his detailed explaining of how to rebind keys in xkb this would not have come together at all, as every other remapping solution were non-starters as complexity increases. *Kinto today no longer uses xkb, but Glen Whitney did provide the basis of a workable method that helped me pursue this method and think it was a worthwhile project to pursue, so for that I thank him.*
|
||||
|
||||
Secondarily I'd like to thank Christian Eriksson*, as he provided information that kept me up at night.. literally. Even after I implemented a similar bash script to one he had suggested I knew that fully implementing a c/c++ solution was where Kinto needed to head to and his 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.
|
||||
|
||||
@@ -356,6 +593,10 @@ Kui and his gist file** was really the c based solution that I found had the few
|
||||
|
||||
Lastly these four people were also very helpful to me as well. @probonopd for being one of the first people to install and use Kinto and gave me the initial feedback to include wordwise support! He also has really great articles*** posted on HackerNews & Medium about UI/UX design. Another person I'd like to thank is @owzim, his feedback allowed me to rapidly iterate and fix several bugs to support additional platforms better. The last two are members of the #ubuntu channel in IRC on freenode, tarzeau ( @alexmyczko ) and sarnold. Alex contributing a proper Makefile, so the project can be packaged properly, and sarnold help me find that IBus could resolve an issue I was having with needing to detect the caret status.
|
||||
|
||||
**Updated 6/13/2020**
|
||||
|
||||
I would also like to thank Jonathan Chun for his patience in helping me work through a very difficult problem related to Alt-Tab switching, which led to the current xkeysnail iteration of Kinto for Linux that far exceeds the original xkb implementation. There are also several others that have created issue tickets that have contributed greatly.
|
||||
|
||||
If I left anyone out then I apologize, that was not intentional. I am happy to say that this project is at a state of completion. Bug fixes will primarily be the only activity happening going forward and possibly a rewrite for Wayland at some point. Contributions as mentioned above are welcomed, and will be merged into master if they help with the goal of making typing on linux more like a mac.
|
||||
|
||||
*https://askubuntu.com/questions/1010276/can-i-act-on-the-event-that-a-window-opens-without-polling
|
||||
|
BIN
assets/kinto-black-invert.ico
Normal file
After Width: | Height: | Size: 99 KiB |
BIN
assets/kinto-black.ico
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
assets/kinto-color-black-invert.ico
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
assets/kinto-color-black.ico
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
assets/kinto-color-invert-border.ico
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
assets/kinto-color-invert.ico
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
assets/kinto-color-white-invert.ico
Normal file
After Width: | Height: | Size: 105 KiB |
BIN
assets/kinto-color.ico
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
assets/kinto-white-invert.ico
Normal file
After Width: | Height: | Size: 101 KiB |
BIN
assets/kinto-white.ico
Normal file
After Width: | Height: | Size: 102 KiB |
344
keycheck.py
Executable file
@@ -0,0 +1,344 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# pip3 install pynput
|
||||
# pip3 install --no-deps pynput
|
||||
|
||||
# from pynput.keyboard import Key, Listener
|
||||
import sys, subprocess, time, os
|
||||
from subprocess import PIPE, Popen
|
||||
delay=3
|
||||
|
||||
def cmdline(command):
|
||||
process = Popen(
|
||||
args=command,
|
||||
stdout=PIPE,
|
||||
universal_newlines=True,
|
||||
shell=True
|
||||
)
|
||||
return process.communicate()[0]
|
||||
|
||||
class color:
|
||||
PURPLE = '\033[95m'
|
||||
CYAN = '\033[96m'
|
||||
DARKCYAN = '\033[36m'
|
||||
BLUE = '\033[94m'
|
||||
GREEN = '\033[92m'
|
||||
YELLOW = '\033[93m'
|
||||
RED = '\033[91m'
|
||||
BOLD = '\033[1m'
|
||||
UNDERLINE = '\033[4m'
|
||||
END = '\033[0m'
|
||||
|
||||
def countdown(secs):
|
||||
for i in range(0,secs):
|
||||
print(secs-i, end="\r", flush=True)
|
||||
time.sleep(1)
|
||||
|
||||
def on_press(key):
|
||||
print('{0} pressed'.format(key))
|
||||
|
||||
def on_release(key):
|
||||
# print('{0} release'.format(key))
|
||||
if key == Key.esc:
|
||||
# Stop listener
|
||||
return False
|
||||
|
||||
def yn_choice(message, default='y'):
|
||||
choices = 'Y/n' if default.lower() in ('y', 'yes') else 'y/N'
|
||||
choice = input("%s (%s) " % (message, choices))
|
||||
values = ('y', 'yes', '') if choices == 'Y/n' else ('y', 'yes')
|
||||
return choice.strip().lower() in values
|
||||
|
||||
modifier_keys = {
|
||||
"primary":"",
|
||||
"secondary":"",
|
||||
"rprimary":"",
|
||||
"rsecondary":"",
|
||||
"capslock":"",
|
||||
"capswap":""
|
||||
}
|
||||
|
||||
def set_key(key):
|
||||
global modifier_keys
|
||||
print("\nWhich key would you like to set?\n")
|
||||
|
||||
while True:
|
||||
try:
|
||||
keytype = int(input(
|
||||
"1) Ctrl\n" +
|
||||
"2) Alt\n" +
|
||||
"3) Super/Win/Cmd/Chrome search key\n"))
|
||||
if keytype < 4 and keytype > 0:
|
||||
break
|
||||
except:
|
||||
print("That's not a valid option!")
|
||||
print("")
|
||||
if keytype == 1:
|
||||
modifier_keys[key] = "Ctrl"
|
||||
elif keytype == 2:
|
||||
modifier_keys[key] = "Alt"
|
||||
elif keytype == 3:
|
||||
modifier_keys[key] = "Cmd"
|
||||
|
||||
def set_cap():
|
||||
global modifier_keys
|
||||
print("\nWhich key would you like to swap?\n")
|
||||
|
||||
while True:
|
||||
try:
|
||||
keytype = int(input(
|
||||
"1) Ctrl (swap)\n" +
|
||||
"2) Ctrl (duplicate)\n" +
|
||||
"3) Esc (swap)\n"))
|
||||
if keytype < 4 and keytype > 0:
|
||||
break
|
||||
except:
|
||||
print("That's not a valid option!")
|
||||
print("")
|
||||
if keytype == 1:
|
||||
modifier_keys["capslock"] = "Ctrl-swap"
|
||||
elif keytype == 2:
|
||||
modifier_keys["capslock"] = "Ctrl-dup"
|
||||
elif keytype == 3:
|
||||
modifier_keys["capswap"] = "Escape"
|
||||
|
||||
def is_primary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["primary"] = str(key).replace("Key.", "").title()
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["primary"] = "Escape"
|
||||
# countdown(3)
|
||||
else:
|
||||
return True
|
||||
return False
|
||||
|
||||
def is_secondary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["secondary"] = str(key).replace("Key.", "").title()
|
||||
return False
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["secondary"] = "Escape"
|
||||
# countdown(3)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def is_rprimary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["rprimary"] = str(key).replace("Key.", "").title()
|
||||
return False
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["rprimary"] = "Escape"
|
||||
# countdown(3)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def is_rsecondary(key):
|
||||
global modifier_keys
|
||||
if not (str(key).replace("Key.", "").title() == "Enter" or str(key).replace("Key.", "").title() == "Escape"):
|
||||
print(str(key).replace("Key.", "").title() + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
# countdown(3)
|
||||
modifier_keys["rsecondary"] = str(key).replace("Key.", "").title()
|
||||
return False
|
||||
elif str(key).replace("Key.", "").title() == "Escape":
|
||||
modifier_keys["rsecondary"] = "Escape"
|
||||
# countdown(3)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPlease ignore the FN key." + color.END + " FN cannot be remapped by software, some Thinkpads can swap it with Ctrl in the BIOS.\n")
|
||||
input("Press Enter to continue...\n\n")
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
counter = 0
|
||||
|
||||
while True:
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 1st key Left of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" □ □ ▣ ░░░░░░░\n")
|
||||
# listener = Listener(on_release=is_primary,suppress=True)
|
||||
# listener.start()
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_primary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
|
||||
modifier_keys["primary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["primary"] + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
|
||||
if modifier_keys["primary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# print("Left Physical " + modifier_keys["primary"] + " = Ctrl/Cmd ⌘")
|
||||
# listener.stop()
|
||||
# input("Press Enter to continue...\n\n")
|
||||
break
|
||||
else:
|
||||
set_key("primary")
|
||||
print("Left Physical " + modifier_keys["primary"] + " = Ctrl/Cmd ⌘\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
counter += 1
|
||||
print(str(counter)+"\n")
|
||||
time.sleep(1)
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
while True:
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 2nd key Left of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" □ ▣ □ ░░░░░░░\n")
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_secondary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
modifier_keys["secondary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["secondary"] + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
|
||||
if modifier_keys["secondary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# listener.stop()
|
||||
# print("Left Physical " + modifier_keys["secondary"] + " = Alt/Option ⌥")
|
||||
# input("Press Enter to continue...\n\n")
|
||||
break
|
||||
else:
|
||||
set_key("secondary")
|
||||
print("Left Physical " + modifier_keys["secondary"] + " = Alt/Option ⌥\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
while True:
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 1st key Right of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" ░░░░░░░ ▣ □")
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_rprimary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
modifier_keys["rprimary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["rprimary"] + " will be remapped to Ctrl, the Cmd ⌘ key position.")
|
||||
|
||||
if modifier_keys["rprimary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# listener.stop()
|
||||
# print("Right Physical " + modifier_keys["rprimary"] + " = Ctrl/Cmd ⌘")
|
||||
# input("Press Enter to continue...\n\n")
|
||||
break
|
||||
else:
|
||||
set_key("rprimary")
|
||||
print("Right Physical " + modifier_keys["rprimary"] + " = Ctrl/Cmd ⌘\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
while True:
|
||||
print(color.UNDERLINE + color.YELLOW + "\n\nPress the 2nd key Right of the spacebar" + color.END + " (Press Esc to set manaully)\n")
|
||||
print(" 👇")
|
||||
print(" ░░░░░░░ □ ▣")
|
||||
|
||||
# with Listener(
|
||||
# on_release=is_rsecondary,suppress=True) as listener:
|
||||
# try:
|
||||
# listener.join()
|
||||
# except MyException as e:
|
||||
# print('{0} was pressed'.format(e.args[0]))
|
||||
modifier_keys["rsecondary"] = cmdline("xbindkeys -k | awk 'END {print $NF}'").strip()
|
||||
print(modifier_keys["rsecondary"] + " will be remapped to Alt, the Option ⌥ key position.")
|
||||
|
||||
if modifier_keys["rsecondary"] != "Escape":
|
||||
choice = yn_choice("Is this correct?")
|
||||
if(choice):
|
||||
# listener.stop()
|
||||
# print("Right Physical " + modifier_keys["rsecondary"] + " = Alt/Option ⌥")
|
||||
# modifier_keys["rsecondary"] = str(os.system("xbindkeys -k | awk 'END {print $NF}'"))
|
||||
break
|
||||
else:
|
||||
set_key("rsecondary")
|
||||
print("Right Physical " + modifier_keys["rsecondary"] + " = Alt/Option ⌥\n")
|
||||
# listener.stop()
|
||||
input("Press Enter to continue...\n\n")
|
||||
break
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
if not (modifier_keys["secondary"] == "Ctrl" or modifier_keys["secondary"] == "Control_R"):
|
||||
print(color.UNDERLINE + color.YELLOW + "GUI Usage (Physical Ctrl key)\n"+ color.END)
|
||||
print("Ctrl key will be mapped to Super. (Search key on chromebooks)")
|
||||
print("👇")
|
||||
print(" ▣ □ □ ░░░░░░░\n")
|
||||
|
||||
print("Note: Super may still activate Ctrl based shortcuts\n")
|
||||
print("at times depending on application or system level shortcuts.\n")
|
||||
print("This will only be done to align shortcuts to their expected functionality.\n")
|
||||
|
||||
input("Press Enter to continue...\n\n")
|
||||
# print(chr(27) + "[2J")
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "Terminal Usage" + color.END + "\n")
|
||||
print("Ctrl key will be the Ctrl key.")
|
||||
print("👇")
|
||||
print(" ▣ □ □ ░░░░░░░\n")
|
||||
print("The Cmd ⌘ key position during terminal usage will usually be Ctrl+Shift.")
|
||||
print(" 👇 ")
|
||||
print(" □ □ ▣ ░░░░░░░\n")
|
||||
input("Press Enter to continue...\n")
|
||||
else:
|
||||
print("Chromebook detected.")
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "GUI Usage\n"+ color.END)
|
||||
print("Search key (capslock position) on chromebooks will be Super\n")
|
||||
|
||||
print("Note: Super may still activate Ctrl based shortcuts")
|
||||
print("at times depending on application or system level shortcuts.\n")
|
||||
print("Efforts have been made though to use the physical Ctrl key")
|
||||
print("when it makes sense to do so, and more often than standard")
|
||||
print("keyboards. How it feels to type is more important than technical")
|
||||
print("accuracy.\n")
|
||||
print("If you believe an improvement can be made or an error was made")
|
||||
print("please let me know on github or you can fork this project.\n")
|
||||
|
||||
input("Press Enter to continue...\n\n")
|
||||
|
||||
print(color.UNDERLINE + color.YELLOW + "Terminal Usage" + color.END + "\n")
|
||||
print(" □ capslock/search key = Alt")
|
||||
print(" shift")
|
||||
print(" ▣ □ ░░░░░░░")
|
||||
print("☝️\n")
|
||||
|
||||
input("Press Enter to continue...\n\n")
|
||||
|
||||
print(chr(27) + "[2J")
|
||||
|
||||
choice = yn_choice(color.UNDERLINE + color.YELLOW + "Do you want to swap Capslock with another key?" + color.END + "\n","n")
|
||||
if(choice):
|
||||
set_cap()
|
229
setup.py
@@ -1,11 +1,66 @@
|
||||
#!/usr/bin/env python3
|
||||
import json, time, os, sys, subprocess, shlex
|
||||
import json, time, os, sys, subprocess, shlex, platform
|
||||
from shutil import copyfile
|
||||
from subprocess import PIPE, Popen
|
||||
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]
|
||||
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"')
|
||||
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('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
elif default == 2:
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" .\\windows\\kinto-new.ahk')
|
||||
elif default == 3:
|
||||
print("Removing any old registry keys from prior versions...")
|
||||
p = subprocess.Popen(['powershell.exe', "Remove-ItemProperty -Path HKLM:'SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -ErrorAction SilentlyContinue"], stdout=sys.stdout)
|
||||
print("Removing Kinto from Startup folder...")
|
||||
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2> nul")
|
||||
os.system('(del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs") 2> nul')
|
||||
print("Ending any running Kinto tasks...")
|
||||
os.system("(taskkill /IM autohotkey.exe) 2> nul")
|
||||
print("Removing Kinto from users profile directory...")
|
||||
os.system('(rd /s /q %userprofile%\\.kinto) 2> nul')
|
||||
print("")
|
||||
print("Uninstall of Kinto is Complete.")
|
||||
if default > 0 and default < 3:
|
||||
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
|
||||
print("\nWill now install Ubuntu Termimnal Theme as default...")
|
||||
os.system("regedit " + path + "\\windows\\theme_ubuntu.reg")
|
||||
os.system('robocopy '+ path + '\\assets "%userprofile%\\.kinto\\assets" /E')
|
||||
if(stvscode):
|
||||
os.system('C:\\Strawberry\\perl\\bin\\perl.exe -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('copy /Y ' + path + '\\windows\\usb.vbs "%userprofile%\\.kinto\\usb.vbs"')
|
||||
os.system('copy /Y ' + path + '\\windows\\detectUSB.ahk "%userprofile%\\.kinto\\detectUSB.ahk"')
|
||||
os.system('mklink "%userprofile%\\Start Menu\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
|
||||
os.system('copy /Y '+ path + '\\windows\\NoShell.vbs "%userprofile%\\.kinto\\NoShell.vbs"')
|
||||
os.system('copy /Y '+ path + '\\windows\\toggle_kb.bat "%userprofile%\\.kinto\\toggle_kb.bat"')
|
||||
os.system('copy /Y '+ path + '\\windows\\kinto-new.ahk "%userprofile%\\.kinto\\kinto.ahk"')
|
||||
os.system("del /f .\\windows\\kinto-new.ahk")
|
||||
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\" 2> nul")
|
||||
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\") 2> nul")
|
||||
|
||||
def cmdline(command):
|
||||
process = Popen(
|
||||
args=command,
|
||||
@@ -14,9 +69,28 @@ def cmdline(command):
|
||||
shell=True
|
||||
)
|
||||
return process.communicate()[0]
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
print("\nYou are detected as running Windows.")
|
||||
windows_setup()
|
||||
sys.exit()
|
||||
|
||||
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 +133,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" or dename == "budgie":
|
||||
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):
|
||||
@@ -69,9 +143,19 @@ def setShortcuts():
|
||||
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']\"")
|
||||
#
|
||||
# Leaving run dialog disabled for now
|
||||
# Too slow on appearing, compared to the app menu
|
||||
#
|
||||
# if dename != "budgie":
|
||||
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":
|
||||
# else:
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Alt>F1']\"")
|
||||
# cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-run-dialog \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
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 == "ubuntu" and dename == "budgie") 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,8 +187,10 @@ 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":
|
||||
print("Applying GalliumOS (xfce) shortcuts...")
|
||||
# elif distro == "budgie" and dename == "gnome":
|
||||
# print("Apply budgie shortcuts here")
|
||||
elif (dename == "xfce"):
|
||||
print("Applying 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')
|
||||
@@ -168,7 +254,8 @@ def setShortcuts():
|
||||
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.")
|
||||
print(bcolors.CRED2 + "A supported OS and DE was not found, you may not have full system level shortcuts installed." + bcolors.ENDC)
|
||||
print(bcolors.CRED2 + "You may want to find your DE or Window Manager settings and manually set Alt-Tab & other OS related shortcuts." + bcolors.ENDC)
|
||||
if dename == "gnome":
|
||||
# Apply dconf update to make updates survive reboots
|
||||
cmdline('dconf dump /org/gnome/desktop/wm/keybindings/ > tempkb.conf')
|
||||
@@ -178,38 +265,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 +273,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 +325,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 +419,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 +430,8 @@ if(kintotype == 4):
|
||||
Uninstall()
|
||||
exit()
|
||||
|
||||
kintoImpOne()
|
||||
|
||||
for index, item in enumerate(data['defaulttypes']):
|
||||
ossym = ""
|
||||
if item == "windows":
|
||||
|
1
system-config/budgie-daemon_10.5.1.md5
Normal file
@@ -0,0 +1 @@
|
||||
3cd35e15350ca7dac0c3cbfce1c661f7 /usr/bin/budgie-daemon
|
1
system-config/budgie-desktop_10.5.1.md5
Normal file
@@ -0,0 +1 @@
|
||||
8660c2f8e0a9d3cff896254f6c0f9159 /usr/bin/budgie-desktop
|
@@ -1,167 +1,182 @@
|
||||
#!/bin/bash
|
||||
|
||||
function detect_budgie()
|
||||
{
|
||||
ps -e | grep -E '^.* budgie-wm' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`dpkg-query -l | grep budgie-core | awk '{print $3}'`
|
||||
DESKTOP="budgie"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_gnome()
|
||||
{
|
||||
ps -e | grep -E '^.* gnome-session' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
ps -e | grep -E '^.* cinnamon$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
VERSION=`cinnamon --version | awk '{print $2}'`
|
||||
DESKTOP="cinnamon"
|
||||
return 1
|
||||
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
|
||||
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
|
||||
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
|
||||
ps -e | grep -E '^.* lxsession$' > /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# We can detect LXDE version only thru package manager
|
||||
which apt-cache > /dev/null 2> /dev/null
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
# 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'
|
||||
VERSION='unknown'
|
||||
else
|
||||
# For Fedora
|
||||
VERSION=`yum list lxde-common | grep lxde-common | awk '{print $2}' | awk -F '-' '{print $1}'`
|
||||
# For Fedora
|
||||
VERSION=`yum list lxde-common | grep lxde-common | awk '{print $2}' | awk -F '-' '{print $1}'`
|
||||
fi
|
||||
else
|
||||
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
|
||||
fi
|
||||
DESKTOP="lxde"
|
||||
return 1
|
||||
}
|
||||
|
||||
function detect_sugar()
|
||||
{
|
||||
if [ "$DESKTOP_SESSION" == "sugar" ];
|
||||
then
|
||||
if [ "$DESKTOP_SESSION" == "sugar" ];
|
||||
then
|
||||
VERSION=`python -c "from jarabe import config; print config.version"`
|
||||
DESKTOP="sugar"
|
||||
else
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
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
|
||||
if detect_kde;
|
||||
then
|
||||
if detect_kde4;
|
||||
then
|
||||
if detect_budgie;
|
||||
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
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" == '-v' ];
|
||||
then
|
||||
echo $VERSION
|
||||
echo $VERSION
|
||||
else
|
||||
if [ "$1" == '-n' ];
|
||||
then
|
||||
if [ "$1" == '-n' ];
|
||||
then
|
||||
echo $DESKTOP
|
||||
else
|
||||
else
|
||||
echo $DESKTOP $VERSION
|
||||
fi
|
||||
fi
|
||||
fi
|
3630
system-config/keyboard.ids
Normal 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
|
||||
|
@@ -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
|
||||
|
@@ -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
@@ -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
|
@@ -1,12 +1,22 @@
|
||||
$testchoco = powershell choco -v
|
||||
if(-not($testchoco)){
|
||||
if(-not(Get-Command "choco" -errorAction SilentlyContinue)){
|
||||
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'))
|
||||
refreshenv
|
||||
}
|
||||
else{
|
||||
Write-Output "Chocolatey Version $testchoco is already installed"
|
||||
Write-Output "Chocolatey is already installed"
|
||||
}
|
||||
|
||||
if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){
|
||||
choco install autohotkey.install
|
||||
}
|
||||
else{
|
||||
Write-Output "Autohotkey is already installed"
|
||||
}
|
||||
if(-not(test-path "C:\Strawberry\")){
|
||||
choco install strawberryperl
|
||||
refreshenv
|
||||
}
|
||||
else{
|
||||
Write-Output "Perl is already installed"
|
||||
}
|
||||
|
39
windows/detectUSB.ahk
Normal file
@@ -0,0 +1,39 @@
|
||||
#SingleInstance, force
|
||||
#NoTrayIcon
|
||||
OnMessage(0x219, "notify_change")
|
||||
Return
|
||||
|
||||
lastkb = ""
|
||||
|
||||
DllCall("AllocConsole")
|
||||
WinHide % "ahk_id " DllCall("GetConsoleWindow", "ptr")
|
||||
|
||||
notify_change(wParam, lParam, msg, hwnd)
|
||||
{
|
||||
global lastkb
|
||||
; kbtype = % ComObjCreate("WScript.Shell").Exec("cscript /nologo usb.vbs").StdOut.ReadAll()
|
||||
DetectHiddenWindows On
|
||||
Run %ComSpec%,, Hide, pid
|
||||
WinWait ahk_pid %pid%
|
||||
DllCall("AttachConsole", "UInt", pid)
|
||||
WshShell := ComObjCreate("Wscript.Shell")
|
||||
exec := WshShell.Exec("cscript /nologo usb.vbs")
|
||||
kbtype := exec.StdOut.ReadAll()
|
||||
DllCall("FreeConsole")
|
||||
Process Close, %pid%
|
||||
if lastkb != %kbtype%
|
||||
{
|
||||
|
||||
if InStr(kbtype, "Apple")
|
||||
{
|
||||
; MsgBox, Apple
|
||||
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat mac, %A_ScriptDir%
|
||||
}
|
||||
else{
|
||||
; MsgBox, Windows
|
||||
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat win, %A_ScriptDir%
|
||||
}
|
||||
; MsgBox % kbtype
|
||||
}
|
||||
lastkb = %kbtype%
|
||||
}
|
7
windows/kinto-start.vbs
Normal 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
|
@@ -1,39 +1,194 @@
|
||||
#SingleInstance force
|
||||
#NoEnv
|
||||
#Persistent
|
||||
|
||||
DetectHiddenWindows, On
|
||||
Run, %A_ScriptDir%\detectUSB.ahk
|
||||
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white.ico ; MacModifiers
|
||||
; IfExist, %I_Icon% ; MacModifiers
|
||||
; Menu, Tray, Icon, %I_Icon%,, 1 ; MacModifiers
|
||||
; Menu, Tray, Tip, Mac - Kinto ; MacModifiers
|
||||
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers
|
||||
; IfExist, %I_Icon% ; WinModifiers
|
||||
; Menu, Tray, Icon, %I_Icon%,, 1 ; WinModifiers
|
||||
; Menu, Tray, Tip, Windows - Kinto ; WinModifiers
|
||||
|
||||
; 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
|
||||
|
||||
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
|
||||
I_Icon = %A_ScriptDir%\assets\kinto-color-invert.ico
|
||||
Menu, Tray, Icon, %I_Icon%,, 1
|
||||
Menu, Tray, Tip, Suspended - Kinto
|
||||
IfWinExist, detectUSB.ahk
|
||||
WinClose
|
||||
}
|
||||
else{
|
||||
menu, tray, unCheck, Suspend Kinto
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white.ico ; MacModifiers
|
||||
; I_Icon = %A_ScriptDir%\assets\kinto-white-invert.ico ; WinModifiers
|
||||
Menu, Tray, Icon, %I_Icon%,,1
|
||||
Run, %A_ScriptDir%\detectUSB.ahk
|
||||
}
|
||||
; Refocus last active Window
|
||||
Send {LAlt down}{tab}{LAlt up}
|
||||
}
|
||||
|
||||
Exit() {
|
||||
IfWinExist, detectUSB.ahk
|
||||
WinClose
|
||||
|
||||
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 mintty.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, posix, 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, browsers, ahk_exe chrome.exe
|
||||
GroupAdd, browsers, ahk_exe opera.exe
|
||||
GroupAdd, browsers, ahk_exe firefox.exe
|
||||
; Disabled Edge for now - no ability to close all instances
|
||||
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
|
||||
|
||||
; 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, vscode, ahk_exe VSCodium.exe
|
||||
GroupAdd, vscode, ahk_exe Code.exe
|
||||
|
||||
; Close Apps
|
||||
GroupAdd, vstudio, ahk_exe devenv.exe
|
||||
|
||||
; 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 +205,170 @@ $^+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}
|
||||
; Close all browsers
|
||||
#IfWinActive ahk_group browsers
|
||||
^q::send {Alt Down}f{Alt Up}x ; exit all windows
|
||||
#If
|
||||
|
||||
; Sublime Text Remaps for VS Code
|
||||
#IfWinActive ahk_group vscode
|
||||
; 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
|
||||
!+g::send ^+{G} ; View source control
|
||||
#If
|
||||
|
||||
#IfWinActive ahk_exe sublime_text.exe
|
||||
#^Up::send !{O} ; Switch file
|
||||
#^f::send {F11} ; toggle_full_screen
|
||||
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history
|
||||
^Up::Return ; cancel scroll_lines up
|
||||
^!Up::send ^{Up} ; scroll_lines up
|
||||
^Down::Return ; cancel scroll_lines down
|
||||
^!Down::send ^{Down} ; scroll_lines down
|
||||
#+Up::send {shift up}^!{Up} ; multi-cursor up
|
||||
#+Down::send {shift up}^!{Down} ; multi-cursor down
|
||||
^PgDn::Return ; cancel next_view
|
||||
^PgUp::Return ; cancel prev_view
|
||||
^+{::send ^{PgDn} ; next_view
|
||||
^+}::send ^{PgUp} ; prev_view
|
||||
^!Right::send ^{PgDn} ; next_view
|
||||
^!Left::send ^{PgUp} ; prev_view
|
||||
Insert::Return ; cancel toggle_overwrite
|
||||
^!O::send {Insert} ; toggle_overwrite
|
||||
!c::Return ; cancel toggle_case_sensitive
|
||||
^!c::send !{c} ; toggle_case_sensitive
|
||||
^h::Return ; cancel replace
|
||||
^!f::send ^{h} ; replace
|
||||
^+h::Return ; cancel replace_next
|
||||
^!e::send ^+{h} ; replace_next
|
||||
F3::Return ; cancel find_next
|
||||
^g::send {F3} ; find_next
|
||||
*F3::Return ; cancel find_prev, find_under, find_all_under
|
||||
^+g::send +{F3} ; find_prev
|
||||
#!g::send ^{F3} ; find_under
|
||||
#!+g::send ^+{F3} ; find_under_prev
|
||||
#^g::send !{F3} ; find_all_under
|
||||
^+Up::Return ; cancel swap_line_up
|
||||
#!Up::send ^+{Up} ; swap_line_up
|
||||
^+Down::Return ; cancel swap_line_down
|
||||
#!Down::send ^+{Down} ; swap_line_down
|
||||
^Pause::Return ; cancel cancel_build
|
||||
#c::send ^{Pause} ; cancel_build
|
||||
F9::Return ; cancel sort_lines case_s false
|
||||
F5::send {F9} ; sort_lines case_s false
|
||||
#F9::Return ; cancel sort_lines case_s true
|
||||
#F5::send #{F9} ; sort_lines case_s true
|
||||
!+1::Return ; cancel set_layout
|
||||
^!1::send !+1 ; set_layout
|
||||
!+2::Return ; cancel set_layout
|
||||
^!2::send !+2 ; set_layout
|
||||
!+3::Return ; cancel set_layout
|
||||
^!3::send !+3 ; set_layout
|
||||
!+4::Return ; cancel set_layout
|
||||
^!4::send !+4 ; set_layout
|
||||
!+5::Return ; cancel set_layout
|
||||
^!5::send !+5 ; set_layout
|
||||
!+8::Return ; cancel set_layout
|
||||
^!8::send !+8 ; set_layout
|
||||
!+9::Return ; cancel set_layout
|
||||
^!9::send !+9 ; set_layout
|
||||
#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_exe mintty.exe"){
|
||||
Send {Shift down}{Insert}{Shift up}
|
||||
}
|
||||
else 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
@@ -0,0 +1,22 @@
|
||||
@echo off
|
||||
|
||||
IF "%1"=="mac" goto mac
|
||||
IF "%1"=="win" goto win
|
||||
|
||||
echo Not found.
|
||||
goto commonexit
|
||||
|
||||
:win
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/^(?!;)(.*)(; MacModifiers)/; $1$2/gm" "%userprofile%\.kinto\kinto.ahk"
|
||||
"C:\Program Files\AutoHotkey\AutoHotkey.exe" "%userprofile%\.kinto\kinto.ahk"
|
||||
goto commonexit
|
||||
|
||||
:mac
|
||||
C:\Strawberry\perl\bin\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" "%userprofile%\.kinto\kinto.ahk"
|
||||
C:\Strawberry\perl\bin\perl.exe -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
|
71
windows/usb.vbs
Normal file
@@ -0,0 +1,71 @@
|
||||
Option Explicit
|
||||
Dim oWMISrv, collDvcs, iUSBDvc , iDvc, sDvcID, sPID, sVID
|
||||
|
||||
' add item to array
|
||||
Function AddItem(arr, val)
|
||||
ReDim Preserve arr(UBound(arr) + 1)
|
||||
arr(UBound(arr)) = val
|
||||
AddItem = arr
|
||||
End Function
|
||||
|
||||
' returns an array of the unique items in for-each-able collection fex
|
||||
Function uniqFE(fex)
|
||||
Dim dicTemp : Set dicTemp = CreateObject("Scripting.Dictionary")
|
||||
Dim xItem
|
||||
For Each xItem In fex
|
||||
dicTemp(xItem) = 0
|
||||
Next
|
||||
uniqFE = dicTemp.Keys()
|
||||
End Function
|
||||
|
||||
Function ReplaceX(ByVal sValue, ByVal sPattern, ByVal sNValue)
|
||||
Dim oReg : Set oReg = New RegExp
|
||||
oReg.Pattern = sPattern
|
||||
ReplaceX = oReg.Replace(sValue, sNValue)
|
||||
Set oReg = Nothing
|
||||
End Function
|
||||
|
||||
Set oWMISrv = GetObject("winmgmts:\\.\root\cimv2")
|
||||
Set collDvcs = oWMISrv.ExecQuery("Select * From Win32_PnPEntity WHERE Service='kbdhid'")
|
||||
|
||||
Dim deviceVID : deviceVID=Array()
|
||||
Dim devicePID : devicePID=Array()
|
||||
Dim deviceDesc : deviceDesc=Array()
|
||||
Dim counter: counter=0
|
||||
|
||||
For Each iUSBDvc In collDvcs
|
||||
sVID = ReplaceX(iUSBDvc.DeviceID, ".*VID_(.{4}).*", "$1")
|
||||
sPID = ReplaceX(iUSBDvc.DeviceID, ".*PID_(.{4}).*", "$1")
|
||||
deviceVID = AddItem(deviceVID, sVID)
|
||||
devicePID = AddItem(devicePID, sPID)
|
||||
deviceDesc = AddItem(deviceDesc, iUSBDvc.Description)
|
||||
counter = counter + 1
|
||||
' Wscript.Echo "Name : "& iUSBDvc.Description &"VID_PID : "& sVID & sPID
|
||||
Next
|
||||
|
||||
Dim uniqueVID: uniqueVID = uniqFE(deviceVID)
|
||||
Dim vcount: vcount = UBound(uniqueVID) + 1
|
||||
Dim nonApple: nonApple = 0
|
||||
Dim i
|
||||
|
||||
If vcount = 1 Then
|
||||
If StrComp(deviceVID(0), "05AC") = 0 Then
|
||||
Wscript.Echo "Apple"
|
||||
Else
|
||||
Wscript.Echo "Windows"
|
||||
End If
|
||||
Else
|
||||
For i = 0 To counter-1
|
||||
If StrComp(deviceVID(i), "05AC") = -1 Then
|
||||
nonApple = 1
|
||||
End If
|
||||
Next
|
||||
If nonApple = 1 Then
|
||||
Wscript.Echo "Windows"
|
||||
Else
|
||||
Wscript.Echo "Apple"
|
||||
End If
|
||||
End If
|
||||
|
||||
Set collDvcs = Nothing
|
||||
Set oWMISrv = Nothing
|
@@ -3,31 +3,42 @@
|
||||
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)
|
||||
|
||||
# Use for browser specific hotkeys
|
||||
browsers = ["Chromium","Chromium-browser","Google-chrome","Epiphany","Firefox","Discord"]
|
||||
browsers = [browser.casefold() for browser in browsers]
|
||||
browserStr = "|".join(str(x) for x in browsers)
|
||||
|
||||
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
|
||||
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
|
||||
# Key.LEFT_CTRL: Key.LEFT_ALT, # Chromebook
|
||||
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook
|
||||
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook
|
||||
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove)
|
||||
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook - Multi-language (Remove)
|
||||
|
||||
# # Default Mac/Win
|
||||
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
|
||||
# Key.LEFT_META: Key.LEFT_ALT, # WinMac
|
||||
# Key.LEFT_CTRL: Key.LEFT_META, # WinMac
|
||||
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac
|
||||
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
|
||||
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac
|
||||
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
|
||||
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove)
|
||||
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac - Multi-language (Remove)
|
||||
|
||||
# # Mac Only
|
||||
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
|
||||
# Key.LEFT_CTRL: Key.LEFT_META, # Mac
|
||||
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac
|
||||
# Key.RIGHT_CTRL: Key.RIGHT_META, # Mac
|
||||
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove)
|
||||
# Key.RIGHT_CTRL: Key.RIGHT_META, # Mac - Multi-language (Remove)
|
||||
})
|
||||
|
||||
# [Conditional modmap] Change modifier keys in certain applications
|
||||
@@ -36,7 +47,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,15 +55,15 @@ 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_META: Key.RIGHT_ALT, # WinMac
|
||||
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac
|
||||
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
|
||||
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac - Multi-language (Remove)
|
||||
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac - Multi-language (Remove)
|
||||
|
||||
# # Mac Only
|
||||
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
|
||||
# # Left Ctrl Stays Left Ctrl
|
||||
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac
|
||||
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # Mac
|
||||
# Key.RIGHT_META: Key.RIGHT_CTRL, # Mac - Multi-language (Remove)
|
||||
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # Mac - Multi-language (Remove)
|
||||
})
|
||||
|
||||
# Keybindings for Nautilus
|
||||
@@ -63,26 +74,36 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{
|
||||
K("RC-Right"): K("M-Right"), # Go Forward
|
||||
})
|
||||
|
||||
# Keybindings for Browsers
|
||||
define_keymap(re.compile(browserStr, re.IGNORECASE),{
|
||||
K("RC-Q"): K("RC-Q"), # Close all browsers Instances
|
||||
})
|
||||
|
||||
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,17 +113,22 @@ 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
|
||||
K("M-Right"): K("C-Right"), # Right of Word
|
||||
K("M-Shift-Right"): K("C-Shift-Right"), # Select Right of Word
|
||||
K("M-Shift-g"): K("C-Shift-g"), # View source control
|
||||
# ** VS Code fix **
|
||||
# Electron issue precludes normal keybinding fix.
|
||||
# Alt menu auto-focus/toggle gets in the way.
|
||||
@@ -120,7 +146,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 +154,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 +171,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,12 +182,12 @@ 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
|
||||
K("C-M-up"): K("C-up"), # scroll_lines up
|
||||
K("C-down"): pass_through_key, # cancel scroll_lines down
|
||||
K("Super-M-down"): K("C-down"), # scroll_lines down
|
||||
K("C-M-down"): K("C-down"), # scroll_lines down
|
||||
K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up
|
||||
K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down
|
||||
K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
|
||||
@@ -185,9 +217,9 @@ define_keymap(re.compile("Sublime_text", re.IGNORECASE),{
|
||||
# K("M-C-g"): K("M-Refresh"), # Chromebook - find_all_under
|
||||
K("Super-C-g"): K("M-f3"), # Default - find_all_under
|
||||
K("C-Shift-up"): pass_through_key, # cancel swap_line_up
|
||||
K("Super-C-up"): K("C-Shift-up"), # swap_line_up
|
||||
K("Super-M-up"): K("C-Shift-up"), # swap_line_up
|
||||
K("C-Shift-down"): pass_through_key, # cancel swap_line_down
|
||||
K("Super-C-down"): K("C-Shift-down"), # swap_line_down
|
||||
K("Super-M-down"): K("C-Shift-down"), # swap_line_down
|
||||
K("C-Pause"): pass_through_key, # cancel cancel_build
|
||||
K("Super-c"): K("C-Pause"), # cancel_build
|
||||
K("f9"): pass_through_key, # cancel sort_lines case_s false
|
||||
@@ -240,7 +272,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"),
|
||||
|
@@ -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
|
||||
|
31
xkeysnail-config/vscode_keybindings.json
Normal file
@@ -0,0 +1,31 @@
|
||||
// Place your key bindings in this file to override the defaultsauto[]
|
||||
[
|
||||
{
|
||||
"key": "alt+left",
|
||||
"command": "-workbench.action.terminal.focusPreviousPane",
|
||||
"when": "terminalFocus"
|
||||
},
|
||||
{
|
||||
"key": "alt+right",
|
||||
"command": "-workbench.action.terminal.focusNextPane",
|
||||
"when": "terminalFocus"
|
||||
},
|
||||
{
|
||||
"key": "alt+right",
|
||||
"command": "cursorWordRight"
|
||||
},
|
||||
{
|
||||
"key": "alt+left",
|
||||
"command": "cursorWordLeft"
|
||||
},
|
||||
{
|
||||
"key": "shift+alt+left",
|
||||
"command": "cursorWordStartLeftSelect",
|
||||
"when": "textInputFocus"
|
||||
},
|
||||
{
|
||||
"key": "shift+alt+right",
|
||||
"command": "cursorWordEndRightSelect",
|
||||
"when": "textInputFocus"
|
||||
}
|
||||
]
|
@@ -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
|
||||
|
@@ -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,121 @@ function uninstall {
|
||||
fi
|
||||
}
|
||||
|
||||
function removeAppleKB {
|
||||
# Undo Apple keyboard cmd & alt swap
|
||||
if test -f "/sys/module/hid_apple/parameters/swap_opt_cmd" && [ `cat /sys/module/hid_apple/parameters/swap_opt_cmd` == "1" ]; then
|
||||
echo '0' | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd
|
||||
echo 'options hid_apple swap_opt_cmd=0' | sudo tee /etc/modprobe.d/hid_apple.conf
|
||||
sudo update-initramfs -u -k all
|
||||
fi
|
||||
if test -f "/sys/module/applespi/parameters/swap_opt_cmd" && [ `cat /sys/module/applespi/parameters/swap_opt_cmd` == "1" ]; then
|
||||
echo '0' | sudo tee /sys/module/applespi/parameters/swap_opt_cmd
|
||||
echo 'options applespi swap_opt_cmd=0' | sudo tee /etc/modprobe.d/applespi.conf
|
||||
sudo update-initramfs -u -k all
|
||||
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/f112e0e349c021c1bbfa7e45c16083eae0d92fac/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 " 1) Windows & Mac (HID driver) - Most Standard keyboards (& 1st party usb/bt Apple keyboards)"
|
||||
echo " 2) Mac Only & VMs on Macbooks - 3rd & 1st party Apple keyboards"
|
||||
echo " 3) Chromebook - Chromebook running Linux"
|
||||
# echo " 5) Uninstall"
|
||||
|
||||
read n
|
||||
|
||||
set "$n"
|
||||
fi
|
||||
|
||||
# multi-language
|
||||
rightalt=false
|
||||
# VS code remap
|
||||
vssublime=false
|
||||
|
||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||
while true; do
|
||||
read -rep $'\nDo you want multi-language on Right Alt key? (y/N)\naka Left side remaps, right side doesn\'t\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,30 +206,35 @@ 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
|
||||
chmod +x ~/.kde/Autostart/kintohost.sh
|
||||
|
||||
# KDE startup - xhost fix
|
||||
mkdir -p ~/.config/autostart
|
||||
yes | cp -rf ./xkeysnail-config/xkeysnail.desktop ~/.config/autostart/xkeysnail.desktop
|
||||
|
||||
yes | cp -rf ./xkeysnail-config/xkeystart.sh ~/.config/kinto/xkeystart.sh
|
||||
@@ -150,30 +251,56 @@ 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
|
||||
if ls /sys/module | grep hid_apple >/dev/null 2>&1 ; then
|
||||
echo '1' | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all
|
||||
fi
|
||||
if ls /sys/module | grep applespi >/dev/null 2>&1 ; then
|
||||
echo '1' | sudo tee /sys/module/applespi/parameters/swap_opt_cmd;echo 'options applespi swap_opt_cmd=1' | sudo tee /etc/modprobe.d/applespi.conf;sudo update-initramfs -u -k all
|
||||
fi
|
||||
if ! ls /sys/module | grep apple ; then
|
||||
removeAppleKB
|
||||
fi
|
||||
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
|
||||
removeAppleKB
|
||||
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
|
||||
fi
|
||||
|
||||
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 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
|
||||
# if [ "$distro" == "fedora" ];then
|
||||
@@ -189,17 +316,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,17 +372,17 @@ 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
|
||||
if test -f "/sys/module/hid_apple/parameters/swap_opt_cmd" && [ `cat /sys/module/hid_apple/parameters/swap_opt_cmd` == "1" ]; then
|
||||
echo '0' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
|
||||
echo 'options hid_apple swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/hid_apple.conf
|
||||
sudo update-initramfs -u -k all
|
||||
fi
|
||||
removeAppleKB
|
||||
sudo systemctl stop xkeysnail
|
||||
sudo systemctl disable xkeysnail
|
||||
sudo rm /etc/sudoers.d/limitedadmins
|
||||
@@ -263,5 +393,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
|
||||
|