ktimer, how to play sound

my system is running opensuse leap 42.1 with plasma 5.7.3:
Laptop=Dell latitude E6510, RAM=8Gb, GPU=GT218 NVS 3100M, CPU=i7 Q 720 @ 1.60GHz
upgraded 13.2 to leap 42.1, using wolfi repos. I’m running KDE 4.14.18 and plasma 5.7.3, KDE frameworks 5.24.0, KDE applications 16.04.3, Kernel 4.1.27-27-default

I use ktimer to show me an advice every few minutes, in ktimer I use kdialog to show the advice with this command:

kdialog --textbox /dati/impo-conf/ktimer/message3 1300 300 

The file /dati/impo-conf/ktimer/message3 contains this:

"<p style='font-size: 68pt; color: red; background-color: yellow'>Wake Up and drink</p>"

And it works fairly, what have I to add to play a sound??
this command works in konsole

play /dati/impo-conf/ktimer/KDE-Sys-Question.ogg

I tried many things but unsuccessfully :frowning:
manythanks, ciao, pier :slight_smile:

Then tell ktimer to run this command… :wink:

If you want to run more than one command one after the other, you should be able to separate them via ‘;’ but you have to use “sh -c” to run the whole line then, like this e.g.:

sh -c "play mysoundfile.wav; kdialog --yesno "test" "

(that’s basic shell usage… :wink: )

Or create a shell script that runs all commands you want, and tell ktimer to run that instead.

As the KDE desktop normally plays a sound when a warning dialog is opened anyway, it may be good enough to set an appropriate sound file in systemsettings/“Configure Desktop” (and verify that the corresponding sound notification is enabled).

PS: As mentioned in your other thread, you might also have a look at kalarm:
http://www.astrojar.org.uk/kalarm/index.htmlhttps://www.kde.org/applications/utilities/kalarm/
This is a lot more sophisticated/flexible, and allows to configure a sound to be played when the reminder is shown.
It likely would also make it unnecessary to run kdialog manually to display the reminder… :wink:

maaaanythanks, :slight_smile: the shell script works very fine.

I will try this also