Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips [2015/04/11 05:56] – Add info on enabling control of window transparency. kadaltips [2026/09/20 17:59] (current) – Uniform source code formatting epetriglia
Line 1: Line 1:
 +~~NOTOC~~
 +
 ====== Tips & Tricks ====== ====== Tips & Tricks ======
-This page contains various tips for the Xfce desktop environment. 
  
 +  * **[[#Performance Tips|Performance Tips]]**
 +    * [[#Fonts|Fonts]]
 +    * [[#Background Color|Background Color]]
 +  * **[[#Gtkrc files|Gtkrc files]]**
 +  * **[[#How to add or remove applications in the system menu|How to add or remove applications in the system menu]]**
 +    * [[#Add an application|Add an application]]
 +    * [[#Remove an application from the menu|Remove an application from the menu]]
 +  * **[[#How to customize starting Xfce|How to customize starting Xfce]]**
 +    * [[#Starting with showing the Root Window|Starting with showing the Root Window]]
 +  * **[[#Use the desktop margin|Use the desktop margin]]**
 +  * **[[#Handle ACPI event for power button, show Xfce logout options|Handle ACPI event for power button, show Xfce logout options]]**
 +    * [[#Solution 1|Solution 1]]
 +    * [[#Solution 2|Solution 2]]
 +  * **[[#Accessing man pages through xfce4-appfinder|Accessing man pages through xfce4-appfinder]]**
 +  * **[[#Do maths with xfce4-appfinder|Do maths with xfce4-appfinder]]**
 +  * **[[#Xfconf|Xfconf]]**
 +    * [[#Toggle panel autohide|Toggle panel autohide]]
 +    * [[#Control per-window transparency|Control per-window transparency]]
  
-===== Customize the font in clock panel plugin =====+This page contains various tips for the Xfce desktop environment.
  
-You can use [[http://library.gnome.org/devel/pango/unstable/PangoMarkupFormat.html|Pango markup format]] to customize the font in clock panel plugin. Switch to custom format (only available with digital layout) and use tags inside the format string. +----
- +
-For example: +
-  * ''<nowiki><span font_desc="URW Gothic L Book 18">%R</span></nowiki>'' +
-  * ''<nowiki><span font_desc="bold 12">%R</span></nowiki>''+
  
 ===== Performance Tips ===== ===== Performance Tips =====
  
-Lets face it: one of the reasons for using Xfce is performance. It is lighter and more responsive than Gnome on almost all hardware, especially on machines with less memory and processor power.+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 ==== ==== Fonts ====
  
Line 24: Line 40:
 ==== Background Color ==== ==== Background Color ====
  
-I regularly connect remotely using vncserverand I always noticed very slow and sluggish response, especially whenever I closed an application window. For example, when closing Firefox, it would take 30 to 60 seconds for the window to close and the system would be completely unresponsive during that time. By changing my background to solid white, all programs (including Firefox) now close within 1 to 2 seconds.+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 solid white color, all programs (including Firefox) can close within 1 to 2 seconds.
  
-Right-click on the desktop and choose Settings then Desktop Settings. Make sure Show Image is UNcheckedand set the Color Style to Solid Color, and then set First Color to white (#FFFFFF).+To apply this change, right-click on the desktop and select Settingsthen Desktop Settings. Make sure that Show Image is unchecked, set Color Style to Solid Color, and set First Color to white (#FFFFFF).
  
-Another optionthat may work for someis to check the options of the program that you are using to connect remotely, and if it has a "Remove Wallpaper" option or "Do Not Display Wallpaper" optionthen enable that optionI use TightVNCviewer and it does not have a Remove Wallpaper option, therefore changing the background color to white is the only solution for me.+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 availableenabling it may improve performanceTightVNC Viewer does not provide a Remove Wallpaper option, so changing the desktop background color to white is the only effective solution in that case.
  
-===== How to use the alternative GNOME-menu =====+===== Gtkrc files =====
  
-If you want to use the new menu from GNOME, with quick starters for favorites applications and such, you can use the [[http://goodies.xfce.org/projects/panel-plugins/xfce4-xfapplet-plugin|xfapplet panel plugin]] with the GNOME main menu applet.  The menu should be installed with your package system, look for **gnome-main-menu**.  [[http://wirelessimage4.pbwiki.com/f/Screenshot.png|Xfce screenshot]], [[http://www.novell.com/video/desktop/|video]].+<note warning> 
 +This section may be outdated and may no longer work since Xfce has migrated to GTK 3! 
 +</note>
  
-Add a new xfapplet item inside your panel, and open its properties dialog to add the GNOME menu applet.+  * A tutorial about the Gtkrc format can be found [[http://live.gnome.org/Attic/GnomeArt/Tutorials/GtkThemes|here]]
  
-If you don't like GNOME main menu, try Ubuntu System Panel, available in several distributions. +  * Xfce has also a couple of custom gtkrc settings for some of the applications: [[https://git.xfce.org/xfce/xfdesktop/tree/README?h=xfce-4.12|xfdesktop]] and [[https://docs.xfce.org/xfce/thunar/hidden-settings]] (see also [[https://docs.xfce.org/xfce/xfce4-settings/keyboard|editable shortcuts]]).
- +
-See also: [[/howto/customize-menu|How to customize the Xfce 4.5+ menu]] +
- +
-===== Gtkrc files ===== +
-  * A tutorial about the Gtkrc format can be found [[http://live.gnome.org/GnomeArt/Tutorials/GtkThemes|here]].  +
- +
-  * Xfce has also a couple of custom gtkrc settings for some of the applications: [[http://svn.xfce.org/svn/xfce/xfdesktop/branches/xfce_4_4/README|xfdesktop]] and [[http://thunar.xfce.org/pwiki/documentation/advanced_settings|Thunar]] (see also [[http://thunar.xfce.org/pwiki/documentation/faq#how_do_i_assign_different_keyboard_shortcuts|editable shortcuts]]).+
  
   * You can not define a custom background for Thunar icon/ list views due to a [[http://bugzilla.gnome.org/show_bug.cgi?id=71926|bug in Gtk+]] itself.   * You can not define a custom background for Thunar icon/ list views due to a [[http://bugzilla.gnome.org/show_bug.cgi?id=71926|bug in Gtk+]] itself.
Line 74: Line 85:
  
    * See also those threads in the forum : http://forum.xfce.org/viewtopic.php?id=6169 and http://forum.xfce.org/viewtopic.php?id=6196    * See also those threads in the forum : http://forum.xfce.org/viewtopic.php?id=6169 and http://forum.xfce.org/viewtopic.php?id=6196
 +
 +[[|Back to Top]]
 +
 +----
  
 ===== How to add or remove applications in the system menu ===== ===== How to add or remove applications in the system menu =====
  
 === Add an application === === Add an application ===
 +
 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. 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.
  
Line 95: Line 111:
 You can read more about .desktop files [[http://standards.freedesktop.org/desktop-entry-spec/latest/|here]]. You can read more about .desktop files [[http://standards.freedesktop.org/desktop-entry-spec/latest/|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 ''<nowiki>exo-desktop-item-edit --create-new</nowiki>'' ;-)+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 ''<nowiki>exo-desktop-item-edit --create-new</nowiki>''
  
 === Remove an application from the menu === === Remove an application from the menu ===
 +
 You can do this in two ways: You can do this in two ways:
   * First way, and the easier one is to simply remove the .desktop file in the ''/usr/share/applications/'' folder, but you will lose mime data (file associations).   * First way, and the easier one is to simply remove the .desktop file in the ''/usr/share/applications/'' folder, but you will lose mime data (file associations).
Line 103: Line 120:
  
   NoDisplay=true   NoDisplay=true
 +  
 +[[|Back to Top]]
 +
 +----
  
-=====How to customize starting Xfce=====+===== How to customize starting Xfce =====
  
 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. 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.
Line 119: Line 140:
  
 ==== Starting with showing the Root Window ==== ==== Starting with showing the Root Window ====
 +
   - xfdesktop --quit   - xfdesktop --quit
   - save your session   - save your session
  
 +[[|Back to Top]]
 +
 +----
  
 ===== Use the desktop margin ===== ===== Use the desktop margin =====
Line 133: Line 158:
 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. 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.
  
-===== Handle acpi event for power button, show Xfce logout options =====+[[|Back to Top]]
  
-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:+---- 
 + 
 +===== Handle ACPI event for power button, show Xfce logout options ===== 
 + 
 +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:
  
 ==== Solution 1 ==== ==== Solution 1 ====
 +
    * ''/etc/acpi/events/powerbtn''    * ''/etc/acpi/events/powerbtn''
-<file> 
-# /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 +  # /etc/acpi/events/powerbtn 
-action=/usr/local/sbin/xfce4-shutdown-as-user.sh +  # This is called when the user presses the power button and calls 
-</file>+  # /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''   * ''/usr/local/sbin/xfce4-shutdown-as-user.sh''
-<file> 
-#!/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 --1 | cut -d' ' -f3` +  #!/bin/sh  
-NUM_X_USERS=`echo $LOGGED_IN_USER | wc -l`+  # 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.
      
-if [ $NUM_X_USERS -eq 1 ]; then +  LOGGED_IN_USER=`ls -trl /tmp/.ICE-unix/ | tail -n -1 | cut -d' ' -f3` 
-    sudo -H -u $LOGGED_IN_USER /usr/local/sbin/xfce4-user-session-shutdown.sh +  NUM_X_USERS=`echo $LOGGED_IN_USER | wc -l` 
-fi +   
-</file>+  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''   * ''/usr/local/sbin/xfce4-user-session-shutdown.sh''
-  <file> 
-#!/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` +  #!/bin/sh 
-SESSION_ID=`ls -t /tmp/.ICE-unix/ | head -n1` +  # xfce4-user-session-shutdown.sh 
-# 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" +  # Set up the environment so that DISPLAY and 
-# instead. You can always find the correct format for your distribution by looking at the +  # SESSION_MANAGER are valid, and xfce4-session-logout can run 
-# value of SESSION_MANAGER in a X session. +   
-DISPLAY=:0 SESSION_MANAGER="local/$HOST:/tmp/.ICE-unix/$SESSION_ID" /usr/bin/xfce4-session-logout +  HOST=`hostname` 
-  </file>+  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
  
    * Make those scripts executable :    * Make those scripts executable :
-<code> + 
-chmod +x /usr/local/sbin/xfce4-user-session-shutdown.sh /usr/local/sbin/xfce4-shutdown-as-user.sh +  chmod +x /usr/local/sbin/xfce4-user-session-shutdown.sh /usr/local/sbin/xfce4-shutdown-as-user.sh 
-</code>+
 ==== Solution 2 ==== ==== Solution 2 ====
 +
    * Open Settings Manager (or by command : xfce4-settings-manager )    * Open Settings Manager (or by command : xfce4-settings-manager )
    * Open Power Manager settings    * Open Power Manager settings
Line 199: Line 227:
    * Close Power Manager settings    * Close Power Manager settings
    * If you have ACPI scripts installed, deactivate or update the **power-button** script from **/etc/acpi/events/**, and change the //action// field to ///bin/true//:    * If you have ACPI scripts installed, deactivate or update the **power-button** script from **/etc/acpi/events/**, and change the //action// field to ///bin/true//:
-<file> 
-# EXAMPLE 
-event=button/power.* 
-#action=/usr/lib/acpid/power_button 
-action=/bin/true 
-</file> 
-===== Use mnemonics to create Thunar Custom Actions ===== 
  
-When you create a [[http://thunar.xfce.org/pwiki/documentation/custom_actions|Thunar Custom Action]] you can set the name with an underscore "_" before a letter to use it as mnemonic.  When you right click in a Thunar view, you can type the letter to access your custom action.+  # EXAMPLE 
 +  event=button/power.
 +  #action=/usr/lib/acpid/power_button 
 +  action=/bin/true
  
-===== Accessing man pages through xfrun4 ===== +[[|Back to Top]]
-Use '#' as a shortcut to open man pages using xfrun4. e.g. #man+
  
-===== Do maths with xfrun4/appfinder ===== +---- 
-  * What you get: input simple mathematical expression, like 5+5 or (5+5)/3 or .5*10, in xfrun4/appfinder, and get the result as notification.+ 
 +===== Accessing man pages through xfce4-appfinder ===== 
 + 
 +Use '#' as a shortcut to open man pages using xfrun4. e.g. ''#man''
 + 
 +[[|Back to Top]] 
 + 
 +---- 
 + 
 +===== Do maths with xfce4-appfinder ===== 
 + 
 +  * What you get: input simple mathematical expression, like 5+5 or (5+5)/3 or .5*10, in xfce4-appfinder, and get the result as notification.
   * Requirement: notify-send   * Requirement: notify-send
   * Save this script as bcme.sh, in your home directory:   * Save this script as bcme.sh, in your home directory:
Line 225: Line 259:
   notify-send -t $notify_time "$res" "=$@"   notify-send -t $notify_time "$res" "=$@"
  
-  *Add custom action to Application finder : +  * Add custom action to Application finder: 
-    * Type : Regular Expression +    * Type: Regular Expression 
-    * Pattern : ^([0-9]|\(|\.).* +    * Pattern: ''^([0-9]|\(|\.).*'' 
-    * Command : /bin/sh ~/bcme.sh \0+    * Command: ''/bin/sh ~/bcme.sh \0''
     *  (check) Save match in command history     *  (check) Save match in command history
  
 +[[|Back to Top]]
 +
 +----
  
 ====== Xfconf ===== ====== Xfconf =====
Line 257: Line 294:
 ===== Control per-window transparency ===== ===== Control per-window transparency =====
  
-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. +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. 
 + 
 +[[|Back to Top]] 
 + 
 +---- 
 + 
 +[[:start|Return to the Xfce wiki start page]]