LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-05-2018, 02:40 PM   #1
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Question 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.
 
Old 07-05-2018, 07:05 PM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.2
Posts: 7,809
Blog Entries: 58

Rep: Reputation: Disabled
Maybe from system time or hardware clock time? I only tried Redshift briefly a while ago, wasn't keen on it.
 
Old 07-06-2018, 07:35 AM   #3
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Quote:
Originally Posted by brianL View Post
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?
 
Old 07-06-2018, 11:51 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,400

Rep: Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090
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/
 
1 members found this post helpful.
Old 07-07-2018, 03:51 AM   #5
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Thumbs up

Quote:
Originally Posted by michaelk View Post
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.
 
Old 07-11-2018, 04:49 AM   #6
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Post

I've certainly been sleeping better after using Redshift.
 
Old 07-14-2018, 05:51 AM   #7
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Lightbulb

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
 
Old 07-15-2018, 05:17 AM   #8
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Question

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

Last edited by linustalman; 07-15-2018 at 05:40 AM.
 
Old 07-15-2018, 05:50 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,400

Rep: Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090
Try using the absolute path to each program.
 
Old 07-15-2018, 06:13 AM   #10
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Unhappy

Quote:
Originally Posted by michaelk View Post
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'
 
Old 07-15-2018, 06:36 AM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,400

Rep: Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090
Are you using a users or system cron job?
 
Old 07-15-2018, 06:37 AM   #12
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Quote:
Originally Posted by michaelk View Post
Are you using a users or system cron job?
Users since I don't need to run those commands as root.
 
Old 07-15-2018, 07:09 AM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,400

Rep: Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090Reputation: 3090
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
 
1 members found this post helpful.
Old 07-15-2018, 07:48 AM   #14
linustalman
Senior Member
 
Registered: Mar 2010
Location: Ireland
Distribution: Debian 10 (Buster) x64
Posts: 3,756

Original Poster
Rep: Reputation: 401Reputation: 401Reputation: 401Reputation: 401Reputation: 401
Thumbs up

Quote:
Originally Posted by michaelk View Post
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

Last edited by linustalman; 07-15-2018 at 08:11 AM.
 
  


Reply

Tags
day, night, redshift, sleep


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick question...Ubuntu8.04 livecd and internet access stoppage Ubuntu 2 01-30-2010 07:01 AM
Question re Internet Access/Email Access Sulli1 Linux - Newbie 5 04-28-2009 08:53 AM
Slackware 10.0 - no internet access and other question Focalpoint Linux - Newbie 5 07-05-2004 07:55 PM
internet access question? samills70 Linux - Software 1 06-14-2004 03:09 PM
Linux internet access (Stupid newbie question) Phr33za Linux - Newbie 11 04-01-2002 06:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration