You are not logged in.
Here is my shell script...
#!/bin/bash
case "$1" in
artist) dcop amarok player artist ;;
title) dcop amarok player title ;;
esac
I want it to send the artist and title truncated if they are more than 20 characters and with a little '...' ellipsis at the end. Can anyone help me?
Last edited by tony5429 (2008-03-12 13:28:24)
Offline
That should works :
#!/bin/bash
case "$1" in
artist)
artistname=`dcop amarok player artist`
if [ ! -z "${artistname:20}" ]; then
echo "${artistname::20}..."
else
echo $artistname
fi
;;
title)
songtitle=`dcop amarok player title`
if [ ! -z "${songtitle:20}" ]; then
echo "${songtitle::20}..."
else
echo $songtitle
fi
;;
esac
Last edited by wain (2008-03-11 20:55:43)
Offline
This might be a starting point, even though I don't know the answer: http://developer.apple.com/documentatio … 03521-SW16 (gosh what a long URL)
edit
wow, I was slow
Last edited by finferflu (2008-03-11 20:52:38)
Have you Syued today?
Free music for free people! | Earthlings
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- A. de Saint-Exupery
Offline
Fantastic! Thanks, Wain! That is exactly what I needed
Offline