You are not logged in.
I wrote a simple and lightweight daemon that dims the backlight of our laptop and, in case, completely turn off it, after a given amount of time.
I don't have time to put the project on a service like sourceforge, github, etc...so I opened this thread.
If you have questions, doubts or if you simply want to report a bug or a feature request, please write here.
You can find the PKGBUILD on AUR here https://aur.archlinux.org/packages.php?ID=54009
So here is a summary of the configuration values :
environnement
userhome : well, the path to your home (only used to connect to eat your magic cookies connect to X)
displayname : choose in
/sys/class/backlight/
powersupplyname : choose a battery in
/sys/class/power_supply/
relative : set to true if you want that dimdaemon dinamically dims your screen brightness; obviously undimpercent will not be used.
ac or battery
active : whether the dimdeamon will change the backlight when the computer is in this mode
undimpercent : brightness when user is active
dimtime : time before the screen gets dimmed if the comp is idle (0 will not disable this)
dimpercent : brightness when idle
turnofftime : time before turning the screen off.
0 will not disable, set big value instead. If it is less than dimtime, will act as if it is equal to it.
Regards
Last edited by punkeroso (2012-09-18 07:57:42)
Offline
So here is a summary of the configuration values :
environnement
userhome : well, the path to your home (only used to connect to eat your magic cookies connect to X)
displayname : choose in
/sys/class/backlight/
powersupplyname : choose a battery in
/sys/class/power_supply/
ac or battery
active : whether the dimdeamon will change the backlight when the computer is in this mode
undimpercent : brightness when user is active
dimtime : time before the screen gets dimmed if the comp is idle (0 will not disable this)
dimpercent : brightness when idle
turnofftime : time before turning the screen off.
0 will not disable, set big value instead. If it is less than dimtime, will act as if it is equal to it.
This is for 0.2-1, I guess some stuff could change in later versions.
Edit : it seems like it generates many messages like this one :
ACPI Error: [\_SB_.VDRV] Namespace lookup failure, AE_NOT_FOUND (20110623/psargs-359)
and this one :
ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPC0.H_EC._Q52] (Node ffff88003cdb1fc8), AE_NOT_FOUND (20110623/psparse-536)
in dmesg
Last edited by sapristi (2012-03-20 02:57:22)
Offline
Many thanks for the summary, I appreciate it a lot!!
Edit : it seems like it generates many messages like this one :
ACPI Error: [\_SB_.VDRV] Namespace lookup failure, AE_NOT_FOUND (20110623/psargs-359)
and this one :
ACPI Error: Method parse/execution failed [\_SB_.PCI0.LPC0.H_EC._Q52] (Node ffff88003cdb1fc8), AE_NOT_FOUND (20110623/psparse-536)
in dmesg
Searching with google, I found that this error should be related to some unmanaged acpi event. Is your bios up to date? Moreover, this should not be related to dimdaemon and you can just ignore it!
Offline
Glad you like it
Thanks for the information, this was happening when i was unplugging my power cable to test the daemon, but this is indeed not related with dimdeamon...
Offline
It's strange, I reinstalled dimdeamon, and now it won't compile, seems like the #include <unistd.h> part is missing. Did you modify the code recently ?
Offline
It's strange, I reinstalled dimdeamon, and now it won't compile, seems like the #include <unistd.h> part is missing. Did you modify the code recently ?
Fixed. This was caused by a change in GCC.
Offline
Hi there,
After reading post 2 about configuration values I'm still a bit confused as to where a configration file is to set the these values. Can someone point me in right direction.
And after configuring I'm assuming it's just a matter of including this in the daemon array in rc.conf.
Thanks,
Offline
Hi there,
After reading post 2 about configuration values I'm still a bit confused as to where a configration file is to set the these values. Can someone point me in right direction.
And after configuring I'm assuming it's just a matter of including this in the daemon array in rc.conf.
Thanks,
Hi,
the configuration file is /etc/conf.d/dimdaemon.conf.
After configuring you have just to start the daemon; if you want it to start at boot, just add it to the daemon array in rc.conf.
Offline
Moved from AUR Issues, Discussion & PKGBUILD Requests to Community Contributions.
To know or not to know ...
... the questions remain forever.
Offline
Thanks punkeroso I ended up viewing dimdaemon.install and found that you had already included a message that answered my question.
It's up and running and works beautifully.
Thanks for the daemon.
Offline
Hi punkeroso,
dimdaemon stopped working on machine and I'm getting the following error in my logs:-
May 17 22:16:36 localhost kernel: [ 3872.308039] dimdaemon[579]: segfault at e0 ip 0000000000401c01 sp 00007fffcf4ddfd0 error 4 in dimdaemon[400000+4000]
Any ideas what it might be?
Thanks,
Offline
Hi punkeroso,
dimdaemon stopped working on machine and I'm getting the following error in my logs:-
May 17 22:16:36 localhost kernel: [ 3872.308039] dimdaemon[579]: segfault at e0 ip 0000000000401c01 sp 00007fffcf4ddfd0 error 4 in dimdaemon[400000+4000]
Any ideas what it might be?
Thanks,
Are you still having this issue? I've updated the PKGBUILD with the last realease. Try it out and report here please.
Offline
Not sure what it is. The problems seems to be intermitant. One thing I did notice is that I have 2 power supplies in /sys/class/power_supply AC and BAT0.
It somtimes runs with powersupplyname = "AC" and sometimes with powersupplyname = "BAT0"
Last edited by bennylb0 (2012-05-23 11:33:18)
Offline
I noticed that are very similar errors with gnome-mplayer and xcompmgr so it may not be specific to dimdaemond. I've installed the new version anyway. I'll keep track and report back later.
Offline
I'm still getting a segfault error but like I said there other programs with similar errors. It doesn't really seem to be a problem though the daemon is working fine.
If you need any further help testing just let me know.
Thanks,
Offline
New version is out with added systemd compatibility.
You can enable dimdaemon to start at boot by issuing:
# systemctl enable dimdaemon.service
Offline
Hi!
I found your project quite interesting! Well, how did you managed to stop it while e.g. watching a movie? It is the first daemon that does such a thing!
Btw I'm using calise (from aur) to adjust my screen brightness, so i'd like, for example, that "undimpercent" could be commented, so it won't affect the screen brightness calise set previously. I tried to comment it, but it seems it will set screen brightness at 100% anyway (as default option).
I'm really interested in "dimtime" and "turnofftime" option, because i'm using xfce4 without power manager, so i lack of those features.
So, what i'd like to see implemented (i'm only asking, obviously), it's :
- If "undimpercent" is not set, leave screen brightness as it is.
- "dimpercent" could be the percentage of the previous brightness (and not an absolute value, eg: if my calise, or "undimpercent" set screen brig, to 5, and "dimpercent" is set to 20, it should not set the screen brightness to 2, but to 1).
Tell me if i'm asking anything wrong, or if i misunderstood anything please.
By the way, thanks for this software
Offline
Hi!
I found your project quite interesting! Well, how did you managed to stop it while e.g. watching a movie? It is the first daemon that does such a thing!
Hi, the daemon "stops" because uses Xlib to know the idle time. A lot of media players (e.g. mplayer) send a "fake" mouse/keyboard event every n seconds, so the idle time resets.
Btw I'm using calise (from aur) to adjust my screen brightness, so i'd like, for example, that "undimpercent" could be commented, so it won't affect the screen brightness calise set previously. I tried to comment it, but it seems it will set screen brightness at 100% anyway (as default option).
I'm really interested in "dimtime" and "turnofftime" option, because i'm using xfce4 without power manager, so i lack of those features.
So, what i'd like to see implemented (i'm only asking, obviously), it's :
- If "undimpercent" is not set, leave screen brightness as it is.
- "dimpercent" could be the percentage of the previous brightness (and not an absolute value, eg: if my calise, or "undimpercent" set screen brig, to 5, and "dimpercent" is set to 20, it should not set the screen brightness to 2, but to 1).
Tell me if i'm asking anything wrong, or if i misunderstood anything please.
By the way, thanks for this software
I could implement what you are suggesting but, what would be the behavior of the daemon when on battery? I mean, the daemon could read the actual brightness value but then, when switching to battery, what value should set? A percentage of the actual brightness?
No question is wrong a priori, we should just clarify some aspects; I'm glad that this piece of code could be useful to someone!
Offline
I could implement what you are suggesting but, what would be the behavior of the daemon when on battery? I mean, the daemon could read the actual brightness value but then, when switching to battery, what value should set? A percentage of the actual brightness?
No question is wrong a priori, we should just clarify some aspects; I'm glad that this piece of code could be useful to someone!
Well, thanks
May be we can have eg an option that disables the alteration of screen brightness when plug in or out ac cable, in this way the backlight would remain the same, whether we're on ac or not. Then the same suggestions as above would be valid.
Practically speaking, i'd like that it won't affect the default screen brightness (because i use another software to do this), but that it lowers it when my netbook is in idle, and eventually it switches off my screen. And the only difference for me, whether i'm on ac or on battery, would be the time before dim the screen, nothing else
Is this reachable?
Thanks for your work by the way!
Last edited by nierro (2012-09-15 16:45:00)
Offline
Well, thanks
May be we can have eg an option that disables the alteration of screen brightness when plug in or out ac cable, in this way the backlight would remain the same, whether we're on ac or not. Then the same suggestions as above would be valid.
Practically speaking, i'd like that it won't affect the default screen brightness (because i use another software to do this), but that it lowers it when my netbook is in idle, and eventually it switches off my screen. And the only difference for me, whether i'm on ac or on battery, would be the time before dim the screen, nothing else
Is this reachable?
Thanks for your work by the way!
I've done the changes! Tomorrow I'll try it on my notebook and possibly release it!
Offline
Let me tell you... Really thanks! You're a hero!! i' ll try it as soon as you upgrade the aur package!!may be i finally found the best solution
Thanks!
Offline
Let me tell you... Really thanks! You're a hero!! i' ll try it as soon as you upgrade the aur package!!may be i finally found the best solution
Thanks!
New version is out!
Remember to set "relative" to true in the enviroment setting as described in the dimdaemon.conf.pacnew.
Let me know if it works as expected.
Offline
Well, it works while on ac. It won't work while on battery.
Here is my conf file:
cat /etc/conf.d/dimdaemon
# idledd configuration file
# enter time in sec
# use bool for active
# set dim in percentage of maximum screenbrightness
# The display name is in /sys/class/backlight/
# The power supply name is in /sys/class/power_supply/
# Set relative to true if you want that dimdaemon dinamically dims your screen brightness; only an AC values will be used (but undimpercet obviously).
# eviroment
enviroment:
{
userhome = "/home/federico";
displayname = "acpi_video0";
powersupplyname = "ADP1";
relative = true;
}
# on AC
ac:
{
active = true;
undimpercent = 100;
dimtime = 10;
dimpercent = 50;
turnofftime = 240;
};
# on Battery
battery:
{
active = true;
undimpercent = 30;
dimtime = 5;
dimpercent = 10;
turnofftime = 105;
};
While on battery, dimdaemon won't dim my screen. Never. Instead, while on ac, it works perfectly. Is there a reason?
By the way, thanks!
Offline
Well, it works while on ac. It won't work while on battery.
Mhmhm...strange, here it's working fine even if on battery.
Have you restarted the daemon after editing the config file?
Offline
Yes!
And every path is correct, ie: ADP1 and acpi_video0.
Last edited by nierro (2012-09-17 11:06:24)
Offline