Is there a way to either place a window in the center of the screen after it is opened, or cause it to open in the center of the screen?
This needs to be done using command line.
command linewindow
Is there a way to either place a window in the center of the screen after it is opened, or cause it to open in the center of the screen?
This needs to be done using command line.
Best Answer
wmctrl tool provides command line access to almost all the features defined in the EWMH (Extended Window Manager Hints) specification. It can be used, for example, to get information about the window manager, to get a detailed list of desktops and managed windows, to switch and resize desktops, to make windows full-screen, always-above or sticky, and to activate, close, move, resize, maximize and minimize them.
You can install it by
And list open windows with
wmctrl -l
. The-G
option shows you the geometry of the windows:You can specify a window by referencing its title or partial title after -r. -e is for moving and resizing
So, to move a window to the upper left corner and make it 1000 pixels wide by 700 tall, you’d use 0,0,0,1000,700
To move/resize it . For that, I used the workaround of “unmaximizing” it first, using the
-b
optionwmctrl -r "Mozilla Firefox" -b add,maximized_vert,maximized_horz
wmctrl -r "Mozilla Firefox" -b remove,maximized_vert,maximized_horz
The Things You Need To Understand 1st
thats is my screen Resolution so x = 1360 & y = 786
Aligning a window to left-half of the screen
Aligning a window to right-half of the screen
Aligning a window to
center of screen
1360 / 4 = 340Manipulate it as of your screen settings
For More Help 1 2 3 4