在打開主文件夾窗口時更改其位置(特別是在屏幕上)


2

每當我使用快捷方式打開主文件夾時,它始終位於屏幕的左下方,如下所示。

Bottom left

如何打開它,使其像這樣在中心彈出?

Center

1

The simplest, pragmatic solution

To make sure the window always appears on the same poissition, create a shortcut to get it done:

  1. Install xdotool, to position the window:

    sudo apt install xdotool
    
  2. Add the following command to a keyboard shortcut:

    /bin/bash -c "nautilus ~ && sleep 0.5 && xdotool getactivewindow windowmove 300 300"
    

    Where you need to replace 300 300 by the actual position (x/y) where you want the window to appear: choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command above to a shortcut you like.

    enter image description here

Note

This works nicely, but there is a small chance that if your system is heavily occupied, the window will not appear in time so the xdotoolcommand will run in vain. Writing a separate script to prevent this from happening once a year seems overkill though in this situation.


1

Window placement is handled by compiz in Unity and to fine control it's behaviour, you need to install ccsm or compizconfig-settings-manager.

Install it with this command

sudo apt-get install compizconfig-settings-manager

Open it and go to Place windows plugin page. Under the section Placement mode select Centered to have the desired effect.

The default selection is smart I think. You can also try Cascade which is the default case in Windows systems afaik.

window placement settings image