devilspie2 icon indicating copy to clipboard operation
devilspie2 copied to clipboard

Window frame extent? [how do i set the window position below the taskbar?]

Open TheCheddarCheese opened this issue 1 year ago • 3 comments

TheCheddarCheese avatar Nov 29 '23 12:11 TheCheddarCheese

You can't position relative to another window – at least, not directly.

One way is to position the window manually, use xwininfo to get the position then use one of the positioning functions (set_window_position, set_window_position2, xy) to move the window.

Or you can get the task bar position (again, xwininfo) and the window frame extent (xwininfo -wm; use any window with a frame). The rest can be calculated from that.

(You can use xdotool instead of xwininfo. I don't know the parameters for it, though.)

I recommend something like this:

taskbar_bottom = 40		-- from "xwininfo", "-geometry" line
window_frame = { 5, 5, 20, 5 }	-- from "xwininfo -wm", "Frame extents" line
				-- note: order is left, right, top, bottom

window_name = get_window_name()
if window_name == 'foo' then
  set_window_position(window_frame[1], taskbar_bottom + window_frame[3])
end

It looks like I need to add a proper way of reading the frame extents at run-time (which is why the “enhancement” label is applied).

dsalt avatar Nov 29 '23 13:11 dsalt

… Is the window in question using client-side decorations? Does it belong to a GTK application? (I normally force server-side decorations, so I wouldn't normally see problems with these.)

dsalt avatar Nov 29 '23 17:11 dsalt

  1. as in program-specific? no i don't think so
  2. no

TheCheddarCheese avatar Dec 01 '23 16:12 TheCheddarCheese