diff --git a/setup.py b/setup.py index 71bb137..fba6748 100755 --- a/setup.py +++ b/setup.py @@ -23,14 +23,12 @@ def windows_setup(): os.system('powershell -executionpolicy bypass ".\\windows\\autohotkey.ps1"') print("Copying autohotkey combinations for Terminals & Editors...") os.system('copy /Y "' + path + '\\windows\\kinto.ahk" "' + path + '\\windows\\kinto-new.ahk"') + if default < 3: + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default)(?!( - ST2CODE))(.*)/$2$3$5/g" .\\windows\\kinto-new.ahk') if default == 1: os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" .\\windows\\kinto-new.ahk') elif default == 2: os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" .\\windows\\kinto-new.ahk') - elif default == 3: - os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Chromebook)/$2$3/g" .\\windows\\kinto-new.ahk') - elif default == 4: - os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/g" .\\windows\\kinto-new.ahk') elif default == 5: print("Removing any old registry keys from prior versions...") p = subprocess.Popen(['powershell.exe', "Remove-ItemProperty -Path HKLM:'SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -ErrorAction SilentlyContinue"], stdout=sys.stdout) @@ -43,13 +41,23 @@ def windows_setup(): os.system('(rd /s /q "%userprofile%\\.kinto") 2> nul') print("") print("Uninstall of Kinto is Complete.") + if default == 3: + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Chromebook)/$2$3/g" .\\windows\\kinto-new.ahk') + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers/CB)/$2$3/g" .\\windows\\kinto-new.ahk') + if default == 3 || default == 4: + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM)/$2$3/g" .\\windows\\kinto-new.ahk') + if default == 4: + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; IBM)/$2$3/g" .\\windows\\kinto-new.ahk') + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; WinModifiers/CB/IBM)/$2$3/g" .\\windows\\kinto-new.ahk') if default > 0 and default < 5: stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC) print("\nWill now install Ubuntu Termimnal Theme as default...") os.system('regedit "' + path + '\\windows\\theme_ubuntu.reg"') os.system('robocopy "'+ path + '\\assets" "%userprofile%\\.kinto\\assets" /E') - if(stvscode): - os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk') + if (stvscode and (default > 0 || default < 3)): + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; Default - ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk') + elif (stvscode and (default == 3 || default == 4 )): + os.system('C:\\Strawberry\\perl\\bin\\perl.exe -pi -e "s/(; )(.*)(; CB/IBM - ST2CODE)/$2$3/g" .\\windows\\kinto-new.ahk') os.system('copy /Y "' + path + '\\windows\\kinto-start.vbs" "%userprofile%\\.kinto\\kinto-start.vbs"') os.system('copy /Y "' + path + '\\windows\\usb.vbs" "%userprofile%\\.kinto\\usb.vbs"') os.system('copy /Y "' + path + '\\windows\\detectUSB.ahk" "%userprofile%\\.kinto\\detectUSB.ahk"') diff --git a/windows/kinto.ahk b/windows/kinto.ahk index dbf4a89..e50ace2 100644 --- a/windows/kinto.ahk +++ b/windows/kinto.ahk @@ -153,9 +153,9 @@ GroupAdd, intellij, ahk_exe idea64.exe } else if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P")) { ; Secondary ; Send {LCtrl down}{Secondary up}{LShift down}{tab} - ; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers + ; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers/CB ; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers - ; Send {LCtrl down}{CapsLock up}{LShift down}{tab} ; CB/IBM + ; Send {LCtrl down}{CapsLock up}{LShift down}{tab} ; IBM KeyWait, tab ; Primary ; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers/CB/IBM @@ -168,14 +168,14 @@ GroupAdd, intellij, ahk_exe idea64.exe Send {LAlt down}{LShift down}{tab} KeyWait, tab ; Secondary - ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers + ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers/CB ; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers - ; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) = false { ; CB/IBM + ; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) = false { ; IBM return ; Secondary - ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers + ; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers/CB ; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers - ; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) { ; CB/IBM + ; } else if (GetKeyState("CapsLock", "P") AND GetKeyState("LShift", "P")) { ; IBM return } else { send {Blind}{tab} @@ -195,7 +195,7 @@ GroupAdd, intellij, ahk_exe idea64.exe ; $LAlt::LCtrl ; CB/IBM ; $RAlt::RCtrl ; CB/IBM - ; $CapsLock::LWin ; CB/IBM + ; $CapsLock::LWin ; IBM ; $LCtrl::LAlt ; CB/IBM ; $LAlt::LCtrl ; WinModifiers @@ -216,6 +216,7 @@ GroupAdd, intellij, ahk_exe idea64.exe ; Primary ; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers ; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers + ; $LAlt up::Send {LWin up}{CapsLock up}{LAlt up}{LCtrl up} ; CB/IBM ; Close Apps ^q::Send !{F4}