12/30/2023 0 Comments Hammerspoon videoSo attempting to move a KDE quick tiled window leads to a 15 second pause, then the window maximizing briefly, and then resizing to the desired size. Move operations are not instantaneous, so setting a location and immediately querying it will yield the old coordinates for a short period.Ī window which is maximized does not respond to the resize and move commands (and attempting it will cause xdotool to hang for 15 seconds), so that has to be detected and unmaximized.Ī window which has been "Quick Tiled" using KDE's native quick-tiling feature acts like a maximized window, but does not set the maximized vert or maximized horz state flags, so cannot be detected with xprop, and to get it out of the KDE quick tiled state, it must be maximized and then unmaximized. Annoying, but I have found no alternative. The space on a secondary monitor where the taskbar would be is also special, even if there is no task bar on that monitor attempting to move a window into that space causes the window to shift up out of that space, so there remains an unused border on the bottom of the screen. A border width by title bar height offset error for only some of the windows proved to be a vexing bug to track down. Windows with a client of N/A use the non-frame values for everything. Getting the position, getting the size, and setting the size, all use the non-frame values. The window coordinates used by the underlying tools for setting and getting the geometries do not include the frame, except for setting the position of the window, on windows that have a 'client' of the machine name instead of N/A. But there appears to be a bug with setting the position of a window. Window geometry has to be adjusted for window decorations. Meta-Arrow keys for moving, Meta-Ctrl-Arrow keys to grow the window by a cell in the given direction, Meta-Shift-Arrow to shrink the window by a cell from the given direction, and Meta-Enter to snap to the closest cell.Ĭonceptually, that's not all that complicated to implement, but in practice: Then I associated keyboard shortcuts with those commands. The program would identify the currently active window, determine which grid cell was a best match for the action, and execute the appropriate xdotool commands. And one additional command 'snap' with the location 'here' to snap the window to the nearest matching grid cells. The commands were 'move', 'grow', and 'shrink', and the directions 'left', 'right', 'up', and 'down'. My solution was to write a Python program which took two arguments: a command and a direction. I found three commandline tools that among them offered primitives I could build upon: xdotool, wmctrl, and xprop. So I went looking for a programatic way to control window size and placement on KDE/X11. Unfortunately, KDE does not have features to support such a setup. Dividing that screen into a 4x4 grid would be awkward I wanted to retain a 2x2 grid for that screen, and keep a consistent mechanism for moving windows around on that screen and across screens. I wanted a 4x4 grid on the screen, with the ability to move windows around on that grid, but also to resize windows to use multiple cells within that grid.įurther complicating matters is the fact that I use that 4K monitor along with the laptop's !FullHD screen which is 1920x1080. There was room on the screen to have a lot more windows that I could see at the same time and remain readable. With a 4K monitor, I could still arrange windows in the same way, but now I had 4 times the number of pixels. ![]() ![]() (I'm going to use "Meta" as a generic term to mean the modifier key that on Windows machines has a Windows logo, on Linux machines has a Ubuntu or Tux logo, and Macs call "command".) Being able to arrange windows on screen quickly and neatly with keyboard shortcuts worked extremely well and quickly became a capability central to how I work. ![]() I assigned those actions to the Meta-Home, Meta-End, Meta-PgUp, and Meta-PgDn shortcuts. I then found that KDE on Linux had that same feature and the ability to snap to the upper-left, lower-left, upper-right, or lower-right quarter of the screen. Many years ago, a coworker of mine showed me Window's "quick tiling" feature, where you would press Window-LeftArrow or Window-RightArrow to snap the current window to the left or right half of the screen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |