You are not logged in.

#1 2007-04-02 22:12:48

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

openbox "slit"?

I don't want a "slit" per se, but I'm wondering if there's any way to define a space along one of my screen edges that windows won't cover when they maximize.

Offline

#2 2007-04-04 12:33:25

Stalwart
Member
From: Latvia, Riga
Registered: 2005-10-18
Posts: 445
Website

Re: openbox "slit"?

It's called strut. There are simple ~20 LOC apps that make it, just google


IRC: Stalwart @ FreeNode
Skype ID: thestalwart
WeeChat-devel nightly packages for i686

Offline

#3 2007-04-07 02:49:48

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

Re: openbox "slit"?

Stalwart wrote:

It's called strut. There are simple ~20 LOC apps that make it, just google

Thanks for the tip. So far google hasn't been my friend with finding info on this, but I'm sure all track something down.

Offline

#4 2007-04-07 03:02:55

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

Re: openbox "slit"?

Hmm........from what I can find the strut is application dependant. If an app has set struts, it stops the window from maximizing over. I'm trying to keep my conky from being hidden by a maxamized window...is it possible to set struts in Conky? I've been unable to find any info on it. :-(

Offline

#5 2007-04-07 08:01:39

WhiteMagic
Member
Registered: 2007-03-01
Posts: 85

Re: openbox "slit"?

Here is short "program" that does what you want I think. You have to set the borders on each side as you want them and then compile it.
I found this while googling for a solution to the same problem you had, I tried to find the news group post I've got it from again, but can't find it anymore.

I'm not really into using Xorg libraries and routtines so I can't say if the code below is good or if it could be done better, but it works. Anyways here's the code:

#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>

#define LEFT    0
#define RIGHT   0
#define TOP     0
#define BOTTOM  20

int main(int argc, char **argv)
{
    Display         *dpy;
    Window          win;
    XEvent          event;
    unsigned long   strut[4];
    XWMHints        xwmh = { (InputHint|StateHint), False, IconicState,
                             0, 0, 0, 0, 0, 0, };

    if ((dpy = XOpenDisplay(NULL)) == NULL) {
        fprintf(stderr, "%s: can't open %s\en", argv[0], XDisplayName(NULL));
        return 1;
    }

    win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 1, 1, 0, 0, 0);

    XSetWMHints(dpy, win, &xwmh);
    XMapWindow(dpy, win);

    strut[0] = LEFT;
    strut[1] = RIGHT;
    strut[2] = TOP;
    strut[3] = BOTTOM;

    XChangeProperty(dpy, win, XInternAtom(dpy, "_NET_WM_STRUT", False),
        XA_CARDINAL, 32, PropModeReplace, (unsigned char *) strut, 4);

    while (1) {
        XNextEvent(dpy, &event);
    }
 
}

To compile it just type:

gcc -L/usr/X11R6/lib -lX11 -o simple_strut simple_strut.c

The prgram has a little flaw, if you use visibility or programs like it you will have a window icon for the above program as it will not automatically skip the window list. One can suerly remedy this but I didn't get around doing it till now.

Offline

#6 2007-04-07 19:34:57

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

Re: openbox "slit"?

Sweet. Thanks.

Offline

Board footer

Powered by FluxBB