How to lauch apps from the phablet's cmd line

There is a common app-launcher 'ubuntu-app-launch' and you may run:

$ ubuntu-app-launch mediaplayer-app http://stream.dradio.de/7/251/142684/v1/gnl.akacast.akamaistream.net/dradio_mp3_dlf_s

or to play files in the phone:

$ ubuntu-app-launch mediaplayer-app file:///home/phablet/Music/VoiceMessage.wav
$ ubuntu-app-launch mediaplayer-app file:///home/phablet/Music/mutti.mp3

I have a small script in ~phablet/pl.sh:

$ cat pl.sh
ubuntu-app-launch mediaplayer-app $1

and use just something like

$ sh pl.sh VoiceMessage.wav

Here is another example how to feed the Spanish Dictionara DRAE from the shell, the script 'rae.sh' sends the word is ISO coded to the server using the browser:

#!/bin/sh
# the server lema.rae.es only understands ISO 8859-1 coded words
# but we have to send them via the 'ubuntu-app-launch' either in ASCII or in UTF-8,
# so we rewrite the spanish tilded chars in ISO coding, but as %xx values
iso=`echo $1 | sed 's/ñ/%f1/g' |\
sed 's/á/%e1/g' |\
sed 's/é/%e9/g' |\
sed 's/í/%ed/g' |\
sed 's/ó/%f3/g' |\
sed 's/ú/%fa/g' |\
sed 's/ü/%fc/g'`
# ubuntu-app-launch webbrowser-app "http://lema.rae.es/drae/srv/search?val=$iso"
ubuntu-app-launch webbrowser-app "http://lema.rae.es/drae/?val=$iso"

Last updated: Sat Oct 17 15:35:27 CEST 2015