Skip to content

Instantly share code, notes, and snippets.

@Kambaa
Last active March 7, 2025 22:54
Show Gist options
  • Save Kambaa/9f0192bfde24e231477c60a32a130f34 to your computer and use it in GitHub Desktop.
Save Kambaa/9f0192bfde24e231477c60a32a130f34 to your computer and use it in GitHub Desktop.
StrokesPlus multimonitor switching notes

2025 Config:

I rewrote the lua scripts. My use case is for the left(vertical) and right(big one) monitors are:

  • If swiped left, move the active window to the left monitor and set the width to monitor width and height to 500, and windows top position is pre-configured for some apps.
  • If swiped right move the active window to the right monitor and toggle maximize.
  • Above 2 configs should not work for my shortcut app(app width change brokes usability).
  • If window is already on the left monitor, left swipe does nothing.
  • If window is already on the right monitor, right swipe toggles maximization

1. ZZ- Move To Left Monitor And Custom Resize

process_name=acGetExecutableName(acGetForegroundWindow())
if process_name ~= "Turbolaunch.exe" then

	current_window=acGetForegroundWindow()
	current_window_x=acGetWindowLeft(acGetForegroundWindow(), gsx, gsy) 
	current_window_y=acGetWindowTop(acGetForegroundWindow(), gsx, gsy) 
	-- acMessageBox("X: "..tostring(current_window_x).." Y: ".. tostring(current_window_y), "Current Window X Y Coords Is:", nil)


	monitor_on_current_window=acGetMonitorFromPoint(current_window_x, current_window_y) 
	monitor_name=acGetMonitorName(monitor_on_current_window) 
	-- acMessageBox(monitor_name, "Current Monitor Name Is:", nil)

	-- according to the description in acSendWindowToMonitorByName we need to escape the \ chars
	left_monitor_name="\\\\.\\DISPLAY1"
	right_monitor_name="\\\\.\\DISPLAY2"
	monitor_name_to_send = left_monitor_name
	monitor_handle_to_send=acGetMonitorFromName(monitor_name_to_send) 


	if monitor_name ~= left_monitor_name then
		acSendWindowToMonitorByName(current_window, nil, nil, monitor_name_to_send)
	end

	monitor_left=acGetMonitorLeft(monitor_handle_to_send, 1) 
	monitor_top=acGetMonitorTop(monitor_handle_to_send, 1) 
	monitor_right=acGetMonitorRight(monitor_handle_to_send, 1)
	monitor_bottom=acGetMonitorBottom(monitor_handle_to_send, 1) 
	-- acMessageBox("Left:"..tostring(monitor_left).." Top:"..tostring(monitor_top).." Right:"..tostring(monitor_right).." Bottom:"..tostring(monitor_bottom), "Monitor Area Coords", nil)



	current_window_size_x=math.abs(acGetWindowLeft(acGetForegroundWindow(), nil, nil) - acGetWindowRight(acGetForegroundWindow(), nil, nil))
	current_window_size_y=math.abs(acGetWindowBottom(acGetForegroundWindow(), nil, nil) - acGetWindowTop(acGetForegroundWindow(), nil, nil))

	monitor_size_x = math.abs(monitor_left-monitor_right)
	monitor_size_y = math.abs(monitor_top-monitor_bottom)


	local positions = {
		["rustdesk.exe"]     = 1920 - 690 - 850,
		["ApplicationFrameHost.exe"]     = monitor_top,
		["Teams.exe"]        = 1920 - 690 - 350 - 600,
		["msedge.exe"]        = 1920 - 690 - 350 - 650,
		["thunderbird.exe"]  = 1920 - 690 - 350 - 650
	}

	local heights = {
		["ApplicationFrameHost.exe"]     = 600
	}

	local y_pos = positions[process_name] or (1920 - 690 - 350 - 850)
	local height=heights[process_name] or 600

	acRestoreWindow(acGetForegroundWindow(), nil, nil) 

	-- move window to the top of the monitor
	acMoveWindow(acGetForegroundWindow(), nil, nil, monitor_left, y_pos)
	-- set the window size with regarding to monitor size
	acSetWindowSize(acGetForegroundWindow(), nil, nil, monitor_size_x, height)
end

1. ZZ- Move To Left Monitor And Custom Resize

process_name=acGetExecutableName(acGetForegroundWindow())
if process_name ~= "shortcut.exe" then

	current_window=acGetForegroundWindow()
	current_window_x=acGetWindowLeft(acGetForegroundWindow(), gsx, gsy) 
	current_window_y=acGetWindowTop(acGetForegroundWindow(), gsx, gsy) 
	monitor_on_current_window=acGetMonitorFromPoint(current_window_x, current_window_y) 
	monitor_name=acGetMonitorName(monitor_on_current_window) 
	-- acMessageBox(monitor_name, "Current Monitor Name Is:", nil)

	-- according to the description in acSendWindowToMonitorByName we need to escape the \ chars
	left_monitor_name="\\\\.\\DISPLAY1"
	right_monitor_name="\\\\.\\DISPLAY2"
	monitor_name_to_send = right_monitor_name



	if monitor_name ~= right_monitor_name then
		acSendWindowToMonitorByName(current_window, nil, nil, monitor_name_to_send)
	end

	acMaximizeOrRestoreWindow(acGetForegroundWindow(), nil, nil) 

end

ytdl shortcut
acSendKeys("ytdl ~")
acDelay(50)
acSendKeys("^v ~")
sol alta alma:
acRestoreWindow(acGetForegroundWindow(), gsx, gsy)
acSetWindowSize(acGetForegroundWindow(), gsx, gsy, 1046, 690)
if acGetExecutableName(acGetForegroundWindow()) == "rustdesk.exe" then
acMoveWindow(acGetForegroundWindow(), gsx, gsy, 10, 1920-690-350)
elseif acGetExecutableName(acGetForegroundWindow()) == "Teams.exe" then
acMoveWindow(acGetForegroundWindow(), gsx, gsy, 10, 1920-690-350-600)
elseif acGetExecutableName(acGetForegroundWindow()) == "brave.exe" then
acMoveWindow(acGetForegroundWindow(), gsx, gsy, 10, 1920-690-350-650)
else
acMoveWindow(acGetForegroundWindow(), gsx, gsy, 10, 1920-690-350-850)
end
acSendKeys("@+{LEFT}")
Sağ tam ekran yapma
acRestoreWindow(acGetForegroundWindow(), gsx, gsy)
acMaximizeWindow(acGetForegroundWindow(), gsx, gsy)
acSendKeys("@+{RIGHT}")
backup.
--acSendKeys("@+{RIGHT}")acSetWindowSize(acGetForegroundWindow(), gsx, gsy, 1046, 690) acMoveWindow(acGetForegroundWindow(), gsx, gsy, 1510, 10) --sample uses the gesture start coordinates (gsx and gsy)-- and sizes the window to 500 by 500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment