Add mic-mute.sh for toggling microphone on/off

This commit is contained in:
Aleksey Samoilov 2024-10-19 23:42:58 +04:00
parent 0bf9521a3c
commit d8d1f022c0
3 changed files with 24 additions and 0 deletions

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
tileos-settings-river (1.2.0~tileos) unstable; urgency=medium
* Add mic-mute.sh script for toggling microphone on/off
-- Aleksey Samoilov <samoilov.lex@gmail.com> Sat, 19 Oct 2024 23:41:50 +0400
tileos-settings-river (1.1.5~tileos) unstable; urgency=medium
* Updates from Sway edition

View file

@ -12,6 +12,9 @@ launcher="eval rofi -show combi -combi-modi 'drun,run' -terminal $term -ssh-comm
# Volume changing notify
volume_bar="/usr/share/river/scripts/volume-notify.sh"
# Mic volume mute
mic_mute="/usr/share/river/scripts/mic-mute.sh"
# Brightness changing notify
brightness_bar="/usr/share/river/scripts/brightness-notify.sh"
@ -153,6 +156,7 @@ do
riverctl map $mode None XF86AudioRaiseVolume spawn "pulsemixer --change-volume +5 && $volume_bar"
riverctl map $mode None XF86AudioLowerVolume spawn "pulsemixer --change-volume -5 && $volume_bar"
riverctl map $mode None XF86AudioMute spawn "pulsemixer --toggle-mute && $volume_bar"
riverctl map $mode None XF86AudioMicMute spawn "$mic_mute"
# Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl)
riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause'

View file

@ -0,0 +1,14 @@
#!/bin/bash
set -e
MIC="${1:-'Capture'}"
amixer sset "$MIC" toggle
STATE="$(amixer sget "$MIC",0 | sed -E -e '0,/^.*\[(on|off)\].*$/d' -e 's/^.*\[(\w+)\].*$/\1/')"
test -n "$STATE" && notify-send \
--app-name river \
--expire-time 800 \
"Microphone is $STATE"