Ekaterina Gerasimova
kittykat3756@gmail.com 2013
Petr Kovar
pknbe@volny.cz 2014
Remata unha sesión de usuario inactivo.
Fran Diéguez
frandieguez@gnome.org 2010-2025

# Configurar o peche da sesión automático

User sessions that have been idle for a specific period of time can be ended automatically. You can set different behaviour based on whether the machine is running from a battery or from mains power by setting the corresponding dconf key, then locking it.

Keep in mind that users can potentially lose unsaved data if an idle session is automatically ended.

# Set automatic logout for a mains powered machine

Create a `local` database for machine-wide settings in /etc/dconf/db/local.d/00-autologout:

[org/gnome/settings-daemon/plugins/power] # Set the timeout to 900 seconds when on mains power sleep-inactive-ac-timeout=900 # Set action after timeout to be logout when on mains power sleep-inactive-ac-type='logout'

Override the user's setting and prevent the user from changing it in /etc/dconf/db/local.d/locks/autologout:

# Lock automatic logout settings /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-timeout /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type

As seguintes chaves de GSettings son interesantes:

# `org.gnome.settings-daemon.plugins.power.sleep-inactive-ac-timeout`

O número de segundos que o computador precisa estar inactivo antes de poñerse en modo repouso se está enchufado.

# `org.gnome.settings-daemon.plugins.power.sleep-inactive-ac-type`

Que debería pasar cando o tempo de espera pasou se o computador está enchufado.

# `org.gnome.settings-daemon.plugins.power.sleep-inactive-battery-timeout`

O número de segundos que o computador precisa estar inactivo antes de poñerse en modo repouso se está usando a batería.

# `org.gnome.settings-daemon.plugins.power.sleep-inactive-battery-type`

Que debería pasar cando o tempo de espera pasou se o computador está usando a batería.

You can run gsettings range on a key for a list of values which you can use. For example:

    $ gsettings range org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
    enum
    'blank' # blanks the screen
    'suspend' # suspends the system
    'shutdown' # starts a standard shutdown procedure
    'hibernate' # hibernates the system
    'interactive' # shows a pop-up query asking the user what to do
    'nothing' # does nothing
    'logout' # log out from the session