Okay, I’m going to tell you the whole story.
there is a persistent “shhhhhh” in my headphones, I already checked with:
watch pacmd list-sinks
and pulseaudio works fine.
Here is the link to my publication in the sound section:
So I created my own script to automate the silence, I have no programming idea, I never wrote a script or something like that, after two days of research, trial and error I have this:
I’m going to call the main engine script:
#!/bin/bash
state=$(pacmd list-sinks | grep RUNNING | grep -o RUNNING)
if [[ $state == *"RUNNING"* ]];then
pactl set-sink-mute 0 0
else
pactl set-sink-mute 0 1
fi
I call the second script the power button:
#!/bin/bash
watch -n0,5 /home/jhonatan/Documentos/mute-on-idle-jcc2
and finally the service:
[Unit]
Description=Mute on idle
[Service]
Type=simple
User=jhonatan
ExecStart=/home/jhonatan/Documentos/call-mute
[Install]
WantedBy=multi-user.target
I would like the service to update the engine command every 0.5 seconds or 1 second if it has errors, but I don’t know how to do it.
It seemed like a reasonable time as I was using it, 1 second seemed slow, I already tried it.