Keep cursor in dialog box on idle [Solved]

'User made' tutorials related to Porteus Kiosk edition.
Official kiosk documentation can be find here: http://porteus-kiosk.org/documentation.html
Post Reply
esc-tech
White ninja
White ninja
Posts: 4
Joined: 12 Apr 2019, 19:02
Distribution: porteus 4 kiosk

Keep cursor in dialog box on idle [Solved]

Post#1 by esc-tech » 12 Apr 2019, 21:44

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.

User avatar
fanthom
Site Admin
Site Admin
Posts: 5089
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Keep cursor in dialog box on idle

Post#2 by fanthom » 13 Apr 2019, 15:41

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
Please add [Solved] to your thread title if the solution was found.

esc-tech
White ninja
White ninja
Posts: 4
Joined: 12 Apr 2019, 19:02
Distribution: porteus 4 kiosk

Keep cursor in dialog box on idle

Post#3 by esc-tech » 16 Apr 2019, 00:06

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 :)

esc-tech
White ninja
White ninja
Posts: 4
Joined: 12 Apr 2019, 19:02
Distribution: porteus 4 kiosk

Keep cursor in dialog box on idle [Solved]

Post#4 by esc-tech » 24 Apr 2019, 00:12

That worked to use xprintidle with xdotool... but only worked properly when milliseconds were used vs trying it with seconds for the idle timeout.

esc-tech
White ninja
White ninja
Posts: 4
Joined: 12 Apr 2019, 19:02
Distribution: porteus 4 kiosk

Keep cursor in dialog box on idle [Solved]

Post#5 by esc-tech » 24 Apr 2019, 18:51

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!

Code: Select all

run_command= ( while true; do [ `xprintidle` -gt 15000 ] && { xdotool mousemove 0 0; xdotool key Menu; } || sleep 2; done; ) &
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...

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; ) &
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!

Post Reply