diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-07-12 15:04:29 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-07-12 15:04:29 +0800 |
| commit | cd2f3a0bf7ef92c46cec14178273ed43cae2bc94 (patch) | |
| tree | 64742b0b993471eb89f48bd65d61026d2fa577e1 /idle.sh | |
| parent | aac617d7178874a65c0deca28897df7fd2c3620b (diff) | |
changed music detection and pause play mechanics
Diffstat (limited to 'idle.sh')
| -rwxr-xr-x | idle.sh | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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" |
