Compare commits
2 commits
27448ac60a
...
44ed078606
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 44ed078606 | ||
Bruno BELANYI | 305b0b985c |
|
@ -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";
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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…
Reference in a new issue