I am very new to the raspberry Pi and try to make like a "alarm Clock" with my Raspberry Pi Model 3 B. For setting the song which it should play for a given time I use the "at" command.
The problem with this is that "at" doesn't execute the script properly when I use the "lxterminal" command like:
lxterminal -e omxplayer sampleFile.mp4
I use this to be able to exit the sample file with hotkeys. Also different bash commands such as the usage of bash arrays don't work:
When I call the script with "at" command like this:
at -f alarmClock.sh 17:21 05.06.2017
without the lxterminal it works. I changed the mode of the file to be executable. Also it has the shebang. Really can not figure out why it doesn't work. Do you have an idea what the error exactly is and how to solve it? Cheers!
As I found out this: https://bbs.archlinux.org/viewtopic.php?id=191251 solved my proplem by adding this:
export DISPLAY=:0.0 before in the line before I execute the music file.