#!/bin/sh # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # Version 2, December 2004 # # Copyright (C) 2011 Luca Mailhol # # Everyone is permitted to copy and distribute verbatim or modified # copies of this license document, and changing it is allowed as long # as the name is changed. # # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION # # 0. You just DO WHAT THE FUCK YOU WANT TO. # Music On Console script for status.sh in WMFS # This script shows the music about to be played in this format : [ Title : XX Artist : XX ] # You have to include this script on your WMFS's status.sh # You can translate that in French easily color="\\#02A1CB\\" # Custom color normal="\\#D9D9D9\\" # Normal color _moc () { if [ -z $(pidof mocp) ]; then # Check if moc is running moc="[ Music on console is not running ]" else songtitle="`mocp -Q %song`" artist="`mocp -Q %artist`" currenttime="`mocp -Q %ct`" totaltime="`mocp -Q %tt`" state="`mocp -Q %state`" filetitle="`mocp -Q %file`" if [ -z $filetitle ]; then # Check if there is a file stream moc="[ No tracks to listen ]" else if [ -z $artist ]; then # If a file is being listen, we check if the title and the artist are know artist="Unknown" fi if [ -z $songtitle ]; then songtitle="Unknown" fi if [ "$state" == "PLAY" ]; then # If a file is being listen, we check if it's on pause playing1="$color Title : $normal$songtitle" playing2="$color Artist : $normal$artist" playing3="$currenttime" playing4="$totaltime" moc="[ $playing1 $playing2 ($playing3$color/$normal$playing4) ]" else playing1="$color Title : $normal$songtitle" playing2="$color Artist : $normal$artist" playing3="$currenttime" playing4="$totaltime" moc="[ $playing1 $playing2 ($playing3$color/$normal$playing4 -$color Pause $normal) ]" fi fi fi }