Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- APPNAME="firefox"
- pactl list sink-inputs |
- while IFS= read -r line; do
- #echo ${line}
- echo $line | grep 'Sink Input'
- if [ $? -eq 0 ]; then
- LATESTID=$(echo $line | egrep -o '[0-9]{1,9}')
- echo $LATESTID
- else
- # Search for specified APPNAME in process.binary
- echo $line | grep 'application.process.binary = "$APPNAME"'
- if [ $? -eq 0 ]; then
- echo $APPNAME $LATESTID
- break
- fi
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement