aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/mpc-status.sh
diff options
context:
space:
mode:
authorkatherine <ageha@airen-no-jikken.icu>2022-12-11 20:56:27 -0700
committerkatherine <ageha@airen-no-jikken.icu>2022-12-11 20:56:27 -0700
commitdfdc8e86b27197ea874929537a8129cc552ff599 (patch)
tree2b78d3fdaabb5ffa8bfffc9b9006b49b195fa48f /.config/herbstluftwm/mpc-status.sh
parent60aac881c76bfa94eb58224c907adcfdccdb91cf (diff)
downloaddotfiles-dfdc8e86b27197ea874929537a8129cc552ff599.tar.gz
update to latest dunst
remove forked version and make necessary relevant adjustments
Diffstat (limited to '.config/herbstluftwm/mpc-status.sh')
-rwxr-xr-x.config/herbstluftwm/mpc-status.sh15
1 files changed, 6 insertions, 9 deletions
diff --git a/.config/herbstluftwm/mpc-status.sh b/.config/herbstluftwm/mpc-status.sh
index 6f3f699..31c13f4 100755
--- a/.config/herbstluftwm/mpc-status.sh
+++ b/.config/herbstluftwm/mpc-status.sh
@@ -1,8 +1,8 @@
-#!/bin/bash
+#!/usr/bin/env zsh
source $HOME/.config/init/vars
-case "$1" in
+case $1 in
next)
mpc next
;;
@@ -15,23 +15,20 @@ esac
mpc status >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
- notify-send -a closeme "mpd disconnected"
+ dunstify -r 109112100 "mpd disconnected"
exit
fi
-if [[ -z "$(mpc status | grep -E '\[(playing|paused)\]')" ]]; then
- notify-send -a closeme "mpd stopped"
+if [[ -z $(mpc status | grep -E '\[(playing|paused)\]') ]]; then
+ dunstify -r 109112100 "mpd stopped"
exit
fi
cd ~/music/
dir=$(dirname "$(mpc current -f %file%)")
-# linking is necessary because notify-send can't into icon paths containing commas
-cd $tmpdir
-ln -sf "$HOME/music/$dir/cover-small.png" mpd-icon.png
message="$(mpc current -f '##%track% %title% (%date%)\n%artist% - %album%')
$(mpc status | tail -n -2 | sed -re 's/volume.*repeat/\nrepeat/' -e 's/( ){3,4}/\n/g' -e '/volume: /d')"
-notify-send -t 4000 -a closeme --icon=$tmpdir/mpd-icon.png "$message"
+dunstify -t 4000 -r 109112100 --icon="$HOME/music/$dir/cover-small.png" $message