Crates.io | xdp-hook |
lib.rs | xdp-hook |
version | 0.1.3 |
source | src |
created_at | 2022-04-09 08:47:33.888832 |
updated_at | 2022-04-23 21:12:41.588849 |
description | trigger user-configured actions when other apps use xdg-desktop-portal ( https://github.com/flatpak/xdg-desktop-portal ) |
homepage | https://gitlab.com/jokeyrhyme/xdp-hook-rs |
repository | https://gitlab.com/jokeyrhyme/xdp-hook-rs.git |
max_upload_size | |
id | 564694 |
size | 98,147 |
trigger user-configured actions when other apps use xdg-desktop-portal ( https://github.com/flatpak/xdg-desktop-portal )
xdg-desktop-portals are a mechanism built on top of dbus and pipewire, used by Linux apps when direct access to sensitive system capabilities is unavailable (or when explicit user consent is desirable)
we can use dbus-monitor
to observe the negotiation and usage of such portals,
but it doesn't make it convenient to create a bird's-eye view of active sessions,
and might not be the easiest way to trigger portal-related automation, etc
xdp-hook
's purpose is not to offer privacy indicators like those on Android,
but rather to make it easier for others to offer such features,
by reacting to portal usage and performing user-configured tasks e.g. executing scripts
this project depends upon Linux and offers functionality for Linux systems (no support for other environments)
cargo
ensure you have a working Rust toolchain: https://rustup.rs/
run cargo install xdp-hook
when xdp-hook
runs a hook that you have configured,
it attempts to set certain environment variables to expose more information:
XDP_HOOK_APP_ID
: the name of the (flatpak app-like) process (if any) that initiated the portal sessionXDP_HOOK_PROCESS_COMMAND
: the name of the process that initiated the portal sessionXDP_HOOK_PROCESS_ID
: the process ID of the process that initiated the portal sessionnote that these are "best-effort" and might be empty strings when information is unavailable