Como soy algo Treky, tengo mi RPi programado de forma que, cada cierto tiempo aleatorio, reproduce un mp3 aleatorio de sonido de Star Trek. Esto es lo que he hecho:
- En el directorio /home/pi/audios/ he colocado un montón de beeps, audios y frases cortas de Star Trek, en formato mp3.
- He creado un fichero "/home/pi/engage.sh" con el siguiente contenido:
#!/bin/bash
# esperara un mínimo de 30 segundos mas un valor aleatorio
# entre 0 y 100 seg. antes de reproducir el siguiente sonido.
files=(/home/pi/audios/*)
while true ; do
omxplayer -o local "${files[RANDOM % ${#files[@]}]}"
sleep $((30 + RANDOM $100))
done
- Luego lo salvo y le doy atributo ejecutable con "chmod +x engage.sh"
- Para lanzarlo, desde el directorio "pi", hago: "./engage.sh" y comenzara a ejecutarse. Minimizo la ventana de la sesión y lo dejo corriendo y abro otra para hacer otras cosas.
- Para hacérmelo mas facil, me he creado un alias "engage" para poder llamarlo desde cualquier sitio, añadiendo al fichero "/home/pi/.bashrc" la linea "alias engage="bash /home/pi/engage.sh"
Evidentemente, el fondo de pantalla también es de temática Treky ...
..engage..
-
- Posts: 11
- Joined: Sun May 15, 2016 2:12 pm
Re: ¿FAN DE STAR TREK? PONER AMBIENTILLO EN RPi
Sorry I only speak English
so used Google translate
Love what you have done
Cool 

Love what you have done



- cpcbegin
- Posts: 226
- Joined: Sun Mar 08, 2015 3:48 pm
- Location: Costa del Sol, Spain
- Contact: Website
Re: ¿FAN DE STAR TREK? PONER AMBIENTILLO EN RPi
¡Fascinante!
Trucos y recetas para raspberry pi:
http://malagaoriginal.blogspot.com.es/search/label/raspberry%20pi
http://malagaoriginal.blogspot.com.es/search/label/raspberry%20pi