Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 2823  / 2 Years ago, thu, april 14, 2022, 6:13:13

I listen to music in my browser (be it Google Music, Spotify, Youtube, etc). Sometimes I need to quickly pause my music (e.g. when a colleague comes to my desk).



I do not have time to find the right browser tab and hit pause, so I currently lose my place in my music!



Is there a simple command I could run to pause all audio? I could assign it to a keyboard shortcut!



I've noticed that light-locker does exactly this! It pauses any audio when I lock my screen and carries on in the right place when I unlock. But I want to keep my screen unlocked when a colleague comes.



Any suggestions much appreciated - thank you!


More From » sound

 Answers
5

Ok here's my best solution so far. Use this command to "pause" all audio:



/bin/bash -c "/usr/bin/amixer -q -D pulse sset Master mute; /usr/bin/killall -q -STOP 'pulseaudio'"


And use this command to "unpause" audio:



/bin/bash -c "/usr/bin/killall -q -CONT 'pulseaudio'; /usr/bin/amixer -q -D pulse sset Master unmute"


Use the Keyboard Settings to add these commands as application shortcuts (e.g. Super+Backspace to pause, Super+Enter to resume).


[#12013] Saturday, April 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
velelf

Total Points: 395
Total Questions: 115
Total Answers: 107

Location: Sudan
Member since Mon, Jun 1, 2020
4 Years ago
;