linux - bash pactl suspend specific application -


i wrote following code suspend audio of specific application

spotify > '/home/user/desktop/temp_spotify.txt' 2>&1 & # store terminal output text file while : # tail grabs updated last line in text file | awk searches specific word in text , signals exit tail   tail -fn0 --pid=$(pidof awk) '/home/user/desktop/temp_spotify.txt' | awk '/spotify:ad/ { exit }'   sleep 5   pactl suspend-sink 2 1 # supend audio applications grouped under sink 2   sleep 25   pactl suspend-sink 2 0 # resume audio applications grouped under sink 2 done 

however unable specify unique identifier pactl suspend spotify application. instead specified sink 2, encompasses many applications.

how 1 suspend audio specific application?

initial parameters in text file of application

01:06:27.735 [breakpad.cpp:110                ] registered breakpad product: spotify  01:06:27.738 [translate.cpp:152               ] reloading language file 01:06:27.749 [translate.cpp:152               ] reloading language file 01:06:27.750 [breakpad.cpp:269                ] searching crashdumps: /home/user/.cache/spotify/*.dmp  got bus address:  "unix:abstract=/tmp/dbus-6gueyklnpi,guid=ad6f12cdc093618710fd017755a787fd"  connected accessibility bus at:  "unix:abstract=/tmp/dbus-6gueyklnpi,guid=ad6f12cdc093618710fd017755a787fd"  registered dec:  true  01:06:27.937 e [offline_key_store.cpp:77        ] offline: failed load key stores, error 7007, path /home/user/.cache/spotify/users/user-user/offline2 01:06:27.940 e [offline_key_store.cpp:77        ] offline: failed load key stores, error 7007, path /home/user/.cache/spotify/users/user-user/cached 


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -