diff --git a/config/xmobar/scripts/music b/config/xmobar/scripts/music
new file mode 100755
index 0000000..339f3f8
--- /dev/null
+++ b/config/xmobar/scripts/music
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if mpc -q; then
+ case "$(mpc status | sed -n '2s/\[\(\w*\)\].*/\1/p')" in
+ "playing") icon="" ;;
+ "paused") icon="" ;;
+ esac
+ echo ''"$icon"''
+fi
+
diff --git a/config/xmobar/scripts/quodlibet b/config/xmobar/scripts/quodlibet
deleted file mode 100755
index 1f6edfa..0000000
--- a/config/xmobar/scripts/quodlibet
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-status=$(quodlibet --status | cut -d' ' -f1)
-case "$status" in
- "playing") icon="" ;;
- "paused") icon="" ;;
- *) ;;
-esac
-
-echo ''"$icon"''
-
diff --git a/xmobarrc b/xmobarrc
index 4a88e9f..1b68023 100644
--- a/xmobarrc
+++ b/xmobarrc
@@ -50,9 +50,9 @@ Config { font = "xft:Source Code Pro:size=9"
, "--load-icon-patterns", ""
, "--load-icon-patterns", ""
] 50
- , Run Com ".config/xmobar/scripts/quodlibet" [] "quodlibet" 10
+ , Run Com ".config/xmobar/scripts/music" [] "music" 10
, Run Com ".config/xmobar/scripts/sound" [] "sound" 10
, Run StdinReader
]
- , template = " %StdinReader%} %date% {%multicpu%%quodlibet%%sound%%wlp7s0wi%%enp9s0%%bright%%battery% "
+ , template = " %StdinReader%} %date% {%multicpu%%music%%sound%%wlp7s0wi%%enp9s0%%bright%%battery% "
}
diff --git a/xmonad/xmonad.hs b/xmonad/xmonad.hs
index 5f0e535..e902016 100644
--- a/xmonad/xmonad.hs
+++ b/xmonad/xmonad.hs
@@ -184,9 +184,9 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
, ((0, xF86XK_AudioMute), spawn "sound_control.sh toggle")
, ((0, xF86XK_AudioRaiseVolume), spawn "sound_control.sh up")
, ((0, xF86XK_AudioLowerVolume), spawn "sound_control.sh down")
- , ((0, xF86XK_AudioNext), spawn "quodlibet --next")
- , ((0, xF86XK_AudioPlay), spawn "quodlibet --play-pause")
- , ((0, xF86XK_AudioPrev), spawn "quodlibet --previous")
+ , ((0, xF86XK_AudioNext), spawn "mpc -q next")
+ , ((0, xF86XK_AudioPlay), spawn "mpc -q toggle")
+ , ((0, xF86XK_AudioPrev), spawn "mpc -q prev")
, ((0, xF86XK_MonBrightnessUp), spawn "xbacklight -inc 10")
, ((0, xF86XK_MonBrightnessDown), spawn "xbacklight -dec 10")