Keep cursor in dialog box on idle [Solved]
Forum rules
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
Porteus Kiosk section of the forum is unmaintained now. Its kept in a 'read only' mode for archival purposes.
Please use the kiosk contact page for directing your queries: https://porteus-kiosk.org/contact.html
Keep cursor in dialog box on idle [Solved]
Hi Porteus Guru's ... I am using Porteus Kiosk as a self checkin solution and it has been working great for a long time. I am implementing it in a new location where it will be used by front desk personnel and they will be entering info into the website and adding notes and checking people in. I am looking for a command that will allow me to detect when the system has been idle for 20 seconds or so. Once the idle timer has completed then have the cursor click back into the checkin dialog box, so that if the checkin person is busy with someone else on a different computer and has forgotten to click back in the checkin dialog box, the scanner will properly check the person in. Thank You in advance!
Last edited by esc-tech on 24 Apr 2019, 00:06, edited 1 time in total.
- fanthom
- Moderator Team
- Posts: 5667
- Joined: 28 Dec 2010, 02:42
- Distribution: Porteus Kiosk
- Location: Poland
- Contact:
Keep cursor in dialog box on idle
Maybe you could reset the browser when kiosk is not used:
https://porteus-kiosk.org/parameters.html#session_idle
If this is not an option then you could use 'run_command=' to run the process in a loop and in the background:
https://porteus-kiosk.org/parameters.html#run_command
You can discover idle time using 'xprintidle' utility, you can move the mouse to desired destination using 'xdotool' command.
Thanks
https://porteus-kiosk.org/parameters.html#session_idle
If this is not an option then you could use 'run_command=' to run the process in a loop and in the background:
https://porteus-kiosk.org/parameters.html#run_command
You can discover idle time using 'xprintidle' utility, you can move the mouse to desired destination using 'xdotool' command.
Thanks
Please add [Solved] to your thread title if the solution was found.
Keep cursor in dialog box on idle
Thank You Fanthom! I will look into the xprintidle ... I will report back if that works for what I am looking to do... I saw a session idle timeout reset, but I can't get it to re select the proper dialog box once it has refreshed the page... I think xprintidle will work great with the xdotool command once I do some research on that... Thanks
Keep cursor in dialog box on idle [Solved]
That worked to use xprintidle with xdotool... but only worked properly when milliseconds were used vs trying it with seconds for the idle timeout.
Keep cursor in dialog box on idle [Solved]
And just in case someone has a similar need for a script that monitors idle time with a xdotool command after a timeout, here is the script I used.
The script was created by one of the geniuses at Porteus. Thank You!
Basically you can change the mousemove 0 0 to mousemove 480 90 or where ever you want the mouse to end up on the screen and you can add click 1 to the script to add a left click on a button or in a dialog box on your webpage. ie "xdotool mousemove 480 90; xdotool click 1;". Or you can run an "xdotool key Escape" to imitate the "esc" key etc...
This is an example of what I did with the script to make it work for us...
The Escape closes the find command that they often use to search though people who have checked in and the F2 puts the cursor back in the dialog box(since that is an option our website has). The second while true command is for making sure the wireless kiosk computer reboots if it looses internet connectivity.
One tip for testing all your commands, and getting it right before installing, is to use putty to ssh into your porteus kiosk by enabling the ssh package in your test config. When running a command in the cli on putty, be sure to remove the "run_command=" from the command you are going to put in the config file. Hope this helps and feel free to correct me on any errors I have made in the info I have given. Hope this helps, Thanks!
The script was created by one of the geniuses at Porteus. Thank You!
Code: Select all
run_command= ( while true; do [ `xprintidle` -gt 15000 ] && { xdotool mousemove 0 0; xdotool key Menu; } || sleep 2; done; ) &
This is an example of what I did with the script to make it work for us...
Code: Select all
run_command=( while true; do [ `xprintidle` -gt 15000 ] && { xdotool key Escape; xdotool key F2; xdotool key Menu; } || sleep 2; done; ) & ( while true; do ping -c3 8.8.8.8 > /dev/null 2>&1 || { sleep 5; ping -c3 8.8.8.8 > /dev/null 2>&1 || { sleep 10; ping -c3 8.8.8.8 > /dev/null 2>&1 || reboot; }; }; sleep 5m; done; ) &
One tip for testing all your commands, and getting it right before installing, is to use putty to ssh into your porteus kiosk by enabling the ssh package in your test config. When running a command in the cli on putty, be sure to remove the "run_command=" from the command you are going to put in the config file. Hope this helps and feel free to correct me on any errors I have made in the info I have given. Hope this helps, Thanks!