Compare commits

...

36 Commits

Author SHA1 Message Date
Ben Reaves
53206855f4 Merge pull request #174 from rbreaves/dev
- Budgie patch for App Switching. Also fixes Ctrl-Tab regression.
2020-05-14 23:52:14 -05:00
Ben Reaves
6298c6c9cc - xkeysnail modifier key persistance regression temp fix. 2020-05-14 20:56:55 -05:00
Ben Reaves
318efcc3fd - Adds additional tab switching to Code/ium. Closes #173 2020-05-14 18:19:03 -05:00
Ben Reaves
2567f5006e - Added support for Ubuntu Budgie. Fixed App Switching bug. 2020-05-13 16:17:57 -05:00
Ben Reaves
fd648d3850 - Added Tilix, default terminal in Ubuntu Budgie 2020-05-12 17:26:13 -05:00
Ben Reaves
ac34350392 Merge pull request #171 from rbreaves/dev
- Added mate-terminal to kinto
2020-05-11 21:55:32 -05:00
Ben Reaves
8df691a52d - Added mate-terminal to kinto 2020-05-11 21:54:05 -05:00
Ben Reaves
11f8e33fdf Merge pull request #170 from rbreaves/dev
- Fixes manjaro install issue (gcc). closes #168.
2020-05-11 19:48:51 -05:00
Ben Reaves
7de111726b - Fixes install issue of kinto xkeysnail implementation on manjaro. Adds gcc check, closes #168. 2020-05-11 19:30:19 -05:00
Ben Reaves
5a12521b58 Merge pull request #165 from rbreaves/dev
- Added optional sublime to vs code keymaps to menu, improved ctrltab for windows
2020-05-10 12:48:02 -05:00
Ben Reaves
ad196c4d6b - Added ST3 keymap match all for VS Code on chromebooks 2020-05-10 02:27:01 -05:00
Ben Reaves
17a877c693 - Improved CtrlTab to work with more apps under Windows 10 2020-05-08 18:24:07 -05:00
Ben Reaves
0c3e03a81b Merge pull request #160 from rbreaves/documentation
- Updated readme to include Fluent Terminal for Windows
2020-05-08 15:00:22 -05:00
Ben Reaves
4c8ae68027 - Adds some optional ST3 keymaps to VS Code on Windows (#159)
* - Added commented out sublime text keymaps for VS Code under Windows

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

* - Added support for Fluent Terminal on Windows

* - Firefox paste fix for Windows

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

* - Added refresh of environment variables after possible package installs on Windows
2020-05-08 14:18:56 -05:00
Ben Reaves
ed771f4ae4 - Added refresh of environment variables after possible package installs on Windows 2020-05-08 14:12:35 -05:00
Ben Reaves
9d5c7b6230 - Added Sublime hotkeys to VS Code to setup for windows 2020-05-08 14:06:35 -05:00
Ben Reaves
b85b786dcc - Firefox paste fix for Windows 2020-05-08 03:46:34 -05:00
Ben Reaves
7904be6d5c - Added support for Fluent Terminal on Windows 2020-05-08 03:26:11 -05:00
Ben Reaves
df5d2d8c0e - Added cmd.exe to kinto.ahk for Windows 2020-05-08 02:47:00 -05:00
Ben Reaves
a556f1afa9 - Added commented out sublime text keymaps for VS Code under Windows 2020-05-07 22:24:23 -05:00
Ben Reaves
61fe293af8 Merge pull request #158 from rbreaves/dev
- Improved setup.py, added full and region screenshots for Windows
2020-05-07 20:23:31 -05:00
Ben Reaves
3ac264ea99 - Added full and region screenshots to Windows. Updated setup.py for Windows. 2020-05-07 20:16:40 -05:00
Ben Reaves
32111fe5a4 Merge pull request #157 from rbreaves/documentation
- Readme updated with ToC and resources
2020-05-07 16:51:18 -05:00
Ben Reaves
dff590e7df Merge pull request #156 from rbreaves/documentation
- Readme updated with ToC and resources
2020-05-07 16:50:29 -05:00
Ben Reaves
4c820d9f67 Merge branch 'dev' 2020-05-07 13:11:04 -05:00
Ben Reaves
59521772af Merge pull request #155 from rbreaves/dev
- Added terminals & improved uninstaller
2020-05-07 13:00:22 -05:00
Ben Reaves
5da49257dc Merge pull request #153 from rbreaves/dev
- Fixed Cmd-Tilde to switch within single app context. Closes #151
2020-05-05 23:00:51 -05:00
Ben Reaves
fcb823bb2f Merge pull request #150 from rbreaves/dev
Allow c code to be detectable to GitHub
2020-05-05 01:31:02 -05:00
Ben Reaves
50e6dfd863 Merge pull request #149 from rbreaves/dev
Updated project to be classified as python over c
2020-05-05 01:28:07 -05:00
Ben Reaves
a52bf9959d Merge pull request #148 from rbreaves/dev
Made readme clearer (Terminal Keys Table)
2020-05-05 00:48:48 -05:00
Ben Reaves
e6db6a9726 Merge pull request #147 from rbreaves/dev
Updated readme to be more clear about Manjaro IBus issue
2020-05-04 12:55:13 -05:00
Ben Reaves
d6c98a345c Merge pull request #146 from rbreaves/dev
- Updated shortcuts to install last during xkeysnail install
2020-05-04 11:47:17 -05:00
Ben Reaves
c98268c287 Merge pull request #145 from rbreaves/dev
- Relocated files not relevant to install under references, deleted others
2020-05-03 22:41:26 -05:00
Ben Reaves
ad35946adb Merge pull request #144 from rbreaves/dev
- Case insensitivity for xkey config. General term tab switching restored. Fixes #143
2020-05-03 12:58:43 -05:00
Ben Reaves
6aa77a30a8 Merge pull request #142 from rbreaves/dev
- Minor fix for non-elementary terminal keymap
2020-05-02 22:46:33 -05:00
Ben Reaves
e22cc5b6c7 Merge pull request #140 from rbreaves/dev
- Xkeysnail added to Production branch
2020-05-02 22:02:14 -05:00
9 changed files with 244 additions and 100 deletions

178
setup.py
View File

@@ -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()
@@ -103,6 +154,8 @@ 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 == "budgie" and dename == "gnome":
# print("Apply budgie shortcuts here")
elif distro == "galliumos" and dename == "xfce":
print("Applying GalliumOS (xfce) shortcuts...")
cmdline('cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml ./xfce4-keyboard-shortcuts_`date +"%Y.%m.%d-%s"`.xml')
@@ -178,38 +231,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?")
@@ -270,64 +291,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 +384,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 +395,8 @@ if(kintotype == 4):
Uninstall()
exit()
kintoImpOne()
for index, item in enumerate(data['defaulttypes']):
ossym = ""
if item == "windows":

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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}

