shell icon indicating copy to clipboard operation
shell copied to clipboard

Center window in floating mode.

Open optijon opened this issue 4 years ago • 4 comments

This is a feature request, I can't find a way to center a window on the display. I like the idea of using tiles for swapping windows and general usage but I have a 3480x1600 ultrawide monitor and working in tile mode full time can be pain. A lone browser window for instance could be tiled across the screen and content can be WAY off to the left, or with multiple windows it could be sandwiched in the middle and unreadable.

I'd love to be able to toggle floating a window then center it at a predefined width and height. I could then flip it back to tile mode when I'm ready to switch windows. For my current workflow, as a workaround, I've set Gnome to open a window centered, which using CTRL-g I can toggle between centered window and tile mode. This is great until I move a window, then I have to recenter it manually. Being able to re-center, mouse free, would be a great feature to have.

optijon avatar Nov 17 '20 02:11 optijon

https://unix.stackexchange.com/questions/471546/xdotool-command-to-resize-current-active-firefox-window

Can you bind a shortcut to a bash script thats finds the active windows and xdotool's the window size and position

sitepodmatt avatar Nov 17 '20 05:11 sitepodmatt

Thanks @sitepodmatt, this works pretty well!

I used:

#! /bin/sh
fw=`xdotool getwindowfocus`
xdotool windowsize "$fw" 1920 1600
xdotool windowmove "$fw" 960 -20

and bound it to super+\.

optijon avatar Nov 18 '20 02:11 optijon

I just got an ultrawide monitor and I've been experiencing exactly what @optijon said: when only one window is open and tiling mode is on, it becomes very uncomfortable on the eyes, especially browser windows. It would be very useful if an app could be marked to get automatically centered when it's the only one shown, and tiled when another window is open, much like we can prevent an app from getting tiled at all with Floating Window Exceptions.

mbenford avatar Dec 08 '20 00:12 mbenford

I second @mbenford's note about a configuration option. Would love to set a max width for certain programs, when they are the only ones on screen. Only tile them when multiple windows are open.

IrrerPolterer avatar Feb 12 '24 13:02 IrrerPolterer