Is there a way to control media volume from command line? [answered]
First of all: I have read following quite similar questions and corresponding answers you will find related to this:
Audio control in sailfish: Setting volume via cmd-line
But my question is different. I don't want to change maximum output volume to be louder than 100% nor do I want to change the base value of a sink in pulse audio.
I really want to control the volume that I can normally control with the hardware keys.
Is there a way to do this by a command executed from command line?
From @dthierbach answer here I know how to read the current value, but I couldn't figure out how to write it.
Motivation: I'd like to set output volume to specific value on specific situations. Situations app has the feature to set ringtone volume based on situations but not media volume. But situations app can issue commands. So if I could control volume from command line, I could create such an action by myself.
try looking at pactl
coderus ( 2019-02-20 18:57:46 +0300 )edit@coderus I had a look at pactl already. But as far as I can see pactl unfortunately only sets the volume levels for the sinks. So this is a nice approach for setting maximum allowed volume to a specific value, but it is not sufficient for my use case. Description: I get into the car and the situation is recognized by bluetooth connection, I want to set output volume to maximum. If I use pactl and set volume to 100%, volume will not be 100%, as I might have changed the media volume by hardware keys to e.g. 60%. So the overall volume ist 60% (media) of 100% (sink). If I want to set volume to say 50% if I connect my headphone and I set sink volume to 50% but my media volume was 20% I only get 50% of 20% (e.g. 10%). So I'd like to leave sink volumes untouched but directly control overall media volume.
naytsyrhc ( 2019-02-20 19:06:33 +0300 )edit