Monday, September 28, 2009

Securing XFCE's Control over the desktop Against Nautilus

If you're like most users of Linux, some apps aren't native to your DE (Desktop Environment). In the case of XFCE, it's common to use Gnome apps, given XFCE can run them perfectly fine, well, they fit into the look of the DE, and presently don't often present too many issues. This showcases the flexibility from modularity of Linux systems, and the power of standards, but having said modularity may cause issues on any system.

For those who don't know, on Gnome the desktop is drawn by the window manager, called Nautilus; for Windows users the same function is served by the window manager called Explorer. This allows the user to paste objects onto the desktop from other folders, and similar operations: standard functionality for most computer operating systems.

It also makes for competition, however, if another facility handles the desktop upon the system which the windows manager resides, such as in the case when that window manager is present with a DE besides Gnome. On XFCE the window manager does not draw the desktop, or handle the files and folders thereupon: another piece of software simply displays these. This is a design choice, not an oversight, but with the drawback that one cannot paste onto the desktop from without a file manager. Among other benefits of this design, however, the desktop won't disapppear when the file manager crashes, as on a Gnome or Windows system. Incidentally, XFCE is more functional (in my view) in regards control of the desktop, draws it more cleanly, and draws using space more intelligently, at least on a system controlled by the XFCE DE.

The common problem I'll be addressing is the sudden (and recurring) takeover of the XFCE desktop by Nautilus. It is an annoying and tricky problem. I'll first give the common methods of manually returning control to XFCE, and then how to prevent it from happening again.

The most basic method to put Nautilus back into its place is to 'kill' it. There's a Linux way of doing this, but there's a utility that is friendly to both Linux and Windows users, which one needn't install. One simply opens the 'Terminal' and types,

sudo top

If you don't know, on an XFCE system--particularly Xubuntu (which I'm using), the terminal can be found in 'Accessories' under the Application menu (equivalent to the Windows 'Start' button).

Within the terminal window, enter your administrator password, and find the process (under the column named 'Command') named 'nautilus'. Press 'k', and enter the number for this process which is found on the far left, followed by pressing 'ENTER' (or 'RETURN'). The process will be killed.

IF, however, you cannot find Nautilus in the Command column, a problem I've often had, you can display ALL processes, by opening a new terminal window or tab, and entering the following command,

ps -A

Then you'll be able to scroll down a list, find Nautilus (be careful not to miss it--it's easy!), note its number (also on the left), and return to your Window running 'sudo top', where you will press 'k', enter the number that you noted, and hit your Enter/Return key.

At this point, with Nautilus shown whose boss, you'll want to block its desktop trespass from occurring again on XFCE.

If your XFCE system is like mine, it only has the bits of Gnome installed necessary to run Gnome apps. These are fetched by the system automatically when those apps are installed. This means you likely won't have installed a utility that isn't for the terminal in order to proceed, so on your XFCE system, on a new line in the terminal, or in a new terminal window or tab (you may have to close or move from the 'sudo top' window), type,

sudo aptitude install gconf-editor

gconf-editor is like the Window's registry editor, only smaller and perhaps more documented. This isn't funny, but the 'joke' is that neither Window's registry nor much of Linux is well-documented, (at least last I checked: perhaps I'm wrong about the former). It will give you the facility to solve this issue. On my system the packages for gconf-editor were already downloaded along with gnome, for some reason, so the system merely had to set them up, but yours may wish to connect to the internet to download some small files.

After installation is complete, type

gconf-editor

onto a new line in your terminal window and hit Enter/Return. A window appears with panes on the left and right. On the left pane click 'Apps', scroll down its sublist to reach 'Nautilus', and click on item 'preferences' in its sublist. Another list will appear in the pane at right. Scroll this to the 'Show Desktop' named item, and to right of the item you'll see a little checked box: uncheck this.

Close the gconf-editor window, and you're done: Nautilus, even if you or some program turns it on, won't try to draw the desktop, leaving its full control to XFCE.

Afterward:

Remember that in the event you decide to run Gnome as your desktop environment instead of XFCE, you'll have to re-check this setting in gconf-editor in order to display your desktop, unless--if I may plug for Linux's customizability--you'd like to use another DE's software to do this!

The strong points of Linux Operating Systems include security (both by obscurity of consumer installations, and design), standards, customizability (both through provided options, and options provided as a result of things like this customizability and standards), and more, but these things can present difficulties, both for experienced, and new, users. When the forums provided for distributions are friendly, solutions are often forthcoming, and freely provided to users as opposed to the charges from propriety vendors.

The downsides, however, include things like this: a simple problem with seemingly no solution. I could not find one online, anywhere, besides killing Nautilus, which was inferred from discovering that Nautilus is what draws the desktop, which led to searching for discussions on this very problem. None of those, however, helped.

This problem is not one the distributors of Linux are at fault for, but the mixing of DE parts: again, itself a feat and thing of which Linux can boast, but when annoyances like this appear, a problem for the new guy wanting to switch OSes AND install software meant for different environments.

Only by investigating Nautilus more deeply could one discover this setting, or by stumbling upon this setting in a topic unrelated to this problem. Again, I don't blame the vendors--they distribute one or another desktop environment per distribution, or per flavor of their distribution. There's plenty I would blame them for, but not this one. However, in the end I'm amazed at the breadth of community resources available online from which solutions can be inferred, written at all levels of computer proficiency. For windows there is in large part only step-by-step guidance for basic users dichotomized from professional-level websites requiring fees and membership. Though this solution took time and luck, I would not be confident it could be so found by a basic-to-intermediate user like myself for a similar problem on Windows: this required an intermingling of levels of knowledge and openness about design.

I'm no programmer, and often have difficulty solving these sorts of things myself: just a near-average intermediate (i.e. youthful) computer user, and yet searching far and wide I could find no other solution for this XFCE/Nautilus problem, and so now I offer it to the world.

[while reviewing comments editor fixed a minor spelling mistake on 2011-03-09]

4 comments:

davemc said...

Thanks, worked like a charm!

a guy said...

Hey Dave, you're welcome! I don't post to this blog or check its comments much, sorry for the elapsed time before replying! It's just something to which I drop any discovered useful solutions to unusual problems that I've myself run into. : )

I'm glad that something here was actually of use to someone!

ds.61.12 said...

Worked very well, used it to solve a problem with cryptkeeper (works only in nautilus and not in thunar for some reason) while not messing up my desktop.

Andre Massing said...

Thanks for sharing that nice solution with us! I started already to become desperate because it xfce4 and nautilus played well together on one machine but not on another one. Thanks to your how-to I could fix that, since it turned out that it was the mentioned option which was set differently

Cheers,
Andre