diff --git a/README.adoc b/README.adoc index 827c237..b883adb 100644 --- a/README.adoc +++ b/README.adoc @@ -45,3 +45,10 @@ to the settings (see later). == Settings For settings, open the XFCE Settings Editor -> `night-mode` channel. + +=== Switch at a time specified by antoher program + +For example, to use http://jonls.dk/redshift/[Redshift] or another program to +determine when it is night, use `xfce4-night-mode-redshift.sh` (or a modified +version of it) instad of `xfce4-night-mode.sh` in "Generic Monitor plugin +usage". diff --git a/xfce4-night-mode-redshift.sh b/xfce4-night-mode-redshift.sh new file mode 100755 index 0000000..b4daaf9 --- /dev/null +++ b/xfce4-night-mode-redshift.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# XFCE Night Mode controlled by Redshift +# +# https://gitlab.com/bimlas/xfce4-night-mode (main repository) +# https://github.com/bimlas/xfce4-night-mode (mirror, please star if you like the plugin) + +if ( LC_ALL='C' redshift -vo 2> /dev/null | grep "Period: Daytime" > /dev/null ); then + mode='day' +else + mode='night' +fi + +"$(dirname "$0")/xfce4-night-mode.sh" $mode | sed '//,/<\/tool>/ d' +echo " + Night mode defined by RedShift + Click to toggle mode for a while + "