Skip to content

Commit 3615157

Browse files
committed
chore(sound): ignore stdout/stderr on wpctl/pw-cli commands
1 parent 13c2dd2 commit 3615157

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

subscriptions/sound/src/wpctl.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
// Copyright 2025 System76 <[email protected]>
2+
// SPDX-License-Identifier: MPL-2.0
3+
14
use numtoa::BaseN;
5+
use std::process::Stdio;
26

37
pub async fn set_default(id: u32) {
48
let id = numtoa::BaseN::<10>::u32(id);
59
_ = tokio::process::Command::new("wpctl")
610
.args(["set-default", id.as_str()])
11+
.stdout(Stdio::null())
12+
.stderr(Stdio::null())
713
.status()
814
.await;
915
}
@@ -12,9 +18,10 @@ pub async fn set_profile(id: u32, index: u32) {
1218
let id = BaseN::<10>::u32(id);
1319
let index = BaseN::<10>::u32(index);
1420
let value = ["{ index: ", index.as_str(), ", save: true }"].concat();
15-
1621
_ = tokio::process::Command::new("pw-cli")
1722
.args(["s", id.as_str(), "Profile", &value])
23+
.stdout(Stdio::null())
24+
.stderr(Stdio::null())
1825
.status()
1926
.await;
2027
}
@@ -23,6 +30,8 @@ pub async fn set_mute(id: u32, mute: bool) {
2330
let default = numtoa::BaseN::<10>::u32(id);
2431
_ = tokio::process::Command::new("wpctl")
2532
.args(["set-mute", default.as_str(), if mute { "1" } else { "0" }])
33+
.stdout(Stdio::null())
34+
.stderr(Stdio::null())
2635
.status()
2736
.await;
2837
}
@@ -32,6 +41,8 @@ pub async fn set_volume(id: u32, volume: u32) {
3241
let volume = format!("{}.{:02}", volume / 100, volume % 100);
3342
_ = tokio::process::Command::new("wpctl")
3443
.args(["set-volume", id.as_str(), volume.as_str()])
44+
.stdout(Stdio::null())
45+
.stderr(Stdio::null())
3546
.status()
3647
.await;
3748
}

0 commit comments

Comments
 (0)