Last active
August 19, 2025 05:33
-
-
Save seungjin/6a410c25595ea6bdad52ae2d58c09bb3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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