Resize a window using a terminal

Hi all,

I’m trying to resizing a window, or shading a window with a function send from a terminal (or a program).

In fact I want to be able to send a kind of FvwmCommand in order to set the parameter of WindowShade or WindowIconify.

Thanks for help

You can just execute Fvwm functions with FvwmCommand, something like this should work:

FvwmCommand "All (xterm) WindowShade"

You should use something similar for Iconify :slight_smile:

Thank you very much, it work very well.

For remove the WindowShade, I just have to put the line :

FvwmCommand “All (xterm) WindowShade”

As a related question, I’d be interested to know if it could be somehow possible to make windows border-/handlewidth 0, and add a “thing” in one of the corners, where you could do window resizing.
What this “thing” could be? A menu? Something else? Ideas?

Well, that was why HandleWidth and BorderWidth got separated I guess, but HandleWidth doesn’t seem to work as intended so I don’t think it is possible without modifying the source code, it would be a very useful, dare I say it, bugfix though…

It would be possible, if you patch it. :slight_smile: Remember that handlewidth and borderwidth are different – and it seems, in the majority of the cases, that the width of one is often necessitate (in general operation) by the other…

– Thomas Adam

Thanks for replies guys :slight_smile:
The thing in my question was “one of the corners”, what I meant was “only one corner”, which just about rules the whole handle-thingie out.
Too bad I can’t code :stuck_out_tongue:
If it would be possible, we could emulate a whole new bunch of WM’s.

It’s possible – I’ll add it to my “TODO” list, but be warned, it’s quite big, already. :slight_smile: I might prioritise it, at some point. One of the good things about my limited connectivity is that I can work on FVWM without other… distractions. :slight_smile:

– Thomas Adam

resize.c

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


int main(int argc, char **argv)
{
     Display *dpy;  

     int windowid;
     int x;
     int y;


if(argc<4){
  printf("usage: win_size WinID x y\n");
  return(1);
}

        sscanf(argv[1], "%x", &windowid);
        sscanf(argv[2], "%d", &x);
        sscanf(argv[3], "%d", &y);


   dpy = XOpenDisplay(NULL);
   if (dpy == NULL)
     {
       fprintf(stderr, "Can't open display\n");
       return 1;
     }


XResizeWindow( dpy, windowid, x, y );

// XMapWindow(dpy,windowid);
// XRaiseWindow(dpy,windowid);


XFlush(dpy);
XCloseDisplay(dpy);


    return(0);
}

Compile it with

gcc -Wall -o resize resize.c imlib2-config --cflags imlib2-config --libs -lXmu
strip $1

or with
gcc -lm resize.c -oresize -I/usr/include/glib-2.0 -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXmu

If you prefer Basic:

viewtopic.php?t=213

I might compile a commandline-version of wxbasic (50 kb-binary) or upload the source, if someone needs it.

Mark