Keyboard shorcut for Nightlight Gnome 3.24 Ubuntu 17.04

I would like to be able to activate and deactivate the night light feature in Gnome 3.24 with a keyboard command.

Since I cant find any information on the bash command, my only solution is to ask the internet for some assistance.

I'm currently running the ubuntu 17.94 with a Gnome 3.24 shell.


If you are still wanting to know, this command worked for me,

gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true

Changing 'true' to 'false' turns it off. Worked it out after seeing this: https://www.reddit.com/r/gnome/comments/6cvlb6/how_to_configure_night_light_in_gnome_324x/


Chiming in for Ubuntu 18.04 here-- I used the standard keyboard shortcut and was able to use the following command:

bash -c "if [[ $(gsettings get org.gnome.settings-daemon.plugins.color night-light-enabled) == "true" ]]; then gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled false; else gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true; fi"

It's not super readable but it works. It's based on the script that @kapad wrote up on his or her Github; I simply shortened it to a one-liner so you could paste it right in. Now F7 is toggling the nightlight on my system!