Nightmode

Various KDE 1.-4. Improvements

Source (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
Score 80.0%
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:

8 years ago

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

9

bugsbane

4 years ago

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?

Report

9

srog

3 years ago

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.

Report

9

srog

3 years ago

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.

Report

dantefff

5 years ago

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

Report

9

bugsbane

6 years ago

[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... :|

Report

mrm0j0risin

6 years ago

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.

Report

9

srog

6 years ago

Well - it is workig - so it is good ;)

Thank you of the fix.

Report

9

bugsbane

7 years ago

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

Report

9

bugsbane

7 years ago

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!

Report

9

bugsbane

7 years ago

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

Report

acidrums4

8 years ago

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')...

Report

C

DavidEdmundson

8 years ago

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.

Report

9

bugsbane

7 years ago

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...

Report

C

DavidEdmundson

7 years ago

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.

Report

dcimafonte

6 years ago

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

Report

acidrums4

7 years ago

Git version not working on KDE 4.8 :(

Report

avlas

7 years ago

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

Report

9

bugsbane

7 years ago

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...

Report

9

bugsbane

8 years ago

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?

Report

C

DavidEdmundson

8 years ago

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

Report

cmoh

8 years ago

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?

Report

C

DavidEdmundson

8 years ago

I updated my personal website, and forgot to update everything that links to it.

Sorry! Fixed now.

Report

cmoh

8 years ago

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

Report

tomsdale

9 years ago

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.

Report

C

DavidEdmundson

9 years ago

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

Report

8 years ago

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

12345678910
12
product-maker l0ll0lll Jan 23 2015 9 excellent
product-maker bugsbane Aug 01 2011 9 excellent
product-maker svah4cky0 Jan 19 2011 9 excellent
product-maker augegr Jan 18 2011 9 excellent
product-maker SvenArcher Jan 18 2011 9 excellent
product-maker frag Jan 18 2011 9 excellent
product-maker pejakm Jan 18 2011 9 excellent
product-maker srog Jan 18 2011 9 excellent
product-maker nikore90 Jan 18 2011 9 excellent
product-maker TommyCZ Jan 08 2011 9 excellent
product-maker aspotashev Nov 14 2010 9 excellent
product-maker Raboch Sep 22 2010 9 excellent
product-maker Base: 4 x 5.0 Ratings
Be the first to comment
bugsbane
Aug 01 2011
ub1x
Feb 09 2011
gmsh
Jan 26 2011
tomsdale
Sep 15 2010
michalm
Jun 28 2010
gerlosgm
Jun 10 2010
File (click to download) Version Description PackagetypeArchitecture Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.2
updated Jan 17 2011
added Apr 25 2010
downloads 24h
0
mediaviews 24h 0
pageviews 24h 8