3

Night Mode not working in ubuntu 18.04 even after enable from settings. Help me. This problem appeared 2-3 days ago. Before that it was working fine. I tried to install redshit & f.lux as well but didn't help.

debsums:

debsums: changed file /usr/share/mysql-workbench/data/main_menu.xml (from mysql-workbench-data package)

debsums: changed file /usr/share/nginx/html/index.html (from nginx-common package)

  • 1
    You have THREE apps trying to control screen gamma... Night Light, redshift, and f.lux. Don't do that. Remove the last two. Update to 18.04.1, reboot, and recheck Night Light operation. – heynnema Oct 18 '18 at 03:26
  • Thank you for the reply. But I did update to 18.04.1 LTS, rebooted. But still unable to fix. – Rajesh Chaudhary Oct 18 '18 at 07:02
  • In terminal, type sudo debsums -s and edit that output into your original question, not the comments, please. Report back to @heynnema – heynnema Oct 18 '18 at 12:31
  • @heynnema the debsums output is ready & is in question. – Rajesh Chaudhary Oct 18 '18 at 15:27
  • debsums looks good. Try this, to eliminate a system vs user problem. Create a new account called "Guest" (or whatever), log out of your normal account, and into the Guest account. See if Night Light works there. If it does, then there's something in your account directory that's causing the problem. Report back. – heynnema Oct 18 '18 at 15:49
  • As you said, I created a new account & it worked perfect in other account. Night Mode works perfect. Desktop icons being shown in other account. So, now what if I want to recover my current account. – Rajesh Chaudhary Oct 18 '18 at 17:01
  • Good. However, you didn't mention missing desktop icons in your primary account. That's important. Do you have any GNOME extensions installed there? – heynnema Oct 18 '18 at 17:03
  • Yes I do have & couple of extensions installed. – Rajesh Chaudhary Oct 18 '18 at 17:05
  • Turn them all off at https://extensions.gnome.org/local/. Log out. Log back in. And see if Night Light works again. – heynnema Oct 18 '18 at 17:05
  • It didn't work. – Rajesh Chaudhary Oct 18 '18 at 17:10
  • Go to the night-light prefs and turn it off. Close the panel. Turn it back on and see if it works. If not, turn it off again... open a Files (Nautilus) window, hit control-h to view all files, view in line view (vs icon view), sort by mod date, see what the most recently changed folder/file is, and look for something that got changed when you turned off night light. – heynnema Oct 18 '18 at 17:33
  • I can't figure out what the changes are. I think the changes are in .cache, .Xauthority, xsession-errors, etc – Rajesh Chaudhary Oct 19 '18 at 02:45
  • Log into the Guest account that you created. Open Files. Control-h. Look at the files there to know what file might hold the Night Light prefs. Change the Night Light to off to see the mod time change on files to help. Then go back to your original account to find the same files. It's probably something in .config or .local. Report back. – heynnema Oct 19 '18 at 05:46
  • Sorry, but I was unable to do. Why don't you do yourself in my PC like from teamviewer or any other medium. or we should chat ? – Rajesh Chaudhary Oct 19 '18 at 10:18
  • Try this. In your home directory, carefully rename .config to .config.HOLD. Log out. Log in. Don't be overly concerned if things look slightly different, or app prefs aren't right. Check Night Light. If it still doesn't work, rename .local to .local.HOLD. Log out. Log in. Retest Night Light. We'll put it all back together later. Report back. – heynnema Oct 19 '18 at 13:15
  • So, renaming .config to .config.HOLD worked fine. So how to I get back my all configs except that night prefs. – Rajesh Chaudhary Oct 20 '18 at 01:34
  • But there is a problem, I switched to another user and then, that(another user) has the same problem as before. No night light working & desktop icons disappear. – Rajesh Chaudhary Oct 20 '18 at 01:35
  • Make sure to start comments to me with @heynnema, or I'll probably miss them. So... are you saying that after renaming .config to .config.HOLD, logging out, logging in, then desktop icons returned, and Night Light worked again? If so, compress .config.HOLD to a zip file, just for backup purposes. Then move the new .config out to the desktop. Rename .config.HOLD to .config. Move a few INDIVIDUAL files from the desktop .config folder into the .config folder, replacing files when prompted. Do a few. Log out. Log in and retest desktop icons and Night Light. Repeat until it all works. – heynnema Oct 20 '18 at 03:15
  • @heynnema You're great... Thanks for helping me out. – Rajesh Chaudhary Oct 20 '18 at 05:29

