mirror of
https://github.com/mr0xb/scripts.git
synced 2026-08-27 19:34:57 -04:00
add old scripts
This commit is contained in:
parent
1c58245cc5
commit
9c1772908b
18 changed files with 338 additions and 0 deletions
24
util/mictoggle
Executable file
24
util/mictoggle
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Toggle microphone mute state using pactl (PulseAudio / PipeWire)
|
||||
# Requires: pactl, notify-send
|
||||
|
||||
# Get default source (microphone)
|
||||
SRC=$(pactl info | awk -F': ' '/Default Source/ { print $2 }')
|
||||
|
||||
if [[ -z "$SRC" ]]; then
|
||||
notify-send "🎙️ Mic Toggle" "No microphone source found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get current mute state: yes/no
|
||||
STATE=$(pactl get-source-mute "$SRC" | awk '{print $2}')
|
||||
|
||||
if [[ "$STATE" == "yes" ]]; then
|
||||
pactl set-source-mute "$SRC" 0
|
||||
notify-send "🎙️ Microphone" "🔊 Unmuted"
|
||||
else
|
||||
pactl set-source-mute "$SRC" 1
|
||||
notify-send "🎙️ Microphone" "🔇 Muted"
|
||||
fi
|
||||
|
||||
Loading…
Reference in a new issue