LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Question on Redshift and no internet access. (https://www.linuxquestions.org/questions/linux-software-2/question-on-redshift-and-no-internet-access-4175633347/)

linustalman 07-05-2018 01:40 PM

Question on Redshift and no internet access.
 
Hi.

If I setup Redshift with a custom config (with lat & long) file on a computer with no internet access - how would it know when is daylight and nighttime? I know that without the ~/.config/redshift.conf file - it detects coordinates, etc. when I go online.

Thanks.

brianL 07-05-2018 06:05 PM

Maybe from system time or hardware clock time? I only tried Redshift briefly a while ago, wasn't keen on it.

linustalman 07-06-2018 06:35 AM

Quote:

Originally Posted by brianL (Post 5875999)
Maybe from system time or hardware clock time? I only tried Redshift briefly a while ago, wasn't keen on it.

Hi Brian. But if it got the time from the PC - how would it determine the time of year? For example night mode would have kick in far sooner in Autumn-Winter.

What did you not like about RS?

michaelk 07-06-2018 10:51 AM

I am only guessing that it uses some type of solar calculator to determine sunrise/sunset times based upon position.


https://www.esrl.noaa.gov/gmd/grad/solcalc/

linustalman 07-07-2018 02:51 AM

Quote:

Originally Posted by michaelk (Post 5876317)
I am only guessing that it uses some type of solar calculator to determine sunrise/sunset times based upon position.


https://www.esrl.noaa.gov/gmd/grad/solcalc/

Hi Michael. That sounds about right.

linustalman 07-11-2018 03:49 AM

I've certainly been sleeping better after using Redshift.

linustalman 07-14-2018 04:51 AM

I've come across another handy blue light app - it does not need internet access.

Example usage for eve/nighttime:

Code:

sct 3500
Edit:

RS can be used in a similar manner:

Code:

redshift -O 3500

linustalman 07-15-2018 04:17 AM

I tried both of these (seperately) in crontab (to run at 9pm every night) but both never ran. Does anyone know why?

Code:

crontab -e
Code:

0 21 * * * sct 3500
Code:

0 21 * * * redshift -O 3500
Edit: I verified that cron was running with:

Code:

systemctl status cron

michaelk 07-15-2018 04:50 AM

Try using the absolute path to each program.

linustalman 07-15-2018 05:13 AM

Quote:

Originally Posted by michaelk (Post 5879360)
Try using the absolute path to each program.

Hi Michael.

I tried both of these but no joy:

Code:

10 11 * * * /usr/bin/sct 3500
Code:

10 11 * * * '/usr/bin/sct 3500'

michaelk 07-15-2018 05:36 AM

Are you using a users or system cron job?

linustalman 07-15-2018 05:37 AM

Quote:

Originally Posted by michaelk (Post 5879368)
Are you using a users or system cron job?

Users since I don't need to run those commands as root.

michaelk 07-15-2018 06:09 AM

I am not familiar with either program and I don't think sct has any sort of configuration file. Since a cron job is not attached to the display you might need to add a export DISPLAY=:0

10 11 * * * export DISPLAY=:0 && /usr/bin/sct 3500

linustalman 07-15-2018 06:48 AM

Quote:

Originally Posted by michaelk (Post 5879371)
I am not familiar with either program and I don't think sct has any sort of configuration file. Since a cron job is not attached to the display you might need to add a export DISPLAY=:0

10 11 * * * export DISPLAY=:0 && /usr/bin/sct 3500

Cheers Michael. That works! I presume the same applies to Redshift - I no longer have it installed (did a fresh reinstall of Debian 9.4 recently) but if someone else wants to try.

Edit: It also works without the full path, like so:

Code:

10 13 * * * export DISPLAY=:0 && sct 3500


All times are GMT -5. The time now is 02:33 PM.