Since I’ll be using an alternate display on desktop mode, I’ll need to pass the displayId when I forward input so that it doesn’t input on my phone’s builtin screen. The id of the builtin one is conveniently always 0, but the id of the external display changes every time I plug my phone into the display card, so I decided to automate the process by parsing the output of adb shell cmd display get-displays whenever the script starts. This tuned out to be way more of a pain than I expected, especially since the syntax isn’t consistent across the entire output, but I’m happy with how it turned out, even if I never use it again. I might make another npm package for this one in the future, but I haven’t really done enough testing to be confident enough in its reliability yet. It seems to work fine for the display info at least, so I’ll move on for now.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.