1

I am using openbox and plank. Whenever I open (and maximize) an application, the window will automatically avoid collision with plank area.

My question is, is it possible to designate a window to be a "taskbar"? For example, can I set a notepad to take 25% width of the screen and anything else (including other notepad instances) I open automatically maximize to the rest 75% region?

SmoothKen
  • 135
  • 3

2 Answers2

1

A task bar client typically uses the _NET_WM_STRUT property to tell an EWMH compliant window manager that it wants some screen real state exclusively to itself.

_NET_WM_STRUT, left, right, top, bottom, CARDINAL[4]/32

This property is equivalent to a _NET_WM_STRUT_PARTIAL property where all start values are 0 and all end values are the height or width of the logical screen.

_NET_WM_STRUT_PARTIAL, left, right, top, bottom, left_start_y, left_end_y, right_start_y, right_end_y, top_start_x, top_end_x, bottom_start_x, bottom_end_x, CARDINAL[12]/32

The property contains 4 cardinals specifying the width of the reserved area at each border of the screen, and an additional 8 cardinals specifying the beginning and end corresponding to each of the four struts.

Then, to reserve the 300 pixels of width for a given window (henceforth the dock), run

xprop -f _NET_WM_STRUT 32c -set _NET_WM_STRUT '300, 0, 0, 0'

and click the said window; now ordinary windows should be constrained to the remaining space, even if maximized.

That does not automatically position the docked window to its reserved space. You can automate the process with Xdotool, though:

xlogo  #Dock window example
xprop -id "$(xdotool search xlogo)" -f _NET_WM_STRUT 32c -set _NET_WM_STRUT '300, 0, 0, 0'
xdotool search xlogo windowmove 0 0 windowsize 300 100%

A window manager that neatly abstracts this task is Icewm; see man icewm-winoptions. All you need is

==> ~/.icewm/winoptions <==
xlogo.layer: Dock
xlogo.geometry: 300x700+0+0

So that every new Xlogo window would become a dock and correctly positioned when spawned.

Quasímodo
  • 18,625
  • 3
  • 35
  • 72
0

The Window Manager (WM) can intercept certain interactions of the application with the X server.

One of this actions is resizing (and maximizing is resizing). So the application says "I would have to like this size for this window, please", and then the WM gets to process the request and will say "ok, and this is the size and position you get".

So in principle, yes, the WM can designate 25% of the screen to one particular window, and 75% of the screen to all other windows.

However, I do not know any WM where you can configure something like this. So you may have to write your own WM, or modify an existing one.

I do know that there are so-called tiling WMs, but they usually tile all windows, so again, that's probably not what you want.

OTOH, I am not familiar with openbox and plank, so maybe they can...

dirkt
  • 31,679
  • 3
  • 40
  • 73
  • Do you happen to be familiar with sticky windows? – SmoothKen Oct 21 '21 at 05:06
  • Sticky in the fvwm sense, i.e. visible in every virtual desktop? (That's managed by the WM by intercepting another kind of request). Or some other kind of sticky, like "fixing" a border of a window? – dirkt Oct 21 '21 at 05:50