Compare commits

...

2 commits

Author SHA1 Message Date
Bruno BELANYI 44ed078606 home: wm: i3: only boost volume on 'Shift' mapping
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-18 12:22:51 +01:00
Bruno BELANYI 305b0b985c pkgs: change-audio: 0.2.0 -> 0.3.0
Only boost audio beyond 100% if specifically asked for.
2022-02-18 12:22:51 +01:00
3 changed files with 24 additions and 5 deletions

View file

@ -249,6 +249,12 @@ in
"XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down 5";
"Control+XF86AudioRaiseVolume" = "exec --no-startup-id ${changeAudio} up 1";
"Control+XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down 1";
"Shift+XF86AudioRaiseVolume" = "exec --no-startup-id ${changeAudio} up --force 5";
"Shift+XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down --force 5";
"Control+Shift+XF86AudioRaiseVolume" = "exec --no-startup-id ${changeAudio} up --force 1";
"Control+Shift+XF86AudioLowerVolume" = "exec --no-startup-id ${changeAudio} down --force 1";
"XF86AudioMute" = "exec --no-startup-id ${changeAudio} toggle";
"XF86AudioMicMute" = "exec --no-startup-id ${changeAudio} toggle mic";

View file

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

View file

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