Skip to content

Instantly share code, notes, and snippets.

@seungjin
Last active August 19, 2025 05:33
Show Gist options
  • Save seungjin/6a410c25595ea6bdad52ae2d58c09bb3 to your computer and use it in GitHub Desktop.
Save seungjin/6a410c25595ea6bdad52ae2d58c09bb3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
LED="/sys/class/leds/platform::micmute/brightness"
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
MIC_STAT=$(wpctl get-volume @DEFAULT_SOURCE@ | grep -c MUTED )
case "$MIC_STAT" in
0)
echo "Mic is ON"
echo 1 | sudo tee "$LED" > /dev/null
;;
*)
echo "Mic is OFF (muted)"
echo 0 | sudo tee "$LED" > /dev/null
;;
esac
#!/usr/bin/env bash
LED="/sys/class/leds/platform::mute/brightness"
wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
SOUND_STAT=$(wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -c MUTED )
case "$SOUND_STAT" in
0)
echo "Sound is ON"
echo 1 | sudo tee "$LED" > /dev/null
;;
*)
echo "Sound is OFF (muted)"
echo 0 | sudo tee "$LED" > /dev/null
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment