This page contains various tips for the Xfce desktop environment.
One of the benefits of Xfce is performance. It is lighter and more responsive than other desktop environments such as GNOME on almost all hardware, especially on machines with less memory and processing power.
Fonts play a huge part in GUI performance. With all of the font smoothing, hinting and rendering turned on, you may notice significant latency when menus or dialog boxes appear. When you turn all of these off, menus and dialog boxes will appear much faster (snappy in fact). Scrolling will also improve in web browsers, text editors, and terminal emulators.
The only problem with turning off hinting/antialising is ugly fonts. On a laptop LCD, I recommend the “Kochi Gothic” font from 9 points and larger. “Helvetica” at 9 points and “Luxi Sans” also gives a clean look. Also, using “Verdana” at 9+ points with only anti-aliasing turned on(no hinting or sub-pixel hinting) looks very slick, however it may appear a little bold. Other font recommendations are welcome!
Using the Fixed font (12+) looks nice on a crt monitor works nicely for me. it is easy to read and i don't need to use anti-aliasing. it looks good and runs fast!
When connecting remotely using VNC, very slow and sluggish response can often be observed, especially when closing application windows. For example, when closing Firefox, it may take 30 to 60 seconds for the window to disappear, during which time the system can become completely unresponsive. By changing the desktop background to a solid white color, all programs (including Firefox) can close within 1 to 2 seconds.
To apply this change, right-click on the desktop and select Settings, then Desktop Settings. Make sure that Show Image is unchecked, set Color Style to Solid Color, and set First Color to white (#FFFFFF).
Another option that may work in some cases is to check the settings of the remote connection software being used. If an option such as “Remove Wallpaper” or “Do Not Display Wallpaper” is available, enabling it may improve performance. TightVNC Viewer does not provide a Remove Wallpaper option, so changing the desktop background color to white is the only effective solution in that case.
# ~/.gtkrc-2.0
style "panel-background" {
bg_pixmap[NORMAL] = "foo.bar"
bg_pixmap[PRELIGHT] = "foo.bar"
bg_pixmap[ACTIVE] = "foo.bar"
bg_pixmap[SELECTED] = "foo.bar"
bg_pixmap[INSENSITIVE] = "foo.bar"
}
style "panel-color" {
fg[NORMAL] = "#222222"
fg[ACTIVE] = "#111111"
bg[NORMAL] = "#edeff2"
bg[PRELIGHT] = "#3d6eab"
bg[ACTIVE] = "#3d6eab"
}
widget_class "*Panel*" style "panel-background"
widget "*PanelWidget*" style "panel-color"
widget "*PanelApplet*" style "panel-color"
widget "*Panel*" style "panel-color"
widget_class "*Panel*" style "panel-color"
class "*Panel*" style "panel-color"
class "*Tray*" style "panel-color"
class "*tray*" style "panel-color"
You have to create a .desktop file (usually in /usr/share/applications for system wide or ~/.local/share/applications for your user) for the application you want to add.
In the following example, we create an entry in the menu with the name “foo” in the submenu “Multimedia”:
[Desktop Entry] Encoding=UTF-8 Name=foo GenericName=bar Comment=Senseless program ever Exec=foobar Icon=/usr/share/pixmaps/foobar.xpm Terminal=false Type=Application Categories=Multimedia;
You can read more about .desktop files here.
The libexo provides several utils amongst one to handle desktop entry files in a GUI fashion: exo-desktop-item-edit. With it you can create a new .desktop file, by running the command exo-desktop-item-edit --create-new
You can do this in two ways:
/usr/share/applications/ folder, but you will lose mime data (file associations).NoDisplay=true
Like most UNIX terminal sessions, Xfce runs through user-customizable startup file when it starts up. You can edit this init file to run your own scripts, send environment variables to the GUI, etc.
To add your own startup code, edit the xinitrc file like this:
You can read more about xinitrc at various locations online.
To set the desktop margins, use the Settings Manager (Settings Manager > Workspaces & Margins > Margins).
The desktop margins are used to limit the size of maximized windows. This may be useful to avoid switching workspaces by accidentally mousing off the side of the screen.
The margins are also useful if you have only one Xfce panel: the margin area leaves a clear space to pull up application or workspace menus. By default, right click on the desktop (the margin) to show the Xfce menu, or middle (left+right) click to show the workspace menu.
The size of the margins is in pixels, so, with a reasonably modern monitor, at a resolution of, say 1680 x 1050, a setting of '10' will give a margin of about 1/8 of an inch. Note that nothing will change on any open window until you minimize and re-maximize it again. Also note that these margins only apply to maximized windows – you can manually resize any window right to the edge of the screen if you want to.
If you would like the Xfce logout menu to show up when you press your power button, and your machine has ACPI support, then do the following:
/etc/acpi/events/powerbtn# /etc/acpi/events/powerbtn # This is called when the user presses the power button and calls # /etc/acpi/powerbtn.sh for further processing. # Optionally you can specify the placeholder %e. It will pass # through the whole kernel event message to the program you've # specified. # We need to react on "button power.*" and "button/power.*" because # of kernel changes. event=button[ /]power action=/usr/local/sbin/xfce4-shutdown-as-user.sh
/usr/local/sbin/xfce4-shutdown-as-user.sh#!/bin/sh
# xfce4-shutdown-as-user.sh
#
# Check how many users are currently logged into X.
# If only one user is logged in, run a script which sets
# up the environment to call xfce4-session-logout.
LOGGED_IN_USER=`ls -trl /tmp/.ICE-unix/ | tail -n -1 | cut -d' ' -f3`
NUM_X_USERS=`echo $LOGGED_IN_USER | wc -l`
if [ $NUM_X_USERS -eq 1 ]; then
sudo -H -u $LOGGED_IN_USER /usr/local/sbin/xfce4-user-session-shutdown.sh
fi
/usr/local/sbin/xfce4-user-session-shutdown.sh#!/bin/sh # xfce4-user-session-shutdown.sh # # Set up the environment so that DISPLAY and # SESSION_MANAGER are valid, and xfce4-session-logout can run HOST=`hostname` SESSION_ID=`ls -t /tmp/.ICE-unix/ | head -n1` # Note that distros use different syntax for the SESSION_MANAGER variable (this script has Debian's format). # If this does not work, then try something like SESSION_MANAGER="local/$HOST:@/tmp/.ICE-unix/$SESSION_ID" # instead. You can always find the correct format for your distribution by looking at the # value of SESSION_MANAGER in a X session. DISPLAY=:0 SESSION_MANAGER="local/$HOST:/tmp/.ICE-unix/$SESSION_ID" /usr/bin/xfce4-session-logout
chmod +x /usr/local/sbin/xfce4-user-session-shutdown.sh /usr/local/sbin/xfce4-shutdown-as-user.sh
# EXAMPLE event=button/power.* #action=/usr/lib/acpid/power_button action=/bin/true
#!/bin/sh precision=2 # number of digit for floating value notify_time=20000 # number of milisecond the notification show res=`echo "scale=$precision;$@" | bc` notify-send -t $notify_time "$res" "=$@"
^([0-9]|\(|\.).*/bin/sh ~/bcme.sh \0Short Bash script to toggle the autohide property of a panel, so you can bind for example a keyboard shortcut to quickly show and hide a panel.
#!/bin/sh test -z "$1" && echo missing panel id && exit 1 test ! -z "`echo $1 | sed s/[0-9]*//g`" && echo bad panel id && exit 1 CHANNEL=xfce4-panel PANELID=$1 PROP=/panels/panel-$PANELID/autohide if `xfconf-query -c $CHANNEL -p $PROP >/dev/null 2>&1`; then xfconf-query -c $CHANNEL -T -p $PROP else xfconf-query -c $CHANNEL -n -p $PROP -t bool -s false fi
Xfce lets you control the transparency of any window by horizontal scrolling on the titlebar. Starting with 4.12 though, it has been disabled by default. To enable this, open Settings Editor > xfwm4 and change horiz_scroll_opacity to true by clicking the checkbox.