Browse Source

pkgs: change-audio: 0.2.0 -> 0.3.0

Only boost audio beyond 100% if specifically asked for.
nvim-notify
Bruno BELANYI 4 months ago
parent
commit
305b0b985c
  1. 21
      pkgs/change-audio/change-audio
  2. 2
      pkgs/change-audio/default.nix

21
pkgs/change-audio/change-audio

@ -9,13 +9,26 @@ NOTIFY=(
)
do_change_volume() {
local args=()
if [ "$1" = "up" ]; then
upDown="-i"
args+=("-i")
else
upDown="-d"
args+=("-d")
fi
shift
# Do not boost over 100% unless explitily asked for
if [ "$1" = "--force" ] || [ "$1" = "-f" ]; then
args=("--allow-boost" "${args[@]}")
shift
fi
pamixer --allow-boost "$upDown" "$2"
# Volume
args+=("$1")
pamixer "${args[@]}"
newVolume="$(pamixer --get-volume || true)"
[ "$(pamixer --get-volume-human)" = "muted" ] && isMuted=true
@ -29,7 +42,7 @@ do_change_volume() {
}
do_toggle() {
args=()
local args=()
if [ "${2:-audio}" = mic ]; then
args+=(--default-source)
MSG="Toggled microphone"

2
pkgs/change-audio/default.nix

@ -1,7 +1,7 @@
{ lib, libnotify, makeWrapper, pamixer, shellcheck, stdenvNoCC }:
stdenvNoCC.mkDerivation rec {
pname = "change-audio";
version = "0.2.0";
version = "0.3.0";
src = ./change-audio;

Loading…
Cancel
Save