Commit 189e1aa3 authored by Jan Hensel's avatar Jan Hensel 🐧
Browse files

scripts::micmutetoggle: Properly detect monitor

parent ecb0e1c0
#!/bin/bash
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
_exit_because_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 get-default-source | grep -i "monitor" && _exit_because_monitor
pactl set-source-mute @DEFAULT_SOURCE@ toggle
muted="$(pactl get-source-mute @DEFAULT_SOURCE@ | sed 's/Mute:\s*\(\S*\)$/\1/')"
......
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