hudkit
hudkit copied to clipboard
Can I use this to display a website as my desktop.
i.e. use case, I would like to run this at the back of all windows? i.e. just above the desktop?
If it's a simple change could you point me in the right direction?
It's doable, but tricky. Braindump:
While GTK has a "keep above" flag (that I'm using here), it has no "keep below" flag, because exactly how to distinguish the set of windows that are part of "the desktop" is not standardised in the full cross-platform context that GTK tries to cover.
On Linux specifically, the EWMH standard specifies a _NET_WM_STATE_BELOW
state, intended for windows that are overlaid on the desktop below other windows. So while GTK doesn't expose that underlying (ha ha) functionality, on Linux you could get an X11 handle on the GTK window (gdk_x11_drawable_get_xid
) and set that state on it, to make it behave this way in all sane desktop environments.
Or if you wanted to stay at GTK-ish-level, you could use libwnck, and subscribe to the window-stacking-changed
event. Whenever anything changes, call wnck_screen_get_windows_stacked
and decide on which window is the first one above "the desktop" (you'll have to decide where and how to draw that line), then call gtk_window_set_keep_below
on that to make the hudkit window unable to be raised above it.
If you just want to do this for a "carboard + hot glue" prototype to see if the above effort makes sense, the simplest way to do this might be to delete the line that sets the "keep above" flag, recompile, and start hudkit on startup. That puts the window just above the desktop, and because the window has override-redirect set, window managers shouldn't raise it when clicked, so any windows that are created after it will always be on top of it. This will definitely break in edge cases though, (e.g. if you restart hudkit, or restart the WM without quitting X, or in WMs that misinterpret "override-redirect" as meaning "this is a right-click context menu; put it on top", etc.).
I'd like to add this functionality at some point. If you hack it up before I do, PR appreciated! :sparkles:
Related, but maybe not quite what you're asking about: Xwinwrap lets you make whatever window your desktop background. I think the way it works is by parenting it onto the root window.
WOWWOW. I like it when a dev is as supportive as this. And will try to use Xwinwrap but will also see if I can play about with your code. Ya see, the reason why I ask this is Gnome shell doesn't allow different wallpapers for different workspaces and there are extensions that change the wallpapaer when you change workspaces. The issue here is that it's a fade animation while the windows 'slide'. It's a weird effect. So I was wondering if I could use an app, that only stays as the bottom of the stack and does nothing but display an image. Maybe I'm reaching out in the wrong direction.
EDIT: Seems like Xwinwrap might be having some issues with Gnome but will test it later after office hours :) https://github.com/mmhobi7/xwinwrap/issues/5
It definitely sounds to me like Xwinwrap or similar is the right tool for that. Hudkit does transparency and overlays, but for a background, you would need neither.
@anko Very cool tool! We need more things like this; I'm glad you're thinking outside the box, which is so rare.
@vviikk Consider checking out https://github.com/progrium/topframe , too :slightly_smiling_face: . Jeff Lindsay (progrium) also thinks big and finds simple ways of doing amazing things; he invented WebHooks, dokku, and more.
Consider checking out progrium/topframe
Thanks for link, I didn't know this existed. I said hi, and added a readme link.
@anko Great! Thank you.