alarm-clock-applet / alarm-clock

Alarm Clock is a fully-featured alarm clock for use with an AppIndicator implementation.
https://alarm-clock-applet.github.io
GNU General Public License v2.0
118 stars 31 forks source link

Not able to run two commands in one alarm #222

Open Xpistos opened 10 months ago

Xpistos commented 10 months ago

I am trying to have the alarm open a full page jpeg in xviewer and play an alert ogg vorbis file in audacious with the following command (tested at command line):

xviewer -f /home/christos/Pictures/Family/Sias_Bus.jpg & audacious /home/christos/Pictures/Family/mando.ogg

It does open xviewer full screen but says mandp.ogg is not an acceptable file format.

error1

I have tried to swamp the order and that just sas audacious cannot play a jpeg file.

error2

Finally it will run using "&&" but that only runs the first half of the command and waits for me to close xviewer before playing the sound file.

Can someone tell me what I am doing wrong?

tatokis commented 10 months ago

Commands don't run inside a shell by default, which is why you are unable to use &.

Try something like

sh -c "xviewer -f /home/christos/Pictures/Family/Sias_Bus.jpg & audacious /home/christos/Pictures/Family/mando.ogg"

I had a look and it seems that to do this by default, the program would have to escape characters before passing them to the shell, and there doesn't seem to be a straightforward way to do this that I can see with a quick glance.