diff options
Diffstat (limited to 'os/core/audio.nix')
| -rw-r--r-- | os/core/audio.nix | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/os/core/audio.nix b/os/core/audio.nix index e677a90..7527501 100644 --- a/os/core/audio.nix +++ b/os/core/audio.nix @@ -2,11 +2,19 @@ config, lib, pkgs, - username, ... }: let cfg = config.os.core.audio; + toggleMuteNotify = pkgs.writeShellScriptBin "toggle-mute-notify" '' + IS_MUTED=$(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep -c "MUTED") + + if [ "$IS_MUTED" -eq 1 ]; then + ${pkgs.libnotify}/bin/notify-send -a "MuteIndicator" -t 0 -u critical "Microphone Muted" "Mic is currently OFF" + else + ${pkgs.mako}/bin/makoctl dismiss -a "MuteIndicator" + fi + ''; in { options.os.core.audio = { @@ -30,12 +38,9 @@ in spotifyd.enable = true; }; - users.users.${username}.linger = true; - security.rtkit.enable = true; - hardware.enableAllFirmware = true; - environment.systemPackages = with pkgs; [ + toggleMuteNotify crosspipe alsa-utils ]; |
