summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-07-12 15:04:29 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-07-12 15:04:29 +0800
commitcd2f3a0bf7ef92c46cec14178273ed43cae2bc94 (patch)
tree64742b0b993471eb89f48bd65d61026d2fa577e1
parentaac617d7178874a65c0deca28897df7fd2c3620b (diff)
changed music detection and pause play mechanics
-rwxr-xr-xidle.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/idle.sh b/idle.sh
index 2de0162..78b6b3c 100755
--- a/idle.sh
+++ b/idle.sh
@@ -53,11 +53,13 @@ function idle() {
notify-send -u critical "Unable to get volume(sound) status: $(pactl get-sink-mute @DEFAULT_SINK@)"
fi
script -c "$HOME/scripts/update.sh" /var/log/sysupdate.log -a --force
- if [ $pmusic ] && [[ $(NekoMC --status) == "Playing" ]]; then
- m=true
+ if [ $pmusic ]; then
+ if [[ $(playerctl status -p spotify) == "Playing" ]]; then
+ m=true
+ fi
fi
- if [ $pmusic ] && [ "$m" ]; then
- NekoMC --pause &
+ if [ $pmusic ]; then
+ playerctl --all-players pause
fi
# re-cache neofetch
# script -c "$HOME/scripts/neofetchCache.sh" "$HOME"/scripts/logs/neofetchCache.log -a --force
@@ -92,7 +94,7 @@ function stopidle() {
/sbin/killall update.sh yay &
unfreezeapp &
if [ $pmusic ] && [ "$m" ]; then
- NekoMC --play &
+ playerctl play -p spotify
unset m
fi
/sbin/echo "Removing lock file"