Added script and keybind to adjust volume

This commit is contained in:
endotrizine
2024-11-21 06:23:46 +05:00
parent 61ce2aec25
commit 1ebae52b65
2 changed files with 17 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
change=$1
current_volume=$(playerctl volume)
new_volume=$(echo "$current_volume + $change" | bc)
if (( $(echo "$new_volume > 1.0" | bc -l) )); then
new_volume=1.0
elif (( $(echo "$new_volume < 0.0" | bc -l) )); then
new_volume=0.0
fi
playerctl volume "$new_volume"
+2 -1
View File
@@ -177,9 +177,10 @@ bind = Super+Alt, f12, exec, notify-send 'Test notification' "Here's a really lo
bind = Super+Alt, Equal, exec, notify-send "Urgent notification" "Ah hell no" -u critical -a 'Hyprland keybind' # [hidden]
##! Media
bindl= Super+Shift, N, exec, playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` # Next track
bindl= ,XF86AudioNext, exec, playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` # [hidden]
bindl= ,XF86AudioPrev, exec, playerctl previous # [hidden]
bindl = Super+Shift, Comma, exec, ~/.config/ags/scripts/music/adjust-volume.sh -0.03 # Raise music volume
bindl = Super+Shift, Period, exec, ~/.config/ags/scripts/music/adjust-volume.sh 0.03 # Lower music volume
bind = Super+Shift+Alt, mouse:275, exec, playerctl previous # [hidden]
bind = Super+Shift+Alt, mouse:276, exec, playerctl next || playerctl position `bc <<< "100 * $(playerctl metadata mpris:length) / 1000000 / 100"` # [hidden]
bindl= Super+Shift, B, exec, playerctl previous # Previous track