mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-02 09:06:40 +02:00
Compare commits
45 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 |
127
README.md
127
README.md
@@ -10,6 +10,34 @@
|
||||
|
||||
Seamless copy and paste with all apps and terminals. Also the only linux remapper that is aware of your cursor/caret status - meaning it avoids shortcut conflicts within an app versus wordwise shortcuts when a text field is in use. (xkeysnail implementation of Kinto has caret checking disabled in master for now.)
|
||||
|
||||
## Table of Contents
|
||||
|
||||
[What does this do exactly?](#What-does-this-do-exactly)
|
||||
|
||||
[What does Kinto require?](#What-does-Kinto-require)
|
||||
|
||||
[How to install](#How-to-install)
|
||||
|
||||
[Shortcut Creation (Xkeysnail)](#Shortcut-Creation-Xkeysnail)
|
||||
|
||||
[Other Notes Related to Install](#Other-Notes-Related-to-Install)
|
||||
|
||||
[How to Upgrade/Control Kinto](#How-to-Upgrade-Kinto)
|
||||
|
||||
[Troubleshooting](#Troubleshooting)
|
||||
|
||||
[Language Support](#Language-Support)
|
||||
|
||||
[Related or Useful Resources](#Related-or-Useful-Resources)
|
||||
|
||||
[Contributing](#Contributing)
|
||||
|
||||
[More information about Kinto](#More-information-about-Kinto)
|
||||
|
||||
[License](#License)
|
||||
|
||||
[Credits and Contributions](#Credits-and-Contributions)
|
||||
|
||||
## What does this do exactly?
|
||||
|
||||
Kinto works for standard Windows, Apple and Chromebook keyboards. The following however describes the dynamic rebinding based on a standard Windows keyboard. (Alt location is Cmd for Apple keyboards)
|
||||
@@ -20,6 +48,10 @@ Kinto works for standard Windows, Apple and Chromebook keyboards. The following
|
||||
|
||||
- Cursor/word-wise shortcut keys have been added to align with macOS keyboard shortcuts.
|
||||
|
||||
Does Kinto have to have specific keymaps for individual apps?
|
||||
|
||||
I'd say 90+% of the time no, but every OS has their default conventions that sometimes run afoul to macs. For this reason you can easily edit kinto.py or kinto.ahk to support the few shortcut keys Kinto may miss. If you do add additional support please consider forking this project and sharing your new keymaps with the rest of us!
|
||||
|
||||
## What does Kinto require?
|
||||
|
||||
- Python (initial install only)
|
||||
@@ -36,7 +68,7 @@ On most distros you can confirm navigate to your "Language Support" and set "Key
|
||||
|
||||
Wayland support is planned, but not ready yet.
|
||||
|
||||
## Kinto for Windows 10 Requirements
|
||||
### Kinto for Windows 10 Requirements
|
||||
|
||||
- WSL Ubuntu edition
|
||||
- Powershell - run as Administrator
|
||||
@@ -191,7 +223,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.
|
||||
@@ -315,16 +346,102 @@ sudo systemctl start xkeysnail
|
||||
sudo systemctl status xkeysnail
|
||||
```
|
||||
|
||||
## Notes about Windows 10
|
||||
Sharpkeys was used to create the layout/reg files to swap the Ctrl, Win and Alt keys. Sharpkeys was not required however because the reg keys were extracted. Autohotkey is used to manage keyswaps needed for terminal usage. Autohotkey is also used to add additional mac like keybinds for Sublime text and can be used for other apps as well.
|
||||
|
||||
Microsoft is working on a new Powertoy Keyboard Manager that could be used with an easier to use GUI interface, but this approach should be fully sufficient for a mac like experience and autohotkeys appears to be more than capable enough to handle complex rebinding of any or most mac like shortcuts.
|
||||
|
||||
## Language Support
|
||||
I'd appreciate any help from people with non-US based keyboards, to help ensure that these keymaps and keyswap methods work in all or most languages.
|
||||
|
||||
If you would like to attempt adding additional custom keymaps for other languages then I strongly recommend reading Glen Whitney's post here.
|
||||
https://superuser.com/questions/385748/binding-superc-superv-to-copy-and-paste
|
||||
|
||||
## Notes about Windows 10
|
||||
Sharpkeys was used to create the layout/reg files to swap the Ctrl, Win and Alt keys. Sharpkeys was not required however because the reg keys were extracted. Autohotkey is used to manage keyswaps needed for terminal usage. Autohotkey is also used to add additional mac like keybinds for Sublime text and can be used for other apps as well.
|
||||
## Related or Useful Resources
|
||||
|
||||
Microsoft is working on a new Powertoy Keyboard Manager that could be used with an easier to use GUI interface, but this approach should be fully sufficient for a mac like experience and autohotkeys appears to be more than capable enough to handle complex rebinding of any or most mac like shortcuts.
|
||||
[Xkeysnail](https://github.com/mooz/xkeysnail) by mooz
|
||||
|
||||
Yet another keyboard remapping tool for X environment
|
||||
|
||||
[fusuma](https://github.com/iberianpig/fusuma) by iberianpig
|
||||
|
||||
Multitouch gestures with libinput driver on Linux
|
||||
|
||||
[Fluent Terminal - Windows only](https://github.com/felixse/FluentTerminal) by felixse
|
||||
|
||||
A Terminal Emulator based on UWP and web technologies.
|
||||
|
||||
[PowerToys - Windows only](https://github.com/microsoft/PowerToys) by microsoft
|
||||
|
||||
Windows system utilities to maximize productivity
|
||||
|
||||
[AutoHotKey - Windows only](https://github.com/AutoHotkey/AutoHotkey) by AutoHotkey
|
||||
|
||||
AutoHotkey is a powerful and easy to use scripting language for desktop automation on Windows.
|
||||
|
||||
[pykeymacs](https://github.com/zhanghai/pykeymacs) by zhanghai
|
||||
|
||||
Emacs style keyboard macros implemented in Python
|
||||
|
||||
[Dynamic Wallpapers](https://github.com/adi1090x/dynamic-wallpaper) by adi1090x
|
||||
|
||||
Simple bash script to set a Dynamic Wallpaper according to certain conditions.
|
||||
|
||||
[macify-linux](https://github.com/Jonchun/macify-linux) by JonChun
|
||||
|
||||
Automated setup scripts to transform Linux into macOS. (Uses Kinto for key remaps)
|
||||
|
||||
[ibus-typing-booster](https://github.com/mike-fabian/ibus-typing-booster) by mike-fabian
|
||||
|
||||
ibus-typing-booster is a completion input method for faster typing
|
||||
|
||||
[twemoji color font](https://github.com/eosrei/twemoji-color-font) by eosrei
|
||||
|
||||
Twitter Unicode 12 emoji color SVGinOT font for Linux/MacOS/Windows
|
||||
|
||||
[iTerm2 Color Schemes](https://github.com/mbadolato/iTerm2-Color-Schemes) by mbadolato
|
||||
|
||||
Over 225 terminal color schemes/themes for iTerm/iTerm2. Includes ports to Terminal, Konsole, PuTTY, Xresources, XRDB, Remmina, Termite, XFCE, Tilda, FreeBSD VT, Terminator, Kitty...
|
||||
|
||||
[espanso](https://github.com/federico-terzi/espanso) by federico-terzi
|
||||
|
||||
Cross-platform Text Expander written in Rust
|
||||
|
||||
[GalliumOS](https://github.com/GalliumOS/galliumos-distro) by GalliumOS
|
||||
|
||||
Docs, issues, and artwork sources for GalliumOS
|
||||
|
||||
[eOS-X](https://github.com/ipproductions/eOS-X) by ipproductions
|
||||
|
||||
Dark & Light Theme w/ OSX controls for Elementary OS
|
||||
|
||||
[Autorandr](https://github.com/phillipberndt/autorandr) by phillipberndt
|
||||
|
||||
Auto-detect the connected display hardware and load the appropriate X11 setup using xrandr
|
||||
|
||||
[Barrier](https://github.com/debauchee/barrier) by debauchee
|
||||
|
||||
Open-source KVM software
|
||||
|
||||
[Synergy Free Binaries](https://github.com/amankhoza/synergy-binaries) by amankhoza
|
||||
|
||||
The latest freely available Synergy binaries
|
||||
|
||||
[Synergy Official](https://symless.com/) by Symless
|
||||
|
||||
Latest Official Synergy
|
||||
|
||||
[Karabiner-Elements](https://github.com/pqrs-org/Karabiner-Elements) by pqrs-org
|
||||
|
||||
Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
|
||||
|
||||
[mbpfan](https://github.com/linux-on-mac/mbpfan) by linux-on-mac
|
||||
|
||||
A simple daemon to control fan speed on all MacBook/MacBook Pros (probably all Apple computers) for Linux Kernel 3 and newer
|
||||
|
||||
[vala-panel](https://github.com/rilian-la-te/vala-panel) by rilian-la-te
|
||||
|
||||
Vala rewrite of SimplePanel - GitHub mirror (Global Menu for XFCE)
|
||||
|
||||
## Contributing
|
||||
|
||||
|
190
setup.py
190
setup.py
@@ -6,6 +6,44 @@ from prekinto import *
|
||||
|
||||
homedir = os.path.expanduser("~")
|
||||
|
||||
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")
|
||||
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 < 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"')
|
||||
os.system('refreshenv')
|
||||
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 " + path + "\\windows\\kinto-new.ahk")
|
||||
if(stvscode):
|
||||
os.system('perl -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" ./windows/kinto-new.ahk')
|
||||
os.system("copy /Y " + path + "\\windows\\kinto-new.ahk \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
|
||||
os.system("del /f .\\windows\\kinto-new.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 cmdline(command):
|
||||
process = Popen(
|
||||
args=command,
|
||||
@@ -14,6 +52,19 @@ def cmdline(command):
|
||||
shell=True
|
||||
)
|
||||
return process.communicate()[0]
|
||||
|
||||
# check_x11 = cmdline("env | grep -i x11").strip()
|
||||
check_x11 = cmdline("(env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type) | awk -F= '{print $2}'").strip()
|
||||
|
||||
if len(check_x11) == 0:
|
||||
if os.name != 'nt':
|
||||
print("You are not using x11, please logout and back in using x11/Xorg")
|
||||
sys.exit()
|
||||
else:
|
||||
print("\nYou are detected as running Windows.")
|
||||
windows_setup()
|
||||
sys.exit()
|
||||
|
||||
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0]
|
||||
dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
|
||||
|
||||
@@ -59,7 +110,7 @@ def setShortcuts():
|
||||
addhotkeys = yn_choice("\nDo you want to apply system level shortcuts?")
|
||||
if(addhotkeys):
|
||||
distro = distro.lower()
|
||||
if dename == "gnome":
|
||||
if dename == "gnome" or dename == "mate":
|
||||
cmdline('dconf dump /org/gnome/desktop/wm/keybindings/ > keybindings_`date +"%Y.%m.%d-%s"`.conf')
|
||||
cmdline('dconf dump /org/gnome/mutter/keybindings/ > mutter_`date +"%Y.%m.%d-%s"`.conf')
|
||||
if(kintotype == 1):
|
||||
@@ -70,8 +121,10 @@ def setShortcuts():
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward \"['<Primary>F14','<Primary><Shift>F14','<Alt><Shift>Tab']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings minimize \"['<Super>h','<Alt>F9']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings panel-main-menu \"['<Primary><Shift>Space','<Primary>Space']\"")
|
||||
cmdline("gsettings set org.gnome.mutter overlay-key ''")
|
||||
if distro == "ubuntu" and dename == "gnome":
|
||||
cmdline("gsettings set org.gnome.shell.keybindings toggle-application-view \"['LaunchB']\"")
|
||||
if dename != "mate":
|
||||
cmdline("gsettings set org.gnome.mutter overlay-key ''")
|
||||
if (distro == "ubuntu" and dename == "gnome") or (distro == "linux" and dename == "mate") or (distro == "ubuntu" and dename == "mate"):
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up \"['<Super>Up','<Super>Left']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down \"['<Super>Down','<Super>Right']\"")
|
||||
cmdline("gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left ['']")
|
||||
@@ -103,7 +156,9 @@ def setShortcuts():
|
||||
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_term')
|
||||
cmdline('perl -pi -e "s/(\/\/ )(.*)(\/\/ Elementary cmdtab)/\$2\$3/g" ~/.xkb/symbols/mac_gui')
|
||||
cmdline('perl -pi -e "s/(\w.*)(\/\/ Default cmdtab)/\/\/ \$1\$2/g" ~/.xkb/symbols/mac_gui')
|
||||
elif distro == "galliumos" and dename == "xfce":
|
||||
# elif distro == "budgie" and dename == "gnome":
|
||||
# print("Apply budgie shortcuts here")
|
||||
elif (distro == "galliumos" and dename == "xfce") or (distro == "ubuntu" and dename == "xfce"):
|
||||
print("Applying GalliumOS (xfce) shortcuts...")
|
||||
cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml')
|
||||
# Reset Show desktop
|
||||
@@ -178,38 +233,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 +241,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 +293,54 @@ 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
|
||||
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:
|
||||
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 +386,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 +397,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
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
1
system-config/budgie-desktop_10.5.1.md5
Normal file
@@ -0,0 +1 @@
|
||||
8660c2f8e0a9d3cff896254f6c0f9159 /usr/bin/budgie-desktop
|
@@ -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",
|
||||
|
@@ -10,3 +10,6 @@ else{
|
||||
if(-not(test-path "C:\Program Files\AutoHotkey\AutoHotkey.exe")){
|
||||
choco install autohotkey.install
|
||||
}
|
||||
if(-not(test-path "C:\Strawberry\")){
|
||||
choco install strawberryperl
|
||||
}
|
||||
|
@@ -1,9 +1,13 @@
|
||||
SetTitleMatchMode, 2
|
||||
|
||||
GroupAdd, terminals, ahk_exe ubuntu.exe
|
||||
GroupAdd, terminals, ahk_exe ConEmu.exe
|
||||
GroupAdd, terminals, ahk_exe ConEmu64.exe
|
||||
GroupAdd, terminals, ahk_exe powershell.exe
|
||||
GroupAdd, terminals, ahk_exe WindowsTerminal.exe
|
||||
GroupAdd, terminals, ahk_exe Hyper.exe
|
||||
GroupAdd, terminals, ahk_exe Cmd.exe
|
||||
GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
|
||||
|
||||
GroupAdd, posix, ahk_exe ubuntu.exe
|
||||
GroupAdd, posix, ahk_exe ConEmu.exe
|
||||
@@ -15,6 +19,11 @@ 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
|
||||
|
||||
GroupAdd, vscode, ahk_exe VSCodium.exe
|
||||
GroupAdd, vscode, ahk_exe Code.exe
|
||||
|
||||
; Cmd+Space Alternative
|
||||
LWin & vk07::return
|
||||
@@ -27,13 +36,35 @@ RWin::return
|
||||
; 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}
|
||||
; https://autohotkey.com/board/topic/72433-controltab/
|
||||
#if GetKeyState("LWin")
|
||||
*Tab::
|
||||
if(!GetKeyState("LControl"))
|
||||
Send {LControl Down}
|
||||
Send {Tab}
|
||||
SetTimer, WaitForWinUp, 10
|
||||
ToolTip trigger
|
||||
return
|
||||
|
||||
WaitForWinUp:
|
||||
if(!GetKeyState("LWin", "P"))
|
||||
{
|
||||
Send {LControl Up}
|
||||
SetTimer, WaitForWinUp, Off
|
||||
}
|
||||
return
|
||||
|
||||
; Close Apps
|
||||
^q::Send !{F4}
|
||||
|
||||
; Full Screenshot
|
||||
^+3::Send {PrintScreen}
|
||||
|
||||
; Region Screenshot
|
||||
^+4::Send #+{S}
|
||||
|
||||
; wordwise support
|
||||
$^Left::Send {Home}
|
||||
$^+Left::Send +{Home}
|
||||
@@ -50,7 +81,17 @@ $^+Right::Send +{End}
|
||||
!Right::Send ^{Right}
|
||||
!+Right::Send ^+{Right}
|
||||
|
||||
#IfWinActive ahk_group editors
|
||||
; ; Sublime Text Remaps for VS Code ; ST2CODE
|
||||
; #IfWinActive ahk_group vscode ; ST2CODE
|
||||
; ; Remap Ctrl+Shift to behave like macOS Sublimetext ; ST2CODE
|
||||
; ; Will extend cursor to multiple lines ; ST2CODE
|
||||
; #+Up::send ^!{Up} ; ST2CODE
|
||||
; #+Down::send ^!{Down} ; ST2CODE
|
||||
; ; Remap Ctrl+Cmd+G to select all matches ; ST2CODE
|
||||
; #^g::send ^+{L} ; ST2CODE
|
||||
; #If ; ST2CODE
|
||||
|
||||
#IfWinActive ahk_exe sublime_text.exe
|
||||
; Remap Ctrl+Shift to behave like macOS Sublimetext
|
||||
; Will extend cursor to multiple lines
|
||||
#+Up::send {shift up}^!{Up}
|
||||
@@ -60,6 +101,11 @@ $^+Right::Send +{End}
|
||||
#^g::send !{F3}
|
||||
#If
|
||||
|
||||
; Not sure why this fix is needed
|
||||
#IfWinActive ahk_exe Firefox.exe
|
||||
^v::send ^v
|
||||
#If
|
||||
|
||||
#IfWinActive ahk_group terminals
|
||||
; Copy
|
||||
^c::Send {LCtrl down}{LShift down}c{LCtrl Up}{LShift Up}
|
||||
|
@@ -3,10 +3,16 @@
|
||||
import re
|
||||
from xkeysnail.transform import *
|
||||
|
||||
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty"]
|
||||
# Use the following for testing terminal keymaps
|
||||
# terminals = [ "", ... ]
|
||||
# xbindkeys -mk
|
||||
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix","xfce4-terminal"]
|
||||
terminals = [term.casefold() for term in terminals]
|
||||
termStr = "|".join(str(x) for x in terminals)
|
||||
|
||||
mscodes = ["code","vscodium"]
|
||||
codeStr = "|".join(str(x) for x in mscodes)
|
||||
|
||||
# [Global modemap] Change modifier keys as in xmodmap
|
||||
define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,{
|
||||
# # Chromebook
|
||||
@@ -23,6 +29,8 @@ define_conditional_modmap(lambda wm_class: wm_class.casefold() not in terminals,
|
||||
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
|
||||
# Key.RIGHT_CTRL: Key.RIGHT_META, # WinMac
|
||||
|
||||
# # KintoWin
|
||||
|
||||
# # Mac Only
|
||||
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
|
||||
# Key.LEFT_CTRL: Key.LEFT_META, # Mac
|
||||
@@ -48,6 +56,10 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
|
||||
# Key.RIGHT_META: Key.RIGHT_ALT, # WinMac
|
||||
# Key.RIGHT_CTRL: Key.LEFT_CTRL, # WinMac
|
||||
|
||||
# # KintoWin
|
||||
# Key.LEFT_CTRL: Key.RIGHT_CTRL, # KintoWin
|
||||
# Key.LEFT_META: Key.LEFT_CTRL, # KintoWin
|
||||
|
||||
# # Mac Only
|
||||
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
|
||||
# # Left Ctrl Stays Left Ctrl
|
||||
@@ -64,25 +76,30 @@ define_keymap(re.compile("org.gnome.nautilus", re.IGNORECASE),{
|
||||
})
|
||||
|
||||
define_keymap(None,{
|
||||
# Basic App hotkey functions
|
||||
K("RC-Q"): K("Alt-F4"),
|
||||
K("RC-H"): K("Alt-F9"),
|
||||
# Cmd Tab - App Switching Default
|
||||
K("RC-Tab"): K("RC-F13"), # Default
|
||||
K("RC-Shift-Tab"): K("RC-Shift-F13"), # Default
|
||||
K("RC-Grave"): K("M-F6"), # Default
|
||||
K("RC-Shift-Grave"): K("M-Shift-F6"), # Default
|
||||
# K("RC-Tab"): K("RC-backslash"), # Chromebook
|
||||
# K("RC-Shift-Tab"): K("RC-Shift-backslash"), # Chromebook
|
||||
# K("RC-Grave"): K("RC-Shift-backslash"), # Chromebook
|
||||
K("RC-Tab"): K("RC-F13"), # Default not-xfce4
|
||||
K("RC-Shift-Tab"): K("RC-Shift-F13"), # Default not-xfce4
|
||||
K("RC-Grave"): K("M-F6"), # Default not-xfce4
|
||||
K("RC-Shift-Grave"): K("M-Shift-F6"), # Default not-xfce4
|
||||
# K("RC-Tab"): K("RC-backslash"), # xfce4
|
||||
# K("RC-Shift-Tab"): K("RC-Shift-backslash"), # xfce4
|
||||
# K("RC-Grave"): K("RC-Shift-backslash"), # xfce4
|
||||
# In-App Tab switching
|
||||
# K("M-Tab"): K("C-Tab"), # Chromebook - In-App Tab switching
|
||||
# K("M-Shift-Tab"): K("C-Shift-Tab"), # Chromebook - In-App Tab switching
|
||||
# K("M-Grave") : K("C-Shift-Tab"), # Chromebook - In-App Tab switching
|
||||
K("Super-Tab"): K("LC-Tab"), # Default
|
||||
K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default
|
||||
K("Super-Tab"): K("LC-Tab"), # Default not-chromebook
|
||||
K("Super-Shift-Tab"): K("LC-Shift-Tab"), # Default not-chromebook
|
||||
|
||||
# Wordwise
|
||||
K("RC-Left"): K("Home"), # Beginning of Line
|
||||
K("Super-a"): K("Home"), # Beginning of Line
|
||||
K("RC-Shift-Left"): K("Shift-Home"), # Select all to Beginning of Line
|
||||
K("RC-Right"): K("End"), # End of Line
|
||||
K("Super-e"): K("End"), # End of Line
|
||||
K("RC-Shift-Right"): K("Shift-End"), # Select all to End of Line
|
||||
# K("RC-Left"): K("C-LEFT_BRACE"), # Firefox-nw - Back
|
||||
# K("RC-Right"): K("C-RIGHT_BRACE"), # Firefox-nw - Forward
|
||||
@@ -92,12 +109,16 @@ define_keymap(None,{
|
||||
K("RC-Shift-Up"): K("C-Shift-Home"), # Select all to Beginning of File
|
||||
K("RC-Down"): K("C-End"), # End of File
|
||||
K("RC-Shift-Down"): K("C-Shift-End"), # Select all to End of File
|
||||
K("M-Backspace"): K("Delete"), # Delete
|
||||
# K("M-Backspace"): K("Delete"), # Chromebook - Delete
|
||||
K("Super-Backspace"): K("C-Backspace"), # Default not-chromebook - Delete Left Word of Cursor
|
||||
K("Super-Delete"): K("C-Delete"), # Default not-chromebook - Delete Right Word of Cursor
|
||||
K("Alt-Backspace"): K("C-Backspace"), # Default not-chromebook - Delete Left Word of Cursor
|
||||
K("Alt-Delete"): K("C-Delete"), # Default not-chromebook - Delete Right Word of Cursor
|
||||
# K(""): pass_through_key, # cancel
|
||||
# K(""): K(""), #
|
||||
})
|
||||
|
||||
define_keymap(lambda wm_class: wm_class.casefold() not in ("code"),{
|
||||
define_keymap(lambda wm_class: wm_class.casefold() not in mscodes,{
|
||||
# Wordwise remaining - for Everything but VS Code
|
||||
K("M-Left"): K("C-Left"), # Left of Word
|
||||
K("M-Shift-Left"): K("C-Shift-Left"), # Select Left of Word
|
||||
@@ -120,7 +141,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 +149,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,7 +166,8 @@ 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-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
|
||||
K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down
|
||||
# K(""): pass_through_key, # cancel
|
||||
@@ -240,7 +267,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"),
|
||||
|
@@ -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,19 +72,83 @@ function uninstall {
|
||||
fi
|
||||
}
|
||||
|
||||
function budgieUninstall {
|
||||
if [ -f /usr/bin/budgie-desktop ];then
|
||||
read -n 1 -s -r -p "Your system may log you off immediately during the restoration of budgie-daemon. Press any key to continue..."
|
||||
bdmd5="$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')"
|
||||
oldbdmd5=$(md5sum ./budgie-daemon_10.5.1.bak | awk '{ print $1 }')
|
||||
if [ "$bdmd5" != "$oldbdmd5" ]; then
|
||||
echo -e "\nReplacing budgie-daemon with backup..."
|
||||
sudo pkill budgie-daemon && sudo cp ./budgie-daemon_10.5.1.bak /usr/bin/budgie-daemon
|
||||
else
|
||||
echo -e "\nBudgie-daemon is already an original."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function budgieUpdate {
|
||||
# Check for budgie and install App Switching hack
|
||||
if [ -f /usr/bin/budgie-desktop ];then
|
||||
while true; do
|
||||
read -rep $'Would you like to update Budgie to support proper App Switching? (y/n)\n(Your system will immediately log you out after this runs.)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) yn="y"; break;;
|
||||
[Nn]* ) yn="n";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
if [ "$yn" == "y" ]; then
|
||||
budgieVersion="$(/usr/bin/budgie-desktop --version | awk '{ print $2; }' | head -n1)"
|
||||
if [ "$budgieVersion" == "10.5.1" ]; then
|
||||
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
|
||||
fi
|
||||
bdmd5=$(md5sum /usr/bin/budgie-daemon | awk '{ print $1 }')
|
||||
newbdmd5=$(md5sum ./system-config/budgie-daemon_10.5.1 | awk '{ print $1 }')
|
||||
if [ "$bdmd5" != "$newbdmd5" ]; then
|
||||
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
echo "Updated Budgie to use App Switching Patch"
|
||||
else
|
||||
echo "Budgie-daemon already patched, skipping replacement."
|
||||
fi
|
||||
else
|
||||
echo "Your Budgie version was $budgieVersion and the patch is for 10.5.1."
|
||||
while true; do
|
||||
read -rep $'Would you like to replace it any ways? (y/n)\n(A backup will be made)\n' yn
|
||||
case $yn in
|
||||
[Yy]* ) yn="y"; break;;
|
||||
[Nn]* ) yn="n";break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
if [ "$yn" == "y" ]; then
|
||||
if ! [ -f ./system-config/budgie-daemon_10.5.1 ]; then
|
||||
wget https://github.com/rbreaves/budgie-desktop/raw/43d3b44243b0bcaee3262a79818024a651475b58/binaries/budgie-daemon_10.5.1 -O ./system-config/budgie-daemon_10.5.1
|
||||
fi
|
||||
cp /usr/bin/budgie-daemon ./budgie-daemon_"$budgieVersion".bak
|
||||
sudo pkill budgie-daemon && sudo cp ./system-config/budgie-daemon_10.5.1 /usr/bin/budgie-daemon
|
||||
echo "Updated Budgie to use App Switching Patch"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Install Kinto - xkeysnail (udev)"
|
||||
echo " 1) Windows & Mac (HID driver)"
|
||||
echo " 2) Mac Only & VMs on Macbooks"
|
||||
echo " 3) Chromebook"
|
||||
# echo " 4) Uninstall"
|
||||
echo " 4) Windows w/ Kinto - aka Linux VM"
|
||||
# echo " 5) Uninstall"
|
||||
|
||||
read n
|
||||
|
||||
set "$n"
|
||||
fi
|
||||
|
||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||
branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
if [ "$branch" == "dev" ] || [ "$branch" == "alpha" ];then
|
||||
while true; do
|
||||
@@ -110,21 +174,25 @@ 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
|
||||
|
||||
@@ -160,21 +228,30 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
||||
sed -i "s/{username}/`whoami`/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"
|
||||
fi
|
||||
|
||||
if [[ $1 == "1" || $1 == "winmac" ]]; then
|
||||
echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all
|
||||
perl -pi -e "s/(# )(.*)(# WinMac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
if [[ $dename == "xfce" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
fi
|
||||
elif [[ $1 == "2" || $1 == "mac" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# Mac)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
if [[ $dename == "xfce" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default not-xfce4)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
fi
|
||||
elif [[ $1 == "3" || $1 == "chromebook" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# Chromebook)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(# )(.*)(# xfce4)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
perl -pi -e "s/(\w.*)(# Default)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new
|
||||
elif [[ $1 == "4" || $1 == "kintowin" ]]; then
|
||||
perl -pi -e "s/(# )(.*)(# KintoWin)/\$2\$3/g" ./xkeysnail-config/kinto.py.new
|
||||
fi
|
||||
|
||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
|
||||
mv ./xkeysnail-config/kinto.py.new ~/.config/kinto/kinto.py
|
||||
# if [ "$distro" == "fedora" ];then
|
||||
sudo rm /etc/systemd/system/xkeysnail.service
|
||||
@@ -189,17 +266,20 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
|
||||
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/xkeysnail.service && echo "Created soft symlink..." || echo "Failed to create soft symlink..."
|
||||
sudo ln -s "$xkeypath"xkeysnail.service /etc/systemd/system/graphical.target.wants/xkeysnail.service && echo "Created soft symlink for graphical target..." || echo "Failed to create soft symlink for graphical target..."
|
||||
xhost +SI:localuser:root
|
||||
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
|
||||
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git || git pull --depth 10
|
||||
cd xkeysnail
|
||||
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||
giturl=$(git ls-remote --get-url)
|
||||
if [ "$geturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
|
||||
if [ "$giturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
|
||||
echo -e "\nreplacing xkeysnail with fork...\n"
|
||||
cd ..
|
||||
rm -rf ./xkeysnail
|
||||
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
|
||||
git clone --depth 10 https://github.com/rbreaves/xkeysnail.git
|
||||
cd xkeysnail
|
||||
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
|
||||
fi
|
||||
git pull origin master
|
||||
sudo pip3 install --upgrade .
|
||||
cd ..
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl --state=not-found --all | grep xkeysnail
|
||||
if [ "$distro" == "fedora" ];then
|
||||
@@ -242,9 +322,7 @@ 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
|
||||
elif [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
|
||||
echo "Uninstalling Kinto - xkeysnail (udev)"
|
||||
uninstall
|
||||
# Undo Apple keyboard cmd & alt swap
|
||||
@@ -263,5 +341,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
|
||||
elif [[ $1 == "5" || $1 == "budgieUpdate" ]]; then
|
||||
budgieUpdate
|
||||
else
|
||||
echo "Expected argument was not provided"
|
||||
fi
|
Reference in New Issue
Block a user