Coder Social home page Coder Social logo

redshift-continuous's Introduction

Note, the Redshift author has implemented a new feature for custom dawn/dusk times (jonls/redshift#529), which will make this script obsolete.

Cron script for continuous Redshifting at arbitrary times

This is designed to work with Redshift: https://github.com/jonls/redshift

Uses bc for math, only other dependencies are bash and redshift as mentioned above.

Example crontab setup

I've set it up like this:

cd
mkdir bin
cd bin
ln -s <repo path>/redshift-continuous.sh

This will run it every 5 minutes. By default it will tween the screen temperature from 7-8am for dawn, and 9-10pm for dusk. You can change this by editing the 'case' block within the script.

*/5 * * * * /home/<username>/bin/redshift-continuous.sh >> /home/<username>/redshift-continuous.log 2>&1

Example systemd.timer setup

For those of us stuck using systemd or like me too lazy to install a cron replacement, this is how i make things work:

In ~/.config/systemd/user/redshift-continuous.service:

[Unit]
Description=Continuously interpolate Redshift colour temperature

[Service]
Type=oneshot
StandardOutput=syslog
StandardError=syslog
ExecStart=/home/USERNAME/bin/redshift-continuous.sh

In ~/.config/systemd/user/redshift-continuous.timer:

# Because of the filenames matching, no need to point explicitly to
# the service file.
[Unit]
Description=Run redshift-continuous.service every 5 minutes

[Timer]
# Every 5 minutes:
OnUnitActiveSec=5m

[Install]
WantedBy=timers.target

Now, run the following commands to make it all work:

systemctl --user daemon-reload
systemctl --user enable redshift-continuous.service
systemctl --user enable redshift-continuous.timer

This is equivalent to the crontab-style setup above.

redshift-continuous's People

Contributors

linusrachlis avatar toothbrush avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.