doc: improve documentation

Fri, 11 Oct 2019 13:12:26 +0200

author
David Demelier <markand@malikania.fr>
date
Fri, 11 Oct 2019 13:12:26 +0200
changeset 16
0d923f0155dd
parent 15
282ec7c30c04
child 17
37d1b7dd73ee

doc: improve documentation

backlight.1 file | annotate | diff | comparison | revisions
backlight.c file | annotate | diff | comparison | revisions
--- a/backlight.1	Fri Oct 11 12:58:48 2019 +0200
+++ b/backlight.1	Fri Oct 11 13:12:26 2019 +0200
@@ -51,6 +51,25 @@
 .Ar percentage
 value.
 .El
+.\" SYSTEM SUPPORT
+.Sh SYSTEM SUPPORT
+.Ss Linux
+On Linux, you need to have ACPI Video support either as module or built-in the
+kernel.
+.Pp
+You may use
+.Nm
+as non-root user if you create appropriate udev rules to make files under
+.Pa /sys/class/backlight
+writable by a group or per user.
+.Ss FreeBSD
+Access to brightness under FreeBSD requires super-user, you may need to run
+.Nm
+as root or use setuid permission for non-root users.
+.Pp
+You also need to load
+.Xr acpi_video 4
+module at boot.
 .\" AUTHORS
 .Sh AUTHORS
 .Nm
--- a/backlight.c	Fri Oct 11 12:58:48 2019 +0200
+++ b/backlight.c	Fri Oct 11 13:12:26 2019 +0200
@@ -271,15 +271,44 @@
 	return downscale(dfd, value);
 }
 
+/* }}} */
+
+/* {{{ Non supported shims */
+
 #else
 
-/* Not supported */
-static int
-set(int type)
+static void
+notsupported(void)
+{
+	die("backlight is not supported on this system\n");
+}
+
+static void
+increase(void)
+{
+	notsupported();
+}
+
+static void
+decrease(void)
 {
-	(void)type;
+	notsupported();
+}
+
+static void
+set(unsigned int v)
+{
+	(void)v;
 
-	die("backlight is not supported on this system");
+	notsupported();
+}
+
+static unsigned int
+get(void)
+{
+	notsupported();
+
+	return -1;
 }
 
 #endif

mercurial