Commit ab8798cb authored by Jan Hensel's avatar Jan Hensel 🐧
Browse files

scripts::micmute: Check if default-source seems to be monitor

parent 594abf18
#!/bin/bash
pulseaudio-ctl mute-input
muted="$(pulseaudio-ctl full-status | cut -f3 -d' ')"
pactl get-default-source | grep "monitor" && \
mpv /usr/share/sounds/freedesktop/stereo/dialog-error.oga > /dev/null & \
notify-send -t 1000 -u critical "default source is a monitor?" && exit 1
pactl set-source-mute @DEFAULT_SOURCE@ toggle
muted="$(pactl get-source-mute @DEFAULT_SOURCE@ | sed 's/Mute:\s*\(\S*\)$/\1/')"
message="$(echo "${muted}" | sed 's/yes/mic muted/' | sed 's/no/mic hot/')"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment