0

I plan to use 16.04 for a cyber cafe. Currently, I am thinking of using some script which will log out the session after a particular time ( say 30 mins )

It would be great to increase the log out time remotely within the same WiFi network. But my main focus currently is an auto log out after a set time.

Is there any method to do this ? Kindly assist. Thanks.

user227495
  • 4,089
  • 17
  • 56
  • 101
  • You mean fixed times, like 30, 60 or 90 minutes as that are the times your patrons paid for and not idle-time, right ? – Robert Riedl Feb 19 '18 at 06:34
  • Yes. 30 minutes as a whole. If possible, multiples of 30. – user227495 Feb 19 '18 at 07:00
  • I think you'll need a small management suite like mkahawa. mkahawa is FOSS. You can of course use a script on your desktop/server that you use in the office that sends kill -9 -1or DISPLAY=:0 gnome-session-quit --logout --no-prompt via SSH to the PCs for the individual users. This could be done with at or with a loop (that maybe checks a file where the 30 minute intervals are kept) – Robert Riedl Feb 19 '18 at 08:49
  • Thanks @RobertRiedl My coding skills are poor. Would it be possible for you to share one ? – user227495 Feb 19 '18 at 09:22
  • if I find the time, I'll post a script. you'd have to setup SSH access to all your PCs, with SSH keys. I guess you have usernames fitting to the PCS ? like "linuxuser1" on PC1, etc etc – Robert Riedl Feb 19 '18 at 09:43
  • PC have names. I can reinstall and reconfigure them if required. Thanks for your help. – user227495 Feb 19 '18 at 10:31
  • @RobertRiedl If you are writing a script the one in my answer below might give you some ideas. – WinEunuuchs2Unix Feb 19 '18 at 15:42
  • @WinEunuuchs2Unix, funnily enough I just saw this script on the original answer where you posted it :-) – Robert Riedl Feb 19 '18 at 15:45
  • @RobertRiedl As coincidence would have it I had just revised that answer an hour or two before reading this question. – WinEunuuchs2Unix Feb 19 '18 at 15:52

1 Answers1

1

Rather than logging out and loosing all their work you can use Lock Screen Timer to lock the screen after 30 minutes. Then if patron chooses to pay for more time your can unlock the screen and they'll resume where they left off.

Lock Screen Timer optionally gives a running countdown on the status bar. It automatically issues a "pop-up bubble message" of time remaining with an audio alert at 15, 10, 5, 3, 2 and 1 minute remaining. This allows the patron to save their work appropriately.

You can find the Lock Screen Timer code here in Ask Ubuntu: Application that will lock screen after a set amount of time for Ubuntu

This is what it looks like when you start the timer for 28 minutes:

systray.gif

The number of minutes defaults to 30 but in this animation I had overridden it to 28 minutes.

If after say 15 minutes they want to pay for another 30 minutes you can relaunch the timer and it will kill the previous countdown. Then you can restart the countdown and manually enter 45 minutes.

Note: There is no client database nor remote control. You'll have to collect the money from the patron, walk them to an unoccupied terminal and manually unlock the screen for them.