I want to take a break from my system after every one hour. How to enable Popups(I mean Pop ups, not notifications). OS: Ubuntu 16.04 LTS, Unity DE
Asked
Active
Viewed 1,548 times
8
-
How about `xcowsay -t 0 "Coffee Break!"` and run it in a cron job every hour. – stumblebee Mar 05 '18 at 21:22
-
1Relevant: https://askubuntu.com/questions/370821/break-reminder-for-ubuntu or https://askubuntu.com/questions/696620/a-timer-that-automatically-locks-the-screen-to-take-a-break-away-from-the-comput – Byte Commander Mar 05 '18 at 21:29
-
@stumblebee will xwindows programs run from cron, and display on screen? – RonJohn Mar 05 '18 at 21:34
-
1@RonJohn Yeppers! `0 * * * * env DISPLAY=:0 /usr/games/xcowsay -t 0 "Coffee Break!"` – stumblebee Mar 05 '18 at 22:23
2 Answers
7
You can run a cron every hour.
crontab -e
Add this line (if you have xcowsay installed):
0 * * * * env DISPLAY=:0 /usr/games/xcowsay -t 0 "Coffee Break!"
To install xcowsay:
sudo apt install xcowsay
Screenshot:
stumblebee
- 2,963
- 3
- 16
- 31
-
I am a beginner in using crons. I cant understand where to head after installing xcowsay. Where shoud I add the line"0 * * * * env DISPLAY=:0 /usr/games/xcowsay -t 0 "Coffee Break!" "? Also, do I need to enter this command "crantab -e" everytime in order for cron to work? – Siddharth Barhate Mar 06 '18 at 03:37
-
@SiddharthBarhate You only need to run `crontab -e` when you want to edit your cron jobs. After that they will always automatically run at the times you specify. The line that you are adding should be at the bottom. Have a look at the [cronhowto](https://help.ubuntu.com/community/CronHowto) for more information. – stumblebee Mar 06 '18 at 03:51
-
the cron jobs are runing after 10 mins, not one hour? Also please edit your answer to crontab -e instead of crantab -e – Siddharth Barhate Mar 06 '18 at 08:33
-
@SiddharthBarhate fixed typo ty. The first field is minutes which is set to "0" in this example. So if you started the cron at 8:50 then it would run at 9:00 (10 minutes later). The next run would be at 10:00 and every hour thereafter. – stumblebee Mar 06 '18 at 18:46
0
Also, you may want to consider the package workrave. It can be set to lock the screen after an hour (or any other time period) and suggest exercises.
Cedric Knight
- 151
- 1
- 4