4 Answers4

5

Start dconf, and search for night-light, and see if your settings look somewhat similar to this...

enter image description here

Update #1:

Creating a new user account, and logging in there, shows that Night Light works fine. So something is wrong in the original user's account directory.

Update #2:

Renaming .config to .config.HOLD, logging out, logging in, made the desktop icons return, and Night Light worked again. Something is wrong in the .config.HOLD folder.

Compress .config.HOLD to a zip file, just for backup purposes. Then move the new .config out to the desktop. Rename .config.HOLD to .config. Move a few INDIVIDUAL files from the desktop .config folder into the .config folder, replacing files when prompted. Do a few. Log out. Log in and retest desktop icons and Night Light. Repeat until it all works.

heynnema
  • 70,711
  • Yeah, it's similar. But it works in another account. – Rajesh Chaudhary Oct 18 '18 at 17:03
  • Any guess, That is way too much logging in an out – mathtick Dec 09 '18 at 00:09
  • MIght be relevant, am trying now: https://bbs.archlinux.org/viewtopic.php?id=228663 – mathtick Dec 09 '18 at 00:13
  • @mathtick that link has nothing to do with this problem. – heynnema Dec 09 '18 at 02:48
  • +1 for nice detective work. I use Eyesome as Night Light / Red Shift / F.lux replacement without any problems like these though: https://github.com/WinEunuuchs2Unix/eyesome – WinEunuuchs2Unix Dec 14 '18 at 23:48
  • @hyennema not necessary that problem but it did fix my problem and this is a recommender system where we sometimes end up in the same symptom-room with different causes. NoMachine does something bad to the night mode settings. – mathtick Dec 15 '18 at 16:18
  • @mathtick but the OP also had problems with missing desktop icons, and colord/NoMachine's has nothing to do with that. My troubleshooting the .config folder was accurate. – heynnema Dec 15 '18 at 16:25
  • @heynnema yeah, I am not solving OP problem obviously. I just had similar symptoms hence the cross link for others who might land here and have same issue as me (not the OP). Hopefully helpful to someone. – mathtick Dec 16 '18 at 17:34
1

This is in addition to @heynnema's answer. In my case, I simply removed the /home/<username>/.config/dconf folder (You can simply rename it for backup, it contained a single file named 'user'). Then log out and log back in.

Alternatively, use this command to rename the folder:

mv ~/.config/dconf ~/.config/dconf.$(date +%s)

Nothing was broken when I renamed the folder. It was automatically recreated. And there were no noticeable undesired changes.

1

It might have been because you would have changed the "Scheduled Timings" in your Night Light settings and it seems like it doesn't work. You can go change the timings manually and then check.

Also, if you find it a little bothersome to turn it ON & OFF from the settings through the mouse, you can simply make a keyboard shortcut to Toggle Night Light on and Off very easily.

To make things easier, I've written a shellscript to do just that. It works well, and I always use that shortcut to Toggle. Anyone can set it up too! It's easy !! Check this Link for more information : Simplified-Tasks-with-Shell-scripts

1

I think they changed the location of the settings widget, and also the default "sunset to sunrise" schedule may not be very accurate.

After checking the above, look for the "night light" option at the very top in the attached screenshot (I think it was formerly down inside the page but now it's in the title bar which was surprising for me.) Then adjust the color temperature, and maybe adjust the schedule, as desired.

I think part of my issue is that it gets dark here around 6pm, but the "sunset to sunrise" setting seems to activate more towards 8pm.

enter image description here