diff options
| author | ryukamish <[email protected]> | 2026-04-11 18:25:38 +0530 |
|---|---|---|
| committer | ryukamish <[email protected]> | 2026-04-11 18:25:38 +0530 |
| commit | b3474e85dcce03e7de0b4a4e30ff7fad1f38ee26 (patch) | |
| tree | bcfe42ad76a825c283eec653140ab4052f0b3017 /scripts/volume-control | |
| parent | 607891801fbf2051a0c9062d15a445dd238c1e1b (diff) | |
add: small bash scripts for added functionality
Diffstat (limited to 'scripts/volume-control')
| -rwxr-xr-x | scripts/volume-control | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/volume-control b/scripts/volume-control new file mode 100755 index 0000000..bf8745d --- /dev/null +++ b/scripts/volume-control @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Taken from: https://github.com/salanpro/hyprland/tree/047f998e710b0ffe8d841a89fb7749b50c931b2c/.config/hypr/scripts + +# Volume up and down +if [[ "$1" == "up" ]]; then + wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ \ + && wpctl get-volume @DEFAULT_AUDIO_SINK@ | \ + awk '{print int($2*100)}' | xargs -I[] \ + notify-send -e -u low -h string:x-canonical-private-synchronous:volume_notif -h \ + int:value:[] " Volume: []%" +elif [[ "$1" == "down" ]]; then + wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- \ + && wpctl get-volume @DEFAULT_AUDIO_SINK@ | \ + awk '{print int($2*100)}' | xargs -I[] \ + notify-send -e -u low -h string:x-canonical-private-synchronous:volume_notif -h \ + int:value:[] " Volume: []%" +elif [[ "$1" == "mute" ]]; then + wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle \ + && (wpctl get-volume @DEFAULT_AUDIO_SINK@ \ + | grep -q MUTED && \ + notify-send -e -u low -h \ + string:x-canonical-private-synchronous:volume_notif \ + " Muted" || wpctl get-volume @DEFAULT_AUDIO_SINK@ | \ + awk '{print int($2*100)}' | xargs -I[] \ + notify-send -e -u low -h string:x-canonical-private-synchronous:volume_notif -h \ + int:value:[] " Volume: []%") +fi |
