alarm-clock icon indicating copy to clipboard operation
alarm-clock copied to clipboard

Not able to run two commands in one alarm

Open Xpistos opened this issue 2 years ago • 1 comments

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?

Xpistos avatar Sep 20 '23 11:09 Xpistos

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.

tatokis avatar Sep 27 '23 14:09 tatokis