summaryrefslogtreecommitdiff
path: root/dot-config/bspwm
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-07-12 11:48:33 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-07-12 11:48:33 +0800
commit85ff8ad17c1456dcd9fbb2c27ee07679bc48e7a9 (patch)
tree3667ccc3211f4b001859dacf0e1e88aee26bb830 /dot-config/bspwm
parent6952a9c67c68e5b4c8ae058bc72b578e1d701476 (diff)
changes
Diffstat (limited to 'dot-config/bspwm')
-rwxr-xr-xdot-config/bspwm/scripts/bsplayer23
-rwxr-xr-xdot-config/bspwm/scripts/bspvolume12
2 files changed, 28 insertions, 7 deletions
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