Difference between revisions of "Thunar"

From ArchWiki
Jump to: navigation, search
m (Custom actions: Changed 'more examples' URL)
(Installation: Some clarification)
 
(121 intermediate revisions by 39 users not shown)
Line 1: Line 1:
 
[[Category:File managers]]
 
[[Category:File managers]]
 +
[[ar:Thunar]]
 
[[es:Thunar]]
 
[[es:Thunar]]
 +
[[fr:Thunar]]
 
[[it:Thunar]]
 
[[it:Thunar]]
 +
[[ja:Thunar]]
 
[[pl:Thunar]]
 
[[pl:Thunar]]
 
[[ru:Thunar]]
 
[[ru:Thunar]]
 
[[zh-CN:Thunar]]
 
[[zh-CN:Thunar]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|This article discusses every aspect of the file manager named [http://thunar.xfce.org/index.html Thunar].}}
+
{{Related|Xfce}}
{{Article summary heading|Related}}
+
{{Related|File manager functionality}}
{{Article summary wiki|Xfce}}: Thunar is installed with a nominal installation of {{Grp|xfce4}}.
+
{{Related|GNOME Files}}
{{Article summary text|[[GNOME#Nautilus|Nautilus]]: Thunar is not the only file manager. There are many. For example, Nautilus is the file manager for {{Grp|gnome}}}}.
+
{{Related|PCManFM}}
{{Article summary end}}
+
{{Related|Nemo}}
 +
{{Related articles end}}
  
[http://thunar.xfce.org/index.html Thunar] is a file manager that is designed to be fast, lightweight, and easy-to-use. A standard installation of {{Grp|xfce4}} will contain Thunar, but it can be used with other standalone window managers.
+
From the project [http://docs.xfce.org/xfce/thunar/start home page]:
 +
: ''Thunar is a 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.''
  
 
== Installation ==
 
== Installation ==
[[pacman|Install]] the {{pkg|thunar}} package which is available in the [[Official Repositories|official repositories]].
 
  
If you are running [[Xfce|Xfce4]], you probably already have Thunar installed.
+
[[Install]] the {{Pkg|thunar}} package. It is part of the {{Grp|xfce4}} group, so if you are running [[Xfce]], you probably already have Thunar installed.
  
== Automounting ==
+
=== Plugins and addons ===
Thunar uses [[gvfs]] for automounting, see [[GVFS]] for details on getting it working.
+
 
 +
* {{App|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 ({{Pkg|file-roller}}), Ark ({{Pkg|ark}}) or Xarchiver ({{Pkg|xarchiver}}). Part of {{Grp|xfce4-goodies}}.|http://goodies.xfce.org/projects/thunar-plugins/thunar-archive-plugin|{{Pkg|thunar-archive-plugin}}}}
 +
* {{App|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 {{Grp|xfce4-goodies}}.|http://goodies.xfce.org/projects/thunar-plugins/thunar-media-tags-plugin|{{Pkg|thunar-media-tags-plugin}}}}
 +
* {{App|Thunar Shares Plugin|Plugin which allows you to quickly share a folder using Samba from Thunar without requiring root access. See also [[Samba#Creating usershare path|how to configure directions]].|http://goodies.xfce.org/projects/thunar-plugins/thunar-shares-plugin|{{AUR|thunar-shares-plugin}}}}
 +
* {{App|[[ #Thunar Volume Manager|Thunar Volume Manager]]|Automatic management of removeable devices in Thunar. Part of {{Grp|xfce4}}.|http://goodies.xfce.org/projects/thunar-plugins/thunar-volman|{{Pkg|thunar-volman}}}}
 +
* {{App|Tumbler|External program to generate thumbnails. Also install {{Pkg|ffmpegthumbnailer}} to enable video thumbnailing.|http://git.xfce.org/xfce/tumbler/tree/README|{{Pkg|tumbler}}}}
 +
* {{App|RAW Thumbnailer|A lightweight and fast raw image thumbnailer that is needed to display raw thumbnails.|https://code.google.com/p/raw-thumbnailer/|{{Pkg|raw-thumbnailer}}}}
 +
* {{App|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|http://directory.fsf.org/wiki/Libgsf|{{Pkg|libgsf}}}}
 +
 
 +
{{Tip|For additional functionality, such as {{ic|mtp}} or {{ic|smb}} services access from Thunar, see [[GVFS]]. Also see [[File manager functionality]] for more details.}}
  
 
== Thunar Volume Manager ==
 
== 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.
 
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.
  
==== Installation ====
+
=== Installation ===
Thunar Volume Manager can be installed from the package {{Pkg|thunar-volman}} in the [[official repositories]].
+
 
 +
Thunar Volume Manager can be installed from the package {{Pkg|thunar-volman}} in the official repositories.
 +
 
 +
{{Tip|To let Thunar handle automatic mounting, one must launch thunar in daemon mode. [[#Starting in daemon mode]] }}
 +
 
 +
=== Configuration ===
  
==== Configuration ====
 
 
It can also be configured to execute certain actions when cameras and audio players are connected.  
 
It can also be configured to execute certain actions when cameras and audio players are connected.  
 
After installing the plugin:
 
After installing the plugin:
# Launch Thunar and go to Edit -> Preferences
+
# Launch Thunar and go to ''Edit > Preferences''
 
# Under the 'Advanced' tab, check 'Enable Volume Management'
 
# Under the 'Advanced' tab, check 'Enable Volume Management'
 
# Click configure and check the following items:
 
# Click configure and check the following items:
#* Mount removable drives when hot-pluged.
+
#* Mount removable drives when hot-plugged.
 
#* Mount removable media when inserted.
 
#* Mount removable media when inserted.
 
# Also make desired changes (see the example below)
 
# Also make desired changes (see the example below)
Line 40: Line 58:
 
   Multimedia - Audio CDs: {{ic|amarok --cdplay %d}}
 
   Multimedia - Audio CDs: {{ic|amarok --cdplay %d}}
  
== Tips and Tricks ==
+
== 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 {{Pkg|udevil}} or {{Pkg|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 ===
 
=== 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, similar to the functionality found in GNOME and KDE. The {{Pkg|gvfs}} and {{Pkg|gvfs-smb}} packages are required to enable this functionality. Both packages are available in the [[official repositories]].
 
  
After a restart of Xfce an additional "Network" entry is added to Thunar's side bar and remote locations can be opened by using the following URI schemes in the location dialog (opened with {{Keypress|Ctrl+L}}): smb://, ftp://, ssh://
+
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 {{Pkg|gvfs}}, {{Pkg|gvfs-smb}} and {{Pkg|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 {{ic|Ctrl+l}}): smb://, <nowiki>ftp://</nowiki>, ssh://, sftp://, davs:// & followed by the server hostname or IP address.
  
=== Starting in Daemon Mode ===
+
There is no URI scheme for [[NFS]] shares, but Thunar can issue a {{ic|mount}} command if you setup your [[fstab]] properly.
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).
+
{{hc|/etc/fstab|
 +
# nas1 server
 +
nas1:/c/home /media/nas1/home nfs noauto,user,_netdev,bg  0 0}}
  
One option is to autostart it using {{ic|.xinitrc}} or an autostart script (such as [[Openbox]]'s {{ic|autostart}}). It is up to you to decide the best way to start it, and this option can be run from a script or run directly as a command in the terminal.
+
What's important here is the {{ic|noauto}} which prevents the share from being mounted until you click on it, {{ic|user}} which allows any user to mount (and unmount) the share, {{ic|_netdev}} which makes network connectivity a pre-requisite, and finally {{ic|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.
  
To run Thunar in daemon mode, simply add to your autostart script or run from the terminal:
+
{{Tip|If you want to permanently store passphrases of remote filesystem locations, you have to install [[GNOME Keyring]].}}
  {{bc|$ thunar --daemon &}}
+
  
=== Setting the Icon Theme ===
+
=== Starting in daemon mode ===
When using Thunar outside of Gnome or Xfce, certain packages and configurations that control which icons are used may be missing.  Window Managers like Awesome and Xmonad do not come with XSettings managers, which is where Thunar looks first for it's icon setting.  It is possible to install and run xfce-mcs-manager from a startup script if many Xfce4 and Gnome applications are going to be used.  The gtk-icon-theme-name setting for gtk2 can be set for a user by adding something like the following to {{ic|~/.gtkrc-2.0}}:
+
  gtk-icon-theme-name = "Tango"
+
  
Of course, just installing the gnome-icon-theme package will give Thunar an icon theme to use other than the default paper icon for all items.
+
Thunar may be run in daemon mode. This has several advantages, including a faster startup for Thunar, Thunar running in the background and only opening a window when necessary (for instance, when a flash drive is inserted), and letting Thunar handle automatic mounting of removable media.
  {{bc|# pacman -S gnome-icon-theme}}
+
 
 +
Make sure the command {{ic|thunar --daemon}} is autostarted on login. See [[Xfce]] and [[Autostarting]] for more details.
  
 
=== Solving problem with slow cold start ===
 
=== 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 {{ic|/usr/share/gvfs/mounts/network.mount}} and change '''AutoMount=true''' to '''AutoMount=false'''.
 
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 {{ic|/usr/share/gvfs/mounts/network.mount}} and change '''AutoMount=true''' to '''AutoMount=false'''.
  
== Other plugins and addons ==
+
=== Hide Shortcuts in Side Pane ===
Many of these plugins are part of the xfce4-goodies group, so if you have downloaded it, you will probably have all of these anyway.
+
  
=== Thunar Archive Plugin ===
+
There is a hidden menu to hide Shortcuts in the Side Pane.
The Thunar Archive Plugin is a frontend to file archive software such as File Roller, Ark, or Xarchiver to allow a simple, consistent interface to opening and decompressing archives.
+
==== Installation ====
+
It can be installed by running:
+
  {{bc|# pacman -S thunar-archive-plugin}}
+
  
=== Thunar Media Tags Plugin ===
+
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.
The media tags plugin will display detailed information about media files. It supports ID3 (the MP3 file format's system) and Ogg/Vorbis tags. It also has a bulk renamer and allows editing of media tags.
+
==== Installation ====
+
It can be installed by running:
+
  {{bc|# pacman -S thunar-media-tags-plugin}}
+
  
=== Thunar thumbnails ===
+
=== Assign keyboard shortcuts in Thunar ===
Thunar relies on an external program called [http://git.xfce.org/xfce/tumbler/tree/README tumbler] to generate thumbnails.
+
{{Pkg|tumbler}} can be installed from the [[official repositories]].
+
{{bc|# pacman -S tumbler}}
+
To generate video thumbnails, you also need to install {{Pkg|ffmpegthumbnailer}}.
+
{{bc|# pacman -S ffmpegthumbnailer}}
+
  
=== Thunar Shares ===
+
See [[GTK+#Keyboard shortcuts]],
The Thunar Shares Plugin allows you to quickly share a folder using Samba from Thunar without requiring root access.
+
==== Installation ====
+
Install [https://aur.archlinux.org/packages.php?ID=24152 thunar-shares-plugin] package from the [[AUR]].
+
  
==== Configuration ====
+
=== Showing partitions defined in fstab ===
{{Merge|Samba|These are samba configuration, should merge to [[Samba]] and leave link here.}}
+
 
This marks the named objects for automatic export to the environment of subsequently executed commands:
+
By default Thunar will not show in devices any partitions defined in {{ic|/etc/fstab}} besides the root partition.
  {{bc|<nowiki># export USERSHARES_DIR="/var/lib/samba/usershares"
+
 
# export USERSHARES_GROUP="sambashare"</nowiki>}}
+
We can change that by adding the option '''comment=x-gvfs-show''' to fstab for the partition we wish to show.
This creates the usershares directory in var/lib/samba:
+
  {{bc|<nowiki># mkdir -p ${USERSHARES_DIR}</nowiki>}}
+
This makes the group sambashare:
+
  {{bc|<nowiki># groupadd ${USERSHARES_GROUP}</nowiki>}}
+
This changes the owner of the directory and group you just created to root:
+
  {{bc|<nowiki># chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}</nowiki>}}
+
This changes the permissions of the usershares directory so that users in the group sambashare can read, write and execute files:
+
  {{bc|<nowiki># chmod 01770 ${USERSHARES_DIR}</nowiki>}}
+
Using your favorite text editor as root, create the file {{ic|/etc/samba/smb.conf}}
+
  {{bc|# joe /etc/samba/smb.conf}}
+
Use this {{ic|smb.conf}} configuration file:
+
{{hc|/etc/samba/smb.conf|<nowiki>
+
  ##This is the main Samba configuration file. You should read the
+
  ##smb.conf(5) manual page in order to understand the options listed
+
  ##here. Samba has a huge number of configurable options (perhaps too
+
  ##many!) most of which are not shown in this example
+
  ##
+
  ##For a step to step guide on installing, configuring and using samba,
+
  ## read the Samba-HOWTO-Collection. This may be obtained from:
+
  ##  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
+
  ##
+
  ## Many working examples of smb.conf files can be found in the
+
  ## Samba-Guide which is generated daily and can be downloaded from:
+
  ##  http://www.samba.org/samba/docs/Samba-Guide.pdf
+
  ##
+
  ## Any line which starts with a ; (semi-colon) or a # (hash)
+
  ## is a comment and is ignored. In this example we will use a #
+
  ## for commentry and a ; for parts of the config file that you
+
  ## may wish to enable
+
  ##
+
  ## NOTE: Whenever you modify this file you should run the command "testparm"
+
  ## to check that you have not made any basic syntactic errors.
+
  ##
+
  #[global]
+
  #  workgroup = WORKGROUP
+
  #  security = share
+
  #  server string = My Share
+
  #  load printers = yes
+
  #  log file = /var/log/samba/%m.log
+
  #  max log size = 50
+
  #  usershare path = /var/lib/samba/usershares
+
  #  usershare max shares = 100
+
  #  usershare allow guests = yes
+
  #  usershare owner only = False
+
  # 
+
  #
+
  # #Windows Internet Name Serving Support Section:
+
  #
+
  # #WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
+
  #;  wins support = yes
+
  #
+
  ## WINS Server - Tells the NMBD components of Samba to be a WINS Client
+
  ## Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
+
  #;  wins server = w.x.y.z
+
  #
+
  ##WINS Proxy - Tells Samba to answer name resolution queries on
+
  ## behalf of a non WINS capable client, for this to work there must be
+
  ## at least one WINS Server on the network. The default is NO.
+
  #;  wins proxy = yes</nowiki>}}
+
Save the file and then add your user to the group sambashares replacing "your_username" with the name of your  user:
+
  {{bc|# usermod -a -G ${USERSHARES_GROUP} your_username}}
+
Restart Samba:
+
  {{bc|# /etc/rc.d/samba restart}}
+
Log out and log back in. You should now be able to right click on any directory and share it on the network.
+
When the error {{ic|You are not the owner of the folder}} appears, simply try to reboot the system.
+
To have samba start at boot, add samba to daemons in your {{ic|/etc/rc.conf}} file.
+
For more information, visit the [[Samba]] wiki page.
+
  
 
== Custom actions ==
 
== Custom actions ==
This section covers useful custom actions which can be accessed through Edit -> Configure custom actions. More examples are listed in the [http://docs.xfce.org/xfce/thunar/custom-actions thunar wiki].
+
 
 +
This section covers useful custom actions which can be accessed through {{ic|Edit -> Configure custom actions}} and which are stored in {{ic|~/.config/Thunar/uca.xml}}. More examples are listed in the [http://docs.xfce.org/xfce/thunar/custom-actions thunar wiki]. Furthermore, [http://duncanlock.net/blog/2013/06/28/useful-thunar-custom-actions/ this] blog post provides a comprehensive collection of custom actions.
 +
 
 +
=== Search for files and folders ===
 +
 
 +
To use this action you need to have {{Pkg|catfish}} installed. The optional dependency {{Pkg|mlocate}} should be installed as well.
 +
{| class="wikitable"
 +
! Name !! Command !! File patterns !! Appears if selection contains
 +
|-
 +
! Search
 +
| {{ic|1=catfish --path=%f}} || * || Directories
 +
|}
  
 
=== Scan for viruses ===
 
=== Scan for viruses ===
To use this action you need to have clamav and clamtk installed.
 
  
{| border="1" cellpadding="4" cellspacing="0"
+
To use this action you need to have {{Pkg|clamav}} and {{AUR|clamtk}} installed.
 +
 
 +
{| class="wikitable"
 
! Name !! Command !! File patterns !! Appears if selection contains
 
! Name !! Command !! File patterns !! Appears if selection contains
 
|-
 
|-
 
! Scan for virus
 
! Scan for virus
| clamtk %F || * || Select all
+
| {{ic|clamtk %F}} || * || Select all
 
|}
 
|}
<br />
+
 
 
=== Link to Dropbox ===
 
=== Link to Dropbox ===
{| border="1" cellpadding="4" cellspacing="0"
+
 
 +
{| class="wikitable"
 
! Name !! Command !! File patterns !! Appears if selection contains
 
! Name !! Command !! File patterns !! Appears if selection contains
 
|-
 
|-
 
! Link to Dropbox
 
! Link to Dropbox
| ln -s %f /path/to/DropboxFolder || * || Directories, other files
+
| {{ic|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 {{ic|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 {{ic|~/.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 {{ic|dropbox_folder.desktop}} with the following content. The new applied action will be active after restarting Thunar.
+
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 {{ic|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 {{ic|~/.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 {{ic|dropbox_folder.desktop}} with the following content. The new applied action will be active after restarting Thunar.
 +
 
 +
{{bc|<nowiki>
 +
[Desktop Entry]
 +
Type=Application
 +
Version=1.0
 +
Encoding=UTF-8
 +
Exec=ln -s %f /path/to/DropboxFolder
 +
Icon=/usr/share/icons/dropbox.png
 +
Name=Dropbox
 +
</nowiki>}}
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Tumblerd hangs up, uses too much CPU ===
 +
 
 +
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 [https://bugzilla.xfce.org/show_bug.cgi?id=7384 bug report]. The following script 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.
 +
 
 +
{{bc|<nowiki>
 +
#!/bin/bash
 +
period=20
 +
tumblerpath="/usr/lib/*/tumbler-1/tumblerd" # The * here should find the right one, whether 32 and 64-bit
 +
cpu_threshold=50
 +
mem_threshold=20
 +
max_strikes=2                              # max number of above cpu/mem-threshold's in a row
 +
log="/tmp/tumblerd-watcher.log"
 +
 
 +
if [[ -n "${log}" ]]; then
 +
    cat /dev/null > "${log}"
 +
    exec >"${log}" 2>&1
 +
fi
 +
 
 +
 
 +
strikes=0
 +
while sleep "${period}"; do
 +
    while read pid; do
 +
cpu_usage=$(ps --no-headers -o pcpu -f "${pid}"|cut -f1 -d.)
 +
mem_usage=$(ps --no-headers -o pmem -f "${pid}"|cut -f1 -d.)
 +
 
 +
if [[ $cpu_usage -gt $cpu_threshold ]] || [[ $mem_usage -gt $mem_threshold ]]; then
 +
    echo "$(date +"%F %T") PID: $pid CPU: $cpu_usage/$cpu_threshold %cpu MEM: $mem_usage/$mem_threshold STRIKES: ${strikes} NPROCS: $(pgrep -c -f ${tumblerpath})"
 +
    (( strikes++ ))
 +
    if [[ ${strikes} -ge ${max_strikes} ]]; then
 +
kill "${pid}"
 +
echo "$(date +"%F %T") PID: $pid KILLED; NPROCS: $(pgrep -c -f ${tumblerpath})"
 +
strikes=0
 +
    fi
 +
else
 +
    strikes=0
 +
fi
 +
    done < <(pgrep -f ${tumblerpath})
 +
done
 +
</nowiki>}}
 +
 
 +
=== Trash/network icons disappear randomly ===
 +
 
 +
Make sure all Thunar instances start '''after''' ''gvfs''. [https://bugs.launchpad.net/ubuntu/+source/thunar/+bug/1057610] For {{ic|thunar --daemon}}, you can create a wrapper that waits until GVFS is active:
 +
 
 +
{{Note|{{ic|/usr/local/bin}} should come before {{ic|/usr/bin}} in {{ic|$PATH}}.}}
 +
 
 +
{{hc|/usr/local/bin/Thunar|<nowiki>
 +
#!/bin/bash
 +
if [[ $1 == --daemon ]]; then
 +
  until pgrep gvfs >/dev/null; do
 +
    sleep 1
 +
  done
 +
  exec /usr/bin/Thunar "$@"
 +
else
 +
  exec /usr/bin/Thunar "$@"
 +
fi
 +
</nowiki>}}
 +
 
 +
=== Not authenticated to mount filesystems ===
 +
 
 +
See [[File manager functionality#Troubleshooting]].
  
[Desktop Entry]
+
== See also ==
Type=Application
+
Version=1.0
+
Encoding=UTF-8
+
Exec=ln -s %f /path/to/DropboxFolder
+
Icon=/usr/share/icons/dropbox.png
+
Name=Dropbox
+
  
== Links and References ==
+
* [http://docs.xfce.org/xfce/thunar/start Thunar] project page
* [http://thunar.xfce.org/index.html Thunar] project page.
+
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-volman Thunar Volume Manager] project page
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-volman Thunar Volume Manager] project page.
+
* This [http://goodies.xfce.org/projects/thunar-plugins/start list] of plugins
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-archive-plugin Thunar Archive Plugin] project page.
+
* [http://goodies.xfce.org/projects/thunar-plugins/thunar-media-tags-plugin Thunar Media Tags Plugin] project page.
+
*[http://goodies.xfce.org/projects/thunar-plugins/thunar-shares-plugin/ Thunar Shares Plugin] project page.
+
* This [http://goodies.xfce.org/projects/thunar-plugins/start list] of plugins.
+

Latest revision as of 17:57, 4 June 2016

From the project home page:

Thunar is a 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.

Installation

Install the thunar package. It is part of the xfce4 group, so if you are running Xfce, you probably already have Thunar installed.

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 (ark) or Xarchiver (xarchiver). Part of xfce4-goodies.
http://goodies.xfce.org/projects/thunar-plugins/thunar-archive-plugin || 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.
http://goodies.xfce.org/projects/thunar-plugins/thunar-media-tags-plugin || 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.
http://goodies.xfce.org/projects/thunar-plugins/thunar-shares-plugin || thunar-shares-pluginAUR
http://goodies.xfce.org/projects/thunar-plugins/thunar-volman || thunar-volman
  • Tumbler — External program to generate thumbnails. Also install ffmpegthumbnailer to enable video thumbnailing.
http://git.xfce.org/xfce/tumbler/tree/README || tumbler
  • RAW Thumbnailer — A lightweight and fast raw image thumbnailer that is needed to display raw thumbnails.
https://code.google.com/p/raw-thumbnailer/ || 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
http://directory.fsf.org/wiki/Libgsf || libgsf
Tip: For additional functionality, such as mtp or smb services access from Thunar, see GVFS. Also see File manager functionality for more details.

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.

Installation

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

Tip: To let Thunar handle automatic mounting, one must launch thunar in daemon mode. #Starting in daemon mode

Configuration

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://, davs:// & 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.

/etc/fstab
# 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, Thunar running in the background and only opening a window when necessary (for instance, when a flash drive is inserted), and letting Thunar handle automatic mounting of removable media.

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

See GTK+#Keyboard shortcuts,

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. The optional dependency mlocate should be installed as well.

Name Command File patterns Appears if selection contains
Search catfish --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]
Type=Application
Version=1.0
Encoding=UTF-8
Exec=ln -s %f /path/to/DropboxFolder
Icon=/usr/share/icons/dropbox.png
Name=Dropbox

Troubleshooting

Tumblerd hangs up, uses too much CPU

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 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.

#!/bin/bash
period=20
tumblerpath="/usr/lib/*/tumbler-1/tumblerd" # The * here should find the right one, whether 32 and 64-bit
cpu_threshold=50
mem_threshold=20
max_strikes=2                               # max number of above cpu/mem-threshold's in a row
log="/tmp/tumblerd-watcher.log"

if [[ -n "${log}" ]]; then
    cat /dev/null > "${log}"
    exec >"${log}" 2>&1
fi


strikes=0
while sleep "${period}"; do
    while read pid; do
	cpu_usage=$(ps --no-headers -o pcpu -f "${pid}"|cut -f1 -d.)
	mem_usage=$(ps --no-headers -o pmem -f "${pid}"|cut -f1 -d.)

	if [[ $cpu_usage -gt $cpu_threshold ]] || [[ $mem_usage -gt $mem_threshold ]]; then
	    echo "$(date +"%F %T") PID: $pid CPU: $cpu_usage/$cpu_threshold %cpu MEM: $mem_usage/$mem_threshold STRIKES: ${strikes} NPROCS: $(pgrep -c -f ${tumblerpath})"
	    (( strikes++ ))
	    if [[ ${strikes} -ge ${max_strikes} ]]; then
		kill "${pid}"
		echo "$(date +"%F %T") PID: $pid KILLED; NPROCS: $(pgrep -c -f ${tumblerpath})"
		strikes=0
	    fi
	else
	    strikes=0
	fi
    done < <(pgrep -f ${tumblerpath})
done

Trash/network icons disappear randomly

Make sure all Thunar instances start after gvfs. [1] For thunar --daemon, you can create a wrapper that waits until GVFS is active:

Note: /usr/local/bin should come before /usr/bin in $PATH.
/usr/local/bin/Thunar
#!/bin/bash
if [[ $1 == --daemon ]]; then
  until pgrep gvfs >/dev/null; do
    sleep 1
  done
  exec /usr/bin/Thunar "$@"
else
  exec /usr/bin/Thunar "$@"
fi

Not authenticated to mount filesystems

See File manager functionality#Troubleshooting.

See also