Flash Guard is an adaptive dimming utility to dynamically darken bright screen contents
As a chronic migraine sufferer, the sudden contrast difference from dark applications to bright white pages is a big trigger.
Sure, I used to use Dark Reader, but there are some issues with it:
- It doesn't always render images, diagrams, etc. properly
- Some pages don't work
- Only works in your browser. What about applications that don't support dark mode?
Note
Only X11 is supported
Clone the repo and build the project:
git clone https://github.com/buxxket/flashguard
cd flashguard
make install
This builds the binary, installs a systemd service to handle starting the
program, and creates a basic config file at ~/.config/flashguard/flashguard.config.
There are a few knobs you can turn to adjust the dimming speed and amount. The
config file lives in ~/.config/flashguard/flashguard.config.
If you want to start from the shipped defaults, copy the file from the repo
root or let make install create one for you. A complete example config is
shown below:
# Flash Guard
#
# All values are optional. Remove a line to fall back to the built-in default.
fps=144 # update frequency in frames per second
min_brightness=0.6 # minimum screen brightness
max_brightness=1.0 # maximum screen brightness
curve_start_avg=0.10 # average luminance where dimming begins
curve_end_avg=0.95 # average luminance where dimming ends
curve_gamma=0.5 # curve steepness
curve_shoulder=0.35 # curve shoulder
avg_input_gamma=1.0 # input gamma applied to sampled brightness
avg_bias=0.0 # bias applied to sampled brightness
brightness_smoothing=0.0 # smoothing factor from 0 to 1
grid_x=40 # horizontal sample grid size
grid_y=24 # vertical sample grid sizeThe most useful settings are:
fpsfor how often the screen is sampled.min_brightnessandmax_brightnessfor the allowed brightness range.curve_start_avgandcurve_end_avgfor where dimming starts and ends.grid_xandgrid_yfor the sampling grid size.
You can start the Flash Guard with systemd:
systemd --user start flashguard.serviceTo enable Flash Guard to start automatically when you login to your system, you
can enable the systemd service:
systemd --user enable --now flashguard.serviceYou can stop Flash Guard with:
systemd --user stop flashguard.serviceTo disable auto-start, disable the systemd service:
systemd --user disable flashguard.serviceLike any systemd service, you can view the logs via journalctl:
journalctl --user -fu flashguard.service