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.

  • 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 6:34
  • Yes. 30 minutes as a whole. If possible, multiples of 30. – user227495 Feb 19 '18 at 7: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 8:49
  • Thanks @RobertRiedl My coding skills are poor. Would it be possible for you to share one ? – user227495 Feb 19 '18 at 9: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 9:43

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:


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.