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.

  • If I get you right, because I haven't worked with wrapper scripts befor: I created a script test.sh which executes the other script playmusic.sh and schedule this with at -f test2.sh 21:50 07.06.3027 &> /tmp/at_error.log It doesn't execute the command and in the logs it tells me "warning commands will be executed using /bin/sh" – Eric Bruch Jun 7 '17 at 21:54
  • I tried it again. and checking the error of each script executed at -f test2.sh 8:27 08.06.2017 &> error.txt test2.sh &> error2.txt and lxterminal -e omxplayer sampleFile.mp4 &> error3.txt It still doesn't work but error3.txt gives me different information: "(lxterminal:3490): Gtk-WARNING **:cannot open display:" DO you know more about this error? – Eric Bruch Jun 8 '17 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.