[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: simple talking clock / reminder for when monitor is off and it is dark



Samuel Wales wrote: 
> i have to have all lights and monitors off at night.  but i have to
> know the time so i can take medicine.
> 
> i want debian to tell me the time at certain times.  for example
> tonight i have to take medicine at 2:40 am.
> 
> here are ideas:
> 
> - tell me time when i right click [kb much less accessible]
> - tell me at a prespecified time like 2.40 am
> - tell me the following hours: midnight, 1 am, 2am
> 
> any would be ok i think.
> 
> ideas please?  i am not going to be able to do anything particularly
> complex, buyt i can script bash.

The at command does exactly what you want. Record a sound file
of your medicine alarm and...

 $ sudo apt install at

 $ at 0240
 warning: commands will be executed using /bin/sh
 at> aplay /home/sam/medicine.wav
 at> ^D
 job 1 at Wed Mar 22 02:40:00 2022

Enter commands to be run at the particular time, and finish with
a control-D (end of file). at will acknowledge with the job
number and the time it will be run.

Feel free to test with 'at now +2m' 

You can use atq to show you the queue of at jobs, and atrm to
remove one.

Now, if the alarm happens more often than that on a regular
basis, you could use cron instead. cron is a little more
complicated, but can handle things like "every Tuesday, on hours
divisible by 4".

-dsr-


Reply to: