From da02ce50d627b98c81712f84a299989cc91b2887 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Wed, 12 Apr 2023 21:26:29 +0200 Subject: Don't force pavucontrol in plasma-desktop enviroment --- perl-install/harddrake/sound.pm | 70 +++++++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm index b77719b58..a023afbbc 100644 --- a/perl-install/harddrake/sound.pm +++ b/perl-install/harddrake/sound.pm @@ -211,10 +211,23 @@ sub configure_pipewire_wireplumber { $pipewire_wp_user = stop_pipewire_media_session(); stop_pipewire(); - my $required_installed = $in->do_pkgs->ensure_are_installed( - ['task-pipewire', + my $plasma_installed = $in->do_pkgs->is_installed('plasma-desktop'); + my @pkgs = ( + 'task-pipewire', 'wireplumber', - 'pavucontrol'] + ); + if (!$in->do_pkgs->is_installed('pavucontrol-qt')) { + if ($plasma_installed) { + push(@pkgs, 'pavucontrol-qt'); + } + else { + push(@pkgs, 'pavucontrol'); + } + } + + + my $required_installed = $in->do_pkgs->ensure_are_installed( + \@pkgs ); if (!$required_installed) @@ -266,11 +279,8 @@ sub configure_pipewire_wireplumber { } #Plasma tricks - if ($in->do_pkgs->is_installed('plasma-desktop')) { - $in->do_pkgs->ensure_are_installed( - [ 'pavucontrol-qt', - 'kpipewire' ] - ); + if ($plasma_installed) { + $in->do_pkgs->ensure_is_installed('kpipewire'); } } @@ -287,10 +297,22 @@ sub configure_pipewire_media_session { stop_pipewire(); - my $required_installed = $in->do_pkgs->ensure_are_installed( - ['task-pipewire', + my $plasma_installed = $in->do_pkgs->is_installed('plasma-desktop'); + my @pkgs = ( + 'task-pulseaudio', 'pipewire-media-session', - 'pavucontrol'] + ); + if (!$in->do_pkgs->is_installed('pavucontrol-qt')) { + if ($plasma_installed) { + push(@pkgs, 'pavucontrol-qt'); + } + else { + push(@pkgs, 'pavucontrol'); + } + } + + my $required_installed = $in->do_pkgs->ensure_are_installed( + \@pkgs ); if (!$required_installed) @@ -341,11 +363,8 @@ sub configure_pipewire_media_session { } #Plasma tricks - if ($in->do_pkgs->is_installed('plasma-desktop')) { - $in->do_pkgs->ensure_are_installed( - [ 'pavucontrol-qt', - 'kpipewire' ] - ); + if ($plasma_installed) { + $in->do_pkgs->ensure_is_installed('kpipewire'); } } @@ -387,9 +406,19 @@ sub configure_pulseaudio { # now packages $in->do_pkgs->remove('pipewire-alsa'); + my $plasma_installed = $in->do_pkgs->is_installed('plasma-desktop'); + my @pkgs = 'task-pulseaudio'; + if (!$in->do_pkgs->is_installed('pavucontrol-qt')) { + if ($plasma_installed) { + push(@pkgs, 'pavucontrol-qt'); + } + else { + push(@pkgs, 'pavucontrol'); + } + } + my $required_installed = $in->do_pkgs->ensure_are_installed( - ['task-pulseaudio', - 'pavucontrol'] + \@pkgs ); if (!$required_installed) @@ -418,11 +447,6 @@ sub configure_pulseaudio { # disable all the pipewire stuff before managing packages disable_all_pipewire($in); - #Plasma tricks - if ($in->do_pkgs->is_installed('plasma-desktop')) { - $in->do_pkgs->ensure_is_installed('pavucontrol-qt'); - } - # start pulseaudio with same pipewire preserved user if ($pipewire_user) { start_pulseaudio($pipewire_user); -- cgit v1.2.1