Merge pull request #255 from rbreaves/alpha

- Added xfce system tray support
This commit is contained in:
Ben Reaves
2020-08-05 01:42:22 -05:00
committed by GitHub
4 changed files with 389 additions and 373 deletions

View File

@@ -118,6 +118,11 @@ GroupAdd, editors, ahk_exe Code.exe
GroupAdd, browsers, ahk_exe chrome.exe
GroupAdd, browsers, ahk_exe opera.exe
GroupAdd, browsers, ahk_exe firefox.exe
; Disable Key Remapping for Virtual Machines
; Disable for Remote desktop solutions too
GroupAdd, virtm, ahk_exe VirtualBoxVM.exe
; Disabled Edge for now - no ability to close all instances
; GroupAdd, browsers, Microsoft Edge ahk_class ApplicationFrameWindow
@@ -129,146 +134,148 @@ GroupAdd, vstudio, ahk_exe devenv.exe
GroupAdd, intellij, ahk_exe idea.exe
GroupAdd, intellij, ahk_exe idea64.exe
; New AltTab and CtrlTab fix
*tab::
{
#IfWinNotActive ahk_group virtm
; New AltTab and CtrlTab fix
*tab::
{
; Tertiary
if (GetKeyState("LCtrl", "P") AND GetKeyState("LShift", "P") = false) {
; Secondary
; Send {LCtrl down}{Secondary up}{tab}
; Send {LCtrl down}{LWin up}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers
; Send {LCtrl down}{LWin up}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{tab} ; MacModifiers
KeyWait, tab
; Tertiary
} 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}{LAlt up}{LShift down}{tab} ; MacModifiers
; Send {LCtrl down}{LWin up}{LShift down}{tab} ; WinModifiers
; Send {LCtrl down}{LAlt up}{LShift down}{tab} ; MacModifiers
KeyWait, tab
; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
Send {LAlt down}{tab}
KeyWait, tab
; Primary
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
Send {LAlt down}{LShift down}{tab}
KeyWait, tab
; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) = false { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P") = false) { ; MacModifiers
return
; Secondary
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
; } else if (GetKeyState("LWin", "P") AND GetKeyState("LShift", "P")) { ; WinModifiers
; } else if (GetKeyState("LAlt", "P") AND GetKeyState("LShift", "P")) { ; MacModifiers
return
} else {
send {Blind}{tab}
}
return
}
}
tab::Send {tab}
tab::Send {tab}
+tab::Send {Shift down}{tab}{Shift up}
+tab::Send {Shift down}{tab}{Shift up}
; Basic Remap
;
; Primary::LCtrl
; Secondary::LAlt
; Tertiary::LWin
; Basic Remap
;
; Primary::LCtrl
; Secondary::LAlt
; Tertiary::LWin
; $LAlt::LCtrl ; WinModifiers
; $RAlt::RCtrl ; WinModifiers
; $LWin::LAlt ; WinModifiers
; $LCtrl::LWin ; WinModifiers
; $LAlt::LCtrl ; WinModifiers
; $RAlt::RCtrl ; WinModifiers
; $LWin::LAlt ; WinModifiers
; $LCtrl::LWin ; WinModifiers
; $LWin::LCtrl ; MacModifiers
; $RWin::RCtrl ; MacModifiers
; $LCtrl::LWin ; MacModifiers
; $LWin::LCtrl ; MacModifiers
; $RWin::RCtrl ; MacModifiers
; $LCtrl::LWin ; MacModifiers
; Hack to disable start menu on winkey
; Static
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; Hack to disable start menu on winkey
; Static
$LCtrl up::Send {Ctrl down}{LWin up}{Ctrl up}
; temporary hack to ensure keys don't get stuck
; impacts Alt-Tab fix
; Primary
; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
; temporary hack to ensure keys don't get stuck
; impacts Alt-Tab fix
; Primary
; $LAlt up::Send {LWin up}{LAlt up}{LCtrl up} ; WinModifiers
; $LWin up::Send {LWin up}{LAlt up}{LCtrl up} ; MacModifiers
; Close Apps
^q::Send !{F4}
; Close Apps
^q::Send !{F4}
; Minimize specific Window
^m::WinMinimize, A
; Minimize specific Window
^m::WinMinimize, A
; Minimize all but Active Window
!^m::
WinGet, winid ,, A
WinMinimizeAll
WinActivate ahk_id %winid%
return
; Minimize all but Active Window
!^m::
WinGet, winid ,, A
WinMinimizeAll
WinActivate ahk_id %winid%
return
; hide all instances of active Program
^h::
WinGetClass, class, A
WinGet, AllWindows, List
loop %AllWindows% {
; hide all instances of active Program
^h::
WinGetClass, class, A
WinGet, AllWindows, List
loop %AllWindows% {
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
if(InStr(WinClass,class)){
WinMinimize, % "ahk_id " AllWindows%A_Index%
}
}
return
}
return
; hide all but active program
!^h::
WinGetClass, class, A
WinMinimizeAll
WinGet, AllWindows, List
loop %AllWindows% {
; hide all but active program
!^h::
WinGetClass, class, A
WinMinimizeAll
WinGet, AllWindows, List
loop %AllWindows% {
WinGetClass, WinClass, % "ahk_id " AllWindows%A_Index%
if(InStr(WinClass,class)){
WinRestore, % "ahk_id " AllWindows%A_Index%
}
}
return
}
return
; Show Desktop
^F3::Send #d
; Show Desktop
^F3::Send #d
; Emoji Panel
#^Space::Send {LWin down};{LWin up}
; Emoji Panel
#^Space::Send {LWin down};{LWin up}
; Full Screenshot
^+3::Send {PrintScreen}
; Full Screenshot
^+3::Send {PrintScreen}
; Region Screenshot
^+4::Send #+{S}
; Region Screenshot
^+4::Send #+{S}
; wordwise support
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
^Up::Send ^{Home}
^+Up::Send ^+{Home}
^Down::Send ^{End}
^+Down::Send ^+{End}
^Backspace::Send +{Home}{Delete}
!Backspace::Send ^{Backspace}
!Left::Send ^{Left}
!+Left::Send ^+{Left}
!Right::Send ^{Right}
!+Right::Send ^+{Right}
; wordwise support
$^Left::Send {Home}
$^+Left::Send +{Home}
$^Right::Send {End}
$^+Right::Send +{End}
^Up::Send ^{Home}
^+Up::Send ^+{Home}
^Down::Send ^{End}
^+Down::Send ^+{End}
^Backspace::Send +{Home}{Delete}
!Backspace::Send ^{Backspace}
!Left::Send ^{Left}
!+Left::Send ^+{Left}
!Right::Send ^{Right}
!+Right::Send ^+{Right}
; Cmd+Space Alternative
^Space::Send ^{Esc}
; Cmd+Space Alternative
^Space::Send ^{Esc}
#IfWinActive ahk_group intellij
#IfWinActive ahk_group intellij
; General
^0::Send !{0} ;Open corresponding tool window
^1::Send !{1} ;Open corresponding tool window
@@ -354,27 +361,27 @@ $^+Right::Send +{End}
#+d::Send ^+{F9} ;Debug context configuration from editor
; VCS/Local History
#v::Send !` ;VCS quick popup
#If
#If
; Close all browsers
#IfWinActive ahk_group browsers
; Close all browsers
#IfWinActive ahk_group browsers
^q::send {Alt Down}f{Alt Up}x ; exit all windows
#If
#If
; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode
; Sublime Text Remaps for VS Code
#IfWinActive ahk_group vscode
; Remap Ctrl+Shift to behave like macOS Sublimetext
; Will extend cursor to multiple lines
; #+Up::send ^!{Up} ; ST2CODE
; #+Down::send ^!{Down} ; ST2CODE
; #+Up::send ^!{Up} ; ST2CODE
; #+Down::send ^!{Down} ; ST2CODE
; Remap Ctrl+Cmd+G to select all matches
; #^g::send ^+{L} ; ST2CODE
; #^g::send ^+{L} ; ST2CODE
!+g::send ^+{G} ; View source control
; Sigints - interrupt
$#c::Send {Ctrl down}c{Ctrl up}
#If
#If
#IfWinActive ahk_exe sublime_text.exe
#IfWinActive ahk_exe sublime_text.exe
#^Up::send !{O} ; Switch file
#^f::send {F11} ; toggle_full_screen
^!v::send {Ctrl Down}k{Ctrl Up}{Ctrl Down}v{Ctrl Up} ; paste_from_history
@@ -429,9 +436,9 @@ $^+Right::Send +{End}
^!8::send !+8 ; set_layout
!+9::Return ; cancel set_layout
^!9::send !+9 ; set_layout
#If
#If
#IfWinActive ahk_group terminals
#IfWinActive ahk_group terminals
; End of Line
#e::
@@ -469,9 +476,9 @@ $^+Right::Send +{End}
Send {Blind}v
}
return
#If
#If
#IfWinActive ahk_group posix
#IfWinActive ahk_group posix
; Open/Close Tab for those that support it
$^t::
If not WinActive("ahk_group ConEmu"){
@@ -510,4 +517,5 @@ $^+Right::Send +{End}
#z::Send {LCtrl down}z{LCtrl Up}
#y::Send {LCtrl down}y{LCtrl Up}
#v::Send {LCtrl down}v{LCtrl Up}
#If
#If

View File

@@ -18,6 +18,7 @@ class Indicator():
homedir = os.path.expanduser("~")
kconfig = homedir+"/.config/kinto/kinto.py"
ostype = os.environ.get('XDG_CURRENT_DESKTOP')
enable_id = 0
winmac_id = 0
@@ -183,9 +184,15 @@ class Indicator():
subprocess.Popen(['notify-send','Kinto: Error Resetting KB Type!','-i','budgie-desktop-symbolic'])
def setSysKB(self,button):
if self.ostype == "XFCE":
subprocess.Popen(['xfce4-keyboard-settings'])
else:
subprocess.Popen(['gnome-control-center','keyboard'])
def setRegion(self,button):
if self.ostype == "XFCE":
subprocess.Popen(['gnome-language-selector'])
else:
subprocess.Popen(['gnome-control-center','region'])
def quit(source):

View File

@@ -5,6 +5,7 @@ Description=xkeysnail
Type=simple
KillMode=process
ExecStart=/usr/bin/sudo /bin/bash -c '/usr/bin/xhost +SI:localuser:root && {homedir}/.config/kinto/killdups.sh && /usr/local/bin/xkeysnail --quiet --watch {homedir}/.config/kinto/kinto.py'
ExecStop=/usr/bin/sudo pkill -f xkeysnail
Restart=on-failure
RestartSec=3
Environment=DISPLAY={displayid}

View File

@@ -201,7 +201,7 @@ rightalt=false
vssublime=false
if [[ $1 == "1" || $1 == "2" || $1 == "3" || $1 == "winmac" || $1 == "mac" || $1 == "chromebook" ]]; then
if [[ $dename == "gnome" || $dename == "budgie" || $dename == "mate" ]];then
if [[ $dename == "gnome" || $dename == "budgie" || $dename == "mate" || $dename == "xfce" ]];then
installtray=true
while true; do
read -rep $'\nWould you like to install the Kinto System Tray (AppInidcator)? (Y/n)\n' yn