From 85ff8ad17c1456dcd9fbb2c27ee07679bc48e7a9 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 12 Jul 2024 11:48:33 +0800 Subject: changes --- dot-config/bspwm/scripts/bsplayer | 23 +++++++++++++++++++++++ dot-config/bspwm/scripts/bspvolume | 12 +++++------- 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100755 dot-config/bspwm/scripts/bsplayer (limited to 'dot-config/bspwm/scripts') diff --git a/dot-config/bspwm/scripts/bsplayer b/dot-config/bspwm/scripts/bsplayer new file mode 100755 index 00000000..8529ef36 --- /dev/null +++ b/dot-config/bspwm/scripts/bsplayer @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +function play() { + playerctl -p spotify play +} + +function pause() { + playerctl -p spotify pause +} + +function play_pause() { + playerctl -p spotify play-pause +} + +function smart_pp() { + if [[ $(playerctl status -p spotify) == "Playing" ]]; then + pause + else + playerctl play-pause + fi +} + +smart_pp diff --git a/dot-config/bspwm/scripts/bspvolume b/dot-config/bspwm/scripts/bspvolume index 716c65b2..78a989a3 100755 --- a/dot-config/bspwm/scripts/bspvolume +++ b/dot-config/bspwm/scripts/bspvolume @@ -1,7 +1,5 @@ #!/usr/bin/env bash -## Script to manage speaker volume on Archcraft. - # Icons iDIR='/usr/share/archcraft/icons/dunst' notify_cmd='dunstify -u low -h string:x-dunst-stack-tag:obvolume' @@ -16,11 +14,11 @@ get_icon() { current="$(get_volume)" if [[ "$current" -eq "0" ]]; then icon="$iDIR/volume-mute.png" - elif [[ ("$current" -ge "0") && ("$current" -le "30") ]]; then + elif [[ ("$current" -ge "0") && ("$current" -le "40") ]]; then icon="$iDIR/volume-low.png" - elif [[ ("$current" -ge "30") && ("$current" -le "60") ]]; then + elif [[ ("$current" -ge "40") && ("$current" -le "60") ]]; then icon="$iDIR/volume-mid.png" - elif [[ ("$current" -ge "60") && ("$current" -le "100") ]]; then + elif [[ ("$current" -ge "60") ]]; then icon="$iDIR/volume-high.png" fi } @@ -33,13 +31,13 @@ notify_user() { # Increase Volume inc_volume() { [[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute - pulsemixer --max-volume 100 --change-volume +5 & get_icon && notify_user + pulsemixer --change-volume +5 & get_icon && notify_user } # Decrease Volume dec_volume() { [[ `pulsemixer --get-mute` == 1 ]] && pulsemixer --unmute - pulsemixer --max-volume 100 --change-volume -5 & get_icon && notify_user + pulsemixer --change-volume -5 & get_icon && notify_user } # Toggle Mute -- cgit v1.2.3