Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

6
Become a Fan
7.8

Available as/for:
Description:
Nightmode is a kwin plugin that makes the entire screen darker. The reason behind this for when you are using the laptop at night, either outside or in bed - and find that even on the darkest screen backlight level the screen is way too bright.

The plugin can be turned on or off by a simple key combination, and the amount of dimming can be configured.
Last changelog:

0.2: Added icon made by srog.
0.2: Ubuntu package by srog


Ratings & Comments

47 Comments

bugsbane

The Ubuntu package link goes to a 404, so I tried compiling on Plasma 5, but just get: CMake Error at CMakeLists.txt:11 (include): include could not find load file: KDE4Defaults CMake Error at CMakeLists.txt:12 (include): include could not find load file: MacroLibrary CMake Error at CMakeLists.txt:17 (kde4_add_plugin): Unknown CMake command "kde4_add_plugin". -- Configuring incomplete, errors occurred! Is there any way to use this beautiful plugin any more?

srog

The Ubuntu link was pointing to a PPA. The PPA was removed 12.7.2015 - more: https://www.kubuntuforums.net/showthread.php?68160-Qmplay2&p=375638&viewfull=1#post375638 This KWin effect uses the KDE4 but I don't think that it works with the KF5 - without the developers love.

srog

The Ubuntu link was pointing to a PPA. The PPA was removed 12.7.2015 - more: https://www.kubuntuforums.net/showthread.php?68160-Qmplay2&p=375638&viewfull=1#post375638 This KWin effect uses the KDE4 but I don't think that it works with the KF5 - without the developers love.

dantefff

As the title said, I could compile and install, but no new effect has appeared int the control panel. Is there anytnig I can do to debug it? Can I force it to load in the all effects tab? I am in solydk (debian based) and kde 4.12.1

bugsbane

[100%] Building CXX object CMakeFiles/kwin4_effect_nightmode.dir/nightmode.o /home/user/Apps/nightmode/nightmode.cpp: In member function ‘virtual void NightmodeEffect::paintWindow(KWin::EffectWindow*, int, QRegion, KWin::WindowPaintData&)’: /home/user/Apps/nightmode/nightmode.cpp:77:49: error: invalid use of member function (did you forget the ‘()’ ?) make[2]: *** [CMakeFiles/kwin4_effect_nightmode.dir/nightmode.o] Error 1 make[1]: *** [CMakeFiles/kwin4_effect_nightmode.dir/all] Error 2 make: *** [all] Error 2 Man I wish this would just get added in KDE by default. I mean we have the explosion effect that I've never seen anyone use and but not this... :|

mrm0j0risin

My programming knowledge covers only M$ Windows systems, but I've been using Ubuntu 12.04 and Kubuntu KDE on my home system over the last year, and I find this plugin really useful. I don't know the KDE API, but after examining the header files, it seems that now the brightness member variable, which belongs to the class WindowPaintData can change value only if you use a member function. To solve this problem, the line 77 in source file nightmode.cpp : data.brightness *= (m_brightness / 100.0); should be changed to: data.setBrightness(data.brightness() * (m_brightness / 100.0)); and the plugin will compile and work properly with KDE 4.10, but as I don't have the necessary qualifications, someone who knows the platform must verify my assumptions.

srog

Well - it is workig - so it is good ;) Thank you of the fix.

bugsbane

It's one of the first things I install each time I reinstall my distro(s). Any chance the darkest setting could be made darker? Ideally the slider would go from 5% (yes, barely visible) brightness to 95%. I don't know the numbers, but right now it looks like it goes from about 25% to 90% I tried to poke around in the code and find it myself, but having the coding experience of a walrus, it generally fell down in a blubbery heap. Anyway, thanks for creating this must have, keeps-my-kids-asleep-and-my-spouse-happy plugin. It rocks! :D

bugsbane

Working perfectly now on my Chakra install, running KDE 4.8. Love that I didn't even need to log out before the effect showed up in the "All effects" tab. Thanks again for this very simple, but incredibly handy effect!

bugsbane

Using the version from: git clone git://anongit.kde.org/scratch/davidedmundson/nightmode

acidrums4

Hello, I love your plugin, it's very useful to me. However, since I updated my Gentoo box to 4.8, Nightmode stopped working. I tried compiling it again, but I get the following: [ 0%] Built target kcm_kwin4_effect_nightmode_automoc [ 25%] Building CXX object CMakeFiles/kcm_kwin4_effect_nightmode.dir/nightmode_config.o /home/mp/Escritorio/nightmode/nightmode_config.cpp: In member function 'virtual void KWin::NightmodeConfig::load()': /home/mp/Escritorio/nightmode/nightmode_config.cpp:88: error: variable 'KConfigGroup conf' has initializer but incomplete type /home/mp/Escritorio/nightmode/nightmode_config.cpp:88: error: invalid use of incomplete type 'struct KConfigGroup' /usr/include/kconfigbase.h:32: error: forward declaration of 'struct KConfigGroup' /home/mp/Escritorio/nightmode/nightmode_config.cpp: In member function 'virtual void KWin::NightmodeConfig::save()': /home/mp/Escritorio/nightmode/nightmode_config.cpp:99: error: variable 'KConfigGroup conf' has initializer but incomplete type /home/mp/Escritorio/nightmode/nightmode_config.cpp:99: error: invalid use of incomplete type 'struct KConfigGroup' /usr/include/kconfigbase.h:32: error: forward declaration of 'struct KConfigGroup' make[2]: *** [CMakeFiles/kcm_kwin4_effect_nightmode.dir/nightmode_config.o] Error 1 make[1]: *** [CMakeFiles/kcm_kwin4_effect_nightmode.dir/all] Error 2 make: *** [all] Error 2 I don't know much about C++, but for my ignorance seems that the API of KDELibs changed (at least, for 'KConfigGroup')...

