lunes, 31 de mayo de 2010

Radio para Ubuntu

Cansado de probar screenlets para ubuntu y no poder escuchar la radio en mi pc sin tener que abrir la pagina de la emisora, decidí crear un pequeño script que se apoya en el famoso zenity para poder interactuar con el usuario, las emisoras que he puesto son las que mas utilizo y las pocas que he encontrado la dirección stream, en fin.

Aquí os dejo el script, o bien lo bajáis de aquí Radio.sh (lo descargáis y le dais permisos de ejecución)



Si usais Ubuntu 10.04 tendreis que ejecutarlo desde terminal

bash Radio.sh

O bien crear un lanzador como yo he hecho, guardando el script donde querais
y poniendo como comando del lanzador

bash /la_ruta/donde_este_el_script/Radio.sh

También podéis crear un archivo nuevo y pegáis este código, guardáis y dais permiso de ejecución.




##Creado por pegasodm
### http://www.dukkon.blogspot.com/

#!/bin/bash
icon=/usr/share/icons/gnome/32x32/devices/audio-input-microphone.png
# Llama al reproductor
repro="Mplayer\nVLC\nTotem\nFirefox"

repro=`echo -e "$repro" | zenity --window-icon=$icon --title="Lemur-search: Radio" --height=300 --width=480 --list --print-column=ALL --text="Elige Reproductor que deseas usar" --column="Reproductores"`
if [ "$repro" = "VLC" ]; then repro="vlc"
elif [ "$repro" = "Totem" ]; then repro="totem"
elif [ "$repro" = "Firefox" ]; then repro="firefox"
elif [ "$repro" = "Mplayer" ]; then repro="mplayer"
fi
#Selecciona radio
Elecc="Cadena Ser\n40 Principales\nCadena dial\nCope\nRadiolé\nM80\nPunto Radio\nCadena 100\nEsRadio"
Elecc=`echo -e "$Elecc" | zenity --window-icon=$icon --title="Lemur-search: Radio" --height=300 --width=480 --list --print-column=ALL --text="Elige la Radio que quieras escuchar" --column="Lista de Radios:"`
#Ejecuta la radio en funcion del reproductor y radio seleccionada.

list="Andalucía\nAragón\nBaleares\nCanarias Las Palmas\nCanarias Tenerife\nCantabria\nCastilla y León\nCataluña\nCeuta\nRegión de Murcia\nPaís Vasco\nNavarra\nMelilla\nToledo\nGalicia\nExtremadura\nComunidad Valenciana"

if [ "$Elecc" = "Cadena Ser" ]; then /usr/bin/notify-send -i $icon "Lista de provincias de $Elecc"

list=`echo -e "$list" | zenity --window-icon=$icon --title="Lemur-search: Radio" --height=500 --width=480 --list --print-column=ALL --text="Elige la provincia a escuchar" --column="Provincias de Cadena Ser"`
if [ "$list" = "Andalucía" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Sevilla
elif [ "$list" = "Aragón" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Zaragoza
elif [ "$list" = "Baleares" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Mallorca
elif [ "$list" = "Canarias Las Palmas" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/laspalmas
elif [ "$list" = "Canarias Tenerife" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Tenerife
elif [ "$list" = "Cantabria" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Santander
elif [ "$list" = "Toledo" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Toledo
elif [ "$list" = "Castilla y León" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Valladolid
elif [ "$list" = "Cataluña" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Barcelona
elif [ "$list" = "Ceuta" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Ceuta
elif [ "$list" = "Comunidad Valenciana" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Valencia
elif [ "$list" = "Extremadura" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Badajoz
elif [ "$list" = "Galicia" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Santiago
elif [ "$list" = "Melilla" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Melilla
elif [ "$list" = "Navarra" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Pamplona
elif [ "$list" = "País Vasco" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Bilbao
elif [ "$list" = "Región de Murcia" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc $list"; $repro http\:\/\/emisoras.cadenaser.com:8085/stream/prisacom_Murcia
fi





elif [ "$Elecc" = "40 Principales" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc"; $repro http://194.169.201.177:8085/live3.mp3 &

elif [ "$Elecc" = "Cadena dial" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc"; $repro http://194.169.201.177:8085/liveDial.mp3 &

elif [ "$Elecc" = "Cope" ]; then /usr/bin/notify-send -i $icon "Estas escuchando La $Elecc"; $repro http://cope.stream.flumotion.com/cope/copefm.mp3.m3u &

elif [ "$Elecc" = "Radiolé" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc"; $repro http://194.169.201.177:8085/liveRadiOle.mp3 &

elif [ "$Elecc" = "M80" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc"; $repro http://194.169.201.177:8085/liveM80.mp3 &

elif [ "$Elecc" = "Punto Radio" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc"; $repro http://streaming.puntoradio.com &

elif [ "$Elecc" = "Cadena 100" ]; then /usr/bin/notify-send -i $icon "Estas escuchando $Elecc"; $repro http://cadena100.cope.stream.flumotion.com/cope/cadena100.flv.m3u &
elif [ "$Elecc" = "EsRadio" ]; then /usr/bin/notify-send -i $icon "Has seleccionado $Elecc Espera que carge el Buffer"
########Totem no es compatible con mms:// y firefox invoca totem para el mms:// asi que compruebo si se usasn esos dos

if [ "$repro" = "totem" ] || [ "$repro" = "firefox" ]
then zenity --window-icon=$icon --title="Lemur-search: Radio" --question --text="El reproductor seleccionado no es compatible con la emisora\nDeseas abrirlo con VLC?" --ok-label="ok"
if [ $? -eq 0 ]
then /usr/bin/notify-send -i $icon "Has seleccionado $Elecc Espera que carge el Buffer"
vlc mms://streaming.esradio.fm/EsRadio &
else /usr/bin/notify-send -i $icon "Cerrando la Radio"
exit 0
fi
else $repro mms://streaming.esradio.fm/EsRadio &
fi
fi
#####################################################################

ps -A | grep mplayer && echo $?
proceso=$?
if [ $proceso = 0 ];
then zenity --window-icon=$icon --title="Lemur-search: Radio" --info --text="Quieres cerrar $Elecc?"
case $? in
0)
killall mplayer
;;
255)
killall mplayer
;;
1)
killall mplayer
;;
esac
fi
######################################
Si no tienes VLC deberás descargarlo para poder seleccionar ese reproductor.
Y a escuchar la radio.



viernes, 28 de mayo de 2010

Ubuntu no reconoce discos duros en la instalación

Ubuntu no reconoce discos duros en la instalación?


Hola, recientemente con el ordenador de un amigo me ha ocurrido que no podía instalar ubuntu por que al llegar al momento de crear las particiones no mostraba ningún disco duro me refiero en esta ventanita.


Lo gracioso es que Gparted si que detectaba el disco duro y sus correspondientes particiones.
El caso es que ya me paso cuando el amigo quería instalar la 9.10, pero si que le cogía la 9.04 asi que no me lo pensé e instale 9.04 y después actualice a la 9.10, pero ahora me vuelve a pasar con Element OS un derivado de ubuntu enfocado al media center aquí les dejo el link por si quieren echar un vistazo. http://www.elementmypc.com/main/index.php


Bien, navegando por la red (unas horitas) encontré la forma de poder hacer que la instalación de ubuntu detecte los discos duros, con un sencillo comando.

sudo apt-get remove dmraid

Presionas Yes y voila!!, nuestro amigo detecta las particiones.