I want the following behaviour: if I am logged in, and it is a certain time, and the program isn't already started, start the program. How can I achieve this?
|
|
Look at this command called |
||||
|
|
|
Assuming this application is a graphical application that requires an X display to connect to, I'd write a script that sleeps for X seconds then runs the application, where X is the number of seconds until the desired time. Then run this via Startup Applications. Something like this:
That should run the app somewhere between 16:30 and 16:31 each day while you're logged in. |
|||
|
|
|
I would write a script to be run by CRON. To check if a user is logged in:
Where
Will return something if it finds Make sure that you run the script with the appropriate user credentials (root?) So, for example here is a bash script snippet that shows testing for the output from the
One thing to note is that the way I've coded |
||||
|
|
|
Another option is to use Scheduled tasks with it can you can specify a lot of things https://apps.ubuntu.com/cat/applications/gnome-schedule/ download it at apt://gnome-schedule |
|||
|
|