summaryrefslogtreecommitdiff
path: root/.local/bin/volumectl
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-01-07 19:08:25 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-01-07 19:08:25 -0500
commitc86d5ec09e08b79fbad53c8921594f47ba8c05c4 (patch)
tree4d8e6faf2f04a6e4f2cbbc8ad0f6cfb5d4c6da12 /.local/bin/volumectl
parent8929559432affa5920d24931ca9f710401c5823f (diff)
parentb9d220c870dad566fb6d13b93ac36d8dc0fbe151 (diff)
Merge branch 'master' of github.com:ChausseBenjamin/dotfiles
Diffstat (limited to '.local/bin/volumectl')
-rwxr-xr-x.local/bin/volumectl16
1 files changed, 7 insertions, 9 deletions
diff --git a/.local/bin/volumectl b/.local/bin/volumectl
index d8766b7..4f4bc6b 100755
--- a/.local/bin/volumectl
+++ b/.local/bin/volumectl
@@ -10,14 +10,12 @@
# If no second argument is given, the audio will be SET
# to a set percentage fixed by the first argument.
case "$1" in
- mute) amixer set Master toggle ;;
- *) pcnt="$1"
- sign="$2"
- amixer set Master $pcnt%$sign ;;
+mute) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
+*)
+ pcnt="$1"
+ sign="$2"
+ wpctl set-volume @DEFAULT_AUDIO_SINK@ "$pcnt%$sign"
+ ;;
esac
-mute=""
-vol=$(awk '/%/ {gsub(/[\[\]]/,""); print $4}' <(amixer sget Master))
-amixer sget Master | grep off && mute="(muted)"
-notify-send.sh -t 1000 --replace-file /tmp/vol-notif -a Volume "$vol $mute"
-
+notify-send.sh -t 1000 --replace-file /tmp/vol-notif -a $(wpctl get-volume @DEFAULT_AUDIO_SINK@)