Difference between revisions of "Xfce"

From ArchWiki
Jump to: navigation, search
(FAM is a daemon, not a kernel module)
m (Starting Xfce: rename section to Starting)
Line 1: Line 1:
[[Category:Desktop environments (English)]]
+
[[Category:Xfce]]
[[Category:Tutorials (English)]]
+
[[cs:Xfce]]
 +
[[de:Xfce]]
 +
[[es:Xfce]]
 +
[[fa:Xfce]]
 +
[[fr:Xfce]]
 +
[[it:Xfce]]
 +
[[ja:Xfce]]
 +
[[ko:Xfce]]
 +
[[pl:Xfce]]
 +
[[ru:Xfce]]
 +
[[zh-hans:Xfce]]
 +
{{Related articles start}}
 +
{{Related|Desktop environment}}
 +
{{Related|Window manager}}
 +
{{Related|Xfwm}}
 +
{{Related|Thunar}}
 +
{{Related|LXDE}}
 +
{{Related|GNOME}}
 +
{{Related articles end}}
  
== What is Xfce?==
+
[http://www.xfce.org Xfce] is a lightweight and modular [[desktop environment]] currently based on GTK+ 2. To provide a complete user experience, it includes a window manager, a file manager, desktop and panel.
Xfce is a Desktop Environment, like GNOME or KDE. It contains a suite of apps like a root window app, window manager, file manager, panel, etc. Xfce is written using the GTK2 toolkit, and contains its own development environment (libraries, daemons, etc), similar to other big DEs. Unlike GNOME or KDE, Xfce is lightweight and designed more around CDE than Windows or Mac. It has a much slower development cycle, but is very stable and extremely fast. Xfce is great for older hardware.
 
  
== Why use Xfce?==
+
== Installation ==
Here is a (subjective) list of reasons to use Xfce:
 
* It's fast, faster than the other major DEs.
 
* It's stable. In the long time Xfce-4 has been out, only a small handful of bugs has been discovered, despite it having a rather large following.
 
* It's pretty. It uses GTK2 and is themable. You can make Xfce look very nice. The fonts are completely AA as well.
 
* It works great with multiple monitors. Xfce's Xinerama support is the best out of any WM/DE, IMO.
 
* It doesn't get in your way. You'll find Xfce helps your work flow, rather than always making itself "present."
 
  
== Why not use Xfce?==
+
[[Install]] the {{Grp|xfce4}} group. You may also wish to install the {{Grp|xfce4-goodies}} group which includes extra plugins and a number of useful utilities such as the {{Pkg|mousepad}} editor. Xfce uses the [[Xfwm]] window manager by default.
Here is a (subjective) list of reasons not to use Xfce:
 
* Doesn't contain all the features and integration of the major DEs.
 
* Slower development cycle.
 
* Because it's based on the CDE design, the layout may not be as familiar.
 
  
== How to Install Xfce==
+
== Starting ==
The Xfce source and documentation are available at http://xfce.org. But since you're using ArchLinux, you can grab Xfce from Pacman.
 
  
Xfce is modular. That means there is no need for you to run every part, you can pick and choose. Because of this, Xfce has a bunch of Arch packages.
+
Choose ''Xfce Session'' from the menu in a [[display manager]] of choice, or add {{ic|exec startxfce4}} to [[Xinitrc]].
  
To install the base Xfce4 system, run:
+
{{Note|Do not call the {{ic|xfce4-session}} executable directly; {{ic|startxfce4}} is the correct command which, in turn, calls the former when appropriate.}}
  
<pre>
+
== Configuration ==
# pacman -S xfce4
 
</pre>
 
  
If you want extras, like Panel plugins (you probably do), run this:
+
Xfce stores configuration options in [http://docs.xfce.org/xfce/xfconf/start Xfconf]. There are several ways to modify these options:
  
<pre>
+
* In the main menu, select [http://docs.xfce.org/xfce/xfce4-settings/start Settings] and the category you want to customize. Categories are programs usually located in {{ic|/usr/bin/xfce4-*}} and {{ic|/usr/bin/xfdesktop-settings}}.
# pacman -S xfce4-goodies
+
* {{ic|xfce4-settings-editor}} can see and modify all settings. Options modified here will take effect immediately. Use {{ic|xfconf-query}} to change settings from the commandline; see [http://docs.xfce.org/xfce/xfconf/xfconf-query the documentation] for details.
</pre>
+
* Settings are stored in XML files in {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/}} which can be edited by hand. However, changes made here will ''not'' take effect immediately.
  
Note that after installing Xfce, you will want to log your user out so that paths update (as Xfce is installed to /opt).
+
=== Menu ===
  
== Running Xfce4==
+
See [[Xdg-menu]] for more info on using the Free Desktop menu system.
  
There are two ways to run Xfce4. One is the "automatic" method. To start Xfce from the console, you can simply run:
+
==== Whisker menu ====
  
<pre>
+
{{Pkg|xfce4-whiskermenu-plugin}} (also part of {{Grp|xfce4-goodies}}) is an alternate application launcher. It shows a list of favorites, browses through all installed applications through category buttons, and supports fuzzy searching. After package being installed, it can replace 'Applications Menu' as first item in Panel 1 (in 'Settings/Panel/Items' add 'Whisker Menu'...).
# startxfce4
 
</pre>
 
'''Note:''' startxfce4 sets DPI to 96 by default, so font sizes will be different than when starting from .xinitrc.
 
  
To customize the Xfce startup using this method, you'll copy /opt/xfce4/etc/xdm/xfce4/xinitrc (/opt/xfce4/etc/xdg/xfce4/xinitrc instead for me using Noodle release)  to $HOME/.xfce4, and edit that file
+
==== Edit entries ====
To add programs to the startup up using this method, add symlinks from the programs you want to $HOME/Desktop/Autostart.
 
  
If you want more control over what starts and your initial settings, you can add these items to your $HOME/.xinitrc (leaving out and adding what you want):
+
A number of graphical tools are available for this task:
  
<pre>
+
* {{App|MenuLibre|An advanced menu editor that provides modern features in a clean, easy-to-use interface.|https://launchpad.net/menulibre|{{AUR|menulibre}}}}.
xfce-mcs-manager
+
* {{App|Alacarte|Menu editor for GNOME|http://www.gnome.org/|{{Pkg|alacarte}}}}
xfwm4 --daemon
+
* {{App|XAME|GUI tool written in Gambas designed specifically for editing menu entries in Xfce, it will not work in other environments. (Discontinued)|http://www.redsquirrel87.com/XAME.php{{Dead link|2017|12|30}}|{{AUR|xame}}}}
xfdesktop &
 
exec xfce4-panel
 
</pre>
 
  
or
+
Alternatively, create the file {{ic|~/.config/menus/xfce-applications.menu}} manually. See the example configuration below:
<pre>
 
# exec xfce4-session
 
</pre>
 
  
== How To Use Xfce With DM's==
+
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
As of Xfce 4.2.0, the Arch packages add the proper session files for Xfce. They are contained in the xfce-utils package, which should be installed with a base installation. Simply [[ Adding_a_login_manager_%28KDM%2C_GDM%2C_or_XDM%29_to_automatically_boot_on_startup| Enable a DM]].
+
  "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
 +
 +
<Menu>
 +
    <Name>Xfce</Name>
 +
    <MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile>
 +
 +
    <Exclude>
 +
        <Filename>xfce4-run.desktop</Filename>
 +
        <Filename>exo-terminal-emulator.desktop</Filename>
 +
        <Filename>exo-file-manager.desktop</Filename>
 +
        <Filename>exo-mail-reader.desktop</Filename>
 +
        <Filename>exo-web-browser.desktop</Filename>
 +
        <Filename>xfce4-about.desktop</Filename>
 +
        <Filename>xfhelp4.desktop</Filename>
 +
    </Exclude>
 +
 +
    <Layout>
 +
        <Merge type="all"/>
 +
        <Separator/>
 +
        <Menuname>Settings</Menuname>
 +
        <Separator/>
 +
        <Filename>xfce4-session-logout.desktop</Filename>
 +
    </Layout>
 +
</Menu>
  
==How to shutdown and reboot from Xfce==
+
The {{ic|<MergeFile>}} tag includes the default Xfce menu.
* Install sudo:
 
# pacman -S sudo
 
* Add the following line at the end of <code>/etc/sudoers</code> file with visudo command:
 
# visudo
 
  
* Note that the new Xfce packages in the 'extra' repository now place Xfce under '/usr'.
+
The {{ic|<Exclude>}} tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude {{ic|firefox.desktop}} or any other application.
user ALL=(root) NOPASSWD: /usr/lib/xfce4/xfsm-shutdown-helper
 
where 'user' is the name of the user you want to allow to shutdown and reboot pc from Xfce.
 
  
Alternatively you can create ''shutdown'' group and allow all its members to shutdown:
+
The {{ic|<Layout>}} tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the [http://wiki.xfce.org/howto/customize-menu  Xfce wiki].
%shutdown ALL=(root) NOPASSWD: /usr/lib/xfce4/xfsm-shutdown-helper
 
  
# groupadd shutdown
+
You can also make changes to the Xfce menu by editing the {{ic|.desktop}} files themselves. To hide entries, see [[Desktop entries#Hide desktop entries]]. You can edit the application's category by modifying the {{ic|1=Categories=}} line of the desktop entry, see [[Desktop entries#File example]].
# gpasswd -a user shutdown
 
where 'user' is name of the user.
 
  
To allow all users to be able to shutdown system add this to /etc/sudoers:
+
=== Desktop ===
%users hostname=NOPASSWD:/usr/lib/xfce4/xfsm-shutdown-helper
 
Where hostname is the name of current machine.
 
  
==How to enable the compositor in Xfce 4.4+==
+
==== Transparent background for icon titles ====
Xfce 4.4 comes with a builtin compositor adding the option for fancy window effects, shadows and transparency and so on.
 
  
You can find it in Settings->Window manager tweaks. But if it isn't there, take the following steps:
+
To change the default white background of desktop icon titles to something more suitable, create or edit {{ic|~/.gtkrc-2.0}}:
* Open up $HOME/.config/xfce4/mcs_settings/wmtweaks.xml, and ensure that ''<option name="Xfwm/UseCompositing" type="int" value="1"/>'' is present. If the wmtweaks file is not there, open up the Settings->Window manager tweaks and change some things, then close it, and the file should appear.
 
* Make sure the following lines are in your /etc/X11/xorg.conf file:
 
<pre>
 
Section "Extensions"
 
Option "Composite" "Enable"
 
EndSection
 
</pre>
 
* Finally, restart X and the compositor should be available.
 
  
==How come my desktop don't refresh?==
+
{{bc|<nowiki>
XFCE 4.4 uses FAM (File Alteration Monitor) to get notification when a file or directory changes.
+
style "xfdesktop-icon-view" {
Don't forget to add 'fam' to the list of DAEMONS in /etc/rc.conf
+
    XfdesktopIconView::label-alpha = 10
 +
    base[NORMAL] = "#000000"
 +
    base[SELECTED] = "#71B9FF"
 +
    base[ACTIVE] = "#71B9FF"
 +
    fg[NORMAL] = "#fcfcfc"
 +
    fg[SELECTED] = "#ffffff"
 +
    fg[ACTIVE] = "#ffffff"
 +
}
 +
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"
 +
</nowiki>}}
  
== Related Articles ==
+
==== Remove desktop icons ====
* [[Build order for XFCE]]
 
* [[Howto make GTK apps look nice| HOWTO: Make GTK1 apps look nice]]
 
  
== External Resources==
+
Issue the following command:
* [http://www.us.xfce.org/documentation/ XFCE.org] - The complete documentation.
+
 
* [http://www.xfce-look.org/ XFCE-Look] - Themes, wallpapers, and more.
+
$ xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0
* [http://wiki.xfce.org Xfce Wiki]
+
 
 +
To reinstate icons on the desktop, issue the same command with a value of 2.
 +
 
 +
==== One wallpaper across multihead ====
 +
 
 +
Open {{ic|xfce4-settings-editor}} and create a new property with the  following settings:
 +
 
 +
Property: /backdrop/screen0/xinerama-stretch
 +
Type: Boolean
 +
Value: TRUE|1|Enabled
 +
 
 +
==== Kill window shortcut ====
 +
 
 +
Xfce does not have a shortcut to kill a window, for example when a program freezes.
 +
 
 +
With {{Pkg|xorg-xkill}}, use {{ic|xkill}} to interactively kill a window. For the currently active window, use {{Pkg|xdotool}}:
 +
 
 +
$ xdotool getwindowfocus windowkill
 +
 
 +
Alternatively:
 +
 
 +
$ sh -c "xkill -id $(xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p')"
 +
 
 +
To add the shortcut, use ''Settings > Keyboard'' or an application like {{pkg|xbindkeys}}.
 +
 
 +
=== Session ===
 +
 
 +
==== Autostart ====
 +
 
 +
To launch custom applications when Xfce starts up, click the ''Applications Menu > Settings > Settings Manager'' and then choose the ''Session and Startup'' option and click the tab ''Application Autostart''.
 +
You will see a list of programs that get launched on startup. To add an entry, click the ''Add'' button and fill out the form, specifying the path to an executable you want to run.
 +
 
 +
Autostart applications are stored as ''.desktop'' files in ''~/.config/autostart/''.
 +
 
 +
Alternatively, add the commands you wish to run (including setting environment variables) to [[xinitrc]] (or [[xprofile]] when a [[display manager]] is being used).
 +
 
 +
{{Tip|Sometimes it might be useful to '''delay the startup of an application'''. Note that specifying under ''Application Autostart'' a command such as {{ic|sleep 3 && ''command''}}  does not work; a workaround is to use the syntax {{ic|sh -c "sleep 3 && ''command''"}}
 +
}}
 +
 
 +
==== Lock the screen ====
 +
''xflock4'' is the reference Bash script which is used to lock an Xfce session . It tries consecutively four screen lockers or exits with return code 1 if it fails to find any. Therefore, for ''xflock4'' to succeed, either {{Pkg|xscreensaver}}, {{Pkg|gnome-screensaver}}, {{Pkg|slock}} or {{Pkg|xlockmore}} needs to be installed.
 +
 
 +
The [[List of applications/Security#Screen lockers]] contains a short description of these four screen lockers together with other popular applications.
 +
 
 +
In particular, {{Pkg|light-locker}} integrates well with {{Pkg|xfce4-power-manager}}: once installed, Xfce Power Manager's setting gains an additional ''Security'' tab to configure ''light-locker'' and the existing ''Lock screen when system is going for sleep'' setting is relocated under this tab. It is then possible to set in this GUI whether the session should be locked upon screensaver activity or whenever the system goes to sleep.
 +
 
 +
To have ''xflock4'' '''run ''light-locker'' or any custom session locker''' not among the four cited above, some steps are required.
 +
The latest 4.13 version of {{pkg|xfce4-session}}, not available in the official repositories yet, eases the integration of custom screen lockers with ''xfclock4'' (see the [https://git.xfce.org/xfce/xfce4-session/tree/scripts/xflock4 latest xflock4 on git.xfce.org]) by checking first for the {{ic|LockCommand}} set in the session's xfconf channel.
 +
Therefore to use a custom locker with ''xflock4'' one can follow the two steps below:
 +
# Use the command line below to set {{ic|LockCommand}}, here for example to use ''light-locker'': {{bc|$ xfconf-query -c xfce4-session -p /general/LockCommand -s "'''light-locker-command --lock'''" --create -t string}}The command inside the quotes can be adapted accordingly for other screen lockers.
 +
# Enhance the ''xflock4'' script with either one of the following methods:
 +
## Replace manually {{ic|/usr/bin/xflock4}} with the latest version of the script, so that it calls the command specified in {{ic|LockCommand}}.
 +
## Install {{aur|xfce4-session-git}} in order to replace the official repository package with the updated 4.13 version which takes into account {{ic|LockCommand}}.
 +
 
 +
The '''panel lock button''' in the ''Action Buttons'' panel simply executes {{ic|/usr/bin/xflock4}}. It should work as expected as long as ''xflock4'' is functioning i.e. one of the native lockers is installed or a custom locker is configured to integrate with it as proposed above.
 +
 
 +
==== Suspend ====
 +
Whenever asked to suspend, Xfce executes the {{man|1|xfce4-session-logout}} command with the {{ic|suspend}} option:
 +
 
 +
$ xfce4-session-logout --suspend
 +
 
 +
Whether or not the session is systematically locked on ''suspend'' can be configured through the xfconf properties or from the GUI.
 +
 
 +
To control this state using the CLI: there are two settings that are used, {{ic|LockScreen}} and {{ic|lock-screen-suspend-hibernate}}, in respectively the session and the power manager xfconf channels.
 +
To prevent locking on suspend, turn them to {{ic|false}}:
 +
$ xfconf-query -c xfce4-session -p /shutdown/LockScreen -s '''false'''
 +
$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lock-screen-suspend-hibernate -s '''false'''
 +
Similarly, turn them to {{ic|true}} to lock the session on suspend.
 +
 
 +
The setting can also be controlled from the GUI: open the ''Session and Startup'' application and turn the flag ''Advanced > Lock screen before sleep'' on or off.
 +
 
 +
Whenever the suspend keyboard button is pressed, it can be handled by either Xfce's power manager or by ''systemd-logind''. To give precedence to logind, the following xfconf setting must be set to {{ic|true}}:
 +
 
 +
$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-suspend-key -n -t bool -s '''true'''
 +
 
 +
{{Note|To check how ''systemd-logind'' handles events whenever it has precedence over Xfce, check {{man|5|logind.conf}}}}
 +
 
 +
==== Disable saved sessions ====
 +
 
 +
Per user, saved sessions can be disabled by executing the following:
 +
$ xfconf-query -c xfce4-session -p /general/SaveOnExit -s false
 +
Then navigate to ''Applications > Settings > Session and Startup > Sessions'' and press the ''Clear saved sessions'' button to remove all previously saved sessions.
 +
 
 +
{{Tip|If the command above does not change the setting persistently, use the following command instead: {{ic|xfconf-query -c xfce4-session -p /general/SaveOnExit -n -t bool -s false}}}}
 +
 
 +
Alternatively, Xfce [https://wiki.xfce.org/howto/kiosk_mode kiosk mode] can be used to disable the saving of sessions systemwide. To disable sessions, create or edit the file {{ic|/etc/xdg/xfce4/kiosk/kioskrc}} and add the following:
 +
 
 +
[xfce4-session]
 +
SaveSession=NONE
 +
 
 +
If kiosk mode is not working, the user can set read only permissions for the sessions directory:
 +
 
 +
$ rm ~/.cache/sessions/* && chmod 500 ~/.cache/sessions
 +
 
 +
This will prevent Xfce from saving any sessions despite any configuration that specifies otherwise.
 +
 
 +
==== Use a different window manager ====
 +
 
 +
{{Note|For the changes to take effect, you will need to clear the saved sessions and ensure that session saving is disabled when logging out for the first time. Once the window manager of choice is running, session saving can be enabled again.}}
 +
 
 +
The files specifying the default window manager are found in the following locations:
 +
*{{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}} - per user
 +
*{{ic|/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml}} - systemwide
 +
 
 +
The default window manager for the user can be set easily using ''xfconf-query'':
 +
$ xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -sa '''wm_name'''
 +
 
 +
If you want to start the window manager with command line options, see the command below:
 +
$ xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -t string -s '''wm_name''' -s '''--wm-option'''
 +
If you need more command line options, simply add more {{ic|-t string}} and {{ic|-s '''--wm-option'''}} arguments to the command.
 +
 
 +
If you want to change the default window manager systemwide, edit the file specified above manually, changing ''xfwm4'' to the preferred window manager and adding more {{ic|1=<value type="string" value="'''--wm-option'''"/>}} lines for extra command line options if needed.
 +
 
 +
You can also change the window manager by autostarting {{ic|'''wm_name''' --replace}} using the autostart facility or by running {{ic|'''wm_name''' --replace &}} in a terminal and making sure the session is saved on logout. Be aware though that this method does not truly change the default manager, it merely replaces it at login. Note that if you are using the autostart facility, you should disable saved sessions as this could lead to the new window manager being started twice after the default window manager.
 +
 
 +
=== Theming ===
 +
 
 +
XFCE themes are available at [http://www.xfce-look.org xfce-look.org]. ''Xfwm'' themes are stored in {{ic|/usr/share/themes/xfce4}}, and set in ''Settings > Window Manager''. [[GTK+]] themes are set in ''Settings > Appearance''.
 +
 
 +
To achieve a uniform look for all applications, see [[Uniform look for Qt and GTK applications]].
 +
 
 +
See also [[Cursor themes]], [[Icons]], and [[Font configuration]].
 +
 
 +
=== Sound ===
 +
 
 +
==== Keyboard volume buttons ====
 +
 
 +
{{Pkg|xfce4-pulseaudio-plugin}} provides a panel applet which has support for keyboard volume control and volume notifications. As an alternative, you can install {{AUR|xfce4-volumed-pulse}}, which also provides keybinding and notification control, but without an icon sitting in the panel. This is handy, for example, when using {{AUR|pasystray}} at the same time for a finer control.
 +
 
 +
Alternatively, [https://git.xfce.org/apps/xfce4-mixer/ xfce4-mixer] also provides a panel applet and keyboard shortcuts which supports Alsa as well. Note however, that it is based on a feature of GStreamer 0.10 which has been abandoned in 1.0.
 +
 
 +
For non desktop environment specific alternatives, see [[List of applications#Volume managers]].
 +
 
 +
===== Shortcuts =====
 +
 
 +
If you are not using an applet or daemon that controls the volume keys, you can map volume control commands to your volume keys manually using Xfce's keyboard settings. For the sound system you are using, see the sections linked to below for the appropriate commands.
 +
*ALSA: see [[Advanced Linux Sound Architecture#Keyboard volume control]].
 +
*PulseAudio: see [[PulseAudio#Keyboard volume control]]
 +
*OSS: see [[OSS#Using multimedia keys with OSS]].
 +
 
 +
=== Keyboard Shortcuts ===
 +
 
 +
Keyboard shortcuts are defined in two places: ''Settings > Window Manager > Keyboard'', and ''Settings > Keyboard > Shortcuts''.
 +
 
 +
=== Polkit Authentication Agent ===
 +
 
 +
The {{Pkg|polkit-gnome}} agent will be installed along with {{Pkg|xfce4-session}} and autostarted automatically; no user intervention is required. For more information, see [[Polkit#Authentication agents]].
 +
 
 +
A third party polkit authentication agent for Xfce is also available, see {{AUR|xfce-polkit}} or {{AUR|xfce-polkit-git}}.
 +
 
 +
=== Display blanking ===
 +
Some programs that are commonly used with Xfce will control monitor blanking and [[DPMS]] (monitor powersaving) settings. They are discussed below.
 +
 
 +
;Xfce Power Manager
 +
''Xfce Power Manager'' controls blanking and DPMS settings. These settings can be configured in the ''Power Manager'' GUI within the ''Display'' tab.
 +
 
 +
Note that when ''Display power management'' is turned off, DPMS is fully disabled, it does not mean that ''Power Manager'' will simply stop controlling DPMS. It does not disable screen blanking either. To disable both blanking and DPMS, right click on the power manager system tray icon or left click on the panel applet and make sure that the option labelled ''Presentation mode'' is ticked.
 +
 
 +
;XScreenSaver
 +
If {{pkg|xscreensaver}} is installed and runs alongside Xfce Power Manager, it may not be clear which application is in control of blanking and DPMS as both are competing for control of the same settings. Therefore, in a situation where it is important that the monitor not be blanked (when watching a video for instance), it is advisable to disable blanking and DPMS through both applications. To know more about ''XScreenSaver'' options, see [[XScreenSaver#DPMS and blanking settings]].
 +
 
 +
;xset
 +
If neither of the above applications are running, then blanking and DPMS settings can be controlled using the ''xset'' command, see [[DPMS#Modifying DPMS and screensaver settings using xset]].
 +
 
 +
{{Note|1=There are some issues associated with blanking and resuming from blanking in some configurations. See [https://bbs.archlinux.org/viewtopic.php?id=194313&p=2][https://bugzilla.xfce.org/show_bug.cgi?id=11107].}}
 +
 
 +
== Tips and tricks ==
 +
 
 +
=== Hide partitions from thunar and xfdesktop ===
 +
 
 +
If your installation partitions are shown as mounted devices on the desktop and in Thunar, try to install {{Pkg|gvfs}}. See [[Udisks#Hide selected partitions]] for more advanced configuration options.
 +
 
 +
=== Screenshots ===
 +
 
 +
Xfce has its own screenshot tool, {{pkg|xfce4-screenshooter}}. It is part of the {{grp|xfce4-goodies}} group.
 +
 
 +
Go to ''Applications > Settings > Keyboard'', ''Application Shortcuts''. Add the {{ic|xfce4-screenshooter -f}} (or {{ic|-w}} for the active window) command to use the {{ic|Print}} key in order to take fullscreen screenshots. See screenshooter's man page for other optional arguments.
 +
 
 +
Alternatively, an independent screenshot program like [[Taking a screenshot#scrot|scrot]] can be used.
 +
 
 +
=== Disable Terminal F1 and F11 shortcuts ===
 +
 
 +
The xfce terminal binds F1 and F11 to help and fullscreen, respectively, which can make using programs like htop difficult. To disable those shortcuts, create or edit its configuration file, then log out and log back in. F10 can disabled in the Preferences menu.
 +
 
 +
{{hc|~/.config/xfce4/terminal/accels.scm|
 +
(gtk_accel_path "<Actions>/terminal-window/fullscreen" "")
 +
(gtk_accel_path "<Actions>/terminal-window/contents" "")
 +
}}
 +
 
 +
=== Terminal color themes or palettes ===
 +
 
 +
Terminal color themes or palettes can be changed in GUI under Appearance tab in Preferences. These are the colors that are available to most console applications like [[Emacs]], [[Vi]] and so on. Their settings are stored individually for each system user in {{ic|~/.config/xfce4/terminal/terminalrc}} file. There are also so many other themes to choose from. Check forum thread [https://bbs.archlinux.org/viewtopic.php?id=51818 Terminal Colour Scheme Screenshots] for hundreds of available choices and themes.
 +
 
 +
==== Changing default color theme ====
 +
 
 +
Xfce's {{ic|extra/terminal}} package comes with a darker colour palette. To change this, append the following in your terminalrc file for a lighter color theme, that is always visible in darker Terminal backgrounds.
 +
 
 +
{{hc|~/.config/xfce4/terminal/terminalrc|2=
 +
ColorPalette5=#38d0fcaaf3a9
 +
ColorPalette4=#e013a0a1612f
 +
ColorPalette2=#d456a81b7b42
 +
ColorPalette6=#ffff7062ffff
 +
ColorPalette3=#7ffff7bd7fff
 +
ColorPalette13=#82108210ffff}}
 +
 
 +
==== Terminal tango color theme ====
 +
 
 +
To switch to tango color theme, open with your favorite editor
 +
 
 +
~/.config/xfce4/terminal/terminalrc
 +
 
 +
And add(replace) these lines:
 +
 
 +
ColorForeground=White
 +
ColorBackground=#323232323232
 +
ColorPalette1=#2e2e34343636
 +
ColorPalette2=#cccc00000000
 +
ColorPalette3=#4e4e9a9a0606
 +
ColorPalette4=#c4c4a0a00000
 +
ColorPalette5=#34346565a4a4
 +
ColorPalette6=#757550507b7b
 +
ColorPalette7=#060698989a9a
 +
ColorPalette8=#d3d3d7d7cfcf
 +
ColorPalette9=#555557575353
 +
ColorPalette10=#efef29292929
 +
ColorPalette11=#8a8ae2e23434
 +
ColorPalette12=#fcfce9e94f4f
 +
ColorPalette13=#72729f9fcfcf
 +
ColorPalette14=#adad7f7fa8a8
 +
ColorPalette15=#3434e2e2e2e2
 +
ColorPalette16=#eeeeeeeeecec
 +
 
 +
=== Open URLs by middle mouse in terminal ===
 +
On update to version 0.8 open URL with middle mouse turned off by default and just paste clip to cursor.
 +
To enable old behavior fix next option in {{ic|${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc}} ({{ic|<nowiki>XDG_CONFIG_HOME=${HOME}/.config</nowiki>}} by default)
 +
{{hc|${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc|<nowiki>[Configuration]
 +
MiscMiddleClickOpensUri=TRUE</nowiki>}}
 +
 
 +
=== Colour management ===
 +
 
 +
Xfce has no native support for colour management. [https://bugzilla.xfce.org/show_bug.cgi?id=8559] See [[ICC profiles]] for alternatives.
 +
 
 +
=== Multiple monitors ===
 +
 
 +
Xfce has support for multiple monitors. Settings can be configured in the ''Applications > Settings > Display'' dialog. For more information, see the [http://docs.xfce.org/xfce/xfce4-settings/display display] article from the Xfce documentation.
 +
 
 +
=== SSH agents ===
 +
 
 +
By default Xfce 4.10 will try to load gpg-agent or ssh-agent in that order during session initialization. To disable this, create an xfconf key using the following command:
 +
 
 +
xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
 +
 
 +
To force using ssh-agent even if gpg-agent is installed, run the following instead:
 +
 
 +
xfconf-query -c xfce4-session -p /startup/ssh-agent/type -n -t string -s ssh-agent
 +
 
 +
To use [[GNOME Keyring]], simply tick the checkbox ''Launch GNOME services on startup'' in the ''Advanced'' tab of ''Session and Startup'' in Xfce's settings. This will also disable gpg-agent and ssh-agent.
 +
 
 +
Source: http://docs.xfce.org/xfce/xfce4-session/advanced
 +
 
 +
=== Scroll a background window without shifting focus on it ===
 +
 
 +
Go to ''Main Menu > Settings > Window Manager Tweaks > Accessibility'' tab.
 +
Uncheck ''Raise windows when any mouse button is pressed''.
 +
 
 +
=== Mouse button modifier ===
 +
 
 +
By default, the mouse button modifier in Xfce is set to {{ic|Alt}}. This can be changed with ''xfconf-query''. For instance, the following command will set the {{ic|Super}} key as the mouse button modifier:
 +
 
 +
$ xfconf-query -c xfwm4 -p /general/easy_click -n -t string -s "Super"
 +
 
 +
Strictly speaking, using multiple modifiers is not supported. However, as a workaround, multiple modifiers can be specified if the key names are separated with {{ic|><}}. For instance, to set {{ic|Ctrl+Alt}} as the mouse button modifier, you can use the following command:
 +
 
 +
$ xfconf-query -c xfwm4 -p /general/easy_click -n -t string -s "Ctrl><Alt"
 +
 
 +
=== Set the two fingers click to middle click for a touchpad ===
 +
 
 +
{{Style|Convoluted way of simply configuring [[Touchpad Synaptics]]}}
 +
 
 +
If you want the 2 finger click on the touchpad to do a middle click, create or edit the following file:
 +
 
 +
{{hc|~/.config/xfce4/xfconf/xfce-perchannel-xml/pointers.xml|<nowiki>
 +
<channel name="pointers" version="1.0">
 +
  <property name="SynPS2_Synaptics_TouchPad" type="empty">
 +
    <property name="Properties" type="empty">
 +
      <property name="Synaptics_Tap_Action" type="array">
 +
        <value type="int" value="0"/>
 +
        <value type="int" value="0"/>
 +
        <value type="int" value="0"/>
 +
        <value type="int" value="0"/>
 +
        <value type="int" value="1"/>
 +
        <value type="int" value="2"/>
 +
        <value type="int" value="3"/>
 +
      </property>
 +
    </property>
 +
  </property>
 +
</channel>
 +
</nowiki>}}
 +
 
 +
The 2 in the array is the middle click.
 +
 
 +
=== Limit the minimum brightness of the brightness-slider ===
 +
Limiting the minimum brightness can be useful for displays which turn off backlight on a brightness level of 0. In {{ic|xfce4-power-manager 1.3.2}} a new hidden option had been introduced to set a minimum brightness value with a xfconf4-property. Add {{ic|brightness-slider-min-level}} as an int property in xfconf4. Adjust the int value to get a suitable minimum brightness level.
 +
 
 +
=== Adding profile pictures ===
 +
To add profile pictures for each user to be displayed in the whisker-menu, simply place a 96x96 PNG file in the respective user's home directory with the name {{ic|.face}}. For example the PNG file {{ic|/home/''bob''/.face}} for user ''bob''.
 +
 
 +
Image editing programs like [[GIMP]] can be used to convert and scale your favourite images down to 96x96.
 +
 
 +
===  Power manager plugin label ===
 +
 
 +
The xfconf option {{ic|show-panel-label}} of type {{ic|int}} controls the label of the power manager, it can be configured for different label formats: it can be set to 0 (no label), 1 (percentage), 2 (remaining time) or 3 (both).
 +
 
 +
It is also accessible through the power manager plugin GUI in ''Properties > Show label''
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Desktop icons rearrange themselves ===
 +
 
 +
At certain events (such as opening the panel settings dialog) icons on the desktop rearrange themselves. This is because icon positions are determined by files in the {{ic|~/.config/xfce4/desktop/}} directory. Each time a change is made to the desktop (icons are added or removed or change position) a new file is generated in this directory and these files can conflict.
 +
 
 +
To solve the problem, navigate to the directory and delete all the files other than the one which correctly defines the icon positions. You can determine which file defines the correct icon positions by opening it and examining the locations of the icons. The topmost row is defined as {{ic|row 0}} and the leftmost column is defined by {{ic|col 0}}. Therefore an entry of:
 +
 
 +
[Firefox]
 +
row=3
 +
col=0
 +
 
 +
means that the Firefox icon will be located on the 4th row of the leftmost column.
 +
 
 +
=== GTK themes not working with multiple monitors ===
 +
 
 +
{{Expansion|Which configuration tools? What does ''ceasing to work'' mean? Is it that new themes cannot be selected or that themes display incorrectly? Is there a bug report?}}
 +
 
 +
Some configuration tools may corrupt displays.xml, which results in GTK themes under ''Applications Menu > Settings > Appearance'' ceasing to work. To fix the issue, delete {{ic|~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml}} and reconfigure your screens.
 +
 
 +
=== Icons do not appear in right-click menus ===
 +
 
 +
{{Note|Despite the deprecation of GConf, this method does still work.}}
 +
 
 +
Users may find that icons do not appear when right-clicking options within some applications, including those made with [[Qt]]. This problem only appears to happen within Xfce. Run these two commands:
 +
 
 +
$ gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true
 +
$ gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true
 +
 
 +
=== NVIDIA and xfce4-sensors-plugin ===
 +
 
 +
To detect and use sensors of nvidia gpu you need to install {{Pkg|libxnvctrl}} and then rebuild {{Pkg|xfce4-sensors-plugin}} with [[ABS]]. You also have the option of using {{AUR|xfce4-sensors-plugin-nvidia}} which replaces {{Pkg|xfce4-sensors-plugin}}.
 +
 
 +
=== Panel applets keep being aligned on the left ===
 +
 
 +
Add a separator someplace before the right end and set its "expand" property. [https://forums.linuxmint.com/viewtopic.php?f=110&t=155602}]
 +
 
 +
=== Preferred Applications preferences have no effect ===
 +
 
 +
Most applications rely on [[xdg-open]] for opening a preferred application for a given file or URL.
 +
 
 +
In order for xdg-open and xdg-settings to detect and integrate with the Xfce desktop environment correctly, you need to [[install]] the {{Pkg|xorg-xprop}} package.
 +
 
 +
If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed.
 +
Installing the package and allowing ''xdg-open'' to detect that you are running Xfce makes it forward all calls to ''exo-open'' instead, which correctly uses all your preferred applications preferences.
 +
 
 +
To make sure xdg-open integration is working correctly, ask ''xdg-settings'' for the default web browser and see what the result is:
 +
 
 +
# xdg-settings get default-web-browser
 +
 
 +
If it replies with:
 +
 
 +
xdg-settings: unknown desktop environment
 +
 
 +
it means that it has failed to detect Xfce as your desktop environment, which is likely due to a missing {{Pkg|xorg-xprop}} package.
 +
 
 +
=== Restore default settings ===
 +
 
 +
If for any reason you need to revert back: to the default settings, rename {{ic|~/.config/xfce4-session/}} and {{ic|~/.config/xfce4/}}
 +
 
 +
$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak
 +
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak
 +
 
 +
Relogin for changes to take effect. If you get {{ic|Unable to load a failsafe session}} upon login, see the [[#Session failure]] section.
 +
 
 +
=== Session failure ===
 +
 
 +
Symptoms include:
 +
 
 +
* The mouse is an X and/or does not appear at all;
 +
* Window decorations have disappeared and windows cannot be closed;
 +
* ({{ic|xfwm4-settings}}) will not start, reporting {{ic|These settings cannot work with your current window manager (unknown)}};
 +
* Errors reported by a [[display manager]] such as {{ic|No window manager registered on screen 0}}.
 +
* Unable to load a failsafe session:
 +
 
 +
Unable to load a failsafe session.
 +
Unable to determine failsafe session name.  Possible causes: xfconfd isn't running (D-Bus setup problem); environment variable $XDG_CONFIG_DIRS is set incorrectly (must include "/etc"), or xfce4-session is installed incorrectly.
 +
 
 +
Restarting Xfce or rebooting your system may solve the problem, but a corrupt session is the likely cause. Delete the session folder:
 +
 
 +
$ rm -r ~/.cache/sessions/
 +
 
 +
Also make sure that the relevant folders in {{ic|$HOME}} are owned by the user starting {{ic|xfce4}}. See [[Chown]].
 +
 
 +
=== Fonts in window title crashing xfce4-title ===
 +
 
 +
[[Install]] {{Pkg|ttf-droid}} and {{Pkg|ttf-dejavu}}. See also {{Bug|44382}}.
 +
 
 +
=== Laptop lid settings ignored ===
 +
 
 +
You may find that the lid close settings in Xfce4 Power Manager are ignored, meaning that the laptop will always suspend on lid close, no matter what settings are chosen in the power manager. This is because the power manager is not set to handle lid close events by default. Instead, ''systemd-logind'' handles the lid close event. To change this behavior so that the power manager handles lid close events, execute the following command:
 +
$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s false
 +
 
 +
{{Note|Under some circumstances, the {{ic|logind-handle-lid-switch}} setting will get set to true when changes are made to the laptop lid actions or the lock on suspend setting. See [https://bugzilla.xfce.org/show_bug.cgi?id&#61;12756#c2]. In this case, you will need to toggle {{ic|logind-handle-lid-switch}} to false again.}}
 +
 
 +
=== User switching action button is greyed out ===
 +
 
 +
The ''Switch User'' action button assumes that the ''gdmflexiserver'' executable (provided by [[GDM]]) exists. Thus, if GDM is not being used then the button will be greyed out. See the [https://bugzilla.xfce.org/show_bug.cgi?id=9307 upstream bug report].
 +
 
 +
A possible workaround is to create an executable script called ''gdmflexiserver'' in {{ic|/usr/bin}} or {{ic|/usr/local/bin}} which calls the greeter switch command provided by the [[display manager]] which is being used.
 +
 
 +
* For LXDM - [[LXDM#Simultaneous users and switching users]].
 +
* For LightDM - [[LightDM#User switching]].
 +
 
 +
=== Macros in .Xresources not working ===
 +
 
 +
Xfce loads {{ic|$HOME/.Xresources}} file using {{ic|xrdb}}, but with {{ic|-nocpp}} option to skip preprocessing. For macros to work properly, copy {{ic|/etc/xdg/xfce4/xinitrc}} to {{ic|$HOME/.config/xfce4}} directory and remove {{ic|-nocpp}} option to {{ic|xrdb}} from the resulting file. See [https://bbs.archlinux.org/profile.php?id=104121 this thread].
 +
 
 +
=== Cursor theme doesn't change on login ===
 +
 
 +
Ensure the systemwide XDG cursor is set to your desired cursor theme - see [[Cursor themes#XDG specification]].
 +
 
 +
== See also ==
 +
 
 +
* [http://docs.xfce.org/ Xfce - Documentation]
 +
* [http://wiki.xfce.org Xfce - Wiki]
 +
* [http://www.xfce.org/about/ Xfce - About]
 +
* [https://xfce.org/about/tour Xfce - Tour]
 +
* [[Wikipedia:Xfce]]
 +
* [http://www.xfce-look.org/ Xfce-Look] - Themes, wallpapers, and more.
 +
* [http://xfce.wikia.com/wiki/Main_Page Xfce Wikia]

Revision as of 12:00, 12 July 2018

Xfce is a lightweight and modular desktop environment currently based on GTK+ 2. To provide a complete user experience, it includes a window manager, a file manager, desktop and panel.

Contents

Installation

Install the xfce4 group. You may also wish to install the xfce4-goodies group which includes extra plugins and a number of useful utilities such as the mousepad editor. Xfce uses the Xfwm window manager by default.

Starting

Choose Xfce Session from the menu in a display manager of choice, or add exec startxfce4 to Xinitrc.

Note: Do not call the xfce4-session executable directly; startxfce4 is the correct command which, in turn, calls the former when appropriate.

Configuration

Xfce stores configuration options in Xfconf. There are several ways to modify these options:

  • In the main menu, select Settings and the category you want to customize. Categories are programs usually located in /usr/bin/xfce4-* and /usr/bin/xfdesktop-settings.
  • xfce4-settings-editor can see and modify all settings. Options modified here will take effect immediately. Use xfconf-query to change settings from the commandline; see the documentation for details.
  • Settings are stored in XML files in ~/.config/xfce4/xfconf/xfce-perchannel-xml/ which can be edited by hand. However, changes made here will not take effect immediately.

Menu

See Xdg-menu for more info on using the Free Desktop menu system.

Whisker menu

xfce4-whiskermenu-plugin (also part of xfce4-goodies) is an alternate application launcher. It shows a list of favorites, browses through all installed applications through category buttons, and supports fuzzy searching. After package being installed, it can replace 'Applications Menu' as first item in Panel 1 (in 'Settings/Panel/Items' add 'Whisker Menu'...).

Edit entries

A number of graphical tools are available for this task:

  • MenuLibre — An advanced menu editor that provides modern features in a clean, easy-to-use interface.
https://launchpad.net/menulibre || menulibreAUR.
  • Alacarte — Menu editor for GNOME
http://www.gnome.org/ || alacarte
  • XAME — GUI tool written in Gambas designed specifically for editing menu entries in Xfce, it will not work in other environments. (Discontinued)
http://www.redsquirrel87.com/XAME.php[dead link 2017-12-30] || xameAUR

Alternatively, create the file ~/.config/menus/xfce-applications.menu manually. See the example configuration below:

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
  "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">

<Menu>
    <Name>Xfce</Name>
    <MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile>

    <Exclude>
        <Filename>xfce4-run.desktop</Filename>
        <Filename>exo-terminal-emulator.desktop</Filename>
        <Filename>exo-file-manager.desktop</Filename>
        <Filename>exo-mail-reader.desktop</Filename>
        <Filename>exo-web-browser.desktop</Filename>
        <Filename>xfce4-about.desktop</Filename>
        <Filename>xfhelp4.desktop</Filename>
    </Exclude>

    <Layout>
        <Merge type="all"/>
        <Separator/>
        <Menuname>Settings</Menuname>
        <Separator/>
        <Filename>xfce4-session-logout.desktop</Filename>
    </Layout>
</Menu>

The <MergeFile> tag includes the default Xfce menu.

The <Exclude> tag excludes applications which we do not want to appear in the menu. Here we excluded some Xfce default shortcuts, but you can exclude firefox.desktop or any other application.

The <Layout> tag defines the layout of the menu. The applications can be organized in folders or however we wish. For more details see the Xfce wiki.

You can also make changes to the Xfce menu by editing the .desktop files themselves. To hide entries, see Desktop entries#Hide desktop entries. You can edit the application's category by modifying the Categories= line of the desktop entry, see Desktop entries#File example.

Desktop

Transparent background for icon titles

To change the default white background of desktop icon titles to something more suitable, create or edit ~/.gtkrc-2.0:

style "xfdesktop-icon-view" {
    XfdesktopIconView::label-alpha = 10
    base[NORMAL] = "#000000"
    base[SELECTED] = "#71B9FF"
    base[ACTIVE] = "#71B9FF"
    fg[NORMAL] = "#fcfcfc"
    fg[SELECTED] = "#ffffff"
    fg[ACTIVE] = "#ffffff"
}
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"

Remove desktop icons

Issue the following command:

$ xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0

To reinstate icons on the desktop, issue the same command with a value of 2.

One wallpaper across multihead

Open xfce4-settings-editor and create a new property with the following settings:

Property: /backdrop/screen0/xinerama-stretch
Type: Boolean
Value: TRUE|1|Enabled

Kill window shortcut

Xfce does not have a shortcut to kill a window, for example when a program freezes.

With xorg-xkill, use xkill to interactively kill a window. For the currently active window, use xdotool:

$ xdotool getwindowfocus windowkill

Alternatively:

$ sh -c "xkill -id $(xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p')"

To add the shortcut, use Settings > Keyboard or an application like xbindkeys.

Session

Autostart

To launch custom applications when Xfce starts up, click the Applications Menu > Settings > Settings Manager and then choose the Session and Startup option and click the tab Application Autostart. You will see a list of programs that get launched on startup. To add an entry, click the Add button and fill out the form, specifying the path to an executable you want to run.

Autostart applications are stored as .desktop files in ~/.config/autostart/.

Alternatively, add the commands you wish to run (including setting environment variables) to xinitrc (or xprofile when a display manager is being used).

Tip: Sometimes it might be useful to delay the startup of an application. Note that specifying under Application Autostart a command such as sleep 3 && command does not work; a workaround is to use the syntax sh -c "sleep 3 && command"

Lock the screen

xflock4 is the reference Bash script which is used to lock an Xfce session . It tries consecutively four screen lockers or exits with return code 1 if it fails to find any. Therefore, for xflock4 to succeed, either xscreensaver, gnome-screensaver, slock or xlockmore needs to be installed.

The List of applications/Security#Screen lockers contains a short description of these four screen lockers together with other popular applications.

In particular, light-locker integrates well with xfce4-power-manager: once installed, Xfce Power Manager's setting gains an additional Security tab to configure light-locker and the existing Lock screen when system is going for sleep setting is relocated under this tab. It is then possible to set in this GUI whether the session should be locked upon screensaver activity or whenever the system goes to sleep.

To have xflock4 run light-locker or any custom session locker not among the four cited above, some steps are required. The latest 4.13 version of xfce4-session, not available in the official repositories yet, eases the integration of custom screen lockers with xfclock4 (see the latest xflock4 on git.xfce.org) by checking first for the LockCommand set in the session's xfconf channel. Therefore to use a custom locker with xflock4 one can follow the two steps below:

  1. Use the command line below to set LockCommand, here for example to use light-locker:
    $ xfconf-query -c xfce4-session -p /general/LockCommand -s "light-locker-command --lock" --create -t string
    The command inside the quotes can be adapted accordingly for other screen lockers.
  2. Enhance the xflock4 script with either one of the following methods:
    1. Replace manually /usr/bin/xflock4 with the latest version of the script, so that it calls the command specified in LockCommand.
    2. Install xfce4-session-gitAUR in order to replace the official repository package with the updated 4.13 version which takes into account LockCommand.

The panel lock button in the Action Buttons panel simply executes /usr/bin/xflock4. It should work as expected as long as xflock4 is functioning i.e. one of the native lockers is installed or a custom locker is configured to integrate with it as proposed above.

Suspend

Whenever asked to suspend, Xfce executes the xfce4-session-logout(1) command with the suspend option:

$ xfce4-session-logout --suspend

Whether or not the session is systematically locked on suspend can be configured through the xfconf properties or from the GUI.

To control this state using the CLI: there are two settings that are used, LockScreen and lock-screen-suspend-hibernate, in respectively the session and the power manager xfconf channels. To prevent locking on suspend, turn them to false:

$ xfconf-query -c xfce4-session -p /shutdown/LockScreen -s false
$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/lock-screen-suspend-hibernate -s false

Similarly, turn them to true to lock the session on suspend.

The setting can also be controlled from the GUI: open the Session and Startup application and turn the flag Advanced > Lock screen before sleep on or off.

Whenever the suspend keyboard button is pressed, it can be handled by either Xfce's power manager or by systemd-logind. To give precedence to logind, the following xfconf setting must be set to true:

$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-suspend-key -n -t bool -s true
Note: To check how systemd-logind handles events whenever it has precedence over Xfce, check logind.conf(5)

Disable saved sessions

Per user, saved sessions can be disabled by executing the following:

$ xfconf-query -c xfce4-session -p /general/SaveOnExit -s false

Then navigate to Applications > Settings > Session and Startup > Sessions and press the Clear saved sessions button to remove all previously saved sessions.

Tip: If the command above does not change the setting persistently, use the following command instead: xfconf-query -c xfce4-session -p /general/SaveOnExit -n -t bool -s false

Alternatively, Xfce kiosk mode can be used to disable the saving of sessions systemwide. To disable sessions, create or edit the file /etc/xdg/xfce4/kiosk/kioskrc and add the following:

[xfce4-session]
SaveSession=NONE

If kiosk mode is not working, the user can set read only permissions for the sessions directory:

$ rm ~/.cache/sessions/* && chmod 500 ~/.cache/sessions

This will prevent Xfce from saving any sessions despite any configuration that specifies otherwise.

Use a different window manager

Note: For the changes to take effect, you will need to clear the saved sessions and ensure that session saving is disabled when logging out for the first time. Once the window manager of choice is running, session saving can be enabled again.

The files specifying the default window manager are found in the following locations:

  • ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml - per user
  • /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml - systemwide

The default window manager for the user can be set easily using xfconf-query:

$ xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -sa wm_name

If you want to start the window manager with command line options, see the command below:

$ xfconf-query -c xfce4-session -p /sessions/Failsafe/Client0_Command -t string -t string -s wm_name -s --wm-option

If you need more command line options, simply add more -t string and -s --wm-option arguments to the command.

If you want to change the default window manager systemwide, edit the file specified above manually, changing xfwm4 to the preferred window manager and adding more <value type="string" value="--wm-option"/> lines for extra command line options if needed.

You can also change the window manager by autostarting wm_name --replace using the autostart facility or by running wm_name --replace & in a terminal and making sure the session is saved on logout. Be aware though that this method does not truly change the default manager, it merely replaces it at login. Note that if you are using the autostart facility, you should disable saved sessions as this could lead to the new window manager being started twice after the default window manager.

Theming

XFCE themes are available at xfce-look.org. Xfwm themes are stored in /usr/share/themes/xfce4, and set in Settings > Window Manager. GTK+ themes are set in Settings > Appearance.

To achieve a uniform look for all applications, see Uniform look for Qt and GTK applications.

See also Cursor themes, Icons, and Font configuration.

Sound

Keyboard volume buttons

xfce4-pulseaudio-plugin provides a panel applet which has support for keyboard volume control and volume notifications. As an alternative, you can install xfce4-volumed-pulseAUR, which also provides keybinding and notification control, but without an icon sitting in the panel. This is handy, for example, when using pasystrayAUR at the same time for a finer control.

Alternatively, xfce4-mixer also provides a panel applet and keyboard shortcuts which supports Alsa as well. Note however, that it is based on a feature of GStreamer 0.10 which has been abandoned in 1.0.

For non desktop environment specific alternatives, see List of applications#Volume managers.

Shortcuts

If you are not using an applet or daemon that controls the volume keys, you can map volume control commands to your volume keys manually using Xfce's keyboard settings. For the sound system you are using, see the sections linked to below for the appropriate commands.

Keyboard Shortcuts

Keyboard shortcuts are defined in two places: Settings > Window Manager > Keyboard, and Settings > Keyboard > Shortcuts.

Polkit Authentication Agent

The polkit-gnome agent will be installed along with xfce4-session and autostarted automatically; no user intervention is required. For more information, see Polkit#Authentication agents.

A third party polkit authentication agent for Xfce is also available, see xfce-polkitAUR or xfce-polkit-gitAUR.

Display blanking

Some programs that are commonly used with Xfce will control monitor blanking and DPMS (monitor powersaving) settings. They are discussed below.

Xfce Power Manager

Xfce Power Manager controls blanking and DPMS settings. These settings can be configured in the Power Manager GUI within the Display tab.

Note that when Display power management is turned off, DPMS is fully disabled, it does not mean that Power Manager will simply stop controlling DPMS. It does not disable screen blanking either. To disable both blanking and DPMS, right click on the power manager system tray icon or left click on the panel applet and make sure that the option labelled Presentation mode is ticked.

XScreenSaver

If xscreensaver is installed and runs alongside Xfce Power Manager, it may not be clear which application is in control of blanking and DPMS as both are competing for control of the same settings. Therefore, in a situation where it is important that the monitor not be blanked (when watching a video for instance), it is advisable to disable blanking and DPMS through both applications. To know more about XScreenSaver options, see XScreenSaver#DPMS and blanking settings.

xset

If neither of the above applications are running, then blanking and DPMS settings can be controlled using the xset command, see DPMS#Modifying DPMS and screensaver settings using xset.

Note: There are some issues associated with blanking and resuming from blanking in some configurations. See [1][2].

Tips and tricks

Hide partitions from thunar and xfdesktop

If your installation partitions are shown as mounted devices on the desktop and in Thunar, try to install gvfs. See Udisks#Hide selected partitions for more advanced configuration options.

Screenshots

Xfce has its own screenshot tool, xfce4-screenshooter. It is part of the xfce4-goodies group.

Go to Applications > Settings > Keyboard, Application Shortcuts. Add the xfce4-screenshooter -f (or -w for the active window) command to use the Print key in order to take fullscreen screenshots. See screenshooter's man page for other optional arguments.

Alternatively, an independent screenshot program like scrot can be used.

Disable Terminal F1 and F11 shortcuts

The xfce terminal binds F1 and F11 to help and fullscreen, respectively, which can make using programs like htop difficult. To disable those shortcuts, create or edit its configuration file, then log out and log back in. F10 can disabled in the Preferences menu.

~/.config/xfce4/terminal/accels.scm
(gtk_accel_path "<Actions>/terminal-window/fullscreen" "")
(gtk_accel_path "<Actions>/terminal-window/contents" "")

Terminal color themes or palettes

Terminal color themes or palettes can be changed in GUI under Appearance tab in Preferences. These are the colors that are available to most console applications like Emacs, Vi and so on. Their settings are stored individually for each system user in ~/.config/xfce4/terminal/terminalrc file. There are also so many other themes to choose from. Check forum thread Terminal Colour Scheme Screenshots for hundreds of available choices and themes.

Changing default color theme

Xfce's extra/terminal package comes with a darker colour palette. To change this, append the following in your terminalrc file for a lighter color theme, that is always visible in darker Terminal backgrounds.

~/.config/xfce4/terminal/terminalrc
ColorPalette5=#38d0fcaaf3a9
ColorPalette4=#e013a0a1612f
ColorPalette2=#d456a81b7b42
ColorPalette6=#ffff7062ffff
ColorPalette3=#7ffff7bd7fff
ColorPalette13=#82108210ffff

Terminal tango color theme

To switch to tango color theme, open with your favorite editor

~/.config/xfce4/terminal/terminalrc

And add(replace) these lines:

ColorForeground=White
ColorBackground=#323232323232
ColorPalette1=#2e2e34343636
ColorPalette2=#cccc00000000
ColorPalette3=#4e4e9a9a0606
ColorPalette4=#c4c4a0a00000
ColorPalette5=#34346565a4a4
ColorPalette6=#757550507b7b
ColorPalette7=#060698989a9a
ColorPalette8=#d3d3d7d7cfcf
ColorPalette9=#555557575353
ColorPalette10=#efef29292929
ColorPalette11=#8a8ae2e23434
ColorPalette12=#fcfce9e94f4f
ColorPalette13=#72729f9fcfcf
ColorPalette14=#adad7f7fa8a8
ColorPalette15=#3434e2e2e2e2
ColorPalette16=#eeeeeeeeecec

Open URLs by middle mouse in terminal

On update to version 0.8 open URL with middle mouse turned off by default and just paste clip to cursor. To enable old behavior fix next option in ${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc (XDG_CONFIG_HOME=${HOME}/.config by default)

${XDG_CONFIG_HOME}/xfce4/terminal/terminalrc
[Configuration]
MiscMiddleClickOpensUri=TRUE

Colour management

Xfce has no native support for colour management. [3] See ICC profiles for alternatives.

Multiple monitors

Xfce has support for multiple monitors. Settings can be configured in the Applications > Settings > Display dialog. For more information, see the display article from the Xfce documentation.

SSH agents

By default Xfce 4.10 will try to load gpg-agent or ssh-agent in that order during session initialization. To disable this, create an xfconf key using the following command:

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

To force using ssh-agent even if gpg-agent is installed, run the following instead:

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

To use GNOME Keyring, simply tick the checkbox Launch GNOME services on startup in the Advanced tab of Session and Startup in Xfce's settings. This will also disable gpg-agent and ssh-agent.

Source: http://docs.xfce.org/xfce/xfce4-session/advanced

Scroll a background window without shifting focus on it

Go to Main Menu > Settings > Window Manager Tweaks > Accessibility tab. Uncheck Raise windows when any mouse button is pressed.

Mouse button modifier

By default, the mouse button modifier in Xfce is set to Alt. This can be changed with xfconf-query. For instance, the following command will set the Super key as the mouse button modifier:

$ xfconf-query -c xfwm4 -p /general/easy_click -n -t string -s "Super"

Strictly speaking, using multiple modifiers is not supported. However, as a workaround, multiple modifiers can be specified if the key names are separated with ><. For instance, to set Ctrl+Alt as the mouse button modifier, you can use the following command:

$ xfconf-query -c xfwm4 -p /general/easy_click -n -t string -s "Ctrl><Alt"

Set the two fingers click to middle click for a touchpad

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Convoluted way of simply configuring Touchpad Synaptics (Discuss in Talk:Xfce#)

If you want the 2 finger click on the touchpad to do a middle click, create or edit the following file:

~/.config/xfce4/xfconf/xfce-perchannel-xml/pointers.xml
<channel name="pointers" version="1.0">
  <property name="SynPS2_Synaptics_TouchPad" type="empty">
    <property name="Properties" type="empty">
      <property name="Synaptics_Tap_Action" type="array">
        <value type="int" value="0"/>
        <value type="int" value="0"/>
        <value type="int" value="0"/>
        <value type="int" value="0"/>
        <value type="int" value="1"/>
        <value type="int" value="2"/>
        <value type="int" value="3"/>
      </property>
    </property>
  </property>
</channel>

The 2 in the array is the middle click.

Limit the minimum brightness of the brightness-slider

Limiting the minimum brightness can be useful for displays which turn off backlight on a brightness level of 0. In xfce4-power-manager 1.3.2 a new hidden option had been introduced to set a minimum brightness value with a xfconf4-property. Add brightness-slider-min-level as an int property in xfconf4. Adjust the int value to get a suitable minimum brightness level.

Adding profile pictures

To add profile pictures for each user to be displayed in the whisker-menu, simply place a 96x96 PNG file in the respective user's home directory with the name .face. For example the PNG file /home/bob/.face for user bob.

Image editing programs like GIMP can be used to convert and scale your favourite images down to 96x96.

Power manager plugin label

The xfconf option show-panel-label of type int controls the label of the power manager, it can be configured for different label formats: it can be set to 0 (no label), 1 (percentage), 2 (remaining time) or 3 (both).

It is also accessible through the power manager plugin GUI in Properties > Show label

Troubleshooting

Desktop icons rearrange themselves

At certain events (such as opening the panel settings dialog) icons on the desktop rearrange themselves. This is because icon positions are determined by files in the ~/.config/xfce4/desktop/ directory. Each time a change is made to the desktop (icons are added or removed or change position) a new file is generated in this directory and these files can conflict.

To solve the problem, navigate to the directory and delete all the files other than the one which correctly defines the icon positions. You can determine which file defines the correct icon positions by opening it and examining the locations of the icons. The topmost row is defined as row 0 and the leftmost column is defined by col 0. Therefore an entry of:

[Firefox]
row=3
col=0

means that the Firefox icon will be located on the 4th row of the leftmost column.

GTK themes not working with multiple monitors

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Which configuration tools? What does ceasing to work mean? Is it that new themes cannot be selected or that themes display incorrectly? Is there a bug report? (Discuss in Talk:Xfce#)

Some configuration tools may corrupt displays.xml, which results in GTK themes under Applications Menu > Settings > Appearance ceasing to work. To fix the issue, delete ~/.config/xfce4/xfconf/xfce-perchannel-xml/displays.xml and reconfigure your screens.

Icons do not appear in right-click menus

Note: Despite the deprecation of GConf, this method does still work.

Users may find that icons do not appear when right-clicking options within some applications, including those made with Qt. This problem only appears to happen within Xfce. Run these two commands:

$ gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true
$ gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true

NVIDIA and xfce4-sensors-plugin

To detect and use sensors of nvidia gpu you need to install libxnvctrl and then rebuild xfce4-sensors-plugin with ABS. You also have the option of using xfce4-sensors-plugin-nvidiaAUR which replaces xfce4-sensors-plugin.

Panel applets keep being aligned on the left

Add a separator someplace before the right end and set its "expand" property. [4]

Preferred Applications preferences have no effect

Most applications rely on xdg-open for opening a preferred application for a given file or URL.

In order for xdg-open and xdg-settings to detect and integrate with the Xfce desktop environment correctly, you need to install the xorg-xprop package.

If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed. Installing the package and allowing xdg-open to detect that you are running Xfce makes it forward all calls to exo-open instead, which correctly uses all your preferred applications preferences.

To make sure xdg-open integration is working correctly, ask xdg-settings for the default web browser and see what the result is:

# xdg-settings get default-web-browser

If it replies with:

xdg-settings: unknown desktop environment

it means that it has failed to detect Xfce as your desktop environment, which is likely due to a missing xorg-xprop package.

Restore default settings

If for any reason you need to revert back: to the default settings, rename ~/.config/xfce4-session/ and ~/.config/xfce4/

$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak

Relogin for changes to take effect. If you get Unable to load a failsafe session upon login, see the #Session failure section.

Session failure

Symptoms include:

  • The mouse is an X and/or does not appear at all;
  • Window decorations have disappeared and windows cannot be closed;
  • (xfwm4-settings) will not start, reporting These settings cannot work with your current window manager (unknown);
  • Errors reported by a display manager such as No window manager registered on screen 0.
  • Unable to load a failsafe session:
Unable to load a failsafe session.
Unable to determine failsafe session name.  Possible causes: xfconfd isn't running (D-Bus setup problem); environment variable $XDG_CONFIG_DIRS is set incorrectly (must include "/etc"), or xfce4-session is installed incorrectly. 

Restarting Xfce or rebooting your system may solve the problem, but a corrupt session is the likely cause. Delete the session folder:

$ rm -r ~/.cache/sessions/

Also make sure that the relevant folders in $HOME are owned by the user starting xfce4. See Chown.

Fonts in window title crashing xfce4-title

Install ttf-droid and ttf-dejavu. See also FS#44382.

Laptop lid settings ignored

You may find that the lid close settings in Xfce4 Power Manager are ignored, meaning that the laptop will always suspend on lid close, no matter what settings are chosen in the power manager. This is because the power manager is not set to handle lid close events by default. Instead, systemd-logind handles the lid close event. To change this behavior so that the power manager handles lid close events, execute the following command:

$ xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s false
Note: Under some circumstances, the logind-handle-lid-switch setting will get set to true when changes are made to the laptop lid actions or the lock on suspend setting. See [5]. In this case, you will need to toggle logind-handle-lid-switch to false again.

User switching action button is greyed out

The Switch User action button assumes that the gdmflexiserver executable (provided by GDM) exists. Thus, if GDM is not being used then the button will be greyed out. See the upstream bug report.

A possible workaround is to create an executable script called gdmflexiserver in /usr/bin or /usr/local/bin which calls the greeter switch command provided by the display manager which is being used.

Macros in .Xresources not working

Xfce loads $HOME/.Xresources file using xrdb, but with -nocpp option to skip preprocessing. For macros to work properly, copy /etc/xdg/xfce4/xinitrc to $HOME/.config/xfce4 directory and remove -nocpp option to xrdb from the resulting file. See this thread.

Cursor theme doesn't change on login

Ensure the systemwide XDG cursor is set to your desired cursor theme - see Cursor themes#XDG specification.

See also