From 2edadbb43fef4c2eb29e99c4834c32bccc65aa20 Mon Sep 17 00:00:00 2001 From: Guzio Date: Sat, 9 May 2026 12:45:15 +0200 Subject: [PATCH 1/2] Just to be clear: this is NOT global --- modules/xdg-user-dirs/module.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/xdg-user-dirs/module.yaml b/modules/xdg-user-dirs/module.yaml index 1cd948a..a98bf8d 100644 --- a/modules/xdg-user-dirs/module.yaml +++ b/modules/xdg-user-dirs/module.yaml @@ -1,11 +1,11 @@ -description: Configures XDG directories the xdg-user-dirs package, if not configured already. Otherwise, it just installs the xdg-user-dirs package, which can still be useful for querying said dirs. +description: Configures XDG directories the xdg-user-dirs package (for whoever ran DCli), if not configured already. Otherwise, it just installs the xdg-user-dirs package, which can still be useful for querying said dirs. package-files: - dependencies.yaml post_install_hook: "hook.sh" run_hooks_as_user: true hook_behavior: always #...instead of "once" because the XDG spec can change from time to time (eg. the recent Projects dir), and we want to make sure that the user's keeps up.; ...instead of "ask" because I don't like pestering people with RUN THIS HOOK? RUN THIS HOOK? questions; ...because running this command multiple times is safe, anyway - it only fixes/adds broken/missing entires as it encounters them instead of overwriting everything or something like that (arguably, this makes "always" safer than "once"/"ask" because it makes your config self-healing) author: "Guzio" -version: "1.0.1" +version: "1.0.2" category: "media" tags: [] license: "MIT" From 7d26b7150558c236a49996da5c82dda0547614ee Mon Sep 17 00:00:00 2001 From: Guzio Date: Sat, 9 May 2026 13:29:06 +0200 Subject: [PATCH 2/2] Organizing my Pipewire mess MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Made sure that WirePlumber is installed explicitly. (Turns out that it wasn't; it just kinda... Happened to be there. But in theory, if I were to somehow end up with pipewire-media-session (Ugh!), there would be nothing telling DCli to switch back to WirePlumber.) * Moved extra packages to a separate module (because - now that I think about it - I think I like the idea of system-packages-GuzioPadV4 being a sort of „archive”, to which I won't be appending anything anymore) * Figured out a way to declaratively enable WirePlumber, so I removed it from the commented-out block in GuzioPadV4 host (also, gotten rid of blend-files (no longer on Blend, after all) while at it) [UPDATE: Nevermind! That declarative way will not work until DCli gets its shit together with user-hooks. Still, the error message is loud enough (and not-DCli-flow-breaking) that I think I'll stick to it for now, instead of an easy-to-miss commented-out service.] * Maybe? fixed camera problems that I've been having on this tablet from day-one (and, now that I think about it, on my previous laptop, too - tho I just always thought it broke after I tried cleaning under the lense with a piece of paper (I thought I severed a ribbon cable or something), but maybe it was working, after all?) by installing pipewire-libcamera. * Explicitly declared pipewire and pipewire-audio for good measure. --- hosts/GuzioPadV4.yaml | 3 +-- modules/pipewire/dependencies.yaml | 3 +++ modules/pipewire/hook.sh | 12 ++++++++++++ modules/pipewire/module.yaml | 14 ++++++++++++++ modules/pipewire/packages.yaml | 9 +++++++++ modules/pipewire/unhook.sh | 12 ++++++++++++ modules/system-packages-GuzioPadV4/packages.yaml | 3 --- 7 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 modules/pipewire/dependencies.yaml create mode 100644 modules/pipewire/hook.sh create mode 100644 modules/pipewire/module.yaml create mode 100644 modules/pipewire/packages.yaml create mode 100644 modules/pipewire/unhook.sh diff --git a/hosts/GuzioPadV4.yaml b/hosts/GuzioPadV4.yaml index fb293f3..f84c68b 100644 --- a/hosts/GuzioPadV4.yaml +++ b/hosts/GuzioPadV4.yaml @@ -19,6 +19,7 @@ enabled_modules: - forgiving-power-button - xdg-user-dirs - atama-branding + - pipewire # Module processing mode # parallel: Collect and install all modules at once (faster, default) @@ -76,9 +77,7 @@ services: # I don't think it's possible to let DCli manage both user and system services at the same time, so I'm commenting-out user services out of this for now #services: # enabled: -# - blend-files # - hyprpolkitagent -# - wireplumber # disabled: [] # scope: user diff --git a/modules/pipewire/dependencies.yaml b/modules/pipewire/dependencies.yaml new file mode 100644 index 0000000..2cdf902 --- /dev/null +++ b/modules/pipewire/dependencies.yaml @@ -0,0 +1,3 @@ +description: Packages needed to run the module's hook. +packages: + - bash \ No newline at end of file diff --git a/modules/pipewire/hook.sh b/modules/pipewire/hook.sh new file mode 100644 index 0000000..0249375 --- /dev/null +++ b/modules/pipewire/hook.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# extra precautions until run_hooks_as_user: true is fixed +if [ -n "$SUDO_USER" ] && [ "$EUID" == 0 ]; then + exec su "$SUDO_USER" $0; +fi + +systemctl --user enable wireplumber.service --now +if [ "$?" -ne 0 ]; then + echo "[WARN] You seem to be running a SystemD-less distro, so WirePlumber couldn't be started automatically. This is not that big of a deal; just start it (AS A USER SERVICE!) manually yourself, according to however your init system works."; + exit 0; +fi \ No newline at end of file diff --git a/modules/pipewire/module.yaml b/modules/pipewire/module.yaml new file mode 100644 index 0000000..b174f9c --- /dev/null +++ b/modules/pipewire/module.yaml @@ -0,0 +1,14 @@ +description: Installs all Pipewire components needed for a functioning session - including Pipewire itself, support for various common audio protocols (alsa, PulseAudio, JACK), libcamera support, and WirePlumber for maintaining a Pipewire session. WirePlumber also be set to auto-start for user sessions (for whoever ran DCli) on SystemD-based distros. +package-files: + - dependencies.yaml + - packages.yaml +post_install_hook: "hook.sh" #I'd love to not need a hook for this, but it seems that service management isn't possible in DCli modules (yet?), and can only be done in the host-file or via a hook. +post_disable_hook: "unhook.sh" #No matter what I tried, I couldn't get this hook to actually trigger, so it seems to be an in-development stub that doesn't work yet (especially given how there was literally 0 documentation on this - I simply spotted it being listed in auto-generated modules). For now, the unhook script has to be run manually if you want to undo the power button setup. Nevertheless, it's listed here, so it should Just Work [TM] when DCli adds support. +run_hooks_as_user: true +hook_behavior: always #...instead of "once" because this lets your service setup be self-healing (even if you mess something up, next dcli sync will restore it); ...instead of "ask" because I don't like pestering people with RUN THIS HOOK? RUN THIS HOOK? (if anything, that makes it more likely that they will "[S]kip always", thus rendering the „self-healing” non-functional) +author: "Guzio" +version: "1.0.0" +category: "media" +tags: [] +license: "MIT" +upstream_url: "https://gitdab.com/Guzio/system/src/branch/main/modules/pipewire" \ No newline at end of file diff --git a/modules/pipewire/packages.yaml b/modules/pipewire/packages.yaml new file mode 100644 index 0000000..6788f9a --- /dev/null +++ b/modules/pipewire/packages.yaml @@ -0,0 +1,9 @@ +description: Pipewire packages +packages: + - pipewire + - pipewire-audio + - pipewire-alsa + - pipewire-pulse + - pipewire-jack + - pipewire-libcamera + - wireplumber \ No newline at end of file diff --git a/modules/pipewire/unhook.sh b/modules/pipewire/unhook.sh new file mode 100644 index 0000000..a1fe760 --- /dev/null +++ b/modules/pipewire/unhook.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# extra precautions until run_hooks_as_user: true is fixed +if [ -n "$SUDO_USER" ] && [ "$EUID" == 0 ]; then + exec su "$SUDO_USER" $0; +fi + +systemctl --user disable wireplumber.service --now +if [ "$?" -ne 0 ]; then + echo "[WARN] You seem to be running a SystemD-less distro, so WirePlumber couldn't be stopped automatically. This is not that big of a deal; just stop it (AS A USER SERVICE!) manually yourself, according to however your init system works."; + exit 0; +fi \ No newline at end of file diff --git a/modules/system-packages-GuzioPadV4/packages.yaml b/modules/system-packages-GuzioPadV4/packages.yaml index 414d866..e2d1d99 100644 --- a/modules/system-packages-GuzioPadV4/packages.yaml +++ b/modules/system-packages-GuzioPadV4/packages.yaml @@ -41,9 +41,6 @@ packages: - 'glm' #Needed by: Hyprgrass - 'iio-sensor-proxy' #Command: monitor-sensors; Needed for: custom rotate scripts - 'wl-clip-persist' #Provides the most basic fucking functionality that exists on literally every OS on Earth ever, ie. the ability to paste from clipboard after the app that copied stuff there closes. How the FUCK is this not a standard on Wayland??? - - 'pipewire-alsa' #Audio won't work without it (idk what cause it to no-longer-be-autoinstalled, all I know is that it suddenly stopped working) - - 'pipewire-pulse' #Bluetooth audio won't work without it (?????? https://bbs.archlinux.org/viewtopic.php?id=304269 ??) - - 'pipewire-jack' #My pronouns are all/in deb_packages: [] exclude: [] conflicts: []