Blue Light Filter in XFCE (Redshift)

Introduction

This guide will help you to quickly configure blue light filter in Qubes OS with XFCE desktop environment.

Redshift

Installation

type sudo qubes-dom0-update redshift in dom0 terminal and confirm installation by y

!

Remember that installing anything in dom0 is not recommended for security reasons

Configuration

Create confiig file - dom0 terminal:

  • cd .config

  • nano redshift.conf
    You will create an empty file in path ~/.config/redshift.conf. Here you have to set values:
    your location*, Day/Night Color. Here is explained sample with more functionality.
    Basic configuration looks like:

     [redshift]
     temp-day=6400
     temp-night=3200
     adjustment-method=randr
     location-provider=manual
    
     [manual]
     lat=xx.xxxxx
     lon=xx.xxxxx
    

Where xx.xxxxx are my city latitude and longitude

  • Save this configuration file
  • Type redshift in dom0 to start the program. It will load previously saved configuration.
  • You can turn it off again by running killall redshift in a dom0 terminal

*Location is needed to know when actually sun sets for you. To find city longitude and latitude you can use geonames.org
Alternatively, use fixed times in the config file; that way you don’t need to come up with a location:

[redshift]
temp-day=6400
temp-night=3200
dawn-time=07:00-08:00
dusk-time=21:30-22:30

Automation/Startup

we need to create script ~/.startupscripts/redshift.sh, open dom0 terminal

  • mkdir .startupscripts

  • cd .startupscripts

  • nano redshift.sh

  • paste:

      #!/bin/sh
      sleep 2
      redshift
    
  • save

  • chmod +x redshift.sh - (this makes script executable)

  • Add redshift to autostart in xfce settings

    Name: Redshift
    Description: Blue light filter
    Command: sh /home/USERNAME/.startupscripts/redshift.sh

Documentation

If You want to copy this to the Qubes OS documentation, sure :slight_smile: it’ll be faster to find.

13 Likes

Now that I can use redshift, this came in very handy–a simple, effective, well-written guide even for non-technical people like me.

Without this, I would’ve had to manually type redshift -O 3000 everytime I wanted to dim the screen. Thanks a bunch!

2 Likes

@BBro thanks for your useful guide.

I suggest you add it to qubes-doc git repository, following the doc-guidelines

2 Likes

IMPORTANT UPDATE

  • Manage Redshift using GUI on system tray. [With it you can e.g. suspend Redshift, which is painful without this tool]
  • security advice, reread whole article.

Introduction

This guide will help you to quickly configure blue light filter in Qubes OS


Redshift

Installation

type sudo qubes-dom0-update redshift in dom0 terminal and confirm installation by y
type sudo qubes-dom0-update redshift-gtk in dom0 terminal and confirm installation by y

Configuration

Create confiig file - dom0 terminal:

  • cd .config
  • nano redshift.conf
    You will create an empty file in path ~/.config/redshift.conf . Here you have to set values:
    your location*, Day/Night Color. Here is explained sample with more functionality.
 [redshift]
 temp-day=6400
 temp-night=3200
 adjustment-method=randr
 location-provider=manual

 [manual]
 lat=xx.xxxxx
 lon=xx.xxxxx

Where xx.xxxxx are my city latitude and longitude

  • Save this configuration file
  • Type redshift in dom0 to start the program. It will load previously saved configuration.

*Location is needed to know when actually sun sets for you. Without that parameter, redshift may not work. In ordinary Linux system, redshift uses location services like geoclue but i don’t know if it’ll work on qubes as dom0 shouldn’t have internet access and the location provider needs IP to determine your location. You can always check it, read the archwiki.
To find city longitude and latitude you can use geonames.org

Important Note:
I suggest not to give your true location because crackers after this guide has been written may use this file to know your location. Just pick another country that is “close” and has similar latitude.

Automation/Startup

Open dom0 terminal and type redshift-gtk, in your system tray redshift icon will appear, then click on it and mark checkbox called autostart. Reboot device.
(For these, who configured auto-start from this guide, you have to delete previously created configuration in settings and script - it’s no longer needed, and will interrupt second package)

Documentation

Notes, Moderators

It may also work on KDE, so maybe we should change the title to: [HOW-TO] Blue Light Filter

Moderators: could you please replace first post with this update content? I have no rights :slight_smile: I’ll try later to go through mentioned Qubes community documentation but believe me that I have lot of work and no time…

6 Likes

Does anyone know if a VM can detect redshift’s color change?

If a process inside a whonix VM can detect the color change, it may be able to determine a rough timezone / geographic location.

From my very limited testing, turning redshift on/off from dom0 does not seem to change pixel color values as read by a color picker installed in a VM (xcolor from https://github.com/Soft/xcolor).

Thanks for this guide!

What do you mean?

Ctrl+Z to suspend or Ctrl+C to kill the process and ‘fg’ to bring it back from suspend or simply ‘redshift’ when I want it to start again.

Thanks all for this useful information! :+1:

I just made a bash script that asks for temperature and brightness. I also use.l redshift -x in it so the filters dont.accumulate.

Good guide! Thanks!

today yields No match for argument: redshift Any ideas? Thanks!

What

$ sudo dnf list *redshift*

in dom0 gives (with asterisks)?

No packages available.

I noticed that the green sys-firewall dialogue box complains about:

sudo qubes-dom0-update redshift
...
Errors during downloading metadata for repository fedora:
Curl error 60: SSL peer certificat or SSH remote key was not OK for ...mirrors... (SSL certificate problem)

You’ll have to describe your net configuration in details.

OK. I have just installed another QubesOS on a Workstation: the problem as described does not exist.

The Laptop discussed here is also a fresh install with no tweaks: the problem exists. I compared sys-net for both installations looking at Settings but did not see a diference.

Problem solved. The net stack has not been informed on the correct time. After waiting for an hour watching the clock, all the above dom0 commands work.

Good that you made it. Please mark your post as a solution so it could help others too.

1 Like

is not possible.

You can do it now. I changed category, because it genuinely belongs to support.

Moderation comment

Respectfully disagree with moving entire thread to User Support. Redshift guide is useful no? Only my opinion but @BBro contribution belongs in guides imo. best…

2 Likes

You were absouletly right. I apologize not being focused at the moment! Thanks for pointing out!

1 Like