Created
May 10, 2024 07:43
-
-
Save saivert/97396a1e6c5637eac8af8b0765b37bf4 to your computer and use it in GitHub Desktop.
Lots of ignoring to do...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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