Compare commits

...

28 Commits
1.1-6 ... 1.1-7

Author SHA1 Message Date
Ben Reaves
1acc948fbc Merge pull request #214 from rbreaves/dev
- Windows auto-keyboard detection, new icon status, Terminus support
2020-06-16 13:35:04 -05:00
Ben Reaves
7174904434 - Added source control remap to VS Code. Closes #191. 2020-06-16 02:37:02 -05:00
Ben Reaves
b5ab41de9d - Added proper disabling of the autodetect feature when program is disabled. 2020-06-16 00:44:44 -05:00
Ben Reaves
86582466cf - Updated uninstaller for Windows to fully remove kinto 2020-06-15 23:13:31 -05:00
Ben Reaves
cc05da2f59 - Added more assets and added suspend and unique windows vs apple keyboard status icons for Windows 2020-06-15 23:01:38 -05:00
Ben Reaves
2b9598c84f - Completed Windows autoset keyboard feature 2020-06-15 01:39:56 -05:00
Ben Reaves
7f9ccabf77 - WIP autoset keyboard type for Windows 2020-06-14 22:20:28 -05:00
Ben Reaves
2249c4538d Merge branch 'dev' into alpha 2020-06-14 15:03:57 -05:00
Ben Reaves
fb630a7d33 Merge branch 'master' into dev 2020-06-14 15:03:12 -05:00
Ben Reaves
28e5141079 Update README.md 2020-06-14 01:15:27 -05:00
Ben Reaves
d29579e0a5 - Fixed posix grouping for Terminus 2020-06-14 00:58:00 -05:00
Ben Reaves
dcd8191bfb Merge pull request #211 from rbreaves/dev
- Sped up installer, improved mac kb & budgie support
2020-06-13 19:30:56 -05:00
Ben Reaves
5b4269fc1f - Allowing galliumOS shortcut keys to apply to any XFCE DE 2020-06-13 19:27:17 -05:00
Ben Reaves
1fc62a54da - Proper Budgie detection, improved mac kb support (hid/spi), installs faster. 2020-06-13 19:25:06 -05:00
Ben Reaves
4c8d8412b8 - converted dename.sh to tabs only 2020-06-13 18:08:55 -05:00
Ben Reaves
6cb66a6b72 Updated resources to include Win10 touchpad driver 2020-06-13 17:22:12 -05:00
Ben Reaves
7c36021642 - Removed another reference to old KintoWin VM Linux 2020-06-13 17:00:29 -05:00
Ben Reaves
3622eeb279 Update README.md 2020-06-13 16:22:54 -05:00
Ben Reaves
a82632fc63 Update README.md 2020-06-13 16:16:15 -05:00
Ben Reaves
3d55b232a9 Merge pull request #210 from rbreaves/dev
- Removed the Windows based Linux VM install option, not needed.
2020-06-13 16:14:02 -05:00
Ben Reaves
d68ca6226c - Removed the Windows based Linux VM install option. No longer needed with registry keyswap removal. 2020-06-13 16:13:07 -05:00
Ben Reaves
9d5ac9142b Merge pull request #209 from rbreaves/dev
- Ubuntu Budgie 20.04 Patch Update
2020-06-13 01:58:25 -05:00
Ben Reaves
87a4c6934d - Updated Budgie patch to use the proper fork for Ubuntu Budgie 20.04 2020-06-13 01:36:36 -05:00
Ben Reaves
7b67a4988e Merge branch 'master' into dev 2020-06-13 01:35:24 -05:00
Ben Reaves
4f259481f4 - Added back vscode keybindings json file 2020-06-07 16:06:25 -05:00
Ben Reaves
e741989128 - Made formatting improvements 2020-06-01 14:49:49 -05:00
Ben Reaves
0adc44907c - Swapped out unstable pynput with xbindkeys 2020-06-01 03:39:16 -05:00
Ben Reaves
7a2aac9d79 - New terminal wizard for Kinto setup. 2020-06-01 01:56:36 -05:00
17 changed files with 4365 additions and 138 deletions

