eGPU and workflow

So I just made the Framework laptop my main computer. Sadly my workstation died. This meant taking down 6 monitors and removing the huge server case. Now I am using a TV and a Razer Chroma X egpu with a 980 Ti. (I’ll upgrade eventually, just don’t need to yet.)

I curious how those of you in a similar situation are setting things up? Do you the additional monitor in duplicate mode? How do you deal with the change in resolutions messing up window sizes and position?

Because of this very thing I am using duplicate because I hate having to put everything back in the right place for my workflow.

Any tips?

I use Autohotkey to define default window positions and move them:

SetTitleMatchMode, 2

; Get monitor info
SysGet, mon_count, MonitorCount
Loop, %mon_count% {
	SysGet, mon%A_Index%, Monitor, %A_Index%
	monsLeft := (monsLeft == "") ? mon%A_Index%Left : Min(monsLeft, mon%A_Index%Left)
	monsTop := (monsTop == "") ? mon%A_Index%Top : Min(monsTop, mon%A_Index%Top)
	monsRight := (monsRight == "") ? mon%A_Index%Right : Max(monsRight, mon%A_Index%Right)
	monsBottom := (monsBottom == "") ? mon%A_Index%Bottom : Max(monsBottom, mon%A_Index%Bottom)
	mon%A_Index%_w := mon%A_Index%Right - mon%A_Index%Left
	mon%A_Index%_h := mon%A_Index%Bottom - mon%A_Index%Top
}

; Get taskbar dimensions
WinGetPos, bar1_x, bar1_y, bar1_w, bar1_h, ahk_class Shell_TrayWnd
WinGetPos, bar2_x, bar2_y, bar2_w, bar2_h, ahk_class Shell_SecondaryTrayWnd
Loop, %mon_count% {
	; taskbar position
	if (bar%A_Index%_w == mon%A_Index%_w) {
		bar%A_Index%_pos := (bar%A_Index%_y == mon%A_Index%Top) ? "top" : "bottom"
	} else {
		bar%A_Index%_pos := (bar%A_Index%_x == mon%A_Index%Left) ? "left" : "right"
	}
	; update mon coords, accounting for taskbar
	if (bar%A_Index%_pos == "top" or bar%A_Index%_pos == "bottom") {
		mon%A_Index%_x := mon%A_Index%Left
		mon%A_Index%_y := (bar%A_Index%_pos == "top") ? bar%A_Index%_h : mon%A_Index%Top
		mon%A_Index%_xc := mon%A_Index%_w/2
		mon%A_Index%_yc := (bar%A_Index%_pos == "bottom") ? (mon%A_Index%_h-bar%A_Index%_h)/2 : bar%A_Index%_h+(mon%A_Index%_h-bar%A_Index%_h)/2
		mon%A_Index%_h -= bar%A_Index%_h
	} else {
		mon%A_Index%_x := (bar%A_Index%_pos == "left") ? bar%A_Index%_w : mon%A_Index%Left
		mon%A_Index%_y := mon%A_Index%Top
		mon%A_Index%_xc := (bar%A_Index%_pos == "right") ? (mon%A_Index%_w-bar%A_Index%_w)/2 : bar%A_Index%_w+(mon%A_Index%_w-bar%A_Index%_w)/2
		mon%A_Index%_yc := mon%A_Index%_h/2
		mon%A_Index%_w -= bar%A_Index%_w
	}
}

WinGet, hwnd, ID, A
left := (get_window_dpi(hwnd) == A_ScreenDPI)
dpi_scale := A_ScreenDPI / get_window_dpi(hwnd)

if WinActive("Spotify ahk_exe Spotify.exe") {
	if (left) {
		w := A_ScreenWidth/2
		h := A_ScreenHeight/1.2
		x := mon1_xc-(w/2)
		y := mon1_yc-(h/2)
	} else {
		padding := 12
		w := mon2_w-20
		h := mon2_h/2.35
		x := mon2_x+(mon2_w-w)/2
		y := mon2_y+mon2_h-h-padding
	}
	WinActivate
	WinRestore
	WinMove, , , x, y, w, h
}

if (WinActive("ahk_exe chrome.exe") {
    ...
}

...

get_window_dpi(hwnd) {
	return DllCall("User32.dll\GetDpiForWindow", "Ptr", hwnd)
}

I activate the window I want to move and trigger the above script with a keyboard shortcut and bam, pixel-perfect window positions :slight_smile:

2 Likes

Windows 11 with Powertoys has pretty good handling of multi-monitors and restoring window locations and config.