Replace Caja with Thunar and XFCE Desktop (update 10/02/16)

#Introduction
Really? You’re writing this again??

Previously, I wrote an article about installing xfdesktop (XFCE desktop) without regard to Thunar. I feel now I have enough information about Thunar for the average user to enable it as a full replacement for Caja (or Nemo, if you’re into that) so users can install it and enjoy a different desktop.

That, and Google by now must have scraped my older thread so I am hoping this ends up above my old article. This will also have nothing to do with Nemo, so consider this the version of my previous article for a bone-stock installation.

#Installation
###Creature comforts
Before this gets to the desktop, I should address resolving some of Thunar’s deficiencies since that is what XFCE (and by extension the desktop) uses as its file manager.

Enabling split view
Some users want this functionality. To make things easier, and to prevent any unnecessary steps just to enable this, the webupd8 experiments PPA should be installed… but it only goes up to 15.10. Bummer. Since there is no software for Xenial, and to minimize events necessary for adding the experiments repository it is better to add these addresses by hand.

  • Method 1
    To do that, open a text editor. Using pluma as an example;
    gksu pluma /etc/apt/sources.list.d/webupd8team-ubuntu-experiments-wily.list
    The .list file can be named anything, but this is what it would had been called.

    Then add the lines below;
    deb http://ppa.launchpad.net/webupd8team/experiments/ubuntu wily main deb-src http://ppa.launchpad.net/webupd8team/experiments/ubuntu wily main

Save, close, keep reading.

  • Method 2
    Alternatively, one can do gksu software-properties-gtk and add the above lines in method 1 individually.

Either way, when those two lines are added, do sudo apt update in a terminal (in gtk-software-properties the repo DB can be updated there instead) and carry on with this guide.

Preserving icon positions
Since xfdesktop doesn’t care to remember how the desktop was configured, it needs to be forced to respect persons who are more spatially-bound than others. To do this, a new script needs to be placed into /etc/rc6.d (Runlevel 6 scripting); Call it whatever you want (begin with K99), but make it memorable. What I used;
gksu pluma /etc/rc6.d/K99xficonsave

