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