SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Question: has anyone actually gotten KTimer to start a program ?
And if so, How, what did you have to do ??
I tried to use KTimer to signal me at a certain time.
KTimer cannot do anything else but start a program, so it is pretty useless without this working.
I have not been able to make KTimer start any program.
I have watched that timer count down to 0 repeatedly, and it does not start the program.
I have tried several programs for it to start.
I made a script that would just play a chime sound 20 times.
The script works by itself.
I have tried using absolute path names, copying a file, tried starting a program on the desktop, and trying playing sounds using several programs.
None of these have worked when given to KTimer.
I have the "once" choice selected.
Note: the sound works fine when I run these programs directly.
Question: has anyone actually gotten KTimer to start a program ?
And if so, How, what did you have to do ??
I also tried to use any of the other timers. None of them could be configured to make a sound at the programmed time.
The tea timer actually worked, but was useless as I was not at the computer at that exact moment, and it did not make any sound. I found a pop-up window later.
I just tried it with slackware64-current and slackware64-15.0, works in both instances. The first I use my email client, used full path and added a switch to receive emails, set for 30 seconds. Started the timer 30 seconds later, the email program started and check mail. In the second, used kcalc, set to 15 seconds, stared the timer, 15 seconds later kcalc started.
I also tried and .mp3 file using play filename.mp3 and tested with some sounds in /usr/share/sounds/ using play, tried a few *.wav files too. All worked.
Of course, I run XFCE4. Any KDE support is a whatever.
Thank you for that information. It must be an KDE support problem.
Does not seem to be that kind of issue that needed much KDE support.
I spent a while last night trying to configure KAlarm, as it was unhappy about not having an email specified. I would prefer it not to have an email, as I do not let my email disturb my work.
I do not know if KAlarm and KTimer have common support needs or not.
Will definitely look into that XFCE4 plugin.
I would like to have at least one timer that worked.
I just tried it with kcalc, and it worked (the kcalc window popped open).
I tried it again with my chime alarm, and got silence again. It will not run my alarm bash script.
Tried it with "play /home/myuser/datadir/sound/chime.wav", and that worked.
Tried it with "aplay /home/myuser/datadir/sound/chime.wav", and that worked this time (yesterday it did not work).
Tried it with "play ~/datadir/sound/chime.wav", and that worked.
Note: if I get anything at all wrong in that file spec, it will fail silently, no error messages nor any error indication.
This is a problem with what files that KTimer will run, and that it fails silently for some.
I must suspect that messing with the KAlarm setup had something to do with it too.
Last edited by selfprogrammed; 01-31-2024 at 05:09 PM.
Tried KTimer with "bash /home/myuser/alarm20", and silence, it would not play it.
-- this exact line plays the alarm when started from Konsole.
-- this is more than just not handling bash scripts.
Tried with "play Music/arsonist*", and it worked, playing the mp3.
-- this shows that KTimer started programs can play sounds, on my system.
Tried with "play /home/myuser/sound/chime.wav", and again got silence.
Have not figured out what it is rejecting.
I don't know what is happening but my guess is that software from the KDE world use KDE's libraries to handle sound events. Maybe some KDE sound configuration prevents things from working correctly. Can you check KDE's sound server settings?
Still, the command "play" working on mp3 but failing on wav input is strange. The are no permission issues on these files, are there?
The KDE sound server is as installed by Slackware. I would not know where to look for KDE sound settings or if I had actually found the right ones, or if they were even active. I have been through those settings before and I consider the KDE stuff to be half broken.
The KTimer does play some music, as said above.
There are some files it will not execute, and that is not likely due to sound settings.
KTimer given play and aplay commands will play sounds, ... but not if they are in a bash script.
Have a new problem, too.
I use system console for much of my work, because my editor works there, and many keypress commands do not respond when it is run from a kconsole. It was not this way in Linux 4.
Whenever I change to a system console, the KTimer STOPS TIMING.
I found this out when it had gone past the set time by 10 minutes without activating.
This is the same problem I had with one of the music players. It stops whenever the desktop is not running.
I have still not gotten it to play an alarm at any set time successfully.
As this KTimer will fail for SO MANY REASONS, it cannot be trusted as a timer, and I will abandon any hope of using it. Better to go buy some kitchen timer, something that I can trust.
There must be a simple reason behind all these but I am also confused as to what it is.
Quote:
Originally Posted by selfprogrammed
As this KTimer will fail for SO MANY REASONS, it cannot be trusted as a timer, and I will abandon any hope of using it. Better to go buy some kitchen timer, something that I can trust.
Since you're running XFCE4, did you try the xfce4-timer-plugin (you can easily install it with sbopkg)?
I think (probably) you want to use this timer in a strange environment, for example with different user or without DISPLAY or something similar. So it has no access right to read some files or play a sound or display something. But it is just a wild guess.
Whenever I change to a system console, the KTimer STOPS TIMING.
I found this out when it had gone past the set time by 10 minutes without activating.
... and this surprised you? KTimer is a KDE desktop application. That's like asking for Firefox to display a desktop notification when you switch to console. I wouldn't be surprised if KTimer did actually fire, but the effects weren't seen because you were logged into a different session.
Use the right tool for the job. I'm guessing "at" will do what you want, but I'm not sure. I don't use it personally (nor KTimer).
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618
Rep:
Kalarm is the same. I try to get it to play a/an mp3 or flac file and nothing happens, no popup letting me know something worked or didn't, nothing. All it's good for is popup messages, which is good enough, but I sure would like to have it play music files too, since it's *supposed* to when I want it to.
I have many applications that run fine when I switch to a system console. I play music that way. There was one music player that was doing the same thing. It would not advance to the next song if the desktop was not current display. It is actually stranger that it should behave that way, than if it had just kept working. That behavior means that it is using KDE display ticks for something.
Flat out, something like KTimer should not be using KDE display ticks for a timer source. That makes it fragile and unreliable. It could have been implemented several ways that would be more reliable.
It is not that difficult.
There are several music players that can keep running. I use one almost every day that plays mp3 files, and they still manage to have desktop and accompanying graphics.
It is not without DISPLAY. The DISPLAY is there and working. It is just not the current display window, and is not being updated. Having multiple workspaces requires this ability.
It may be that the xfce4 timer will behave better. I am losing confidence, and would not rely upon that though, as too many of these apps are so fragile. I am spending way too much time diagnosing problems that should not have arisen in the first place.
Last edited by selfprogrammed; 02-09-2024 at 08:13 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.