2

When I add a new command to kcron it seems to work fine. I hit Run Now and it works perfectly. BUT when the task is scheduled it never runs. How do I get kcron to run commands exactly as Konsole can run them?

For example if I run xdotool key Ctrl+Alt+l

it works fine from the Konsole and from the Run Now button. BUT it never runs otherwise.

Same for soffice

which will open the LibreOffice splash screen.

Gnome-Schedule will run most commands. BUT I want to use KDE native stuff and would love to get kcron running.

I am running kubuntu 14.04.2 fully updated. Have tried on 32 bit and 64 bit machines.

2 Answers2

1

KCron & Cron

KDE UserBase KCron: https://userbase.kde.org/KCron

KCron is a tool for running applications in the background at regular intervals. It's a graphical interface to the Cron command.

Ubuntu Community Cron HowTo: https://help.ubuntu.com/community/CronHowto

GUI Applications

It is possible to run gui applications via cronjobs. This can be done by telling cron which display to use.

00 06 * * * env DISPLAY=:0 gui_appname

The env DISPLAY=:0 portion will tell cron to use the current display (desktop) for the program "gui_appname".

man xdotool

KEYBOARD COMMANDS
       key [options] keystroke [keystroke ...]
           Options:

           --window window
               Send keystrokes to a specific window id. You can use "WINDOW STACK" references like "%1" and "%@"
               here. If there is a window stack, then "%1" is the default, otherwise the current window is used.

It needs a window.

More of the KCron and Cron:

user26687
  • 14,934
  • Thanks for your comment. I have tried that a few times with no luck. Here is the command in my Task Scheduler: env DISPLAY=:0 && qdbus org.freedesktop.ScreenSaver /ScreenSaver Lock Still does not work. Thanks for additional help. – walttheboss May 13 '15 at 09:17
0

I have given up on this. Tried everything imaginable. Kalarm which is also native to KDE runs great. It is easy to use and schedule and will run anything I can do in the Konsole.