Xfce Wiki

Sub domains
 

xfce4-session - Advanced Topics

Auto login from console

Instead of using a desktop manager, you can also auto login from the console. If you use bash, you can put the following in your ~/.bash_profile:

if [ "$(tty)" = "/dev/tty1" ] ; then
  startxfce4
fi

This will start Xfce if you login from the first console. For properly registering the ConsoleKit session, you probably want to add --with-ck-launch with startxfce4 (new since Xfce 4.10). Read the section below for more information.

Back to Top


SSH and GPG Agents

By default xfce4-session tries to start the gpg- or ssh-agent. To disable this run the following commands:

xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false

To force the ssh-agent instead of the gpg-agent use the following command:

xfconf-query -c xfce4-session -p /startup/ssh-agent/type -n -t string -s ssh-agent

In case you want to use gnome-keyring enable the Launch GNOME services on startup in the Advanced tab of the settings dialog. If you do this xfce4-session will not attempt to start the gpg- or ssh-agent.

Back to Top


ConsoleKit

The Xfce Desktop requires an active ConsoleKit session to function properly. ConsoleKit is used for system actions like shutdown, suspend and (un)mounting devices (through Polkit for authorization). In case you use a desktop manager, the DM will take care of that. For console starts this is a bit different.

  1. If you login on the console (without starting X) run ck-list-sessions. Make sure active = TRUE and is-local = TRUE. If not, check if the consolekit library is loaded by PAM.
  2. In 4.10, start Xfce with startxfce4 --with-ck-launch. This will start xfce4-session with ck-launch-session. In 4.10, Xfce4-sesion will take care of the dbus-session launch.
  3. When Xfce is started and you run ck-list-sessions, a second session is created that should give you all required permissions to mount devices and execute power actions (depending per-distribution, you might need to add yourself to various user groups).

Back to Top


Files and Environment Variables

Xfce now uses the Basedir Specification as defined on Freedesktop.org to locate its data and configuration files. This means that file locations will be specified as a path relative to the directories described in the specification.

${XDG_CONFIG_HOME}
The first base directory to look for configuration files. By default this is set to ~/.config/.
${XDG_CONFIG_DIRS}
A list of system directories that contain configuration data. By default the panel will look in ${sysconfdir}/xdg/ and /etc/xdg/. The value of ${sysconfdir} depends on how the program was build and will often be /etc/ for binary packages.
${XDG_CACHE_HOME}
Specifies the root for all user-specific cache data. If this environment variable is unset, it defaults to ~/.cache.
${XDG_CONFIG_DIRS}/autostart/
This is the location where the list of applications that should be automatically run on login is stored. Each autostarted application is represented by a .desktop file (see the Desktop Entry Specification for details).
Prior to Xfce 4.3, the list of autostarted applications was stored in ~/Desktop/Autostart, which contained scripts and symbolic links to applications. If you run xfce4-session 4.4 or above for the first time, it will automatically migrate the autostart items from the old location to the standard location and place a LOCATION-CHANGED.txt file in the old directory, that describes the location change.
${XDG_CONFIG_DIRS}/xfce4-session/xfce4-session.rc
This is the location of the configuration file that includes the various settings for xfce4-session, which can be changed from the settings dialog.
${XDG_CONFIG_DIRS}/xfce4-session/xfce4-splash.rc
This is the location of the configuration file that includes the configuration for the splash screen, which can be changed from the settings dialog.
${XDG_CACHE_HOME}/sessions/
The directory where xfce4-session and xfwm4 store the session data to.
${sysconfdir}/xdg/xfce4/kiosk/kioskrc
Kiosk mode configuration file. See next section for an explanation.

Back to Top


Kiosk Mode

The session manager offers support for the Kiosk Mode, that helps to prevent users from making changes to their session settings. To use it you have to edit or create the file ${sysconfdir}/xdg/xfce4/kiosk/kioskrc.

The way to explain the format of this file is by using an example. The xfce4-session section of your kioskrc file might look like this:

[xfce4-session]
CustomizeSplash=ALL
CustomizeChooser=ALL
CustomizeLogout=ALL
CustomizeCompatibility=%wheel
Shutdown=%wheel
CustomizeSecurity=NONE

This allows all users to change their splash, chooser and logout settings, but allows only users in the group wheel to customize the compatibility settings and shutdown the system. No one will be allowed to adjust the security settings.

The session manager supports the following KIOSK capabilities:

CustomizeSplash
Whether or not the user is allowed to customize the splash screen.
CustomizeChooser
Whether or not the user is allowed to customize the session chooser settings.
CustomizeLogout
Whether or not the user is allowed to customize the logout settings.
CustomizeCompatibility
Whether or not the user is allowed to customize the compatibility settings (KDE/Gnome compat)
CustomizeSecurity
Whether or not the user is allowed to customize the security settings. This is one of the most IMPORTANT settings, since it prevents users (actually libICE) from binding to a TCP port.
Shutdown
Whether or not the user is allowed to shutdown (reboot or poweroff) the system. If a user lacks this capability the reboot and poweroff options in the shutdown dialog will be greyed out.

Back To Top


Return to xfce4-session 4.20 Main Documentation Page