feat: migrate to i3blocks and autotiling-rs
This commit is contained in:
parent
ce241fd98d
commit
487870a473
14 changed files with 512 additions and 7 deletions
33
home/oli/bin/i3blocks/mic_mute
Executable file
33
home/oli/bin/i3blocks/mic_mute
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Shows microphone mute status for the default audio source.
|
||||
# Left click toggles mute.
|
||||
|
||||
. ~/bin/i3blocks/_utils
|
||||
|
||||
mic_mute() {
|
||||
if [[ "$BLOCK_BUTTON" == "1" ]]; then
|
||||
wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle
|
||||
fi
|
||||
|
||||
local wpctl_output
|
||||
wpctl_output=$(wpctl get-volume @DEFAULT_AUDIO_SOURCE@)
|
||||
local muted
|
||||
muted=$(echo "$wpctl_output" | grep -c '\[MUTED\]')
|
||||
|
||||
local bg fg icon stat
|
||||
|
||||
if [[ "$muted" -ge 1 ]]; then
|
||||
bg=$mute_bg
|
||||
fg=$mute_fg
|
||||
stat="MUT"
|
||||
else
|
||||
bg=$crit_bg
|
||||
fg=$crit_fg
|
||||
stat="REC"
|
||||
fi
|
||||
|
||||
echo -e "MIC <span background=\"$bg\" color=\"$fg\"> $stat </span>\n"
|
||||
}
|
||||
|
||||
mic_mute
|
||||
Loading…
Add table
Add a link
Reference in a new issue