I'm working on a project using Libre LePotato with Raspbian for a basic display kiosk. It launches chromium-browser to a specific url, then uses xdotool to type the username and password and hit enter. Once logged in the page refreshes every 5 minutes. Eventually the page forgets the login credentials and needs to be logged into again. The URL does not change between the login screen and the actual display page, but the title of the window does. Is there any way for me to fetch the title of the window? That way I can just create an if/then script that runs xdotool when the window title is Login.
I've tried setting the device up to reboot more frequently in order to hopefully reset the memory cache and log in again on boot up, but the issue occurs too frequently and constant rebooting on a display does not look good.
The proper way to automate this would be through the use of Selenium, Playwright or Puppeteer (I prefer Puppeteer). If you insist though, you can use
wmctrl.For example, I'm using Brave, and let's say the normal output is this (I use Brave Browser):
It lists the window id, a bunch of other stuff along with the title.
Now, the following is the output, when I'm on the sign-in page:
With that knowledge, creating a script is relatively simple:
Since this is all in a Kiosk, I figure that you won't have any other windows that potentialy interfere with the logic (ex. two codewars windows open at once)