<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Great,</div><div><br class="webkit-block-placeholder"></div><div>that works. Now I have a random jukebox with just one click (with a desktop file).</div><div><br></div><div>Lothar</div><div><br class="webkit-block-placeholder"></div><div>Here is my script to get it working onto my bluetooth device:</div><div><br class="webkit-block-placeholder"></div><div><div>#!/bin/sh</div><div>killall -SIGQUIT mplayer</div><div>/home/root/setup-bluetooth-audio.sh</div><div>rm playlist-sorted.m3u</div><div>rm playlist.m3u</div><div>find /media/card/Musik -name "*.mp3" &gt; /home/root/playlist-sorted.m3u</div><div>/home/root/scramble.py /home/root/playlist-sorted.m3u &gt; /home/root/playlist.m3u</div><div>mplayer -ao alsa:device=bluetooth -playlist /home/root/playlist.m3u &amp;</div><div>#mplayer -ao alsa:device=bluetooth <a href="http://yp.shoutcast.com/sbin/tunein-station.pls?id=2408">http://yp.shoutcast.com/sbin/tunein-station.pls?id=2408</a></div><div>sleep 3</div><div>renice -19 `ps ax | grep mplayer | grep -Ev "grep|Unknown" | awk -- 'BEGIN {}{ print $1;}'`</div><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>setup-bluetooth-audio.sh:</div><div><br class="webkit-block-placeholder"></div><div><div>#!/bin/sh</div><div># Your device</div><div>export DEVICE=XX:XX:XX:XX:XX:XX</div><div><br class="webkit-block-placeholder"></div><div>/etc/init.d/bluetooth stop</div><div>/etc/init.d/bluetooth start</div><div><br class="webkit-block-placeholder"></div><div>sleep 1</div><div>passkey-agent --default 0000 &amp;</div><div><br class="webkit-block-placeholder"></div><div>sleep 1</div><div>echo Create bonding</div><div>dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/hci0 org.bluez.Adapter.CreateBonding string</div><div><br class="webkit-block-placeholder"></div><div>sleep 1</div><div>echo Activating service audio</div><div>dbus-send --system --print-reply --dest=org.bluez /org/bluez org.bluez.Manager.ActivateService string:audio</div><div><br class="webkit-block-placeholder"></div><div>sleep 1</div><div>echo Creating device</div><div>dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez/audio org.bluez.audio.Manager.CreateDevice</div><div><br class="webkit-block-placeholder"></div><div>sleep 1</div><div>echo Connecting sink</div><div>dbus-send --system --type=method_call --print-reply --dest=org.bluez "/org/bluez/audio/device0" org.bluez.audio.Sink.Connec</div><div><br class="webkit-block-placeholder"></div></div><div><br class="webkit-block-placeholder"></div></div><br><div><div>Am 20.01.2009 um 22:09 schrieb <a href="mailto:eric@ericanddebbie.com">eric@ericanddebbie.com</a>:</div><br class="Apple-interchange-newline"><blockquote type="cite">Here's a way to do it in python:<br><br>#!/usr/bin/env python<br>import sys, random<br>filename = sys.argv[1]<br>a = open(filename).read().strip().split("\n")<br>random.shuffle(a)<br>for i in a:<br> &nbsp;&nbsp;&nbsp;&nbsp;print i<br><br><br>If you're not famililar with shell stuff:<br><br>Save that to a file like "scramble" and then do:<br>python scramble myfile<br><br>You can just type "scramble myfile" after you've done<br> &nbsp;&nbsp;&nbsp;"chmod +x scramble"<br><br>Probably you want to redirect the list into a file:<br>python scramble myplaylist.txt &gt; /tmp/shuffledplaylist.txt<br>or you can add python code to accept another argument for an &nbsp;<br>outfilename and write the file -- with a check to make sure you're not &nbsp;<br>overwriting an existing file (don't want you to overwrite your &nbsp;<br>playlist on accident :)<br><br>Eric<br><br>_______________________________________________<br>Openmoko community mailing list<br><a href="mailto:community@lists.openmoko.org">community@lists.openmoko.org</a><br>http://lists.openmoko.org/mailman/listinfo/community<br><br></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font style="font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" face="Courier">--&nbsp;<span class="Apple-style-span" style="font-family: Helvetica; "><font class="Apple-style-span" face="Courier">|&nbsp;</font><font class="Apple-style-span" face="Courier">Rapid Prototyping&nbsp;<span class="Apple-style-span" style="font-family: Helvetica; "><font class="Apple-style-span" face="Courier">|&nbsp;</font><font class="Apple-style-span" face="Courier">XSLT Codegeneration&nbsp;<span class="Apple-style-span" style="font-family: Helvetica; "><font class="Apple-style-span" face="Courier">| http://</font><font class="Apple-style-span" face="Courier"><a href="http://www.lollisoft.de">www.lollisoft.de</a></font></span></font></span></font></span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font style="font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" face="Courier">Lothar Behrens</font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font style="font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" face="Courier">Heinrich-Scheufelen-Platz 2</font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font style="font: normal normal normal 12px/normal Helvetica; "><font class="Apple-style-span" face="Courier">73252 Lenningen</font></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="white-space: pre; "><br class="webkit-block-placeholder"></span></font></div></div><p></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></p></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></body></html>