View File

@@ -7,7 +7,7 @@
\- Type in Linux & Windows like it's a Mac. \- \- 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 ## Table of Contents
@@ -373,12 +373,21 @@ https://superuser.com/questions/385748/binding-superc-superv-to-copy-and-paste
Yet another keyboard remapping tool for X environment 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 [fusuma](https://github.com/iberianpig/fusuma) by iberianpig
Multitouch gestures with libinput driver on Linux 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 [Fluent Terminal - Windows only](https://github.com/felixse/FluentTerminal) by felixse
A Terminal Emulator based on UWP and web technologies. A Terminal Emulator based on UWP and web technologies.
[PowerToys - Windows only](https://github.com/microsoft/PowerToys) by microsoft [PowerToys - Windows only](https://github.com/microsoft/PowerToys) by microsoft
@@ -474,7 +483,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. 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. 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.
@@ -483,6 +492,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. 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. If I left anyone out then I apologize, that was not intentional. I am happy to say that this project is at a state of completion. Bug fixes will primarily be the only activity happening going forward and possibly a rewrite for Wayland at some point. Contributions as mentioned above are welcomed, and will be merged into master if they help with the goal of making typing on linux more like a mac.
*https://askubuntu.com/questions/1010276/can-i-act-on-the-event-that-a-window-opens-without-polling *https://askubuntu.com/questions/1010276/can-i-act-on-the-event-that-a-window-opens-without-polling

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

344
keycheck.py Executable file
View 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()

View File

@@ -26,6 +26,11 @@ def windows_setup():
# os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg") # os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg")
elif default == 3: elif default == 3:
os.system("regedit " + path + "\\windows\\remove_keyswap.reg") os.system("regedit " + path + "\\windows\\remove_keyswap.reg")
os.system("del /f .\\windows\\kinto-new.ahk")
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
os.system("taskkill /IM autohotkey.exe")
os.system('rd /s /q %userprofile%\\.kinto')
os.system('del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC) stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
if default > 0 and default < 3: if default > 0 and default < 3:
print("Will now install chocolatey and autohotkey with elevated privileges...") print("Will now install chocolatey and autohotkey with elevated privileges...")
@@ -37,6 +42,8 @@ def windows_setup():
if(stvscode): if(stvscode):
os.system('perl -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" ./windows/kinto-new.ahk') os.system('perl -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" ./windows/kinto-new.ahk')
os.system('copy /Y ' + path + '\\windows\\kinto-start.vbs "%userprofile%\\.kinto\\kinto-start.vbs"') os.system('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\\usb.vbs "%userprofile%\\.kinto\\detectUSB.vbs"')
os.system('mklink "%userprofile%\\Start Menu\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"') os.system('mklink "%userprofile%\\Start Menu\\Programs\\Startup\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"')
os.system('cp '+ path + '\\windows\\NoShell.vbs "%userprofile%\\.kinto\\NoShell.vbs"') os.system('cp '+ path + '\\windows\\NoShell.vbs "%userprofile%\\.kinto\\NoShell.vbs"')
os.system('cp '+ path + '\\windows\\toggle_kb.bat "%userprofile%\\.kinto\\toggle_kb.bat"') os.system('cp '+ path + '\\windows\\toggle_kb.bat "%userprofile%\\.kinto\\toggle_kb.bat"')
@@ -119,7 +126,7 @@ def setShortcuts():
addhotkeys = yn_choice("\nDo you want to apply system level shortcuts?") addhotkeys = yn_choice("\nDo you want to apply system level shortcuts?")
if(addhotkeys): if(addhotkeys):
distro = distro.lower() distro = distro.lower()
if dename == "gnome" or dename == "mate": 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/desktop/wm/keybindings/ > keybindings_`date +"%Y.%m.%d-%s"`.conf')
cmdline('dconf dump /org/gnome/mutter/keybindings/ > mutter_`date +"%Y.%m.%d-%s"`.conf') cmdline('dconf dump /org/gnome/mutter/keybindings/ > mutter_`date +"%Y.%m.%d-%s"`.conf')
if(kintotype == 1): if(kintotype == 1):
@@ -129,11 +136,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 \"['<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 switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"") cmdline("gsettings set org.gnome.desktop.wm.keybindings 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.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
# 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']\"") cmdline("gsettings set org.gnome.shell.keybindings toggle-application-view \"['LaunchB']\"")
if dename != "mate": if dename != "mate":
cmdline("gsettings set org.gnome.mutter overlay-key ''") cmdline("gsettings set org.gnome.mutter overlay-key ''")
if (distro == "ubuntu" and dename == "gnome") or (distro == "linux" and dename == "mate") or (distro == "ubuntu" and dename == "mate"): 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-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-down \"['<Super>Down','<Super>Right']\"")
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']") cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
@@ -167,8 +182,8 @@ def setShortcuts():
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui') cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
# elif distro == "budgie" and dename == "gnome": # elif distro == "budgie" and dename == "gnome":
# print("Apply budgie shortcuts here") # print("Apply budgie shortcuts here")
elif (distro == "galliumos" and dename == "xfce") or (distro == "ubuntu" and dename == "xfce"): elif (dename == "xfce"):
print("Applying GalliumOS (xfce) shortcuts...") 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') cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml')
# Reset Show desktop # Reset Show desktop
cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>d" --reset') cmdline('xfconf-query --channel xfce4-keyboard-shortcuts --property "/xfwm4/custom/<Primary><Alt>d" --reset')
@@ -232,7 +247,8 @@ def setShortcuts():
os.system('kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &') os.system('kquitapp5 kglobalaccel && sleep 2s && kglobalaccel5 &')
else: else:
print('distro: ' + distro + ' de: ' + dename) 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": if dename == "gnome":
# Apply dconf update to make updates survive reboots # Apply dconf update to make updates survive reboots
cmdline('dconf dump /org/gnome/desktop/wm/keybindings/ > tempkb.conf') cmdline('dconf dump /org/gnome/desktop/wm/keybindings/ > tempkb.conf')

View File

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

3630
system-config/keyboard.ids Normal file

File diff suppressed because it is too large Load Diff

39
windows/detectUSB.ahk Normal file
View 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%
}

View File

@@ -2,9 +2,18 @@
#NoEnv #NoEnv
#Persistent #Persistent
I_Icon = %A_ScriptDir%\assets\kinto-white.ico DetectHiddenWindows, On
IfExist, %I_Icon% Run, %A_ScriptDir%\detectUSB.ahk
Menu, Tray, Icon, %I_Icon%
; 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 ; Set Tray menu
; Menu, Tray, Standard ; Menu, Tray, Standard
@@ -16,7 +25,6 @@ Menu, Tray, Add, Returns to Desktop, min
Menu, Tray, Add Menu, Tray, Add
Menu, Tray, Add, Close, Exit Menu, Tray, Add, Close, Exit
Menu, Tray, Click, 1 Menu, Tray, Click, 1
Menu, Tray, Tip, Kinto
winkb(){ winkb(){
Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat win, %A_ScriptDir% Run, %A_ScriptDir%\NoShell.vbs %A_ScriptDir%\toggle_kb.bat win, %A_ScriptDir%
@@ -29,24 +37,74 @@ mackb(){
min(){ min(){
; Refocus last active Window ; Refocus last active Window
Send {LAlt down}{tab}{LAlt up} Send {LAlt down}{tab}{LAlt up}
} }
tray_suspend(){ tray_suspend(){
suspend toggle suspend toggle
if (a_isSuspended = 1){ if (a_isSuspended = 1){
menu, tray, check , Suspend Kinto 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{ else{
menu, tray, unCheck, Suspend Kinto 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 ; Refocus last active Window
Send {LAlt down}{tab}{LAlt up} Send {LAlt down}{tab}{LAlt up}
} }
Exit() { Exit() {
IfWinExist, detectUSB.ahk
WinClose
ExitApp ExitApp
} }
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%
}
SetTitleMatchMode, 2 SetTitleMatchMode, 2
GroupAdd, terminals, ahk_exe ubuntu.exe GroupAdd, terminals, ahk_exe ubuntu.exe
@@ -64,7 +122,7 @@ GroupAdd, posix, ahk_exe ConEmu.exe
GroupAdd, posix, ahk_exe ConEmu64.exe GroupAdd, posix, ahk_exe ConEmu64.exe
GroupAdd, posix, ahk_exe Hyper.exe GroupAdd, posix, ahk_exe Hyper.exe
GroupAdd, posix, ahk_exe mintty.exe GroupAdd, posix, ahk_exe mintty.exe
GroupAdd, terminals, ahk_exe Terminus.exe GroupAdd, posix, ahk_exe Terminus.exe
GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, ConEmu, ahk_exe ConEmu.exe GroupAdd, ConEmu, ahk_exe ConEmu.exe
@@ -181,15 +239,16 @@ $^+Right::Send +{End}
; Cmd+Space Alternative ; Cmd+Space Alternative
^Space::Send ^{Esc} ^Space::Send ^{Esc}
; ; Sublime Text Remaps for VS Code ; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode ; ST2CODE #IfWinActive ahk_group vscode
; Remap Ctrl+Shift to behave like macOS Sublimetext ; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines ; Will extend cursor to multiple lines
#+Up::send ^!{Up} ; ST2CODE ; #+Up::send ^!{Up} ; ST2CODE
#+Down::send ^!{Down} ; ST2CODE ; #+Down::send ^!{Down} ; ST2CODE
; Remap Ctrl+Cmd+G to select all matches ; Remap Ctrl+Cmd+G to select all matches
#^g::send ^+{L} ; ST2CODE ; #^g::send ^+{L} ; ST2CODE
#If ; ST2CODE !+g::send ^+{G} ; View source control
#If
#IfWinActive ahk_exe sublime_text.exe #IfWinActive ahk_exe sublime_text.exe
; Remap Ctrl+Shift to behave like macOS Sublimetext ; Remap Ctrl+Shift to behave like macOS Sublimetext

71
windows/usb.vbs Normal file
View 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

View File

@@ -29,9 +29,6 @@ define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac # Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac # Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac
# # KintoWin
# Key.LEFT_CTRL: Key.RIGHT_CTRL, # KintoWin
# # Mac Only # # Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac # Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# Key.LEFT_CTRL: Key.LEFT_META, # Mac # Key.LEFT_CTRL: Key.LEFT_META, # Mac
@@ -57,10 +54,6 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac # Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac # Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac
# # KintoWin
# Key.LEFT_CTRL: Key.RIGHT_CTRL, # KintoWin
# Key.LEFT_META: Key.LEFT_CTRL, # KintoWin
# # Mac Only # # Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac # Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# # Left Ctrl Stays Left Ctrl # # Left Ctrl Stays Left Ctrl
@@ -125,6 +118,7 @@ define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
K("M-Shift-Left"): K("C-Shift-Left"), # Select 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-Right"): K("C-Right"), # Right of Word
K("M-Shift-Right"): K("C-Shift-Right"), # Select 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 ** # ** VS Code fix **
# Electron issue precludes normal keybinding fix. # Electron issue precludes normal keybinding fix.
# Alt menu auto-focus/toggle gets in the way. # Alt menu auto-focus/toggle gets in the way.

View 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"
}
]

View File

@@ -72,6 +72,20 @@ function uninstall {
fi 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 -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
if test -f "/sys/module/applespi/parameters/swap_opt_cmd" && [ `cat /sys/module/applespi/parameters/swap_opt_cmd` == "1" ]; then
echo '0' | sudo tee -a /sys/module/applespi/parameters/swap_opt_cmd
echo 'options applespi swap_opt_cmd=0' | sudo tee -a /etc/modprobe.d/applespi.conf
sudo update-initramfs -u -k all
fi
}
function budgieUninstall { function budgieUninstall {
if [ -f /usr/bin/budgie-desktop ];then 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..." read -n 1 -s -r -p "Your system may log you off immediately during the restoration of budgie-daemon. Press any key to continue..."
@@ -101,7 +115,7 @@ function budgieUpdate {
budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)" budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)"
if [ "$budgieVersion" == "10.5.1" ]; then if [ "$budgieVersion" == "10.5.1" ]; then
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1 wget https://github.com/rbreaves/budgie-desktop/raw/f112e0e349c021c1bbfa7e45c16083eae0d92fac/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
fi fi
bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }') bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')
newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }') newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
@@ -140,7 +154,6 @@ if [ $# -eq 0 ]; then
echo " 1) Windows & Mac (HID driver)" echo " 1) Windows & Mac (HID driver)"
echo " 2) Mac Only & VMs on Macbooks" echo " 2) Mac Only & VMs on Macbooks"
echo " 3) Chromebook" echo " 3) Chromebook"
echo " 4) Windows w/ Kinto - aka Linux VM"
# echo " 5) Uninstall" # echo " 5) Uninstall"
read n read n
@@ -153,7 +166,7 @@ rightalt=false
# VS code remap # VS code remap
vssublime=false vssublime=false
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
while true; do while true; do
read -rep $'\nDo you want multi-language support (the right Alt key will not remap)? (y/N)\n' yn read -rep $'\nDo you want multi-language support (the right Alt key will not remap)? (y/N)\n' yn
case $yn in case $yn in
@@ -256,13 +269,22 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1
fi fi
if [[ $1 == "1" || $1 == "winmac" ]]; then 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 -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
fi
if ls /sys/module | grep applespi >/dev/null 2>&1 ; then
echo '1' | sudo tee -a /sys/module/applespi/parameters/swap_opt_cmd;echo 'options applespi swap_opt_cmd=1' | sudo tee -a /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 perl -pi -e "s/(# )(.*)(# WinMac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
if [[ $dename == "xfce" ]]; then if [[ $dename == "xfce" ]]; then
perl -pi -e "s/(# )(.*)(# xfce4)/\$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 not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
fi fi
elif [[ $1 == "2" || $1 == "mac" ]]; then elif [[ $1 == "2" || $1 == "mac" ]]; then
removeAppleKB
perl -pi -e "s/(# )(.*)(# Mac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new perl -pi -e "s/(# )(.*)(# Mac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
if [[ $dename == "xfce" ]]; then if [[ $dename == "xfce" ]]; then
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
@@ -272,15 +294,13 @@ elif [[ $1 == "3" || $1 == "chromebook" ]]; then
perl -pi -e "s/(# )(.*)(# Chromebook)/\$2\$3/g" ./xkeysnail-config/kinto.py.new 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/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
elif [[ $1 == "4" || $1 == "kintowin" ]]; then
perl -pi -e "s/(# )(.*)(# KintoWin)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
fi fi
if $rightalt ; then if $rightalt ; then
perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1 perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi fi
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
# if [ "$distro" == "fedora" ];then # if [ "$distro" == "fedora" ];then
sudo rm /etc/systemd/system/xkeysnail.service sudo rm /etc/systemd/system/xkeysnail.service
@@ -361,12 +381,7 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1
elif [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then elif [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo "Uninstalling Kinto - xkeysnail (udev)" echo "Uninstalling Kinto - xkeysnail (udev)"
uninstall uninstall
# Undo Apple keyboard cmd & alt swap removeAppleKB
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
sudo systemctl stop xkeysnail sudo systemctl stop xkeysnail
sudo systemctl disable xkeysnail sudo systemctl disable xkeysnail
sudo rm /etc/sudoers.d/limitedadmins sudo rm /etc/sudoers.d/limitedadmins