shell
shell copied to clipboard
Center window in floating mode.
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.
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
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+\
.
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.
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.