Commit 3c2dc005 authored by bbguimaraes's avatar bbguimaraes
Browse files

scripts/sink: set card profile

parent aa1f5759
......@@ -13,6 +13,7 @@ sub main {
my @f = split;
exec_cmd("pactl", "move-sink-input", $f[0], $id);
}
set_profile($sink);
}
sub exec_cmd {
......@@ -39,4 +40,19 @@ sub map_sink_name {
}
}
sub set_profile {
my $sink = shift;
my $profile;
if($sink eq "analog-stereo") {
$profile = "output:analog-stereo+input:analog-stereo";
} elsif($sink eq "hdmi-stereo") {
$profile = "output:hdmi-stereo-extra1+input:analog-stereo";
} else {
return
}
my @cards = `pactl list short cards`;
my $card = (split(" ", $cards[0]))[1];
exec_cmd("pactl", "set-card-profile", $card, $profile);
}
main @ARGV;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment