diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-07-13 19:19:56 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-07-13 19:19:56 +0800 |
| commit | d7aed071e7e314ebd3a833f93b69f9827e267dd0 (patch) | |
| tree | 191b131c28e7a3c768e1f2216c709773475bd212 /dot-config/bspwm | |
| parent | 9e2359c9cafb29486fe8cb7ec9f54e6cd6a8b5ee (diff) | |
added bsppp for play-pause smooth transitions
Diffstat (limited to 'dot-config/bspwm')
| -rwxr-xr-x | dot-config/bspwm/scripts/bsppp | 24 | ||||
| -rw-r--r-- | dot-config/bspwm/sxhkdrc | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/dot-config/bspwm/scripts/bsppp b/dot-config/bspwm/scripts/bsppp new file mode 100755 index 00000000..7835c22d --- /dev/null +++ b/dot-config/bspwm/scripts/bsppp @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +status=$(playerctl status -p spotify) + +if [[ $status == "Paused" ]] || [[ $status == "Playing" ]]; then + vol=$(playerctl metadata -p spotify -f "{{volume*100}}" | awk '{print int($1)}') + if [[ $status == "Paused" ]]; then + playerctl volume -p spotify 0 + playerctl play -p spotify + for ((i=1; i<=$vol; i++)); do + playerctl volume -p spotify $(echo "$i/100" | bc -l) + done + exit 0 + elif [[ $status == "Playing" ]]; then + for ((i=$vol; i>=0; i--)); do + playerctl volume -p spotify $(echo "$i/100" | bc -l) + done + playerctl pause -p spotify + playerctl volume -p spotify 0.$vol + exit 0 + fi + exit 0 +fi + diff --git a/dot-config/bspwm/sxhkdrc b/dot-config/bspwm/sxhkdrc index 21cef973..cd990ec3 100644 --- a/dot-config/bspwm/sxhkdrc +++ b/dot-config/bspwm/sxhkdrc @@ -123,7 +123,7 @@ XF86Audio{Mute,MicMute} # Music control XF86Audio{Next,Prev,Play,Stop} - playerctl -p spotify {next,previous,play-pause,stop} + {playerctl -p spotify next, playerctl -p spotifyprevious,bsppp,playerctl -p spotify stop} super + XF86PowerOff $HOME/.config/rofi/scripts/rofi_shutdown |
