I wanted to dim my lights if I was watching netflix
Using this method I was able to control my lights based on the app on screen. So if Netflix is on screen the lights dim if netflix is not on screen they brighten.
replace the shield:5555 with your own device hostname or IP
Add your own application names, use this command to find them
(adb shell dumpsys window windows | grep -E āmFocusedAppā| cut -d / -f 1 | cut -d " " -f 7)
Iād love to use your solution on my Nvidia shield too! Iād like to look at your bash script, but the patebin link you provided no longer works. Is this solution still working for you? If so, would you be willing to reshare your bash script again?
Hello, I am not using it for a while but only due to data loss. Iāll try to find my script but it was basically an adb over network command that returned the application on screen and when matched a string (app name) it then told home assist to do a function (canāt recall exactly). Maybe someone else has a copy and might see this or try archive.org.
I will let you know and if I donāt find it I will redo it from scratch and update you.
The script ran every second so as soon as an app I was looking for was open on screen home assist we do an action.
replace the shield:5555 with your own device hostname or IP
Add your own application names, use this command to find them
(adb shell dumpsys window windows | grep -E āmFocusedAppā| cut -d / -f 1 | cut -d " " -f 7)
So this is cool. So you can tell if a particular app on the Shield is running. How about the other way around so to speak? Any way to launch an app in a similar fashion? Trying to see if there is a way with Alexa or the Harmony Hub to launch things like YouTube directly without a bunch of commands to go to the home page, scroll down two clicks, to the right three clicks, click enter. Or whatever. Be nice to directly call apps on the device.
Also side question as I am still debating on getting a Shield, does that command tell you if itās open in the foreground vs having multiple apps open at once? Not sure if they close when you switch to semething else or what.