From ArchWiki
Revision as of 04:39, 4 June 2014 by Kynikos (Talk | contribs) (Tumblerd hanging up and using too much cpu and other resources On Xfce and Thunar: fix link in comment and add links to original source and to the bug report (please always do it))

Jump to: navigation, search

From the project home page:

Thunar is a new modern file manager for the Xfce Desktop Environment. Thunar has been designed from the ground up to be fast and easy-to-use. Its user interface is clean and intuitive, and does not include any confusing or useless options by default. Thunar is fast and responsive with a good start up time and folder load time.


Install the thunar package which is available in the official repositories. It is part of the xfce4 group, so if you are running Xfce4, you probably already have Thunar installed.


Thunar uses GVFS for automounting. See also File manager functionality for more details.

Plugins and addons

  • Thunar Archive Plugin — Plugin which allows you to create and extract archive files using contextual menu items. It does not create or extract archives directly, but instead acts as a frontend for other programs such as File Roller (file-roller), Ark (kdeutils-ark) or Xarchiver (xarchiver). Part of xfce4-goodies. || thunar-archive-plugin
  • Thunar Media Tags Plugin — Plugin which allows you to view detailed information about media files. It also has a bulk renamed and allows editing of media tags. It supports ID3 (the MP3 file format's system) and Ogg/Vorbis tags. Part of xfce4-goodies. || thunar-media-tags-plugin
  • Thunar Shares Plugin — Plugin which allows you to quickly share a folder using Samba from Thunar without requiring root access. See also how to configure directions. || thunar-shares-pluginAUR || thunar-volman
  • Tumbler — External program to generate thumbnails. Also install ffmpegthumbnailer to enable video thumbnailing. || tumbler
  • RAW Thumbnailer — A lightweight and fast raw image thumbnailer that is needed to displane raw thumbnails. || raw-thumbnailer
  • libgsf — The GNOME Structured File Library is a utility library for reading and writing structured file formats. Install if you need support for odf thumbnails || libgsf

Thunar Volume Manager

While Thunar can support automatic mounting and unmounting of removable media, the Thunar Volume Manager allows extended functionality, such as automatically running commands or automatically opening a Thunar window for mounted media.


Thunar Volume Manager can be installed from the package thunar-volman in the official repositories.


It can also be configured to execute certain actions when cameras and audio players are connected. After installing the plugin:

  1. Launch Thunar and go to Edit > Preferences
  2. Under the 'Advanced' tab, check 'Enable Volume Management'
  3. Click configure and check the following items:
    • Mount removable drives when hot-plugged.
    • Mount removable media when inserted.
  4. Also make desired changes (see the example below)

Here's an example setting for making Amarok play an audio CD.

 Multimedia - Audio CDs: amarok --cdplay %d

Tips and tricks

Automounting of large external drives

If Thunar refuses to mount large removable media (size > 1TB) although thunar-volman and gvfs has been installed, then try installing a different automounter such as udevil or udiskie. The latter should be preferred as it uses udisks2 and thus is compatible with gvfs. To start udiskie with udisks2 support, add the following line to your autostart file:

udiskie -2 &

Using Thunar to browse remote locations

Since Xfce 4.8 (Thunar 1.2) it is possible to browse remote locations (such as FTP servers or Samba shares) directly in Thunar. To enable this functionality ensure that gvfs, gvfs-smb and sshfs packages are installed. A 'Network' entry is visible in Thunar's side bar and remote locations can be opened by using the following URI schemes in the location dialog (opened with Ctrl+l): smb://, ftp://, ssh://, sftp:// & followed by the server hostname or IP address.

There is no URI scheme for NFS shares, but Thunar can issue a mount command if you setup your fstab properly.

# nas1 server
nas1:/c/home		/media/nas1/home	nfs	noauto,user,_netdev,bg  0 0

What's important here is the noauto which prevents the share from being mounted until you click on it, user which allows any user to mount (and unmount) the share, _netdev which makes network connectivity a pre-requisite, and finally bg which puts the mounting operation the background so if your server requires some spin-up time you won't have to deal with time out messages and re-clicking until it works.

Tip: If you want to permanently store passphrases of remote filesystem locations, you have to install GNOME Keyring.

Starting in daemon mode

Thunar may be run in daemon mode. This has several advantages, including a faster startup for Thunar, as well as Thunar running in the background and only opening a window when necessary (for instance, when a flash drive is inserted).

Make sure the command thunar --daemon is autostarted on login. See Xfce and Autostarting for more details.

Solving problem with slow cold start

Some people still have problems with Thunar taking a long time to start for the first time. This is due to gvfs checking the network, preventing Thunar from starting until gvfs finishes its operations. To change this behaviour, edit /usr/share/gvfs/mounts/network.mount and change AutoMount=true to AutoMount=false.

Hide Shortcuts in Side Pane

There is a hidden menu to hide Shortcuts in the Side Pane.

Right click in the Side Pane where there are no shortcuts, like on the DEVICES section label. Then you will get a pop-up menu where you can uncheck items you do not want displayed.

Assign keyboard shortcuts in Thunar

There is a way to assign a shortcut to the commands with whatever key you like, in fact, menu option which is listed in the menubar in Thunar can be assigned with shortcuts of your liking. But unfortunately options from plugins (like the Thunar Archive Plugin) can't be assigned via shortcuts.

Anyway, for this, go into Settings Manager -> Appearance -> Tab Settings. Activate "Enable editable accelerators" if haven't done so.

After this step, open Thunar and search for in example the "Open Terminal Here" menu option, hover with the mouse over this entry and just press your favourite keyboard shortcut. For many (not all) of you, F4 is the right option. To delete a key assignment, press the Backspace key.

Done, now you can open the terminal simply by pressing the shortcut you defined inside Thunar!

Showing partitions defined in fstab

By default Thunar will not show in devices any partitions defined in /etc/fstab besides the root partition.

We can change that by adding the option comment=x-gvfs-show to fstab for the partition we wish to show.

Custom actions

This section covers useful custom actions which can be accessed through Edit -> Configure custom actions and which are stored in ~/.config/Thunar/uca.xml. More examples are listed in the thunar wiki. Furthermore, this blog post provides a comprehensive collection of custom actions.

Search for files and folders

To use this action you need to have catfish installed.

Name Command File patterns Appears if selection contains
Search catfish --fileman=thunar --path=%f * Directories

Scan for viruses

To use this action you need to have clamav and clamtkAUR installed.

Name Command File patterns Appears if selection contains
Scan for virus clamtk %F * Select all

Link to Dropbox

Name Command File patterns Appears if selection contains
Link to Dropbox ln -s %f /path/to/DropboxFolder * Directories, other files

Please note that when using many custom actions to symlink files and folder to a particular place, it might be useful to put them into the Send To folder of the context menu to avoid that the menu itself gets bloated. This is fairly easy to achieve and requires a .desktop file in ~/.local/share/Thunar/sendto for each action to perform. Say we want to put the above Dropbox symlink action into Send To, we create a dropbox_folder.desktop with the following content. The new applied action will be active after restarting Thunar.

[Desktop Entry]
Exec=ln -s %f /path/to/DropboxFolder


Tumblerd hanging up and using too much cpu and other resources On Xfce and Thunar

Tumblerd, the service that watches the file system and notifies the system when a thumbnail needs to be made may get stuck in a loop, using 100% of the system's CPU, see the bug report. The following script, originally devised in [1], is a temporary workaround to stop this from happening. Copy, and paste this into a .sh file, save it somewhere in your home directory, mark the file as executable then set up the system to autostart it at system startup.

# Tumblerdwatcher v 1.0
# Script to check and kill tumblerd process if a loop is suspected. To be automatically scheduled at user session start.
# Homemade workaround for bug:
# The author has no responsibility for the execution. Feel free to distribute and modify it.
# Advice are welcome to
period=60                  # check period (sec)
process="/usr/lib/i386-linux-gnu/tumbler-1/tumblerd"   # tumblerd binary path
Pcpu=20                     # tolerated cpu usage (%)
Pmem=25                     # tolerated memory usage (%)
mountpath="/media"               # automatic mount point for removable storage
sec=10                     # time limit (sec) for opened file at $mountpath for thumbnail generation
sg="-15"                  # process termination signal (-15 is OK)
logpath="/tmp/Tumblerdwatcher.log"         # log path                     
cat /dev/null > $logpath
exec >$logpath 2>&1
# reset log file
while true
# execute endlessly
sleep $period
# wait a set period of time
[[ `ps -ef | grep $process | grep -v 'grep' | wc -l` -eq 0 ]] && continue
# skip to next period if not executing
ps -eo pcpu,pid,pmem,args | grep $process | grep -v 'grep' | while read dpcpu pid dpmem
# catch proccess id, cpu usage and memory usage
  pcpu=`echo $dpcpu | cut -d'.' -f1`
  pmem=`echo $dpmem | cut -d'.' -f1`
  [[ $pcpu -gt $Pcpu ]] || [[ $pmem -gt $Pmem ]] && kill $sg $pid && echo "`date` PID $pid $pcpu/$Pcpu %cpu $pmem/$Pmem %mem" && continue
# if cpu usage or memory usage exceed, kill it and report values in the log file
  [[ `lsof -p $pid | grep $mountpath | wc -l` -eq 0 ]] && continue
# if no opened file by tumblerd at removable storage mountpoint, skip to next period
  lsof -p $pid | grep $mountpath | tr -s ' ' | cut -d' ' -f9 > /tmp/tumblerd.lsof.old
# list opened files
  sleep $sec
# wait for tolerated time limit
  [[ `lsof -p $pid | grep $mountpath | wc -l` -eq 0 ]] && continue
# if no more opened file skip to next period
  lsof -p $pid | grep $mountpath | tr -s ' ' | cut -d' ' -f9 > /tmp/
# list opened files again
  for opened_file in `cat /tmp/tumblerd.lsof.old`
# if some file was open before....
     grep $opened_file /tmp/ && kill $sg $pid && echo "`date` PID $pid ^^^^^^^^^^^^^^^^^^^^^^^^" && continue
# ...and it's still hung open, kill tumblerd

See also