Skip to content

Instantly share code, notes, and snippets.

@saivert
Created May 10, 2024 07:43
Show Gist options
  • Save saivert/97396a1e6c5637eac8af8b0765b37bf4 to your computer and use it in GitHub Desktop.
Save saivert/97396a1e6c5637eac8af8b0765b37bf4 to your computer and use it in GitHub Desktop.
Lots of ignoring to do...
// Hide ourselves.
if node.name().unwrap_or_default() == "pwvucontrol-peak-detect" {
return;
}
// Hide any playback from pavucontrol (mainly volume control notification sound).
if node.name().unwrap_or_default() == "pavucontrol" {
return;
}
// Hide any notification sounds.
// The presence of the event.id property means most likely this is an event sound.
if node.pw_property::<String>("event.id").is_ok() {
return;
}
// Or media.role being Notification.
if node.pw_property::<String>("media.role").unwrap_or_default() == "Notification" {
return;
}
// Hide applications that only record for peak meter.
if node.pw_property::<String>("media.class").unwrap_or_default() == "Stream/Input/Audio" {
if let Ok(medianame) = node.pw_property::<String>("application.id") {
let hidden_apps = ["org.PulseAudio.pavucontrol", "org.gnome.VolumeControl", "org.kde.kmixd"];
for app in hidden_apps {
if app == medianame {
return;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment