For those who simply can't wait for the Music app to come to Ubuntu Touch, I made a short bash script that randomly shuffles songs in ~/Music and plays them while you use the phone.
The script is triggered "on" by turning the volume to max (slide down from the top over the speaker icon, then slide the slider to the far right). If the volume is at less than max, songs will no longer be played until you turn it back up to max.
Here is the script:
#!/bin/bash while [ 1 ] do export vol=$(amixer | head -n5 | grep "Mono: Playback" | cut -c 18,19) if [ $vol = 10 ] && [ ! -f /tmp/music-is-playing ] then touch /tmp/music-is-playing while [ $vol = 10 ] do mplayer /home/phablet/Music/$(ls /home/phablet/Music/ | rl -c 1) export vol=$(amixer | head -n5 | grep "Mono: Playback" | cut -c 18,19) done rm /tmp/music-is-playing fi done
Here is how to install it (assuming you already have Ubuntu Touch installed on your phone):
adb root
", then "adb shell
".ubuntu_chroot shell
".su - phablet
", then "sudo -i
" (password "phablet") to get root.apt-get install openssh-server
". Run "exit
" to exit the device after that finishes.adb forward tcp:8888# tcp:22
", then "ssh phablet@localhost -p 8888
".
sudo -i
".
apt-get install mplayer randomize-lines wget
".wget http://habs.name/ubuntu-touch/shuffle.sh -O /usr/bin/shuffle.sh
".chmod +x /usr/bin/shuffle.sh
" to make it executable.scp '-P 8888' /path/to/your/music/files/* phablet@localhost:/home/phablet/Music/
" as many times as necessary.shuffle.sh
", then press "Ctrl-Z", then run the command "disown
" to start shuffling!Feel free to detach your phone once it's installed and running. Remember: turn it on by turning the volume up to max, and turn it off by turning the volume up to less than max.