Guest session custom countdown timer

Forum rules
Before you post please read how to get help
Post Reply
cdaaawg
Level 2
Level 2
Posts: 53
Joined: Wed Jun 01, 2011 1:41 am

Guest session custom countdown timer

Post by cdaaawg » Tue Apr 09, 2019 5:16 pm

Hi all! I am the IT librarian at our local public library. I am introducing
our rural community to the wonders of open source computing. Some of our
older hardware is running fully updated LinuxMint 19.1 64-bit MATE with
the default lightdm desktop manager. I have enabled the lightdm guest-session
user account in an effort to ensure our patrons' privacy. I created a "normal"
user account with full-name Patrone (username patrone) with limited sudo
privileges to act as a skeleton account for the guest-session user as per
instructions here:

https://easylinuxtipsproject.blogspot.c ... t.html#ID1

The system works well but I would like to incorporate several additional features,
one of which is an xsession countdown timer for the guest-session account only.

Using the skeleton account:
I considered using the mate panel applet "Timer Applet" version 1.20.1 by the MATE
developers and Stefano Karapetsas, but the controls are accessible by the
session owner which is not acceptable.

I have also tried using the mate panel applet "Command Applet" version 1.20.1
also written by Stefano Karapetsas. I edited the Preferences > Command to point
to a script called countdown-timer.sh

Code: Select all

#!/bin/bash
seconds=60 
date1=$((`date +%s` + $seconds)) 
while [ "$date1" -ge `date +%s` ];
do 
echo -ne "\r$(date -u --date @$(($date1 - `date +%s` )) +%H:%M:%S)";
done
Although this script works directly in a shell, only a "#" is displayed
on the panel when I add it to the applet, so obviously something is amiss
when trying to use that script - maybe scripts don't work, just single
bash commands like echo "Hello World"?

The documentation here

Code: Select all

/usr/share/gtk-doc/html/mate-panel-applet/mate-panel-applet-mate-panel-applet.html
appears to be for developers and was no help in guiding me to a solution.

Perhaps someone could provide some enlightenment as to how to incorporate
a visible countdown timer feature for the guest-session? If necessary, I
could collaborate with a developer by testing new or altered code.

The countdown timer feature should display time remaining on the panel with
HH:MM:SS format. No controls should be changeable by the guest-session user.
The timer should have a configurable count down settable by a user with
sudo access via either dconf/gsettings or text-based configuration file.

Once I incorporate this as well as another feature or two and get the
kinks worked out, I plan to make a script available to the community to
make public computer setup with some custom features easy peasy.

Thanks for any enlightenment! :)

Carl

Post Reply

Return to “MATE”