From bb1ef350564368b36ca8378de10d9b13ebdde261 Mon Sep 17 00:00:00 2001 From: Jeremiah Ticket Date: Wed, 23 Mar 2022 05:01:09 -0600 Subject: [PATCH] Updated configure_pipewire.sh --- tools/configure_pipewire.sh | 39 +++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/tools/configure_pipewire.sh b/tools/configure_pipewire.sh index 2712f474..b2f1605a 100755 --- a/tools/configure_pipewire.sh +++ b/tools/configure_pipewire.sh @@ -6,8 +6,8 @@ if [[ $(whoami) != "root" ]]; then # Get the current user's XDG_HOME xdgPath="${XDG_CONFIG_HOME:-$HOME/.config}" mkdir -p "$xdgPath/pipewire/pipewire-pulse.conf.d" - -# Warn user if we are going to overwrite an existing default.pa +mkdir -p "$xdgPath/wireplumber/main.lua.d" +# Warn user if we are going to overwrite an existing 10-console_audio.conf if [ -f "$xdgPath/pipewire/pipewire-pulse.conf.d/10-console_audio.conf" ]; then read -p "This will replace the current file located at $xdgPath/pipewire/pipewire-pulse.conf.d/10-console_audio.conf, press enter to continue or control+c to abort. " continue fi @@ -23,6 +23,37 @@ server.address = [ context.exec = [ { path = "pactl" args = "load-module module-switch-on-connect" } ]' > $xdgPath/pipewire/pipewire-pulse.conf.d/10-console_audio.conf + +# Warn user if we are going to overwrite an existing 50-do-not-suspend.lua +if [ -f "$xdgPath/wireplumber/main.lua.d/50-do-not-suspend.lua" ]; then + read -p "This will replace the current file located at $xdgPath/wireplumber/main.lua.d/50-do-not-suspend.lua, press enter to continue or control+c to abort. " continue +fi +echo 'alsa_monitor.rules = { + { + matches = { + { + { "device.name", "matches", "alsa_card.*" }, + }, + }, + apply_properties = { +["session.suspend-timeout-seconds"] = 0 + }, + }, + { + matches = { + { + { "node.name", "matches", "alsa_input.*" }, + }, + { + { "node.name", "matches", "alsa_output.*" }, + }, + }, + apply_properties = { + ["session.suspend-timeout-seconds"] = 0 + }, + }, +}' > $xdgPath/wireplumber/main.lua.d/50-do-not-suspend.lua + echo "If you have not yet done so, please run this script as root to write the client.conf file." else # This section does the root part: @@ -72,12 +103,12 @@ autospawn = no ; auto-connect-localhost = no ; auto-connect-display = no EOF -echo "If you have not yet done so, run this script as your normal user to write the user default.pa" +echo "If you have not yet done so, run this script as your normal user to write the user configs" fi # If there were no errors tell user to restart, else warn them errors happened. if [ $? -eq 0 ]; then -echo "Configuration created successfully, please restart Pulseaudio or your system, for changes to take affect." +echo "Configuration created successfully, please restart both Pipewire-pulseaudio and Wireplumber or your system, for changes to take affect." else echo "Errors were encountered whilst writing the configuration, please correct them manually." fi