Actually... That's an excellent suggestion. Except: the last command in a .xinitrc or .xsession file must stay runningfor the duration of the X session. Normally, that command is "kdeinit" or "gnome-session", or historically, the window manager executable i.e. "mwm" or "twm" or whatever.
If you start GNOME, say, by including "gnome-session &" as the second-last line, the *last* line can then be "sleep 1800". When it exits, so does the X session.
(It might be nice to provide a countdown timer for the user.)
-Adam
Adam Thompson wrote:
Actually... That's an excellent suggestion. Except: the last command in a .xinitrc or .xsession file must stay runningfor the duration of the X session. Normally, that command is "kdeinit" or "gnome-session", or historically, the window manager executable i.e. "mwm" or "twm" or whatever.
I remember having seen this when I wanted to run KDE in FreeBSD.
If you start GNOME, say, by including "gnome-session &" as the second-last line, the *last* line can then be "sleep 1800". When it exits, so does the X session.
Let's see if I understand how this works (I'm getting better at this)... The window manager starts in the background. This is OK because it's an interactive program and will grab the I/O anyway. The last line is executed in the foreground and does nothing for 1800 seconds (30 minutes) then stops. At that point there is nothing left in the file so the session quits. Being an Ubuntu fork it will then pop back into mode 5 and present the login screen. Once the user types the password and starts a new session the whole process repeats. For the most part this is acceptable. There are a couple of problems.
It appears they've decided to do away with those files (at least I can't find them in the "~" directory). Next, if the user knew where to look they could edit the file and change it back to normal. Then all they'd have to do is logout and login again when nobody was looking. This would then stay in effect until the next startup when the users home directory is removed and recreated. Unless it is possible to change the ownership of the file to a different account such as root, then prevent editing by the user...
(It might be nice to provide a countdown timer for the user.)
I know how to create a "popup" dialogue using Zenity but I'm not sure how to do a timer.
-Adam
Later Mike