summaryrefslogtreecommitdiff
path: root/xbacklight.c
AgeCommit message (Collapse)Author
2019-06-09exit if conv. from string to double failsRoberto Ricci
atof(3), whose return value is undefined on error, is used to parse command line arguments, leading to undefined beavior if something else than a number is specified. this patch uses strtod(3) and exits on error. Signed-off-by: Roberto Ricci <rroberto2r@gmail.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-09Properly round the new brightness valueRoman Donchenko
Previously, it was always rounded down, which meant that -dec X would result in a bigger change than -inc X for the same X if rounding took place. Signed-off-by: Roman Donchenko <dpb@corrigendum.ru> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-11-05Use current output configurationNils Schneider
Do not trigger re-enumerating output devices when changing or querying the backlight. Re-enumerating output devices may stall Xorg at least on Intel GPUs when EDID is unresponsive or contains bogus data (due to retries). When working with the backlight it is safe to assume that a monitor capable of setting its backlight is currently connected. Signed-off-by: Nils Schneider <nils@nilsschneider.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2015-10-26Use double instead of int for valueNils Schneider
Modern displays allow for fine grained brightness settings. For example, my laptop allows for 852 brightness steps. In some situations I find it useful to set the brightness below 1 percent (the minimum possible when using integers). This patch makes xbacklight use a double instead so lower brightness values like 0.12 are possible. Signed-off-by: Nils Schneider <nils@nilsschneider.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-11-25Add -version option to print program versionAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-11-25Print which option was in error along with usage messageAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-08Fix reading backlight level on 64-bit systems (bug 63205)Edward Sheldrake
obviously incorrect output of "xbacklight -get": 51671552015166906368.000000 valgrind reports an invalid read of size 8 at xbacklight.c:91 https://bugs.freedesktop.org/show_bug.cgi?id=63205 Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-04-06Combine usage message stringsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-08-12Port xbacklight to XCBJon Lund Steffensen
Signed-off-by: Matt Turner <mattst88@gmail.com>
2009-08-19Use "Backlight" RandR property, fall back to legacy "BACKLIGHT".Matthias Hopf
2009-01-19Ansification and compile warning fixes.Paulo Cesar Pereira de Andrade
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects make distcheck and all gcc 4.3 and sparse warnings.
2007-06-21Add licenses (oops)Keith Packard
2007-03-29Add -time and -steps options to adjust fadeKeith Packard
2007-03-29Initial xbacklight programKeith Packard