Configuring redshift
This commit is contained in:
parent
4cfc692186
commit
1948ab154b
16
Makefile
16
Makefile
@ -1,13 +1,19 @@
|
||||
SOURCES := $(shell ls | grep -E -v 'README|Makefile')
|
||||
TARGETS := $(patsubst %,$(HOME)/.%,$(SOURCES))
|
||||
TOP_SOURCES := $(git ls-files | grep -vE 'README|Makefile|^config|^\.git|^\.travis' | grep -v /)
|
||||
CONFIG_SOURCES := $(shell git ls-files config)
|
||||
TARGETS := \
|
||||
$(patsubst %,$(HOME)/.%,$(TOP_SOURCES)) \
|
||||
$(patsubst %,$(HOME)/.%,$(CONFIG_SOURCES))
|
||||
|
||||
$(HOME)/.%: %
|
||||
$(RM) '$@' && ln -svf '$(PWD)/$^' '$@'
|
||||
$(RM) '$@' && mkdir -p $(dir $@) && ln -svf '$(PWD)/$^' '$@'
|
||||
|
||||
.PHONY: all
|
||||
all: $(TARGETS)
|
||||
all: $(HOME)/.config $(TARGETS)
|
||||
|
||||
$(HOME)/.config:
|
||||
mkdir -p $@
|
||||
|
||||
.PHONY: echo
|
||||
echo:
|
||||
@echo SOURCES=$(SOURCES)
|
||||
@echo TOP_SOURCES=$(TOP_SOURCES)
|
||||
@echo TARGETS=$(TARGETS)
|
||||
|
6
config/redshift.conf
Normal file
6
config/redshift.conf
Normal file
@ -0,0 +1,6 @@
|
||||
[redshift]
|
||||
temp-day=6500
|
||||
temp-night=3000
|
||||
transition=1
|
||||
brightness-day=1.0
|
||||
brightness-night=0.8
|
26
config/redshift/hooks/brightness.sh
Executable file
26
config/redshift/hooks/brightness.sh
Executable file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
main() {
|
||||
: "${BRIGHTNESS_DAY:=100}"
|
||||
: "${BRIGHTNESS_TRANSITION:=50}"
|
||||
: "${BRIGHTNESS_NIGHT:=20}"
|
||||
: "${FADE_TIME:=60000}"
|
||||
|
||||
if [[ "${1}" != period-changed ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
case "${3}" in
|
||||
night)
|
||||
xbacklight -set "${BRIGHTNESS_NIGHT}" -time "${FADE_TIME}"
|
||||
;;
|
||||
transition)
|
||||
xbacklight -set "${BRIGHTNESS_TRANSITION}" -time "${FADE_TIME}"
|
||||
;;
|
||||
daytime)
|
||||
xbacklight -set "${BRIGHTNESS_DAY}" -time "${FADE_TIME}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
Reference in New Issue
Block a user