Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic Logout
I hope this is the correct place to post this article, if not please inform me.

I know I can use screensaver to lock the screen and have to enter my password when re-entering the OS. My question, is there a way I can have the computer actually log out after a certain amount of time of no activity? I can log out in the mint menu or by hitting some keyboard keys I have set up. I want to be able to "log out" and return to the regular "log in" screen when I go and work on the computer.

Hope this is a clear enough explanation of my question [Image: icon_confused.gif]

Thank you:
NO - not 'log-out' as such

you can only use suspend / hibernate - - on an Power Saver session.
using an Levono Laptop with LM19 Tongue
I don't think it is impossible, but I would assume it's not a usual thing, so probably there isn't a GUI tool for that.
Just a quick google-ing brought this to my attention, but I haven't tested this method:
My top 10 reasons to still use Arch after 2 months on my main PC at home.
(11-15-2019, 04:32 AM)TarsolyGer Wrote: I don't think it is impossible, but I would assume it's not a usual thing, so probably there isn't a GUI tool for that.

Agreed. Basically all you need is a program that monitors your inputs and when you have been inactive for some time, execute the logout command. A lot of programs monitor your activity/inactivity (notification daemons, as an example), so it might be possible to find one that can be configured to execute a command.
My git repos

"Things are only impossible until they’re not." - Captain Jean-Luc Picard
If I understand you correctly you would like to force a session logout after an inactivity period of time.  You can monitor the inactivity using the xssstate program.   The following bash script might help you:

# xim - Xsession inactivity monitor.
# You must supply the appropriate value for the Timeout variable.  Remember,
# the Timeout value is in milliseconds (ms).  One second is 1000 ms, and  one
# minute is 60000ms.  If you want to detect an Xsession inactivity for fifteen
# minutes or more the Timeout value should be 15X60X1000ms or 900000ms.

Timeout=900000        # value in milliseconds.

# You can update the Idle_Action function to perform your desired command.
function Idle_Action()
    # for LM19.1 xfce use the xfce4-session-logout.
    # For testing a simple echo command.
    # Put <your command> below.
    echo -e "\n\nNotice: idle X session detected. (${Session_idle})\n\n"


Polling_interval=15    # value in seconds.

while (true)

    Session_idle="$(xssstate -i)"

    if [[ "${Session_idle}" -gt "${Timeout}" ]] ; then

        sleep "${Polling_interval}"



exit 0

For testing use a smaller Timeout value and manually run the script.

Once you have the desired logout command and Timeout value updated you can add the xim script to your autostart program list.  Use settings and session section section to add an autostart program.
Idea Give a person a fish, and you feed them for a day. Teach a person how to fish, and you feed them for a lifetime. ✝️ Proverbs 4:7 Wisdom is the principal thing; therefore get wisdom: and with all thy getting get understanding.

Forum Jump:

Users browsing this thread: 1 Guest(s)