#gamma #brightness #sunset #sunrise #command-line #eye-strain

bin+lib reddish-shift

Set color temperature of display according to time of day

3 releases

0.1.2 Jul 16, 2024
0.1.1 Jun 27, 2024
0.1.0 Jun 27, 2024

#916 in Command line utilities

Download history 28/week @ 2024-09-10 13/week @ 2024-09-17 21/week @ 2024-09-24 20/week @ 2024-10-01

141 downloads per month

GPL-3.0-or-later

225KB
4.5K SLoC

Reddish Shift

Build Coverage Crates.io Support

A port of Redshift. Translated line by line with the help of C2Rust.

Reddish Shift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.

Installation

REPOSITORIES

Cargo
cargo install reddish-shift
Archlinux
paru -S reddish-shift
paru -S reddish-shift-bin
paru -S reddish-shift-git

Usage

For a quick start, run:

reddish-shift daemon --location LATITUDE:LONGITUDE

replace LATITUDE and LONGITUDE with your current geolocation.

To see all available commands:

reddish-shift -h

To see all available options for a given command (e.g. daemon):

reddish-shift daemon --help

Note that using --help instead of -h prints a more detailed help message.

A configuration file can also be used. It should be saved in the following location depending on the platform:

  • Linux: $XDG_CONFIG_HOME/reddish-shift/config.toml or $HOME/.config/reddish-shift/config.toml if $XDG_CONFIG_HOME is not set or /etc/reddish-shift/config.toml for system wide configuration
  • macOS: $HOME/Library/Application Support/reddish-shift/config.toml
  • Windows: %AppData%\reddish-shift\config.toml

Building

Run cargo build --release --all to build these files:

  • target/release/reddish-shift: the main program
  • target/release/man1/: man pages
  • target/release/completion/: various shell completion scrips

RoadMap

  • Linux
    • XRANDR gamma adjustment
    • XVidMode gamma adjustment
    • DRM gamma adjustment
    • reddish-shift-gtk (from redshift-gtk)
    • systemd service, apparmor config (from redshift/data)
  • Windows
    • Win32gdi gamma adjustment
  • Support installation with: Appimage, AUR, DEB, PPA, MSI, Choco
  • Geoclue2 location provider
  • Real screen brightness control (experimental)
  • Supporting macOS is not planned currently. Contributions are welcomed.
  • Unit testing
  • Automatic Conversion from Redshift's config file to reddish-shift/config.toml

License

This project is licensed under the terms of GNU General Public License v3.0.

Dependencies

~15–59MB
~1M SLoC