Skip to content

Commit

Permalink
Add multimonitor support
Browse files Browse the repository at this point in the history
  • Loading branch information
Lara Maia committed Jan 26, 2020
1 parent df8bf21 commit 48efc2d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
32 changes: 30 additions & 2 deletions mintty-dropdown.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ if minttyPath contains ERROR

console = %minttyPath% --class mintty-dropdown %shell%

height = 400
IniRead, height, %iniFile%, Global, height
if height contains ERROR
height = 400

IniRead, consoleHotKey, %iniFile%, Global, consoleHotKey
if consoleHotKey contains ERROR
Expand All @@ -72,6 +74,18 @@ if fullScreenHotKey != !F11
if fullScreenHotKey != !Enter
Hotkey, !Enter, Ignore

IniRead, screenMoveRight, %iniFile%, Global, screenMoveRight
if screenMoveRight contains ERROR
screenMoveRight = ^+Right
HotKey, %screenMoveRight%, screenMoveRightCheck

IniRead, screenMoveLeft, %iniFile%, Global, screenMoveLeft
if screenMoveLeft contains ERROR
screenMoveLeft = ^+Left
HotKey, %screenMoveLeft%, screenMoveLeftCheck

CurrentScreenWidth = 0
CurrentScreenHeight = 0
window = ahk_class mintty-dropdown
start()
setGeometry()
Expand All @@ -87,7 +101,7 @@ setGeometry() {
WinSet, Style, -0x00200000, %window% ; WS_VSCROLL
WinSet, ExStyle, 0x00000080, %window% ; WS_EX_TOOLWINDOW

WinMove, %window%,, 0, 0, A_ScreenWidth, %height%
WinMove, %window%,, CurrentScreenWidth, CurrentScreenHeight, A_ScreenWidth, %height%
}

start() {
Expand Down Expand Up @@ -153,6 +167,20 @@ fullScreenCheck:

return

screenMoveLeftCheck:
SysGet, CurrentScreenWidth, 76
SysGet, CurrentScreenHeight, 77
setGeometry()

return

screenMoveRightCheck:
CurrentScreenWidth = 0
CurrentScreenHeight = 0
setGeometry()

return

Ignore:
return

Expand Down
8 changes: 8 additions & 0 deletions mintty-dropdown.ini
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,13 @@
; The default is:
; Launch_App2 (Calculator key) for console
; !F11 (Alt+F11) for FullScreen mode
; ^+Right (Ctrl+Alt+Right) for move to right screen
; ^+Left (Ctrl+Alt+Left) for move to left screen
;consoleHotKey=
;fullScreenHotKey=
;moveScreenRight=
;moveScreenLeft=

; Default window height
;(E.g.: 400)
;height=

0 comments on commit 48efc2d

Please sign in to comment.