Compare commits

...

39 Commits

Author SHA1 Message Date
Ben Reaves
cbb60668e3 - Proof of concept cheatsheet feature 2020-06-06 03:29:47 -05:00
Ben Reaves
0275669be1 - Fixed pasting & various shortcut issues under Windows 10 2020-06-01 19:22:19 -05:00
Ben Reaves
3899fcf596 - Fixed potential problem in the xkb setup 2020-05-31 20:14:26 -05:00
Ben Reaves
20c93600e1 - Added Windows 10 Emoji Panel Ctrl-Cmd-Spacebar 2020-05-31 16:37:01 -05:00
Ben Reaves
c0bfec035f - Fixes RCtrl key on Left Cmd position for Windows using VMs & VS Code remaps. Recloses #191 2020-05-30 19:46:11 -05:00
Ben Reaves
eb576a6217 - Fixed shortcuts by re-ordering code (windows) 2020-05-30 00:10:03 -05:00
Ben Reaves
b34dc4e928 - Sublime text remaps in VS Code now optional (linux). Closes #191 2020-05-29 16:06:40 -05:00
Ben Reaves
2ffe639024 - Resolves multi-language support under xkeysnail. Closes #192. 2020-05-29 15:33:53 -05:00
Ben Reaves
4c5cb36503 - Added cmd-t/w - open/close tabs to win terminals 2020-05-27 02:38:14 -05:00
Ben Reaves
6b4c697dd0 - Added support for Windows 10 Hosts w/ Kinto & running Linux VMs 2020-05-27 00:02:41 -05:00
Ben Reaves
7fe9230b5f - Added proper Ctrl/Alt + Backspace behavior for Linux remap. Closes #187 2020-05-23 16:02:32 -05:00
Ben Reaves
e3d42651b7 - Adding basic hotkey functions for apps 2020-05-18 14:21:31 -05:00
Ben Reaves
ca54bf89d6 - Part of #182 merge, brings back Ctrl-a/e functionality for GUI apps. 2020-05-18 14:03:43 -05:00
Ben Reaves
772413a9c3 Merge pull request #182 from Mahoney-forks/fix-ctl-a-beginning-of-line
Make toggle-application-view shortcut more mac like
2020-05-18 13:44:20 -05:00
Robert Elliot
bbd7b3fc93 Make toggle-application-view shortcut more mac like
Toggle-application-view defaults to `<Super-a>` (virtual)/`<Ctrl-a>` (physical)
This clashed with using `<Ctrl-a>` for move cursor to beginning of line (OS/X).
`LaunchB` seems the closes OS/X analogue - FN-F4.
2020-05-18 11:40:57 +01:00
Ben Reaves
98120062eb - Added linux mint and mate support 2020-05-16 02:52:25 -05:00
Ben Reaves
637a8fecaa Merge pull request #178 from rbreaves/dev
- Improved xfce4 support, added xfce4-terminal. Fixed xkeysnail issue.
2020-05-16 01:03:40 -05:00
Ben Reaves
ad53b7034d - Improved support for xfce4 with Ubuntu, xubuntu, voyager. Fixed In-app switching bug. 2020-05-15 20:49:48 -05:00
Ben Reaves
896c6fd6a1 - Added xfce4-terminal 2020-05-15 20:19:15 -05:00
Ben Reaves
dbaf02f884 Merge pull request #177 from rbreaves/dev
- Setup fixes for xkeynail install
2020-05-15 13:45:15 -05:00
Ben Reaves
79857af79c - Setup fixes for xkeynail install 2020-05-15 13:43:21 -05:00
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
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
10 changed files with 457 additions and 119 deletions

2
.gitignore vendored
View File

@@ -2,3 +2,5 @@
.DS_Store
__pycache__/
xkeysnail/
keybindings_*
mutter_*

138
references/overlay.py Normal file
View File

@@ -0,0 +1,138 @@
import wx
# import wx.richtext as rt
# import images
# http://www.ccp4.ac.uk/dist/checkout/wxPython-src-3.0.2.0/wxPython/demo/RichTextCtrl.py
# https://stackoverflow.com/questions/40257359/how-to-dynamically-update-multiple-wxpython-static-text
def GetRoundBitmap( w, h, r ):
maskColor = wx.Colour(0,0,0)
shownColor = wx.Colour(5,5,5)
b = wx.EmptyBitmap(w,h)
dc = wx.MemoryDC(b)
dc.SetBrush(wx.Brush(maskColor))
dc.DrawRectangle(0,0,w,h)
dc.SetBrush(wx.Brush(shownColor))
dc.SetPen(wx.Pen(shownColor))
dc.DrawRoundedRectangle(0,0,w,h,r)
dc.SelectObject(wx.NullBitmap)
b.SetMaskColour(maskColor)
return b
def GetRoundShape( w, h, r ):
return wx.Region( GetRoundBitmap(w,h,r) )
class PanelOne(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
self.Bind(wx.EVT_KEY_UP, self.OnKeyDown)
wx.StaticText(self, label = "'^⌘G - Select All (Ctrl-Cmd-G) ^⌘G - Select All (Ctrl-Cmd-G)\n^⌘G - Select All (Ctrl-Cmd-G) ^⌘G - Select All (Ctrl-Cmd-G)")
self.SetTransparent( 220 )
def OnKeyDown(self, event):
self.Destroy()
class FancyFrame(wx.Frame):
def __init__(self):
sizer = wx.GridBagSizer()
style = ( wx.CLIP_CHILDREN | wx.STAY_ON_TOP | wx.FRAME_NO_TASKBAR |
wx.NO_BORDER | wx.FRAME_SHAPED )
wx.Frame.__init__(self, None, title='Fancy', style = style)
# self.rtc = rt.RichTextCtrl(self, style=wx.VSCROLL|wx.TE_READONLY|wx.HSCROLL|wx.NO_BORDER);
# self.rtc.Disable()
boldstatic = wx.Font(pointSize = 24, family = wx.DEFAULT,
style = wx.BOLD, weight = wx.BOLD,
faceName = 'Consolas')
normalstatic = wx.Font(pointSize = 10, family = wx.DEFAULT,
style = wx.NORMAL, weight = wx.NORMAL,
faceName = 'Consolas')
# font = wx.Font(pointSize = 18, family = wx.DEFAULT,
# style = wx.NORMAL, weight = wx.NORMAL,
# faceName = 'Consolas')
self.SetFont(boldstatic)
self.SetBackgroundColour((211,211,211))
self.label = wx.StaticText(self, label = "^⌘G", pos = (100,50))
self.SetFont(normalstatic)
self.label2 = wx.StaticText(self, label = " - Select All (Ctrl-Cmd-G)", pos = (200,50))
# sizer.Add(self.label, (4, 0), (1, 5), wx.EXPAND)
# sizer.Add(self.label2, (5, 0), (1, 5), wx.EXPAND)
# wx.StaticText(self, label = "^⌘G - Select All (Ctrl-Cmd-G) || ^⌘G - Select All (Ctrl-Cmd-G)\n^⌘G - Select All (Ctrl-Cmd-G) ^⌘G - Select All (Ctrl-Cmd-G)")
# self.rtc.Bind(wx.EVT_SET_FOCUS,self.OnInput)
# self.rtc.Bind(wx.EVT_KILL_FOCUS,self.OnInput)
# self.rtc.Bind(wx.EVT_KEY_UP, self.OnKeyDown)
# self.rtc.BeginFontSize(14)
# self.rtc.BeginBold()
# self.rtc.WriteText("^⌘G")
# self.rtc.EndBold()
# self.rtc.BeginFontSize(10)
# self.rtc.WriteText(" - Select All (Ctrl-Cmd-G)\n")
# self.rtc.BeginFontSize(14)
# self.rtc.WriteText("Different font sizes on the same line is allowed, too.")
# self.rtc.EndFontSize()
# self.rtc.WriteText(" Next we'll show an indented paragraph.")
# self.rtc.BeginLeftIndent(60)
# self.rtc.Newline()
# self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")
# self.rtc.EndLeftIndent()
# self.SetFont(wx.Font(20, wx.SWISS, wx.NORMAL, wx.BOLD))
# font = wx.Font(18, wx.DECORATIVE, wx.ITALIC, wx.NORMAL)
# wx.text.SetFont(font)
# self.panelOne = PanelOne(self)
# self.SetFocus()
w, h = wx.GetDisplaySize()
self.SetSize((w/2, h/2))
self.SetPosition( ((w-w/2)/2,(h-h/2)/2) )
self.SetTransparent( 220 )
self.Bind(wx.EVT_KEY_UP, self.OnKeyDown)
self.Bind(wx.EVT_MOTION, self.OnMouse)
self.Bind(wx.EVT_PAINT, self.OnPaint)
if wx.Platform == '__WXGTK__':
self.Bind(wx.EVT_WINDOW_CREATE, self.SetRoundShape)
else:
self.SetRoundShape()
self.SetSizer(sizer)
self.Show(True)
def OnInput(self, e):
self.Destroy()
# e.Skip()
def SetRoundShape(self, event=None):
w, h = self.GetSizeTuple()
self.SetShape(GetRoundShape( w,h, 10 ) )
def OnPaint(self, event):
dc = wx.PaintDC(self)
dc = wx.GCDC(dc)
w, h = self.GetSizeTuple()
r = 10
dc.SetPen( wx.Pen("#D3D3D3dth = 2"))
dc.SetBrush( wx.Brush("#D3D3D3"))
dc.DrawRoundedRectangle( 0,0,w,h,r )
def OnKeyDown(self, event):
# self.Close(force=True)
self.Destroy()
def OnMouse(self, event):
"""implement dragging"""
if not event.Dragging():
self._dragPos = None
return
self.CaptureMouse()
if not self._dragPos:
self._dragPos = event.GetPosition()
else:
pos = event.GetPosition()
displacement = self._dragPos - pos
self.SetPosition( self.GetPosition() - displacement )
app = wx.App()
f = FancyFrame()
app.MainLoop()

View File

@@ -68,6 +68,8 @@ if len(check_x11) == 0:
distro = cmdline("awk -F= '$1==\"NAME\" { print $2 ;}' /etc/os-release").replace('"','').strip().split(" ")[0]
dename = cmdline("./system-config/dename.sh").replace('"','').strip().split(" ")[0].lower()
run_pkg = ""
def requirements(pkgm):
print(bcolors.CYELLOW2 + "You need to install some packages, " +run_pkg+ ", for Kinto to fully remap browsers during input focus.\n" + bcolors.ENDC)
print("sudo " + pkgm + " " + run_pkg + "\n")
@@ -110,7 +112,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):
@@ -121,8 +123,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 ['']")
@@ -154,7 +158,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
@@ -289,52 +295,55 @@ def Uninstall():
if dename == "kde" or dename == "xfce":
print("Please log off and back on for your original DE hotkeys to take effect.")
check_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()
def kintoImpOne():
pkgm = cmdline("which apt-get 2>/dev/null").strip()
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()
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 "
pkgm = cmdline("which apt-get 2>/dev/null").strip()
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:
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(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()
if len(pkgm) == 0:
print("No supported package manager found. Exiting...")
sys.exit()
runpkg = 0
run_pkg = ""
runpkg = 0
global 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 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 runpkg != 0:
print(runpkg)
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")
@@ -380,6 +389,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):
@@ -390,6 +400,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","xfce4-terminal" ]
},
{
"name": "firefox",

View File

@@ -12,7 +12,9 @@ GroupAdd, terminals, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, posix, ahk_exe ubuntu.exe
GroupAdd, posix, ahk_exe ConEmu.exe
GroupAdd, posix, ahk_exe ConEmu64.exe
GroupAdd, posix, ahk_exe Hyper.exe
GroupAdd, posix, ahk_exe mintty.exe
GroupAdd, posix, Fluent Terminal ahk_class ApplicationFrameWindow
GroupAdd, ConEmu, ahk_exe ConEmu.exe
GroupAdd, ConEmu, ahk_exe ConEmu64.exe
@@ -25,24 +27,12 @@ GroupAdd, editors, ahk_exe Code.exe
GroupAdd, vscode, ahk_exe VSCodium.exe
GroupAdd, vscode, ahk_exe Code.exe
; Cmd+Space Alternative
LWin & vk07::return
LWin::return
RWin & vk07::return
RWin::return
^Space::Send ^{Esc}
; ^Space::run AppName
; 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}
; Close Apps
^q::Send !{F4}
; Emoji Panel
#^Space::Send {LWin down};{LWin up}
; Full Screenshot
^+3::Send {PrintScreen}
@@ -65,15 +55,46 @@ $^+Right::Send +{End}
!Right::Send ^{Right}
!+Right::Send ^+{Right}
; ; 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
; Cmd+Space Alternative
LWin & vk07::return
LWin::return
RWin & vk07::return
RWin::return
^Space::Send ^{Esc}
; ^Space::run AppName
; Cmd Tab For App Switching
LCtrl & Tab::AltTab
RCtrl & Tab::AltTab
; Ctrl Tab for In-App Tab Switching
; 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
; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode ; ST2CODE
; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines
#+Up::send ^!{Up} ; ST2CODE
#+Down::send ^!{Down} ; ST2CODE
; Remap Ctrl+Cmd+G to select all matches
#^g::send ^+{L} ; ST2CODE
#If ; ST2CODE
#IfWinActive ahk_exe sublime_text.exe
; Remap Ctrl+Shift to behave like macOS Sublimetext
@@ -85,22 +106,41 @@ $^+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}
#c::Send {LCtrl down}c{LCtrl Up}
#IfWinNotActive ahk_group ConEmu
; Paste
^v::Send {LCtrl down}{LShift down}v{LCtrl Up}{LShift Up}
#If
; Paste
$^v::
If not WinActive("ahk_group ConEmu") && not WinActive("ahk_exe cmd.exe"){
Send {LCtrl down}{LShift down}v{LCtrl Up}{LShift Up}
}
else{
Send ^v
}
return
#If
#IfWinActive ahk_group posix
; Open/Close Tab for those that support it
$^t::
If not WinActive("ahk_group ConEmu"){
Send {LCtrl down}{LShift down}t{LCtrl Up}{LShift Up}
}
else{
Send ^t
}
return
$^w::
If not WinActive("ahk_group ConEmu"){
Send {LCtrl down}{LShift down}w{LCtrl Up}{LShift Up}
}
else{
Send ^w
}
return
; End of Line
#e::Send {LCtrl down}e{LCtrl Up}
^e::return
@@ -125,11 +165,11 @@ $^+Right::Send +{End}
#z::Send {LCtrl down}z{LCtrl Up}
#If
#IfWinActive ahk_group ConEmu
; Paste
$^v::Send {Shift down}{Insert}{Shift Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If
; #IfWinActive ahk_group ConEmu
; ; Paste
; $^v::Send {Shift down}{Insert}{Shift Up}
; #v::Send {LCtrl down}v{LCtrl Up}
; #If
#IfWinActive ahk_exe mintty.exe
; Copy

View File

@@ -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,9 @@ 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
# Key.LEFT_CTRL: Key.RIGHT_CTRL, # KintoWin
# # Mac Only
# Key.LEFT_META: Key.RIGHT_CTRL, # Mac
# Key.LEFT_CTRL: Key.LEFT_META, # Mac
@@ -36,7 +45,7 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# Key.LEFT_ALT: Key.RIGHT_CTRL, # Chromebook
# # Left Ctrl Stays Left Ctrl
# Key.LEFT_META: Key.LEFT_ALT, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # Chromebook - Multi-language (Remove)
# Key.RIGHT_CTRL: Key.RIGHT_ALT, # Chromebook
# # Right Meta does not exist on chromebooks
@@ -44,10 +53,14 @@ define_conditional_modmap(re.compile(termStr, re.IGNORECASE), {
# Key.LEFT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.LEFT_META: Key.LEFT_ALT, # WinMac
# Key.LEFT_CTRL: Key.LEFT_CTRL, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac
# Key.RIGHT_ALT: Key.RIGHT_CTRL, # WinMac - Multi-language (Remove)
# 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 +77,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 +110,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 +142,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 +150,11 @@ define_keymap(re.compile("code", re.IGNORECASE),{
K("M-Shift-Left"): [K("M-F19"),K("C-Shift-Left")], # Select Left of Word
K("M-Shift-Right"): [K("M-F19"),K("C-Shift-Right")], # Select Right of Word
# K("C-PAGE_DOWN"): pass_through_key, # cancel next_view
# K("C-PAGE_UP"): pass_through_key, # cancel prev_view
K("C-M-Left"): K("C-PAGE_UP"), # next_view
K("C-M-Right"): K("C-PAGE_DOWN"), # prev_view
# VS Code Shortcuts
K("C-g"): pass_through_key, # cancel Go to Line...
K("Super-g"): K("C-g"), # Go to Line...
@@ -140,9 +167,10 @@ define_keymap(re.compile("code", re.IGNORECASE),{
K("C-g"): K("f3"), # find_next
K("Shift-f3"): pass_through_key, # cancel find_prev
K("C-Shift-g"): K("Shift-f3"), # find_prev
K("Super-C-g"): K("C-f2"), # Sublime - find_all_under
K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up
K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down
# K("Super-C-g"): K("C-f2"), # Default - Sublime - find_all_under
# K("C-M-g"): K("C-f2"), # Chromebook - Sublime - find_all_under
# K("Super-Shift-up"): K("M-Shift-up"), # multi-cursor up - Sublime
# K("Super-Shift-down"): K("M-Shift-down"), # multi-cursor down - Sublime
# K(""): pass_through_key, # cancel
# K(""): K(""), #
}, "Code")
@@ -240,7 +268,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"),

View File

@@ -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
@@ -72,19 +72,102 @@ 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
# multi-language
rightalt=false
# VS code remap
vssublime=false
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "4" || $1 == "kintowin" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
while true; do
read -rep $'\nDo you want multi-language support (the right Alt key will not remap)? (y/N)\n' yn
case $yn in
[Yy]* ) rightalt=true; break;;
* ) break;;
esac
done
while true; do
read -rep $'\nWould you like to give VS Code Sublime Text keymaps? (y/N)\n' yn
case $yn in
[Yy]* ) vssublime=true; break;;
* ) break;;
esac
done
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" == "dev" ] || [ "$branch" == "alpha" ];then
while true; do
@@ -110,21 +193,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 +247,38 @@ 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"
if $vssublime ; then
perl -pi -e "s/(# )(.*)(- Sublime)/\$2\$3/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
fi
if [[ $1 == "1" || $1 == "winmac" ]]; then
echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd;echo 'options hid_apple swap_opt_cmd=1' | sudo tee -a /etc/modprobe.d/hid_apple.conf;sudo update-initramfs -u -k all
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 $rightalt ; then
perl -pi -e "s/(\w.*)(Multi-language)/# \$1\$2/g" ./xkeysnail-config/kinto.py.new >/dev/null 2>&1
fi
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "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 +293,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 +349,14 @@ if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1
echo "You can run 'sudo systemctl status xkeysnail' for more info"
echo "You can also run 'sudo journalctl -u xkeysnail'"
fi
elif ! [[ $1 == "4" || $1 == "uninstall" ]]; then
echo "Expected argument was not provided"
else
echo ""
if $vssublime ; then
echo -e "\e[1m\e[32mEnabled\e[0m VS Code Sublime Text remap."
fi
if $rightalt ; then
echo -e "\e[1m\e[32mEnabled\e[0m mutli-language support."
fi
elif [[ $1 == "5" || $1 == "uninstall" || $1 == "Uninstall" ]]; then
echo "Uninstalling Kinto - xkeysnail (udev)"
uninstall
# Undo Apple keyboard cmd & alt swap
@@ -263,5 +375,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