The output of both pactl list sink-inputs
and pacmd list-sink-inputs
contains a Properties section:
Properties:
media.name = "ALSA Playback"
application.name = "ALSA plug-in [snapclient]"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "29"
application.process.id = "6393"
application.process.user = "root"
application.process.host = "xxxxxx"
application.process.binary = "snapclient"
application.language = "C"
application.process.machine_id = "8dadf95c2f504864bc0f8b3ab149cbe0"
application.process.session_id = "c4"
module-stream-restore.id = "sink-input-by-application-name:ALSA plug-in [snapclient]"
I am wondering if there is a way to directly look up the index of a sink-input by either the application.process.id
or application.process.binary
, without resorting to parsing the many lines of output of the aforementioned commands or writing a separate C program.