What window manager should I use as example? - linux

I want to implement a simple specialized window manager for presentations (not user-controllable) that supports only the following operations:
Moving and resizing of windows
Switching desktops
Starting applications not on current desktop (in background) without disrupting current image.
I don't need any user input, button/titles, ...
What existing window manager should I use as example? There are many little "hello world" window managers, but they usually does not support desktop switching.

You don't need to reimplement the wheel.
openbox will do everything you mention and more besides.
Simply edit the rc.xml to disable the root menu, and re-launch.
Openbox also allows per app setting so that certain applications can open on a particular desktop by default, or with a particular size, or open hidden.
It also supports wildcards in the window selection, so that settings can apply to all windows.
devilspie2 is a window matching utility that can perform actions whenever a window opens.
It is highly hackable and the code is available on github. It will match windows by name/class/etc when they open, and perform actions on them. (including matching all windows and moving them to a different desktop. It will work with most window managers.
Based on the original devilspie which does not have Lua scripting, but is configured using s-exprs instead.
xdotool will also allow you to perform complex actions on windows without hacking any code. It will even fake user input (mouse/kbd) if you need it.

There are a few window managers written in Python that could be good starting points. Qtile and whimsy both describe themselves as hackable.

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 launch evince at 100% zoom, or other pdf-viewing solution

I'm going through a bunch of PDFs viewing and then renaming.
I want to open each PDF at 100% zoom when I double-click it from nautilus. Currently it opens at 59%. I have to resize the window every time.
The application seems to call itself "Document Viewer". As far as I can tell, this is an unhelpful indirect name for evince. But I am not sure, because GNOME as a whole is trying to be "clever" about everything.
I've tried "Save Current Settings as Default", but that doesn't have the desired effect.
I've also tried gsettings set org.gnome.Evince.Default zoom 1.0 based on eg https://askubuntu.com/questions/606838/configure-evince-to-open-maximized-with-100-zoom-level . The gesttings command did not produce an error. But nor did it change evince's behaviour.
I'm open to a generic X11 solution, and reserving an area of the screen for this. I'm also open to a solution involving evince, or how nautilus launches it, or a different graphical shell or PDF viewer. Preferably applications available with debian 10.
Ideally I'd like a graphical shell which can give 100% previews and inline renames with F2. This would give a quick workflow for view-renaming whole folders of scanned papers one after the other.
I'd also be interested in socio-cultural explanations of the confluence of factors that resulted in such a severe and basic failure: opening a PDF from the graphical file browser does not result in a readable rendering, and requires the user to resize the window.
Screen is 3840x2160.
"Save Current Settings as Default" works for me on F33. I didn't change any of the other Gnome settings. I use a couple of different monitors with different resolutions and it doesn't give me any issues. I don't know if Debian handles Evince differently; I haven't used Debian for ages. Not a lot of help, sorry.

X Window System Window Hierarchy exploration program

Is there a program to explore X window hierarchy? Anything like Spy++ of MS
(http://msdn.microsoft.com/en-us/library/dd460727.aspx)
You could write one. Use XQueryTree starting from the root window.
Also, study carefully EWMH. It might have something relevant (e.g. _NET_CLIENT_LIST)
At last, code your own window manager, or adapt an existing one to fit your needs. A window manager has to know the list of top-level windows.
Remember that some X top-level windows might have been opened by some remote X11 client application running on a different machine (e.g. thru ssh -X)
Look also into xps and xwininfo; see this related question.

Call my application through keyword

My problem is very simple, but implementation can be hard!
I want that my application (Windows Application:: Visual C# .net) is launched whenever the user uses some keys combinations (on his keyboard).
For example it types Ctrl+W+W and my application is launched, that's all, I want the simplest implementation, less code, memory...
Thanks :D
You would need to write a keylogger type application in conjunction with your app which monitors for keyboard events. Once your specific shortcut is triggered you could then load your application.
See here for information on how to capture keystrokes.
Create a shortcut to the application, and assign a hot-key combination to the shortcut. Depending on the O/S, not every keystroke combination can be assigned to a shortcut, e.g. you may be able to assign Ctrl+Alt+W but not Ctrl+W+W.
On Windows, you can create a shortcut (on the desktop) to your application.
When you open the properties of the shortcut, on the second tab (labeled "Shortcut"), you can assign a shortcut key. But you can use only Ctrl+Alt+key shortcuts.
I don't think this is possible in the way that you framed this question. What is possible, however, is to have your application run automatically on startup without showing any forms, have it hook into Windows to monitor all keystrokes (I'm not sure how to do that part, exactly) and then show a form when the user presses a particular sequence of keys.
So in other words, your application would have to be running from the time Windows starts, but only show itself (make a form visible) when the user clicks a particular key sequence.
Update: here is a link to an article that discusses how to do global keystroke capture using C#: http://blogs.msdn.com/toub/archive/2006/05/03/589423.aspx.

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