Questo contenuto non è disponibile nella lingua selezionata.
Chapter 22. Managing user sessions
22.1. What GDM is Copia collegamentoCollegamento copiato negli appunti!
The GNOME Display Manager (GDM) is a graphical login program running in the background that runs and manages the X.Org display servers for both local and remote logins.
GDM is a replacement for XDM, the X Display Manager. However, GDM is not derived from XDM and does not contain any original XDM code. In addition, there is no support for a graphical configuration tool in GDM, so editing the /etc/gdm/custom.conf configuration file is necessary to change the GDM settings.
22.2. Restarting GDM Copia collegamentoCollegamento copiato negli appunti!
When you make changes to the system configuration such as setting up the login screen banner message, login screen logo, or login screen background, restart GDM for your changes to take effect.
Restarting the gdm service terminates all currently running GNOME sessions of all desktop users who are logged in. This might result in users losing unsaved data.
Procedure
To restart the GDM service, run the following command:
systemctl restart gdm.service
# systemctl restart gdm.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
To display results of the GDM configuration, run the following command:
DCONF_PROFILE=gdm gsettings list-recursively org.gnome.login-screen
$ DCONF_PROFILE=gdm gsettings list-recursively org.gnome.login-screenCopy to Clipboard Copied! Toggle word wrap Toggle overflow
22.3. Adding an autostart application for all users Copia collegamentoCollegamento copiato negli appunti!
You can set application to start automatically when any user logs into the GNOME environment.
Procedure
Create a
.desktopfile in the/etc/xdg/autostart/directory, such as/etc/xdg/autostart/nautilus.desktop. Enter the following content in the file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
Fileswith the name of the application. -
Replace
/usr/bin/nautilus -nwith the command that starts the application. Use the full file path.
-
Replace
Optional: Configure the application to start only when a selected GSettings key is enabled. GNOME then runs the application automatically if the key’s value is true. If the key’s value changes in the running session, GNOME starts or stops the application to match the new value.
Add the following line in the
.desktopfile:AutostartCondition=GSettings org.gnome.desktop.background show-desktop-icons
AutostartCondition=GSettings org.gnome.desktop.background show-desktop-iconsCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
org.gnome.desktop.background show-desktop-iconswith the GSettings schema and key that the automatic start depends on.
-
Replace
22.4. Configuring automatic login Copia collegamentoCollegamento copiato negli appunti!
As an administrator, you can enable automatic login from the Users panel in GNOME Settings, or you can set up automatic login manually in the GDM custom configuration file, as follows.
Run the following procedure to set up automatic login for a user john.
Procedure
Edit the
/etc/gdm/custom.conffile, and make sure that the[daemon]section in the file specifies the following:[daemon] AutomaticLoginEnable=True AutomaticLogin=john
[daemon] AutomaticLoginEnable=True AutomaticLogin=johnCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
johnwith the user that you want to be automatically logged in.
22.5. Configuring automatic logout Copia collegamentoCollegamento copiato negli appunti!
User sessions that have been idle for a specific period of time can be ended automatically. You can set different behavior based on whether the machine is running from a battery or from mains power by setting the corresponding GSettings key, then locking it.
Users can potentially lose unsaved data if an idle session is automatically ended.
To set automatic logout for a mains powered machine:
Procedure
Create a local database for machine-wide settings in the
/etc/dconf/db/local.d/00-autologoutfile:[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'
[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'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Override the user’s setting, and prevent the user from changing it in the
/etc/dconf/db/local.d/locks/autologoutfile:Lock automatic logout settings
# Lock automatic logout settings /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-timeout /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-typeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Users must log out and back in again before the system-wide settings take effect.
The following GSettings keys are of interest:
org.gnome.settings-daemon.plugins.power.sleep-inactive-ac-timeout
The number of seconds that the computer needs to be inactive before it goes to sleep if it is running from AC power.
org.gnome.settings-daemon.plugins.power.sleep-inactive-ac-type
What should happen when the timeout has passed if the computer is running from AC power.
org.gnome.settings-daemon.plugins.power.sleep-inactive-battery-timeout
The number of seconds that the computer needs to be inactive before it goes to sleep if it is running from power.
org.gnome.settings-daemon.plugins.power.sleep-inactive-battery-type
What should happen when the timeout has passed if the computer is running from battery power.
If you want to list available values for a key, use the following procedure:
Procedure
-
Run the
gsettings rangecommand on the required key. For example:
22.6. Setting a default desktop session for all users Copia collegamentoCollegamento copiato negli appunti!
You can configure a default desktop session that is preselected for all users that have not logged in yet.
If a user logs in using a different session than the default, their selection persists to their next login.
Procedure
To apply the default desktop session for ordinary users:
Copy the configuration file template for ordinary users:
cp /usr/share/accountsservice/user-templates/standard \ /etc/accountsservice/user-templates/standard# cp /usr/share/accountsservice/user-templates/standard \ /etc/accountsservice/user-templates/standardCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the new
/etc/accountsservice/user-templates/standardfile. -
On the
Session=gnomeline, replacegnomewith the session that you want to set as the default.
To apply the default desktop session to administrator users (members of the
wheelorsudogroups), create and configure the administrator template:Copy the administrator template:
cp /usr/share/accountsservice/user-templates/administrator \ /etc/accountsservice/user-templates/administrator# cp /usr/share/accountsservice/user-templates/administrator \ /etc/accountsservice/user-templates/administratorCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Edit the new
/etc/accountsservice/user-templates/administratorfile. -
Replace the value of
Session=gnomewith the session that you want to set as the default for administrator users.
Optional: To configure an exception to the default session for a certain user, follow these steps:
Copy the template file to
/var/lib/AccountsService/users/user-name:cp /usr/share/accountsservice/user-templates/standard \ /var/lib/AccountsService/users/user-name# cp /usr/share/accountsservice/user-templates/standard \ /var/lib/AccountsService/users/user-nameCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
In the new file, replace variables such as
${USER}and${ID}with the user values. -
Replace the value of
Session=gnomewith the session that you want to set as the default for that user.
22.7. Setting screen brightness and idle time Copia collegamentoCollegamento copiato negli appunti!
By creating a local database, you can, for example:
- Configure the drop in the brightness level
- Set brightness level
- Set idle time
Configuring the drop in the brightness level
To set the drop in the brightness level when the device has been idle for some time:
Procedure
Create a local database for machine-wide settings in the
/etc/dconf/db/local.d/00-powerfile including these lines:[org/gnome/settings-daemon/plugins/power] idle-dim=true
[org/gnome/settings-daemon/plugins/power] idle-dim=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Users must log out and back in again before the system-wide settings take effect.
Setting brightness level
To set brightness level:
Procedure
Create a local database for machine-wide settings in the
/etc/dconf/db/local.d/00-powerfile, as in the following example:[org/gnome/settings-daemon/plugins/power] idle-brightness=30
[org/gnome/settings-daemon/plugins/power] idle-brightness=30Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
30with the integer value you want to use.Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Users must log out and back in again before the system-wide settings take effect.
Setting idle time
To set idle time after which the screen is blanked and the default screensaver is displayed:
Procedure
Create a local database for machine-wide settings in
/etc/dconf/db/local.d/00-session, as in the following example:[org/gnome/desktop/session] idle-delay=uint32 900
[org/gnome/desktop/session] idle-delay=uint32 900Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
900with the integer value you want to use.You must include the
uint32along with the integer value as shown.Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Users must log out and back in again before the system-wide settings take effect.
22.8. Locking the screen when the user is idle Copia collegamentoCollegamento copiato negli appunti!
To enable the screensaver and make the screen lock automatically when the user is idle, follow this procedure:
Procedure
Create a local database for system-wide settings in the
etc/dconf/db/local.d/00-screensaverfile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow You must include the
uint32along with the integer key values as shown.Override the user’s setting, and prevent the user from changing it in the
/etc/dconf/db/local.d/locks/screensaverfile:Lock desktop screensaver settings
# Lock desktop screensaver settings /org/gnome/desktop/session/idle-delay /org/gnome/desktop/screensaver/lock-enabled /org/gnome/desktop/screensaver/lock-delayCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the system databases:
dconf update
# dconf updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Users must log out and back in again before the system-wide settings take effect.
22.9. Screencast recording Copia collegamentoCollegamento copiato negli appunti!
GNOME Shell features a built-in screencast recorder. The recorder allows users to record desktop or application activity during their session and distribute the recordings as high-resolution video files in the webm format.
To make a screencast:
Procedure
To start the recording, press the Ctrl+Alt+Shift+R shortcut.
When the recorder is capturing the screen activity, it displays a red circle in the top-right corner of the screen.
To stop the recording, press the Ctrl+Alt+Shift+R shortcut.
The red circle in the top-right corner of the screen disappears.
-
Navigate to the
~/Videosdirectory where you can find the recorded video with a file name that starts with Screencast and includes the date and time of the recording.
The built-in recorder always captures the entire screen, including all monitors in multi-monitor setups.