Results 1 to 4 of 4

Thread: ktimer, how to play sound

  1. #1

    Default 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:
    Code:
    kdialog --textbox /dati/impo-conf/ktimer/message3 1300 300
    The file /dati/impo-conf/ktimer/message3 contains this:
    Code:
    "<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
    Code:
    play /dati/impo-conf/ktimer/KDE-Sys-Question.ogg
    I tried many things but unsuccessfully :-(
    manythanks, ciao, pier :-)

  2. #2

    Default Re: ktimer, how to play sound

    Quote Originally Posted by pier_andreit View Post
    And it works fairly, what have I to add to play a sound??
    this command works in konsole
    Code:
    play /dati/impo-conf/ktimer/KDE-Sys-Question.ogg
    Then tell ktimer to run this command...

    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.:
    Code:
    sh -c "play mysoundfile.wav; kdialog --yesno "test" "
    (that's basic shell usage... )

    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).

  3. #3

    Default Re: ktimer, how to play sound

    PS: As mentioned in your other thread, you might also have a look at kalarm:
    http://www.astrojar.org.uk/kalarm/index.html
    https://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...

  4. #4

    Default Re: ktimer, how to play sound

    Quote Originally Posted by wolfi323 View Post
    Then tell ktimer to run this command...

    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.:
    Code:
    sh -c "play mysoundfile.wav; kdialog --yesno "test" "
    (that's basic shell usage... )

    Or create a shell script that runs all commands you want, and tell ktimer to run that instead.
    maaaanythanks, the shell script works very fine.

    Quote Originally Posted by wolfi323 View Post
    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).
    I will try this also

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •