Blugon – A Blue Light Filter for X

I have been covering a series of command-line apps/tool recently including Cookie, Sway, and takeover.sh. Today, I came across an app that will end all your (potential) blue light problems and it goes by the name of Blugon.

Blugon is a lightweight configurable command line Blue light filter for X. You can run it once or as a daemon (manually or via systemd). It works effectively by calculating the screen colour from your system time and configuration.

Blugon also supports several backends including tty for running blugon on your TTY, and xgamma.

Blugon – A Blue Light Filter for X
Blugon – A Blue Light Filter for X

Features in Blue Light Filter

  • Open source and freely available for Linux distributions.
  • Source code available on GitHub.
  • Supports several backends includingxgamma, tty, and scg.

Blugon’s dependencies are Python, libx11, libxrandr, and the optional xorg-xgamma backend.

How to Install Blugon in Linux

First, install the following required dependencies and clone the Blugon’s source code from the git repository as shown.

$ sudo apt install libxrandr2 libxrandr-dev libx11-dev
$ git clone https://github.com/jumper149/blugon.git

Now you can build and install Blugon in Linux as shown.

$ cd blugon/
$ make
$ sudo make install

Blugon Configuration

You can use the default configuration as a template:

$ mkdir -p ~/.config/blugon/
$ cp /usr/share/blugon/configs/default/gamma ~/.config/blugon/gamma
$ blugon --printconfig > ~/.config/blugon/config

Otherwise, you can find configuration examples in your /usr/share/blugon/configs/ directory.

Blugon Usage

Start blugon from the terminal:

$ blugon

Run it in the background with:

$ (blugon&)          # to start
$ killall blugon         # to stop

To run blugon with systemd, enable the service as a user with the command:

$ systemctl --user enable blugon.service

You can use the current-mode to manually control colour temperature (e.g. with keyboard shortcuts) without using a daemon:

$ blugon --setcurrent="+600"    # for more blue
$ blugon --setcurrent="-600"    # for more red

As usual, you can use the -h flag for help or the more intensive man-page:

$ man blugon

Blugon Options

  • -o or --once implements gamma values using the current time.
  • -S or --setcurrent sets the colour temperature.
  • -s or --simulation simulates the configuration for the whole day.
  • -f or --fade fades in screen colour on startup.
  • -i [secs] or --interval=[secs] sets the time between refreshes.
  • -c [path] or --configdir=[path] specifies a configuration directory.
  • -b [backend] or --backend=[backend] for choosing the backend for communicating with X.

Are there scripts or applications for managing blue light that you know of? Drop your comments, questions, and opinion on Blugon in the discussion section.

Divine Okoi is a cybersecurity postgrad with a passion for the open-source community. With 700+ articles covering different topics in IT, you can always trust him to inform you about the coolest tech.

Each tutorial at GeeksMint is created by a team of experienced writers so that it meets our high-quality writing standards.

3 thoughts on “Blugon – A Blue Light Filter for X”

  1. I have a problem with make command. Any idea?

    sed “s|MAKE_INSTALL_PREFIX = ‘.*’|MAKE_INSTALL_PREFIX = ‘/usr’|g” blugon.py > blugon

    gcc -std=c99 -O2 -I /usr/X11R6/include -o backends/scg/scg backends/scg/scg.c -L /usr/X11R6/lib -lm -lX11 -lXrandr

    In file included from backends/scg/scg.c:1:0:

    /usr/include/X11/Xlib.h:38:10: fatal error: sys/types.h: No such file or directory

    #include

    ^~~~~~~~~~~~~

    compilation terminated.

    Makefile:5: recipe for target ‘build’ failed

    make: *** [build] Error 1

    Reply
  2. Thanks for this guide! Im desperatly looking for a working app for filtering the blue light. I got it working perfectly on my macbook, android phones, ubuntu with Gnome on this laptop. But to get a good bluelight filtering to work good outside Gnome seems harder than hell :/

    Reply

Got Something to Say? Join the Discussion...