pinwheel: Toggle mute LED when (un)muting
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
toggle-mute = pkgs.writeShellScript "foo" ''
|
||||
${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
|
||||
MUTED=$(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep MUTED | wc -l)
|
||||
echo $MUTED > /sys/class/leds/platform::mute/brightness
|
||||
'';
|
||||
in
|
||||
{
|
||||
users.users.alex.extraGroups = [ "audio" ];
|
||||
|
||||
@@ -22,7 +29,7 @@
|
||||
bind = [
|
||||
", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+"
|
||||
", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
", XF86AudioMute, exec, ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86AudioMute, exec, ${toggle-mute}"
|
||||
", XF86AudioMicMute, exec, ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"
|
||||
];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user