Therein, put this into that script;
mkdir -p ~/.config/xfce4/desktop.bak xfdesktop --reload; sleep .5; cp -f ~/.config/xfce4/desktop/* ~/.config/xfce4/desktop.bak/

Then make it executable with chmod. For the example I presented above;
sudo chmod +x /etc/rc6.d/K99xficonsave

The rest will be provided in Post-install configuration

###Catching mice
To install only the XFCE desktop, simply do the following in a terminal, or install the listed package names with gksu synaptic if that is installed:
sudo apt install xfdesktop4 thunar-*
The glob for thunar will also install the following extra packages:
thunar-media-tags-plugin thunar-archive-program thunar-dropbox-plugin thunar-vcs-plugin
Basically, everything xfce4-goodies would install, but without the XFCE stuff.

###Post-install configuration
The installation of xfdesktop4 will also add exo-utils to the system. As with anything not necessarily made for MATE, some work needs to be done to make everything run smoothly so do the following to make that happen;

Making it work

  • In terminal;
  • Make directory for xdg-mime to use:
    mkdir ~/.local/share/applications
  • Make xdg-open use whatever exo-open uses (just like Xubuntu);
    xdg-mime default exo-file-manager.desktop inode/directory application/x-mate-saved-search application/x-gnome-saved-search
  • Modify dconf entry for MATE to reload xfdesktop upon crash;
    gsettings set org.mate.session.required-components filemanager xfdesktop
  • In pluma:
    Make a script for loading the XFCE desktop. This seems weird, but if using the above advice in Installation / Creature comforts / Preserving icon positions then this script is necessary for loading the previous position of desktop icons;
    cp -f ~/.config/xfce4/desktop.bak/* ~/.config/xfce4/desktop/ sleep .5 xfdesktop

    Save it as something memorable. For the below step, I’ll assume the script is called xficonload.sh
  • In mate-session-properties
    Assuming the information above, this should load the script made prior;
    sh -c "sh ~/xficonload.sh"
  • In exo-preferred-applications:
  • Under the Internet tab, set the browser to Mozilla Firefox (default is “Debian Sensible Browser”, whatever that is…)
  • Under the Utilities tab, if not already specified, set the file manager to “Thunar”
  • In xfdesktop-settings
    In the Menus tab, choose to disable Include applications menu on right click because that includes some things exclusive to XFCE and Xubuntu.

Thunar configuration
Thunar by default is a touch restrictive on what the user can do, so in thunar go into Edit > Preferences and adjust the following;

  • Storage
    Enable the following:
  • Mount removbale drives when hot-plugged
  • Mount removable media when inserted
  • Browse removable media when inserted
  • Multimedia
    Set this up to open whatever media player is preferred. Unlike Caja, Thunar will not pick up on MATE’s defaults so additional configuration to whatever file is required. Most people will have all three options enabled, and in the case for Ubuntu MATE users, specify the command to all three be /usr/bin/vlc or /usr/bin/rhythmbox; Specify whatever is desired.
  • All the rest
    Whatever is desired, though the PDAs tab is strangely unusable. Probably due to missing libraries Thunar relies on for that functionality.

Fixing the desktop background
Expand either of the selections below to learn an option;

Make the GNOME / MATE and XFCE backgrounds match Make a symbolic link to whatever image is preferred, then select the symbolic link in the _Background_ tab. After that, go into `xfdesktop-settings` and do the same thing.

Confused about the whole symbolic linking thing? In a terminal, you can use ln for this. Do man ln to learn more about it, but an example that will work is provided below;
ln -s /usr/share/backgrounds/ubuntu-mate-common/Ubuntu-Mate-Cold-no-logo.jpg ~/Pictures/desktopbg

Use XFCE's image cycling Open `mate-appearance-properties` and specify a solid colour for best results. After, open `xfdesktop-settings` and set up the images to be used as the desktop. Unlike in MATE, XFCE allows for multiple images ala WIndows (Vista and up), so users can enjoy that.

#Conclusion
The XFCE desktop and Thunar together is a lightweight solution that will enable some of the things that are missing in MATE’s Caja at the moment, and while Thunar is lean in features compared to Caja, it does everything one would want and then some with the addition of custom actions, as well, provide an easier-to-use desktop experience compared to MATE / Caja. While not the easiest to set up. and not without its own pops and hisses that make it more burdensome to set up, it may provide a better desktop experience for some, especially for those coming from XFCE.

#Undoing the above
Simple instructions are provided via this guide. Please use the contents above to remove and undo any additional files as necessary.

#Information sources




How to make shutdown and startup scripts

XFCE forum: Desktop icons rearrange on reboot, post #8
https://forum.xfce.org/viewtopic.php?pid=28391#p28391

1 Like

I really like Thunar apart from one thing. It is not possible to set different views for different regularly used folders. So, for example, if, while in a folder, I set it to compact view, this then means that all other folders are also in compact view. In other words, it is impossible to set persistent individual views for individual folders, which is possible in Caja.

1 Like

The tutorial lets you add wily (15.10) PPA’s. This not recommended if you are using a xenial (16.04.1). WebUpd8 does not have xenial versions in the PPA.

So as it seems to work, I would not recommend this.

Only if you care about split view. Also, thunar is the only package for that version of Ubuntu.

Or, if you care about individual folder view settings. Thunar does not have this., Instead, if you change the folder view on one folder, this is reflected system wide.

There is also another thing I use in Caja that I have not seen in Thunar, but it may be available. I’d be interested to know if it is because, lack of individual folder view settings aside, I do actually quite like Thunar.

In Caja, the equivalent of Thunar custom actions is the caja scripts folder. In there, it is possible to have sub-folders for all of my useful little scripts. Thus, when I use the right click context menu, I am able to have a cascading menu for all of my context-based commands. In turn, making them all accessible simultaneously in an efficient manner. Does Thunar custom actions offer this facility?

I am uncertain about that as I do not use custom features in file managers all that much. Ask in #xubuntu-help or #xfce on FreeNode.

Added how to preserve the desktop icon position in xfdesktop, ended up having to reformat parts of my guide to include it.

Also added instructions to disable applications right-click menu on desktop because some of the menu items are broken.

mate-preferred-applications? lol.

I fixed it. Instead of that it was suppose to be mate-session-properties. After going back and forth between things for so long the words and thir meanings begin to blur for me.

Also fixed some other typos. There shouldn’t be any more typographical issues.