add toggle-mic-mute.sh script
also, adjust dunst config for it
This commit is contained in:
17
bin/toggle-mic-mute.sh
Executable file
17
bin/toggle-mic-mute.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#! /bin/bash
|
||||
|
||||
pactl list sources | grep -qi 'Mute: yes'
|
||||
state="$?"
|
||||
|
||||
id="991050"
|
||||
appName="microphone-is-muted"
|
||||
|
||||
if [[ "$state" == "0" ]]; then
|
||||
# mic is muted
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ 0
|
||||
dunstify -a "$appName" -u low -t 1000 -r "$id" "Actived microphone" "It's not muted now"
|
||||
else
|
||||
# mic is not muted
|
||||
pactl set-source-mute @DEFAULT_SOURCE@ 1
|
||||
dunstify -a "$appName" -u low -t 1000 -r "$id" "Disabled microphone" "It's muted now"
|
||||
fi
|
||||
@@ -63,3 +63,7 @@ frame_color = "#ff3333"
|
||||
[volume]
|
||||
appname = "notify-on-volume"
|
||||
history_ignore=yes
|
||||
|
||||
[microphone]
|
||||
appname = "microphone-is-muted"
|
||||
history_ignore=yes
|
||||
|
||||
@@ -143,13 +143,13 @@ exec_always --no-startup-id $HOME/dotfiles/bin/set-wallpaper --restore
|
||||
#
|
||||
|
||||
# Bind media keys on a keyboard to control volume and playback
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pamixer -i 5 && $HOME/dotfiles/bin/notify-on-volume
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pamixer -d 5 && $HOME/dotfiles/bin/notify-on-volume
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pamixer --allow-boost -i 5 && $HOME/dotfiles/bin/notify-on-volume
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id pamixer --allow-boost -d 5 && $HOME/dotfiles/bin/notify-on-volume
|
||||
bindsym XF86AudioMute exec --no-startup-id pamixer -t
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
bindsym XF86AudioNext exec playerctl next
|
||||
bindsym XF86AudioPrev exec playerctl previous
|
||||
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
|
||||
bindsym XF86AudioMicMute exec $HOME/dotfiles/bin/toggle-mic-mute.sh
|
||||
|
||||
# brightness
|
||||
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
|
||||
|
||||
Reference in New Issue
Block a user