Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved in my musicctl script (adding support for cmus as well)

  • Loading branch information...
commit 4043c0f7602fd43959883182f6ca7a010d3782ce 1 parent 937d14a
@evandeaubl authored
Showing with 41 additions and 2 deletions.
  1. +39 −0 bin/musicctl
  2. +2 −2 etc/xbindkeys/xbindkeysrc
View
39 bin/musicctl
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+process_active() {
+ ps x|grep "$1"|grep -v grep >/dev/null
+}
+
+case "$1" in
+ toggle)
+ process_active pianobar && echo -n p >$HOME/.config/pianobar/ctl
+ process_active shell-fm && echo -n pause |socat stdin unix-client:$HOME/.shell-fm/socket
+ process_active mpd && mpc toggle
+ process_active cmus && cmus-remote -u
+ ;;
+ next)
+ process_active pianobar && echo -n n >$HOME/.config/pianobar/ctl
+ process_active shell-fm && echo -n skip |socat stdin unix-client:$HOME/.shell-fm/socket
+ process_active mpd && mpc next
+ process_active cmus && cmus-remote -n
+ ;;
+ prev)
+ ;;
+ status)
+ if process_active pianobar
+ then
+ echo "Pianobar not implemented"
+ elif process_active shell-fm
+ then
+ echo -n info %a - %t |socat -t 1 stdio unix-client:$HOME/.shell-fm/socket
+ elif process_active mpd
+ then
+ mpc current --format="%artist% - %title"
+ elif process_active cmus
+ then
+ cmus-remote -Q | egrep "tag artist|tag title" | sed 's/^tag artist \(.*\)$/\1 /g' |sed 's/tag title//g' |paste -sd '-'
+ else
+ echo "No lights? No music?!?"
+ fi
+ ;;
+esac
View
4 etc/xbindkeys/xbindkeysrc
@@ -10,10 +10,10 @@
"xterm"
Mod4 + Return
-"/home/evan/.opt/bin/musicctl.sh toggle"
+"musicctl toggle"
XF86AudioPlay
-"/home/evan/.opt/bin/musicctl.sh next"
+"musicctl next"
XF86AudioNext
"amixer set Master 5%+"
Please sign in to comment.
Something went wrong with that request. Please try again.