Photo by Chris Ried on Unsplash
For some tasks like writing I prefer to have my displays set to monochrome / grayscale. This is how I do it on Xubuntu / XFCE.
There are several solutions out there that use xrandr
or ddcutil
but none of them worked for me. I'm using Xubuntu 22.04.2 LTS on a late 2012 Mac mini for some tasks.
So here is how you would do it using xrandr
:
xrandr --output HDMI-3 --set Saturation 0
HDMI-3
is the name of my display.
You can get the name of your display by running xrandr
without any arguments.
Connected displays will be listed like this:
HDMI-3 connected 1920x1200+1920+0 (normal left inverted right x axis y axis) 518mm x 324mm
The solution that actually worked for me was to use libvibrant
and its source can be found on GitHub.
It's said to be build and installed this way:
mkdir build
cd build
cmake ..
make
sudo make install
However, I had to do few more things to get it working:
mkdir build
cd build
# fixes: Could not find X11
sudo apt install libx11-dev
# fixes: The RandR library and headers were not found
sudo apt install xorg-dev libglu1-mesa-dev
# fixes: fatal error: NVCtrl/NVCtrlLib.h: No such file or directory
sudo apt install libxnvctrl-dev
cmake ..
make
# fixes: libvibrant.so.1 cannot open shared object file
sudo /sbin/ldconfig -v*
sudo make install
After that I was able to run vibrant-cli
and it worked like a charm:
vibrant-cli HDMI-3 0
vibrant-cli DP-1 0
To reset the saturation to 100%:
vibrant-cli HDMI-3 1
vibrant-cli DP-1 1
Running this will make it look even better:
xgamma -gamma 0.8
If you create a .desktop
entry for both commands, you easily run them using a launcher like Albert: