Setting the default location for opening windows in an Xvfb environment - linux

This problem is driving me crazy. Maybe the experts at Stack Overflow can help.
I want to open an application in Xvfb and to have it always positioned at x,y=0,0 (Top left corner).
The application does not take any parameters, allowing it to reposition the opened window itself. Is there a way to set the default window position in a X-server? (Xvfb).
Best regards
Gustaf

I use Xvfb with twm (yum install twm). You need to create a ~/.twmrc file to indicate how windows are displayed.
I just use 'RandomPlacement' but in your case you might want to use 'UsePPosition' (check http://www.xfree86.org/4.4.0/twm.1.html) for more options.

Are you running a window manager? It's up to the window manager to place windows,
and it should default to (0,0) already when no window manager is running.

Is there a way to set the default window position in a X-server? (Xvfb).
It's open source, so yes, you could hack it in. But it's normally the window manager's job, so find a light-weight wm that allows window-placement rules. Some can pattern-match on window name to select rules.

Related

How can one greate grid/tile view of selected parts of windows on xfce/linux

I have a few windows on my linux machine using the xfce4 desktop enviorment.
I wish to have a grid-like view where i can see only the part of each window im intrested in.
An example for the general vision:
see a script running without the window borders on terminal across the header
see work status of F#H client out of the advenced client view in the middle left
see only the turrents status list of qBittorrent at middle right
have another terminal at footer (again without header/borders)
My best way to describe it shortly is to generate a view from selective parts of windows.
Added a picture for illustration
Is there any way of doing such thing in a practical way? Am i missing out on a great software?
There are several tiling helpers for Xfce.
Perhaps try xpytile , which is a tiling add-on for Xfce. It offers
automatic tiling, manual tiling and can simulaneously resize side-by-side windows (like AeroSnap for MS-Windows).

How to use awesome WM with LXSession (LXDE, Lubuntu)

I have Lubuntu. But when i tried to use clean Awesome WM, i thought that can i use awesome WM with GTK themes. I this possible?
I tried to run awesome, but got:
E: awesome: main:463: another window manager is already running
Also, clean Awesome WM works fine without Lubuntu. How to use awesome WM as a Window Manager in Lubuntu?
In some case, you can add --replace to replace the current window manager. LXDE defaults to OpenBox.
Some desktop environment also have settings to replace the window manager (in this case, by AwesomeWM). A quick googling seems to indicate some distribution store this setting in /etc/xdg/lxsession/LXDE/default.
However this is a bit of going in circle around the real issue here. Why run AwesomeWM in LXDE? Their feature set overlap at a rate of almost 100%. If you use lxde only for lxappearance (gtk theme mananger) and PCManFM, note that those 2 applications run just fine from the normal Awesome session. AwesomeWM itself provide the panel, wallpaper and window manager features, which leaves nothing from the original LXDE.

Is there a way to specify the window offset for an app spawned in X?

I am writing a bash script that calls some apps that run in their own window. However, they appear at a standard position on the screen. I want to be able to specify the screen co-ordinates where they appear.
Is there a setting that can be passed in command line to make this happen? I am presently using openbox and if this is a window manager feature that openbox cannot provide, could anyone recommend another lightweight window manager (fluxbox?) to which I can specify window offsets?
Is there an X setting that can do this for me?
Many X clients support a -geometry argument (sometimes --geometry) which allows you to specify size and/or position of the initial window.
devilspie could be of help you can specify different window properties on compliant window managers.
Some examples are also available.

How do I create a X-windows window independent of the current window manager?

I am playing with X-windows, Xlib, etc. I want to create a X-window independent of the window-manager: meaning that I do not want the WM to put a frame, minimize-maximize, close, menu, title-bar, etc. in the window. I want to create a vanilla X window. How?
[edit]
Alternatively, how to I capture those events so my windowing app can at least die without an error?
[edit] ninjalj's answer led me to the following info:
ICCCM
Lots & lots of info :) cool!
Tutorial
I think what you want is an override-redirect window. Just set the override-redirect on your XSetWindowAttributes struct (and the corresponding bit on valuemask) when creating the window.

How to change focus in X-Windows?

I am working on old Motif-based application for Linux. I want to be able to programmatically change the active window of our application. I can redirect the input by using XSetInputFocus() function and the keyboard input start to go there, but XReconfigureWMWindow() and XRaiseWindow() functions just don't work.
I've read that Window Managers try to stop this behaviour, so tried to disable configure redirection, but this doesn't work either. Any ideas how to make one of my own windows on top of the window stack?
There is a tiny program called wmctrl available (at least in Debian/Ubuntu it is in standard distribution) which is able to perform many operations on windows and desktops, and handles plenty of window managers. I'd suggest testing whether it works in your environment, and if so, peeking at its sources.
You may find the answer to this is dependent on the Window Manager the user is using, or even what settings they've given to the Window Manager. I like to set my Window Managers to do "focus follows mouse", which means you can't send the focus to a window that I haven't put my mouse on, unless you also warp the mouse there (is that function called XWarpMouse?).

Resources