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 [2019/03/27 22:47] – [How to add or remove applications in the system menu] blueberrybrownietips [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]]
  
 +This page contains various tips for the Xfce desktop environment.
 +
 +----
  
 ===== Performance Tips ===== ===== Performance Tips =====
  
 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. 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 17: 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 UNchecked, and set the Color Style to Solid Color, and then set First Color to white (#FFFFFF).+
  
-Another optionthat may work for some, is to check the options of the program that you are using to connect remotely, and if it has a "Remove Wallpaper" option or a "Do Not Display Wallpaper" option, then enable that option. I use TightVNCviewer and it does not have a Remove Wallpaper optiontherefore changing the background color to white is the only solution for me.+To apply this changeright-click on the desktop and select Settings, then Desktop Settings. Make sure that Show Image is uncheckedset 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 files ===== ===== Gtkrc files =====
 +
 +<note warning>
 +This section may be outdated and may no longer work since Xfce has migrated to GTK 3!
 +</note>
 +
   * A tutorial about the Gtkrc format can be found [[http://live.gnome.org/Attic/GnomeArt/Tutorials/GtkThemes|here]].    * A tutorial about the Gtkrc format can be found [[http://live.gnome.org/Attic/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]]).+  * 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]]).
  
   * 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 58: 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 82: Line 114:
  
 === 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 87: 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 103: 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 117: 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 183: 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> 
  
-===== Accessing man pages through xfrun4 ===== +  # EXAMPLE 
-Use '#' as a shortcut to open man pages using xfrun4. e.g. #man+  event=button/power.* 
 +  #action=/usr/lib/acpid/power_button 
 +  action=/bin/true
  
-===== Do maths with xfrun4/appfinder ===== +[[|Back to Top]] 
-  * 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 206: 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 238: 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]]