DavidEdmundson

Partly my fault. Try this version git clone git://anongit.kde.org/scratch/davidedmundson/nightmode Let me know if it fixes it/is still broken.

bugsbane

Since upgrading from Kubuntu 11.04 to 11.10, my Night Mode just stopped doing anything at all. I grabbed your new code above, recompiled and installed without a problem, but I still don't see any effect. I have darkness turned way down and I've tried changing the keyboard shortcut. No dice. I am getting a "The following plugins can't be activated: Darken screen for night viewing" popup. This is odd as I've used Nightmode on Kubuntu+FGLRX on this machine before. Can I do anything to get you more useful information? Night mode is such a crucial plugin to me. I still don't understand how the explode plugin is included by default but not this...

bugsbane

Since upgrading from Kubuntu 11.04 to 11.10, my Night Mode just stopped doing anything at all. I grabbed your new code above, recompiled and installed without a problem, but I still don't see any effect. I have darkness turned way down and I've tried changing the keyboard shortcut. No dice. I am getting a "The following plugins can't be activated: Darken screen for night viewing" popup. This is odd as I've used Nightmode on Kubuntu+FGLRX on this machine before. Can I do anything to get you more useful information? Night mode is such a crucial plugin to me. I still don't understand how the explode plugin is included by default but not this...

DavidEdmundson

Chances are they've changed some internal aspect of the kwin API without telling anyone. I'm very busy at the moment, but remind me constantly (you can see my email at the top of any of the source files) and I'll get round to it. Alternately you can possibly post on the kwin bugzilla page saying "you've broken this plugin". It's a bit rude, but I think technically valid. KDE Libs isn't allowed to break compatibility within a 4.x series.

avlas

I'm also in kubuntu 11.10 with kde 4.8 rc2 and it works with no issues. I used the code from git indicated above

acidrums4

Git version not working on KDE 4.8 :(

dcimafonte

I'm actually getting: ~/.xsession-errors Quote:

OpenGL vendor string: Tungsten Graphics, Inc OpenGL renderer string: Mesa DRI Intel(R) 945GM x86/MMX/SSE2 OpenGL version string: 1.4 Mesa 8.0.4 OpenGL shading language version string: 1.20 Driver: Intel GPU class: i915/i945 OpenGL version: 1.4 GLSL version: 1.20 Mesa version: 8.0.4 X server version: 1.11.3 Linux kernel version: 3.2 Direct rendering: yes Requires strict binding: yes GLSL shaders: limited Texture NPOT support: yes kwin(2769) KWin::EffectsHandlerImpl::loadEffect: Effect "kwin4_effect_nightmode" requires unsupported API version 157

bugsbane

I get compiling breaking saying that kwineffects.h can't be found. In previous versions of Kubuntu this was in kdebase-workspace-dev. This is now replaced in 11.10 by kde-workspace-dev, but kwineffects.h doesn't seem to exist in that file. Helpfully apt-file no longer works either, so I have no idea how to get past this. Any ideas?

DavidEdmundson

Appears to be a Kubuntu packaging bug. I'm on Kubuntu too. Will report it

cmoh

Hello. I have been using your nightmode desktop effect for a while now, and it is an exceptionally useful plugin. However, the source code link is not working now. Also the link from kde-apps.org is broken. What happened? Can you put it back?

DavidEdmundson

I updated my personal website, and forgot to update everything that links to it. Sorry! Fixed now.

cmoh

Thanks for your quick response! For reference, here is the gentoo bug report containing the Gentoo ebuild responsible for bringing your nice plugin on my machines. http://bugs.gentoo.org/show_bug.cgi?id=317291

tomsdale

Hi, Your plugin stopped working when I upgraded to KDE 4.5.X. It was running fine on 4.4.X. Is this just my configuration or is there an incompatibility with 4.5? I totally love your plugin. I have an external screen attached and while I can control the laptop with software your plugin allows me to just 'dim it down' at night which is so much easier on the eyes.

DavidEdmundson

There is a binary incompatibility. i.e the code stays the same, but it needs to be compiled again against KDE4.5

Pling
0 Affiliates
Details
license
version 0.2
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 2

Other Various KDE 1.-4. Improvements:

Slicker Debian Package for Woody
cirrusgr
last update date: 22 years ago

Score 5.0

Konqueror/kdesktop suggestion
PovMan
last update date: 22 years ago

Score 5.0

Biiig buttons
dbojan
last update date: 20 years ago

Score 5.0

Yet Another KControl
Frans
last update date: 21 years ago

Score 5.0

Next window and next/previos window
dbojan
last update date: 20 years ago

Score 5.0

Fantasie Toolbar
katoe
last update date: 19 years ago

Score 5.0