Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
fd356cdc61 | |||
93997c2cdf | |||
5bfca82c4d |
1 changed files with 12 additions and 11 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
try TraySetIcon("img\win_manager.ico")
|
||||
|
||||
TERMINAL_WIN := "ahk_class mintty"
|
||||
TERMINAL_EXE := "ahk_exe mintty.exe"
|
||||
TERMINAL_CMD := "
|
||||
(LTrim Join`s
|
||||
C:\Users\fernando.schauenburg\AppData\Local\wsltty\bin\mintty.exe
|
||||
|
@ -17,8 +17,8 @@ TERMINAL_CMD := "
|
|||
-
|
||||
)"
|
||||
|
||||
BROWSER_WIN:= "ahk_class MozillaWindowClass"
|
||||
BROWSER_CMD:= "C:\Program Files\Mozilla Firefox\firefox.exe"
|
||||
BROWSER_EXE := "ahk_exe librewolf.exe"
|
||||
BROWSER_CMD := "C:\Program Files\LibreWolf\librewolf.exe"
|
||||
|
||||
; Returns the rectangle (position & size) of a given monitor.
|
||||
MonitorGetRect(N)
|
||||
|
@ -108,15 +108,15 @@ WinSetMonitor(target, WinTitle:="A")
|
|||
WinSetRelativeRect(WinGetRelativeRect(WinTitle), target, WinTitle)
|
||||
}
|
||||
|
||||
openProgram(WinTitle, Target, WorkingDir, rect?)
|
||||
openProgram(WinExe, Target, WorkingDir, rect?)
|
||||
{
|
||||
if WinExist(WinTitle) {
|
||||
WinActivate(WinTitle)
|
||||
if WinExist(WinExe) {
|
||||
WinActivate(WinExe)
|
||||
} else {
|
||||
Run(Target, WorkingDir)
|
||||
if IsSet(rect)
|
||||
if WinWait(WinTitle,,5)
|
||||
WinSetRelativeRect(rect, 1, WinTitle)
|
||||
if WinWait(WinExe,,5)
|
||||
WinSetRelativeRect(rect, 1, WinExe)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,6 +141,7 @@ POS := {
|
|||
|
||||
; Center
|
||||
mainFocus : {pos: {x: 0.18, y: 0}, size: {width: 0.64, height: 1 }},
|
||||
fullScreen : {pos: {x: 0, y: 0}, size: {width: 1, height: 1 }},
|
||||
}
|
||||
|
||||
; Uncomment the following line while making changes for easy reload.
|
||||
|
@ -170,7 +171,7 @@ SetNumLockState True
|
|||
!^Numpad3:: WinSetRelativeRect(POS.halfRight)
|
||||
|
||||
; Center and...
|
||||
!#NumpadAdd:: WinSetRelativeRect(POS.mainFocus) ; ... resize to default.
|
||||
!#NumpadAdd:: WinSetRelativeRect(POS.fullScreen) ; ... make full screen.
|
||||
!^Numpad5:: WinCenter() ; ... keep size.
|
||||
|
||||
; Move to other monitor (FIXME this is a hack, but works on my current setup)
|
||||
|
@ -185,6 +186,6 @@ step := 50 ; dx dy
|
|||
!^Numpad6:: WinTranslate( step, 0) ; right (L)
|
||||
|
||||
; Launch programs
|
||||
!^+t::openProgram(TERMINAL_WIN, TERMINAL_CMD, A_Temp, POS.mainFocus)
|
||||
!^+b::openProgram(BROWSER_WIN, BROWSER_CMD, A_Temp, POS.mainFocus)
|
||||
!^+t::openProgram(TERMINAL_EXE, TERMINAL_CMD, A_Temp, POS.mainFocus)
|
||||
!^+b::openProgram(BROWSER_EXE, BROWSER_CMD, A_Temp, POS.mainFocus)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue