Skip to content

A tool to adjust gamma and color tint for Wayland compositors.

License

Notifications You must be signed in to change notification settings

cswingley/wlgamma

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wlgamma

A tool to adjust gamma and color tint for Wayland compositors.

Building

Run the following commands to build the project:

mkdir -p build
cd build
cmake ..
make wlr-gamma-control-header wlr-gamma-control-source
cmake .. # This second invocation is required to detect the additional source files generated by the preceding step
make

After building compiled binary can be found in the bin directory.

Installing

After running the commands above run the following command in the build directory to install to your system globally:

sudo make install

Usage

To darken the red channel while leaving everything else untouched:

wlgamma -r 0.9

To set the gamma for all channels:

wlgamma -G 1.1

To apply a complex effect:

wlgamma -r 0.5 -g 1.5 -b 0 -G 1.6

To undo the effect simply kill the program.

Troubleshooting

If the program fails to find your Wayland compositor please make sure one is running and that the WAYLAND_DISPLAY environment variable is configured correctly in the environment in which the program is running.

If the program fails to find zwlr_gamma_control_manager_v1 this is probably because your Wayland compositor does not support the required extension. The required extension is wlr-gamma-control-unstable-v1. Check the documentation of your Wayland compositor for more information.

Internally the program works by passing per-channel gamma ramps to the Wayland compositor. These ramps are generated according to the following equation:

y = (x * multiplier)^(1 / gamma)

Where gamma is the user-supplied gamma value, multiplier is the user supplied channel-specific multiplier and x is a value between 0 and 1 inclusive indicating the position on the ramp.

Credit & License

Developed by Amini Allight, licensed under the GPL 3.0 except for wl/wlr-gamma-control-unstable-v1.xml, taken from here, which is included under the terms of the license found within the file itself.

Many thanks to Kenny Levinsen for developing wlsunset, a similar program which was a great help in learning how to use the wlr-gamma-control extension correctly.

About

A tool to adjust gamma and color tint for Wayland compositors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 85.0%
  • CMake 8.2%
  • Roff 6.8%