I’d like to share a side-project that I finally got to a minimally-useful state this weekend, in case others find it useful
Repository: https://gitlab.com/jokeyrhyme/xdp-hook-rs
Features (as of 0.1.2):
Example use case:
eww
as my status bar across the top of my screenxdp-hook
to detect when any application creates a ScreenCast session, and update the state in eww
accordingly so that a blinking widget is displayed/removedSuggestions and code contributions are welcome :)
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word “Linux” in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
Ooh that’s nice ! Didn’t read the code but could it support generic hooks so that you can catch all portal events to “profile” whatever certain flatpak app is doing?
So far, from what I’ve learned about dbus and xdg-desktop-portal messages, we could definitely have catch-all hooks like that ( https://gitlab.com/jokeyrhyme/xdp-hook-rs/-/issues/2 )
What’s not clear to me yet, however, is how i can trace the ownership of such messages back to the processes that initiated them
dbus sender/receiver IDs are just arbitrary text, and don’t seem to have a reliable relationship with the caller
I do have this on my roadmap though ( https://gitlab.com/jokeyrhyme/xdp-hook-rs#roadmap )
I’m not familiar with dbus, but i had a quick look. I don’t know the difference between a bus and a connection, btu apparently:
Not sure if the latter would accept the result from the former as a valid parameter, but this SO thread suggested so.
I’ve raised https://gitlab.com/jokeyrhyme/xdp-hook-rs/-/issues/3
Oh, nice
And it looks like the “zbus” library that I’m using exposes the equivalent functionality: https://docs.rs/zbus/2.1.1/zbus/fdo/struct.DBusProxy.html#method.get_connection_unix_process_id
Is there a good intro document for xdg coding?#
Start with the home page: https://www.freedesktop.org/wiki/Software/dbus/
There are a few “introduction” resources and an FAQ linked there that seem like a good start
The “dbus” part is really the hard part of working with xdg-desktop-portal, at least in my own experience