View File

@@ -3,10 +3,13 @@
import re
from xkeysnail.transform import *
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty"]
terminals = ["gnome-terminal","konsole","io.elementary.terminal","terminator","sakura","guake","tilda","xterm","eterm","kitty","alacritty","mate-terminal","tilix"]
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
@@ -97,7 +100,7 @@ define_keymap(None,{
# 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 +123,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 +131,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 +148,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

View File

@@ -72,6 +72,69 @@ 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)"
@@ -120,11 +183,12 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
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
# echo "Transferring files..."
mkdir -p ~/.config/kinto
@@ -189,17 +253,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 5 https://github.com/rbreaves/xkeysnail.git
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
cd xkeysnail
giturl=$(git ls-remote --get-url)
if [ "$geturl" != "https://github.com/rbreaves/xkeysnail.git" ];then
cd ..
rm -rf ./xkeysnail
git clone --depth 1 https://github.com/rbreaves/xkeysnail.git
git clone --depth 5 https://github.com/rbreaves/xkeysnail.git
git checkout 51c369084e0045a8410d227bab52411bf84fb65b
cd xkeysnail
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 +309,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 == "4" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo "Uninstalling Kinto - xkeysnail (udev)"
uninstall
# Undo Apple keyboard cmd & alt swap
@@ -263,5 +328,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