Posting the updated version of the solution as in
"/usr/share/pipewire/pipewire-pulse.conf" I was unable to find
"content.exec" part, it could be the config file structure update or something, not sure.
I am referring to
"by CharlesV » Tue Jan 02, 2024 5:13 pm" post here
including the point of the post/note above, your changes to survive the update, instead of edit the file
"/usr/share/pipewire/pipewire-pulse.conf" - you just:
1. Create the folder
"pipewire" (if does not exist) in
"~/.config" folder of the current user:
2. copy
"pipewire-pulse.conf" file from
"/usr/share/pipewire" folder into
"~/.config/pipewire" folder:
Code: Select all
sudo cp /usr/share/pipewire/pipewire-pulse.conf ~/.config/pipewire/
(you can copy all config files from there if you want)
3. Change ownership of the file:
Code: Select all
sudo chown USER:USER ~/.config/pipewire/pipewire-pulse.conf
(replace
USER:USER with your actual username!)
4. Open the file in your favourite text editor:
Code: Select all
vim ~/.config/pipewire/pipewire-pulse.conf
5. Find the blocks
and
(they are one on top of the other actually)
6. Add two lines of code to each block accordingly, to make like this:
Code: Select all
context.exec = [
#{ path = "pactl" args = "load-module module-always-sink" }
#{ path = "pactl" args = "upload-sample my-sample.wav my-sample" }
#{ path = "/usr/bin/sh" args = "~/.config/pipewire/default.pw" }
{ path = "pactl" args = "load-module module-switch-on-connect" }
]
and
Code: Select all
pulse.cmd = [
{ cmd = "load-module" args = "module-always-sink" flags = [ ] }
#{ cmd = "load-module" args = "module-switch-on-connect" }
#{ cmd = "load-module" args = "module-gsettings" flags = [ nofail ] }
{ cmd = "load-module" args = "module-switch-on-connect" }
]
(Pay attention to those two last lines in each block)
7. Reboot and try, it works for me.
I posted different approach in my post (
https://www.forum.mxlinux.org/viewtopic.php?t=73504), before I sorted the problem like this one.
you can check that post if you want, but I think this method is better way to solve it =)
Worth mentioning that if you want those changes system wide, if you have multiple users for example, then you can do these steps
into
"/etc/pipewire" instead of
"~/.config/pipewire"
(in that case ignore the step
3. as no ownership changes needed here).