Skip to content

Commit 2efada9

Browse files
committed
fix(sound): use pw-cli for setting profiles that persist
1 parent c7a7d7d commit 2efada9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

subscriptions/sound/src/wpctl.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ pub async fn set_default(id: u32, name: &str, is_sink: bool) {
99
}
1010

1111
pub async fn set_profile(id: u32, index: u32) {
12-
set("set-profile", id, index).await;
13-
}
14-
15-
pub async fn set(command: &'static str, id: u32, index: u32) {
1612
let id = BaseN::<10>::u32(id);
1713
let index = BaseN::<10>::u32(index);
14+
let value = ["{ index: ", index.as_str(), ", save: true }"].concat();
1815

19-
_ = tokio::process::Command::new("wpctl")
20-
.args([command, id.as_str(), index.as_str()])
16+
_ = tokio::process::Command::new("pw-cli")
17+
.args(["s", id.as_str(), "Profile", &value])
2118
.status()
2219
.await;
2320
}

0 commit comments

Comments
 (0)