Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOWTO: autoadb scrcpy - hide/show from Windows system tray and auto start at boot. #17

Open
browntownington opened this issue Aug 3, 2021 · 0 comments

Comments

@browntownington
Copy link

browntownington commented Aug 3, 2021

Big ups @rom1v for autoadb and scrcpy. I've been getting RSI from holding my phone too much swiping on the tinders and now I can control it remotely when at my desk all day haha jokes to the tinder part ;). Thank you!!

Before
image

After
image

Now, to business. Here's how to launch autoadb and scrcpy @ system boot and hidden to system tray to lessen the clutter of autoadb always running in taskbar.

  1. download an icon to your autoadb/scrcpy folder and make sure it's called "android.ico", i choose one similar to what scrcpy uses for the phone display window (https://www.iconspedia.com/icon/android-icon-37831.html)
  2. download free autohotkey (https://www.autohotkey.com/)
  3. in your autoadb/scrcpy folder create a new autohotkey file (right click > new AutoHotKey script) e.g ahk-autoadb-scrcpy-launch-to-tray.ahk
  4. paste this all in to the script over anything else that was there by default. Save the file.
#NoTrayIcon
#Persistent

global hAutoadb

/* Setup Tray icon and add item that will handle
 * double click events
 */
Menu Tray, Icon
Menu Tray, Icon, android.ico
Menu Tray, Add, Show / Hide autoadb, TrayClick
Menu Tray, Default, Show / Hide autoadb

;// Run autoadb hidden
DetectHiddenWindows On
Run autoadb.exe scrcpy.exe --always-on-top --turn-screen-off --stay-awake --show-touches,, Hide, PID
WinWait ahk_pid %PID%
hAutoadb := WinExist()
DetectHiddenWindows Off
return

TrayClick:
OnTrayClick()
return

;// Show / hide Autoadb on double click
OnTrayClick() {
	if DllCall("IsWindowVisible", "Ptr", hAutoadb) {
		WinHide ahk_id %hAutoadb%
	
	} else {
		WinShow ahk_id %hAutoadb%
		WinActivate ahk_id %hAutoadb%
	}
}
  1. right click your script and " send to > desktop (create shortcut)"
  2. cut this shortcut and paste it in
    • for user
      C:\Users<userid>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
      or - for all users
      C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
  3. PROFIT from these for amazing tools (figuratively ;)) auto launching at start and hiding the autoadb window
Repository owner deleted a comment from mxdljwxx Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant