Microphone status and muting
This commit is contained in:
parent
ebcc1a51ef
commit
f0853adde2
2 changed files with 23 additions and 3 deletions
|
@ -1,5 +1,18 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
mic-status = pkgs.writeScript "mic-status" ''
|
||||
#!${pkgs.zsh}/bin/zsh
|
||||
|
||||
if [ "$(${pkgs.pulseaudio}/bin/pactl list sources | grep -o 'Mute: yes')" = "Mute: yes" ]
|
||||
then
|
||||
echo -e '\uf131'
|
||||
else
|
||||
echo -e '\uf130'
|
||||
fi
|
||||
'';
|
||||
in
|
||||
|
||||
pkgs.writeText "configuration.toml" ''
|
||||
[theme]
|
||||
name = "gruvbox-light"
|
||||
|
@ -61,6 +74,12 @@ pkgs.writeText "configuration.toml" ''
|
|||
[[block]]
|
||||
block = "sound"
|
||||
|
||||
[[block]]
|
||||
block = "custom"
|
||||
command = "${mic-status}"
|
||||
interval = 1
|
||||
on_click = "${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"
|
||||
|
||||
[[block]]
|
||||
block = "time"
|
||||
interval = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue