Can I manipulate night mode from command line?

Is it possible to change the color temperature of night mode from command line?

1 Like
sudo tee /etc/profile.d/night_light.sh << "EOF"
night_light() {
    if [ -n "${1}" ]
    then
        gsettings set \
            org.gnome.settings-daemon.plugins.color \
            night-light-temperature "${1}"
    else
        gsettings get \
            org.gnome.settings-daemon.plugins.color \
            night-light-temperature
    fi
}
EOF

. /etc/profile
night_light
4 Likes

Should I change the {TEMP _ NEW} to the color temperature I want to set?

No, simply copy-paste as is.
It creates a shell function which can change the color temperature:

$ night_light
4000

$ night_light 5000

$ night_light
5000
1 Like

Thank you, I succeeded. This is Awesome.

2 Likes