philip3270
asked on
Detecting and Controling Window Status in a Shell Script
Hi everyone,
I'm trying to control the status of a window - namely to make sure that it can't "disappear" off the screen Since I do not want to delve into the source code, merely detecting when the user minimizes it and automatically restoring it would be the goal.
Requirements for Kiosk:
P1 200MHZ machine running X (fun.)
Minimalist - running simple web browser and metacity for windowing without any other systems running (no task bar and they don't want one)
Web browser should not ever "disappear" - I have a script polling every once in a while to start it up again if Its not running, but the problem is without a taskbar, minimizing the window means it... dissapears into the background with no obvious way to get at it, other than Alt-tab.
I know xwininfo can tell me the status of a window, if i click on one, but is there any way to get a listing of windows?
Is there any way to tell a window to maximize from a script?
I'm trying to control the status of a window - namely to make sure that it can't "disappear" off the screen Since I do not want to delve into the source code, merely detecting when the user minimizes it and automatically restoring it would be the goal.
Requirements for Kiosk:
P1 200MHZ machine running X (fun.)
Minimalist - running simple web browser and metacity for windowing without any other systems running (no task bar and they don't want one)
Web browser should not ever "disappear" - I have a script polling every once in a while to start it up again if Its not running, but the problem is without a taskbar, minimizing the window means it... dissapears into the background with no obvious way to get at it, other than Alt-tab.
I know xwininfo can tell me the status of a window, if i click on one, but is there any way to get a listing of windows?
Is there any way to tell a window to maximize from a script?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In windows one can write a program to send the keyboard event of "Alt - space + R" to restore the window in a hackish sort of way. Im sure linux has some sort of similar functionality.
> In windows ..
X is multi user, multi tasking, multi application, multi host, multi .. multi .. multi ..
are you really trying to compare X with M$'s windows? I doubt ;-)
> minimalistic "taskbar"?
taskbar of what? window, window manager, X?
taskbar for what?
> .. to send the keyboard ..
no problem in X, see X's SEND facility, but your program needs to have it implemented.
> .. Im sure linux has ..
X has nothing to do with Linux, well it has .. the other way around: Linux uses X
> .. to restore the window ..
hmm, restore from what? you mean it's behind other windows? Then this is a task of you window manager, neither X or the window itself (well, the window needs to draw its content again).
Please don't read my comments as offence, but it sounds like you're missing some major concepts of the X window system. Rule one: don't compare X with M$ windows, even don't try it. They have nothing common except some events and some colours and the stolen word windows (X is older than M$:).
Said this, back to your problem.
IIRC you simply want a sticky window occupying the whole visible screen. Is this correct?
(sticky means: cannot be behind another window or iconized)
You have to check your program's X initialization, there have to be flags for the window behaviour and its size. If you want to send the window an event, you first need to enable that feature in your program, then you need to implement the proper handlers for these events. Then you can write a second program to send events to the first.
If you want a simple test environment for that, I'd suggest to play arround with Tcl/Tk which has this all build-in and also can communicate with any other X program. Note: Tcl/Tk is not X nor X programming, but it will give you a good feeling how it all glues together.
X is multi user, multi tasking, multi application, multi host, multi .. multi .. multi ..
are you really trying to compare X with M$'s windows? I doubt ;-)
> minimalistic "taskbar"?
taskbar of what? window, window manager, X?
taskbar for what?
> .. to send the keyboard ..
no problem in X, see X's SEND facility, but your program needs to have it implemented.
> .. Im sure linux has ..
X has nothing to do with Linux, well it has .. the other way around: Linux uses X
> .. to restore the window ..
hmm, restore from what? you mean it's behind other windows? Then this is a task of you window manager, neither X or the window itself (well, the window needs to draw its content again).
Please don't read my comments as offence, but it sounds like you're missing some major concepts of the X window system. Rule one: don't compare X with M$ windows, even don't try it. They have nothing common except some events and some colours and the stolen word windows (X is older than M$:).
Said this, back to your problem.
IIRC you simply want a sticky window occupying the whole visible screen. Is this correct?
(sticky means: cannot be behind another window or iconized)
You have to check your program's X initialization, there have to be flags for the window behaviour and its size. If you want to send the window an event, you first need to enable that feature in your program, then you need to implement the proper handlers for these events. Then you can write a second program to send events to the first.
If you want a simple test environment for that, I'd suggest to play arround with Tcl/Tk which has this all build-in and also can communicate with any other X program. Note: Tcl/Tk is not X nor X programming, but it will give you a good feeling how it all glues together.
ASKER
Thanks for the insight. I'm coming from the dark side and some things in linux are still a bit fuzzy. :-)
After some consulting, they decided that icewm would be less confusing then no taskbar, and that fullscreen operation wasn't necessary anymore.
After some consulting, they decided that icewm would be less confusing then no taskbar, and that fullscreen operation wasn't necessary anymore.
glad to have shed some light on "you" ;-)
ASKER