add i3bar indicator for microphone status

This commit is contained in:
Franzi 2022-02-14 20:17:20 +01:00
parent 0a9ca8b889
commit 0599466e2c
Signed by untrusted user: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 17 additions and 1 deletions

View file

@ -132,7 +132,7 @@ bindsym $mod+Next exec pactl set-sink-volume @DEFAULT_SINK@ -2%; exec pactl set-
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +2%; exec pactl set-sink-mute @DEFAULT_SINK@ 0
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -2%; exec pactl set-sink-mute @DEFAULT_SINK@ 0
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute alsa_input.pci-0000_00_1f.3.analog-stereo toggle
bindsym XF86AudioMicMute exec pactl set-source-mute alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source toggle
bindsym XF86MonBrightnessUp exec sudo light -A 5
bindsym XF86MonBrightnessDown exec sudo light -U 5

View file

@ -14,6 +14,12 @@ status.register("pulseaudio",
format_muted="♪D -∞dB",
step="2",
sink="@DEFAULT_SINK@")
status.register("shell",
format="{output}",
hints = {"markup": "pango"},
command="/home/kunsi/.config/i3pystatus/microphone-status.sh",
on_rightclick="pactl set-source-mute alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source toggle",
interval=1)
status.register("backlight",
format="{percentage}%",

View file

@ -0,0 +1,10 @@
#!/bin/bash
OUT="$(pactl get-source-mute alsa_input.pci-0000_07_00.6.HiFi__hw_acp__source | cut -d' ' -f2)"
if [ "$OUT" = "yes" ]
then
echo '<span color="#00FF00">M</span>'
else
echo '<span color="#FF0000">Microphone unmuted</span>'
fi