pkgs: change-audio: 0.1.1 -> 0.1.2

Show if volume is currently muted.
This commit is contained in:
Bruno BELANYI 2021-11-12 09:49:00 +01:00
parent 6ebfa1a8cc
commit 2d7f01f035
2 changed files with 8 additions and 2 deletions

View file

@ -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"

View file

@ -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;