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
-
Cree o perfíl user que contén as seguintes liñas:
/etc/dconf/profile/user
user-db:user system-db:locallocal é o nome dunha base de datos dconf.
Create the directory /etc/dconf/db/local.d/ if it does not already exist.
-
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 -
Actualizar a base de datos do sistema:
# dconf update Os usuarios deben pechar a sesión e iniciala de novo para que a configuración a nivel de sistema se aplique.
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