3

I installed Nemo from the Ubuntu 13.10 Saucy repositories, and replaced Nautilus with it as shown here:

$ xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search
$ gsettings set org.gnome.desktop.background show-desktop-icons false
$ gsettings set org.nemo.desktop show-desktop-icons true

Now, when I start Nemo from the Unity Launcher, it places its window below other windows on the screen. I want Nemo to start like Nautilus did, and every other application, in the foreground.

3 Answers 3

9

I started to experience the issue with other apps later, and then I began to search for solution not for Nemo, but in general, and found one on the Ubuntu Forums, and two on Ask Ubuntu as well.

This is caused by Compiz, so you have to use compizconfig-settings-manager (sudo apt-get install compizconfig-settings-manager, then start ccsm command with Alt+F2, or from terminal, or search for "CompizConfig Settings Manager" from the dash).

  1. Open "General Options"
  2. Under "Focus and Raise Behaviour" tab set Focus Prevention Level to Off

After following these steps, all my newly opened windows show up in the foreground as expected.

2

The question about nemo (and some other applications for that matter) starting up in the background, is still valid in Ubuntu 14.04.

The solution provided by yourself (Barta Tamás, answer 1) is also still solving this issue under 14.04:

  1. (install and) open compizconfig-settings-manager
  2. Under 'General' open 'General Options'
  3. Select tab 'Focus & Raise Behaviour'
  4. Set 'Focus Prevention Level' to 'Off'

And all applications that newly opened will now appear in the foreground.

0

A more general (but also much more flexible) solution is to use devilspie2.

Install the package devilspie2, add the command /usr/bin/devilspie2 to your startup applications, create the file ~/.config/devilspie2/window_open.lua and fill it with the following content:

if (get_application_name() == "nemo") then
  focus_window()
end

You can easily add other commands, so if you also want Nemo to appear in the center of your screen, try this:

if (get_application_name() == "nemo") then
  focus_window()
  center()
end

This should work on most window managers, not only the ones supporting Compiz!

For debugging (run devilspie2 --debug from the shell), it's probably a good idea to have something like this:

function debug_output(header, window_information)
  if window_information == "" then
    debug_print(header .. "---")
  else
    debug_print(header .. window_information)
  end
end

debug_output("Application:   ", get_application_name())
debug_output("Window Name:   ", get_window_name())
debug_output("Window Type:   ", get_window_type())
debug_output("Window Class:  ", get_window_class())
debug_output("Window Role:   ", get_window_role())

geometry = string.format("x=%d, y=%d, width=%d, height=%d",
                         get_window_geometry())
debug_output("Geometry:      ", geometry)

if (get_application_name() == "nemo") then
  focus_window()
end

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .