From 2d7f01f035c0b475027f06bf43437cd9ec7a209b Mon Sep 17 00:00:00 2001
From: Bruno BELANYI <bruno@belanyi.fr>
Date: Fri, 12 Nov 2021 09:49:00 +0100
Subject: [PATCH] pkgs: change-audio: 0.1.1 -> 0.1.2

Show if volume is currently muted.
---
 pkgs/change-audio/change-audio | 8 +++++++-
 pkgs/change-audio/default.nix  | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/pkgs/change-audio/change-audio b/pkgs/change-audio/change-audio
index 22479d4..836e0c1 100755
--- a/pkgs/change-audio/change-audio
+++ b/pkgs/change-audio/change-audio
@@ -10,8 +10,14 @@ fi
 
 pamixer --allow-boost "$upDown" "$2"
 newVolume="$(pamixer --get-volume || true)"
+[ "$(pamixer --get-volume-human)" = "muted" ] && isMuted=true
+
+MSG="Set volume to $newVolume%"
+if [ "${isMuted:-false}" = true ]; then
+    MSG="$MSG (muted)"
+fi
 
 notify-send -u low \
     -h string:x-canonical-private-synchronous:change-audio \
     -h "int:value:$newVolume" \
-    -- "Set volume to $newVolume%"
+    -- "$MSG"
diff --git a/pkgs/change-audio/default.nix b/pkgs/change-audio/default.nix
index c931ee6..de050ff 100644
--- a/pkgs/change-audio/default.nix
+++ b/pkgs/change-audio/default.nix
@@ -1,7 +1,7 @@
 { lib, libnotify, makeWrapper, pamixer, shellcheck, stdenvNoCC }:
 stdenvNoCC.mkDerivation rec {
   pname = "change-audio";
-  version = "0.1.1";
+  version = "0.1.2";
 
   src = ./change-audio;