项目作者: qualiaa

项目描述 :
Useful hooks for redshift (http://github.com/jonls/redshift)
高级语言: Shell
项目地址: git://github.com/qualiaa/redshift-hooks.git
创建时间: 2018-09-06T22:36:32Z
项目社区:https://github.com/qualiaa/redshift-hooks

开源协议:GNU General Public License v3.0

下载


Redshift hooks

Hooks to enhance redshift‘s abilities.

  • brightness.sh - Set screen backlight brightness according to time of day.
  • colorscheme.sh - Live-reload terminal colorscheme according to time of day

Installation

For each script, copy from hooks/script_name to
.config/redshift/hooks/script_name. Each script may have its own installation
instructions.

brightness.sh

Set screen backlight brightness according to time of day.

The default brightnesses for day, transition and night are 90, 60, 35, and the
default fade time is one hour. If you wish to alter them, you can find them at
the top of the script.

Using acpi-brightness

By default, brightness.sh uses
acpi-brightness. If using it, you will
have to change the line

  1. readonly brightness=$HOME/usr/bin/brightness

to point to the location of the acpi-brightness script.

Using xbacklight

If you wish to use xbacklight, you will need to replace the brightness
function with something like

  1. brightness() {
  2. local seconds=${1:-0}
  3. local steps=$((seconds * 100))
  4. xbacklight -time $((seconds*1000)) -set $percent
  5. }

However, I have not tested this as xbacklight does not work on my system.

colorscheme.sh

Live-reload terminal colorscheme according to time of day.

By default, this switches between solarized light and solarized dark.

With URxvt

  • Install
    urxvt-config-reload
  • Copy Xresources.d to your ~/.Xresources.d
  • Add #include ".Xresources.d/solarized" to .Xresources file
  • (optional) Copy dircolors.ansi-dark from
    seebi/dircolors-solarized to
    ~/.dircolors.ansi-dark, and the same for dircolors.ansi-light

With other terminals

This currently only works for URxvt using
urxvt-config-reload, though you
may be able to rewrite the update_terminal() function to work with your
terminal of choice.

Note that for best behaviour you need to change the colorscheme of running
terminals, and also the global configuration for new terminals. Some terminals
may automatically reload changes to their configuration, but in general to
change running terminals you need to send control codes directly. Someone has
already done this
for Gnome terminal.

Acknowledgements

Licence

All code is licensed under the GNU General Public Licence v3.0.