Wiki Table of Contents

Xfce Commands and Other Useful Stuff

This document brings together some of the important commands, scripts and other information for working with Xfce. Many are extracted from various Xfce Forum posts, usually by ToZ.

NOTE: for now, the document lacks any overriding structure, serving merely as a repository of material.

GTK+3 code snippets to change style

/*These are selected snippets of gtk-3.0 code that the user can insert into the ~/.config/gtk.css file to make style changes of various components*/

##change background color of pager when selected (here to orange)
wnck-pager { background: #333; color: #ccc }
wnck-pager:selected { background: #ff9900; color: black }

##increase spacing in Notification Area##
.xfce4-panel frame .horizontal { 
	padding-bottom: 0px;
	padding-top: 0px; 
	padding-left: 4px;
	padding-right: 0px;
.xfce4-panel frame .vertical { 
	padding-bottom: 4px;
	padding-top: 0px; 
	padding-left: 0px;
	padding-right: 4px;

##change the size of a panel icon, here some examples; adjust scale number as ##desired

#pulseaudio-button image {
    -gtk-icon-transform: scale(0.5);
#xfce-panel-button image {
    -gtk-icon-transform: scale(0.5);
#xfce4-clipman-plugin image {
    -gtk-icon-transform: scale(0.5);

##hide tooltips of gtk apps

$ vi ~/.config/gtk-3.0/gtk.css

tooltip {
    opacity: 0;

##theming Whisker menu (from Graeme Gott)

#whiskermenu-window {
	background-color: #404040;
	color: #ccc;

/* Make sidebar buttons match */
#whiskermenu-window button {
	background-color: #404040;
	color: #ccc;
#whiskermenu-window button:hover {
	background-color: #808080;
	color: #fff;
#whiskermenu-window button:checked {
	background-color: #606060;
	color: #fff;

/* Make treeview match */
#whiskermenu-window treeview {
	background-color: #404040;
	color: #ccc;
#whiskermenu-window treeview:hover {
	background-color: #808080;
	color: #fff;

##various changes to Whisker menu

/* transparent windows border */
#whiskermenu-window>frame>border { border-color: transparent; }

/* transparent grip image - also makes the name transparent - they are tied together */
#whiskermenu-window { color: transparent }

/* smaller toolbar widgets and area */
#whiskermenu-window>frame>stack>box>box * { -gtk-icon-transform: scale(0.5); margin: 0px; padding: 0px; font-size: 6pt;}

/* smaller search entry box */
#whiskermenu-window>frame>stack>box>box>entry { margin: 5px; font-size: 6pt;}

##change the color of thunar
.thunar .view { background-color: #96b389; }
.thunar .sidebar { background-color: red; }
.thunar .standard-view .view { background-color: blue; }

#change colors of timer plugin
#xfce4-timer-plugin-12 progress { 
	background-color: silver; 

#xfce4-timer-plugin-12 trough { 
	background-color: red; 

#Change size of desktop icon grid to adjust icon spacing
* {

Easily change GTK+3 settings

There is a little-known tool built into GTK3.14 and later called the GTK Inspector. You can use it on whatever app is active. For instance, to change the xfdesktop settings open a console and type:

pkill xfdesktop
GTK_DEBUG=interactive xfdesktop

Refresh the icon cache

This command can be used to install a new icon set (does not work on svg icons).

gtk-update-icon-cache /path/to/my/icon/theme

Use the Xfce splash screen to create something personal

The three (simple, balou, mice) are hard coded, but “Simple” is configurable with respect to font, background/text colors and background image. Click on the “Configure” button to change those properties.

You can also add more theme options to the balou splash theme using the balou-install-theme script. For example:

  1. create a new directory to work with. In Thunar, right-click a blank space where you want it > Create Folder OR open a console and type: mkdir MyTheme
  2. To make things easier, copy over the default balou configuration files: cp -rv /usr/share/themes/Default/balou MyTheme
  3. Edit the MyTheme/balou/themerc file to suit (make sure to change the name so that it is easy to identify)
  4. Optionally, change the logo.png file to a file of your choice (name the file logo or change the name in the themerc file)
  5. Compress the directory: tar czvf MyTheme.tar.gz MyTheme
  6. Install the theme: /usr/lib/xfce4/session/balou-install-theme MyTheme.tar.gz ~/.themes
  7. Go to to the Balou splash screen configuration properties (Settings > Session and Startup > Splash) and select your new splash theme

Wrap mouse at end of multiple screens (script)


#calculate total width of all screens
let “totalWidth = -1”
let “numOfScreens = -1”
for size in $(xrandr | grep -w connected | awk -F'[ +]’ ‘{print $3}’ | cut -d x -f 1)
let “totalWidth += $size”
let “numOfScreens += 1”

while true
#get mouse position
mdata=`xdotool getmouselocation`

#extract x/y coordinates
mx=`echo “$mdata”|cut -f1 -d’ ‘|cut -d: -f2`
my=`echo “$mdata”|cut -f2 -d’ ‘|cut -d: -f2`

#check for position and if at either left or right edge, move the mouse
if [ $mx == $totalWidth ]; then
xdotool mousemove 1 $my
elif [ $mx == 0 ]; then
xdotool mousemove –screen $numOfScreens $totalWidth $my

List configuration settings

xfconf-query -c <name of channel> -lv

  • Channel names are those in ~/.config/xfce4/xfconf/xfce-perchannel-xml/, see the Xfce4 Start page.
    • displays
    • keyboard-layout
    • keyboards
    • thunar
    • thunar-volman
    • xfce4-appfinder
    • xfce4-desktop
    • xfce4-keyboard-shortcuts
    • xfce4-mime-settings
    • xfce4-mixer
    • xfce4-notifyd
    • xfce4-panel
    • xfce4-power-manager
    • xfce4-session
    • xfce4-settings-editor
    • xfce4-settings-manager
    • xfce4-xfwm4
    • xfce4-xsettings
  • For example, to list all available properties in the channel xfce4-panel:
xfconf-query -c xfce4-panel -l
  • More on the command xfconf-query here and here.

Change folder icon on desktop

Xfdesktop does support custom folders as of version 4.11.0. Simply put a jpg file in the same folder with the name either folder.jpg, cover.jpg, albumart.jpg, or fanart.jpg and it will become the folder icon on the desktop

How to scale panel icons

Create or edit the file, ~/.gtkrc-2.0, with the following content:

style “launcher-padding”
xthickness = 5
ythickness = 5
widget “*launcher*” style “launcher-padding”

…and restart the panel:

xfce4-panel -r

Adjust the “5” as required.

Use Thunar to edit remote files

Assuming you have a server with sshd running and access to this server, enter into the Thunar address bar:


…and authenticate when prompted. This will create a gvfs-mounted share in thunar. Simply right-click the file in question and select “Open With Mousepad/Leafpad”. If you have write permissions on the server for this file, you should be able to edit and save the file.

Note: you need to have gvfs (or gvfs-fuse) installed.

Trick for recovering from Suspend

If you have tried solutions for recovering correctly from Suspend, try mapping:

xrandr –auto

…to a keyboard combination. When you resume from suspend, press the keyboard combination.

Get longer titles on desktop icons

Make a file in your home folder called .gtkrc-2.0 (or edit if you have one) and add the following info.

style “xfdesktop-icon-view” {
    XfdesktopIconView::ellipsize-icon-labels = 0
widget_class “*XfdesktopIconView*” style “xfdesktop-icon-view”

log out and log in and you should have long file names.

Change font on Whisker menu

You can change the font of the title if you use the pango markup language.

  • Right-click on the Menu > Properties.
  • Set the top pull-down Display menu to ‘Title’ or ‘Icon and title’. That way text will be displayed on a Whisker Menu button.
  • Log out and back in to see the change

Then, change the ‘Title’ to what you want. For example:

<span foreground=”black” size=”large”>Menu</span>


<span font_desc=”Droid Sans Bold 10″>Applications</span>

Kiosk mode

Some components of Xfce have support for kiosk mode. This can be enabled by creating and modifying the system kioskrc file found at:


By default, ${sysconfdir} points to /etc

Details in the Xfce Wiki.

Icon size in Panel

If you go to the Panel Preferences > Items tab, and hover your mouse over one of the items, a tooltip will pop up that will contain the internal-name (e.g., launcher-7). The internal-name is the widget name, so you open ~/.gtk-2.0/gtkrc and add something like:

style “my-launchers”
xthickness = 3
ythickness = 3

widget “*launcher*” style “my-launchers”

This will affect all launchers, but you can be more specific with the widget name to affect individual launchers.

If you don’t know the widget name or you want to effect a class of widgets, you can use the widget_class parameter. Referring back to the hierarchy, you can see that alot of button widgets are derived from the GTKButton. Therefore, to effect all button-based widgets you can do something like:

widget_class “*Button*” style “mystyle”

Run executable with click

Having shell scripts execute like that through thunar or from the desktop was deemed a security risk (it was too easy to mistakenly execute a script that would run) so that functionality was turned off by default. You can re-enable that functionality by enabling the misc-exec-shell-scripts-by-default xfconf key. To do so, create the key via the xfce4-settings-editor, or run the following command:

xfconf-query –channel thunar –property /misc-exec-shell-scripts-by-default –create –type bool –set true

Change default name of Screenshot files

There are two settings available that you can add to xfce4-screenshooter config file (~/.config/xfce4/xfce4-screenshooter) that will allow you to change the default filename:


The title parameter will change the first part of the filename (defaults to “Screenshot”) and the second will turn on or off the appending of the timestamp after the filename.

If you turn off the timestamp, the program is smart enough to append a -1, -2, -3, etc to the end of the filename, if a file exists with that name already.

Launch multiple applications with a single click

Launch multiple programs with a single click

1. Create a new script listing the items that you want to launch, following this example:


/opt/firefox/firefox &
/usr/bin/Thunar &
/usr/bin/thunderbird &

exit 0

Be sure that the paths and names are correct. Save it somewhere in your Home directory, and give it a name. Let’s suppose you name it “” and place it in ~/Home/Scripts. Right-click it > Properties, Permissions tab, and check the box to make it run as a program.

2. Right-click the panel > Panel > Add New Items… > Launcher, click Add; then right-click the new icon > Properties and click the Add a new empty item icon. Alternatively, on the desktop > Create Launcher. Either way, you will end up looking at the launcher’s dialog box.

2. Right-click the panel > Panel > Add New Items… > Launcher, click Add; then right-click the new icon > Properties and click the Add a new empty item icon. Alternatively, on the desktop > Create Launcher. Either way, you will end up looking at the launcher’s dialog box.


Give the launcher a name such as LaunchAll, and then click on the little square to the right of the Command line to navigate to your script. Select an icon if you want one.

That’s it: now when you click that icon, all the programs you listed in your script will launch. BTW: if you want those applications not to show up on the same disorganized workspace, this would be a great time to make use of gdevilspie.

Gtkrc files

In a nutshell (lowest to highest priority):
– built-in theme (raleigh)
– built into the app config info
– theme location (either /usr/share/themes or ~/.themes)
– /etc/gtk-2.0/gtkrc   /   ~/.gtkrc-2.0   /   GTK2_RC_FILES
*preferred locations:
   – in a theme file if its your own custom-designed theme
   – /etc/gtk-2.0/gtkrc for system-wide overrides
   – ~/.gtkrc-2.0 for user-specific overrides
   – GTK2_RC_FILES to override gtk theme for one specific application

– built-in theme (adwaita)
– built into the app config info
– theme location (either /usr/share/themes or ~/.themes)
– /etc/gtk-3.0/gtk.css   /   ~/.config/gtk-3.0/gtk.css   /   GTK_THEME
*preferred locations:
   – in a theme file if its your own custom-designed theme
   – /etc/gtk-3.0/gtk.css for system-wide overrides
   – ~/.config/gtk-3.0/gtk.css for user-specific overrides
   – GTK_THEME to override gtk theme for one specific application

Dual Monitor customization

You could use a udev rule and script such as this one that will be called and executed when udev reports the connection/disconnection of the monitor.

Alternatively, one can write a script that calls xrandr to set up the screen arrangement and then bind this to a keyboard shortcut.

For example, the following script will check if a second monitor is connected on the output “DP1-2” (which is a monitor connected to a docking station on a Dell XPS 15 9560) and then put it left to the primary monitor (“eDP1” on the Dell):



if [ -n “`DISPLAY:0 xrandr | sed -n “/$second_output connected/p”`” ]; then
DISPLAY:0 xrandr –output $second_output –pos 0x0
DISPLAY:0 xrandr –output eDP-1 –pos 1920×0

Assign key to Custom actions in Thunar

You can easily assign a key combination to any Custom action. For example, if you have the “Open in Terminal” custom action (or something similar), you can assign a keyboard shortcut key to it. To do so, first enable editable accelerators in Settings Manager > Appearance > Settings. Then, in Thunar, hover your mouse over the File>Open in Terminal menu item and press the keyboard combination that you would like to use for that action. Then when browsing in Thunar, use the keyboard combination to open a terminal window in your active directory.

Force regular icons

With the migration to GTK+ 3, symbolic icons will be used in the Panel. But those are a GNOME-only thing so you will always have a panel mixed with regular and symbollic icons. To solve this, you can use this hint:

-gtk-icon-style: regular;

in the (new) folder “.gtk-3.0* to force non-symboic icons for the panel plugins that have ported to GTK3.

Add timestamp to a file

Use this script with a Thunar custom action:

TS=”$(date +”%d-%b-%Y_%H:%M:%S”)”

for f in “[email protected]

   dir=$(dirname “$f”)
   fullfilename=$(basename “$f”)

   # append timestamp
   cp “$f” “$dir/$filename-$TS.$extension”

   # prepend timestamp
   cp “$f” “$dir/$TS-$filename.$extension”


exit 0


It will work with single files (%f) and multiple files (%F).  Comment out one of the append or prepend actions if you don’t want both to happen.

Adjust spacing of Thunar columns

The text inside the columns of Thunar is often jammed up against the right column edge. ToZ looked at the code and found that this snippet will fix it. Create a new file ~/.gtkrc-2.0 and paste in the code below. Then log out and back in to see the effect.


style “my-details-view”
GtkTreeView::horizontal-separator = 20
widget_class “*ThunarDetailsView*” style “my-details-view”


You can vary the value (10, 15, ,etc.) to suit your tastes.

Center a window using the keyboard

You can center a window using a keyboard with this script:



IFS=’x’ read screenWidth screenHeight < <(xdpyinfo | grep dimensions | grep -o ‘[0-9x]*’ | head -n1)

width=$(xdotool getactivewindow getwindowgeometry –shell | head -4 | tail -1 | sed ‘s/[^0-9]*//’)
height=$(xdotool getactivewindow getwindowgeometry –shell | head -5 | tail -1 | sed ‘s/[^0-9]*//’)


xdotool getactivewindow windowmove “$newPosX” “$newPosY”


Save it somewhere (/usr/local/bin if you want all users to access it), make it executable and assign it to a keyboard shortcut.


The place to start is with the Gnome overview. Also helpful is the GTK Inspector which will allow you to see and manipulate the style classes, widgets, etc. To run it temporarilyi with respect to xfce4-panel, for instance, you would do the following:

GTK_DEBUG=interactive xfce4-panel

Test GTK3 theme

You can always test theme issues by using the default Adwaita theme. To test firefox with the default GTK3 theme (adwaita), first close firefox then start it with:

GTK_THEME=Adwaita firefox

Reset to default Xfce

You can remove all MX Linux modifications and restore the native Xfce configuration when you log in with a single command when not logged in (as root from another user’s account or a LiveMedium):

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

You can return to the MX Linux config by restoring the backup. [Arch Wiki via ToZ).

Order partitions in Thunar

Normally Thunar reorders partitions with each login. Here is a trick to get it how you would like it (from user Paul1149):

  • Go to each internal drive, and from the right pane or address bar drag it into the PLACES list.
  • Drag them into your desired order.
  • Now right-click the empty space to the right of the word “DEVICES” in the left pane and uncheck them.
  • They will disappear, giving their vertical space back, and you will be left with a tidy list of devices in the order you want.

Change volume increments to xfce4-pulseaudio-plugin

The xfce4-pulseaudio-plugin has a hidden “volume-step” property that can be enabled. To do so, you would run a command like:

xfconf-query -c xfce4-panel -p /plugins/plugin-18/volume-step –create -t int -s 15


  • “plugin-18” is the actual plugin number for the pulseaudio plugin which you can get via: xfconf-query -c xfce4-panel -lv | grep pulseaudio
  • “-s 15” is the step size  – change the 15 to whatever step size you want

Check Xfce version

Since Xfce is modular, its various components have their own versioning scheme. Usually the version reported is for xfdesktop. There are a couple of ways to do this.

  • Click Start menu > MX Tools > Quick System Info (command line: inxi -S). You will see in the first stanza an entry called “Desktop” followed by a version number.
  • Install libxfce4ui-utils. Then you will find an entry in the menu called “About Xfce” or get the same information from entering xfce4-about in a console.

Theming Whisker Menu

From the developer Graeme Gott:

Working with the Menu

See this separate Wiki entry

Change icon size in Notification Area

For gtk3 panel plugins, add padding as in following examples to ~/.config/gtk-3.0/gtk.css (create the file if you don’t already have it):

For the power manager:
#xfce4-power-manager-plugin { padding: 2px; }

For the pulseaudio plugin:
#pulseaudio-button { padding: 3px; }

For the notifyd plugin:
#xfce4-notification-plugin { padding: 4px; }

Update native xfce4-panel clock after suspend

See this lengthy Forum post.

Disable all Alt + F1-4 combinations

A quick way to make such a global change is to use xfconf-query commands.

These commands will list all the shortcuts for you (second one will list only the custom ones):

xfconf-query -c xfce4-keyboard-shortcuts -l -v
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom -l -v

And you can reset / remove a specific shortcut with this command (for example Alt+F2):

xfconf-query -c xfce4-keyboard-shortcuts -p ‘/commands/custom/<Alt>F2’ -r -R

Hide an app from the Panel

Manually, you can use wmctrl:

wmctrl -r :SELECT: -b add,skip_taskbar

…and when prompted with the cross cursor select the window that you want hidden from taskbar.

To automate it, you could use a tool like gdevilspie and a .ds file [script containing instructions that automate program functionality). For example:


(if (is (application_name) “APPNAME”)


…where APPNAME is the name of the app (which you can get from running devilspie in debug mode: “gdevilspie -d”).

How to Use the Genmon Plugin

The plugin genmon captures the output (stdout) of a script or program and displays the resulting string into the panel. It is very powerful as well as handy, though the setup is not obvious.

As an example, lets have a click open a thunar window.

  1. Add the Generic Monitor plugin to the panel
  2. Right-click it and select Properties
  3. Uncheck the “label” option
  4. If you want just clickable text displayed on the button, type the following in the command window:echo "<txt>thunar</txt><txtclick>thunar</txtclick>"…the first instance of “thunar” is the label to display, the second instance is the command to run, Change them as required,
  5. If you want a clickable image instead, use the following:echo "<img>/path/to/image/file</img><click>thunar</click>"…where “/path/to/image/file” is an actual image file on your computer.
  6. Click close.

Clicking on the plugin will now run thunar.

2 thoughts on “Xfce Commands and Other Useful Stuff”

  1. Using Thunar with MX with a 2Tb USB portable hard drive. Seagate 2017 “Backup Plus” model. Apparently deleted a subdirectory that I was working with. About 1Gb size, mainly HTML files and JPGs. I think I was looking up other files on a separate window when it happened.
    So, Question, “Is Thunar subject to instability?” (assuming always the user was not at fault!).


Leave a Comment

MX Linux