Pages

How To Install Thunar File Manager In Ubuntu?

A file manager or the default file management utility is one of the most important aspects of a modern desktop environment. From things like running your entire desktop screen to managing files/folders... by having a well equipped and a stable file manager is certainly a necessity. Although I'm drifted towards GTK written applications but I certainly am not a huge fan of the default fm in Gnome called Nautilus.

For me it's too simple and I find it hard to "control". But still if you have an old GNU/Linux installed PC/Laptop then you might actually like applications that are "simple" because most of the time they have a tendency of being a bit merciful at your hardware resources (though, not always true). And with start of Gnome3, GNU/Linux distributions such as Fedora Core 15 is now asking for you to have at least 768MB of RAM.

So what I'm trying to say is that, if you love or "okay" (like me) with your Gnome 2+ desktop... but looking for a way to reduce some "weight" from the system as far as possible, then you could give a try another excellent file manager called Thunar!.

Thunar is actually the default fm for another more lightweight (that Gnome) desktop called XFCE. Since the goal of XFCE is try to use as low system resources as possible, the fm Thunar is especially written to help in achieving that. Although it may not make a huge difference concerting Nautilus, still it certainly uses lower amounts of resources nonetheless.

As you can see, Thunar has a very similar GUI to the Nautilus... in fact, they both actually are trying to "emulate" Mac OSX file manager. Anyhow, to be short and precise, almost anything that Nautilus can do, Thunar can do them as well...

... from deleting/creating folders to navigating using different views, expanding features via installing new plugins and generating previews of certain file types, etc ... it certainly is very powerful.

If you want to install Thunar in Ubuntu then open your Terminal and issue the below command.

sudo apt-get install thunar

Although this won't replace your Nautilus file manager and whenever you double click on any folder, it won't be opened using Thunar. If you want to replace Nautilus with it then,

## Originally written by aysiu from the Ubuntu Forums
## This is GPL'ed code
## So improve it and re-release it

## Define portion to make Thunar the default if that appears to be the appropriate action
makethunardefault()
{
## I went with --no-install-recommends because
## I didn't want to bring in a whole lot of junk,
## and Jaunty installs recommended packages by default.
echo -e "\nMaking sure Thunar is installed\n"
sudo apt-get update && sudo apt-get install thunar --no-install-recommends

## Does it make sense to change to the directory?
## Or should all the individual commands just reference the full path?
echo -e "\nChanging to application launcher directory\n"
cd /usr/share/applications
echo -e "\nMaking backup directory\n"

## Does it make sense to create an entire backup directory?
## Should each file just be backed up in place?
sudo mkdir nonautilusplease
echo -e "\nModifying folder handler launcher\n"
sudo cp nautilus-folder-handler.desktop nonautilusplease/

## This last bit I'm not sure should be included
## See, the only thing that doesn't change to the
## new Thunar default is clicking the files on the desktop,
## because Nautilus is managing the desktop (so technically
## it's not launching a new process when you double-click
## an icon there).
## So this kills the desktop management of icons completely
## Making the desktop pretty useless... would it be better
## to keep Nautilus there instead of nothing? Or go so far
## as to have Xfce manage the desktop in Gnome?
echo -e "\nChanging base Nautilus launcher\n"
sudo dpkg-divert --divert /usr/bin/nautilus.old --rename /usr/bin/nautilus && sudo ln -s /usr/bin/thunar /usr/bin/nautilus
echo -e "\nRemoving Nautilus as desktop manager\n"
killall nautilus
echo -e "\nThunar is now the default file manager. To return Nautilus to the default, run this script again.\n"
}

## The only change that isn't undone is the installation of Thunar
## Should Thunar be removed? Or just kept in?
## Don't want to load the script with too many questions?
}

## Make sure that we exit if any commands do not complete successfully.
## Thanks to nanotube for this little snippet of code from the early
## versions of UbuntuZilla
set -o errexit
trap 'echo "Previous command did not complete successfully. Exiting."' ERR

## This is the main code
## Is it necessary to put an elseif in here? Or is
## redundant, since the directory pretty much
## either exists or it doesn't?
## Is there a better way to keep track of whether
## the script has been run before?
if [[ -e /usr/share/applications/nonautilusplease ]]; then

restorenautilusdefault

else

makethunardefault

fi;

2. Then open your Terminal and enter the below command.

chmod +x defaultthunar
./defaultthunar

But remember, unlike with Nautilus, you could run into few "issues" while trying to preview/thumbnails on videos for instance (there could be a separate plug for that) in Thunar. In that case, if you want to restore Nautilus back, then use the below command. Good luck.