view backlight.1 @ 23:6081cc143d37

backlight: add OpenBSD support
author David Demelier <markand@malikania.fr>
date Thu, 26 Mar 2020 12:35:53 +0100
parents 232b390f1682
children 25155025900d
line wrap: on
line source

.\"
.\" Copyright (c) 2010-2020 David Demelier <markand@malikania.fr>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd September 16, 2019
.Dt BACKLIGHT 1
.Os
.\" NAME
.Sh NAME
.Nm backlight
.Nd adjust screen brightness
.\" SYNOPSIS
.Sh SYNOPSIS
.Nm
.Ar decrease
.Op Ar amount
.Nm
.Ar get
.Nm
.Ar increase
.Op Ar amount
.Nm
.Ar set
.Ar percentage
.\" DESCRIPTION
.Sh DESCRIPTION
The
.Nm
tool adjust the brightness on your screen using direct access to ACPI video
extension.
.Pp
The following commands are available:
.Bl -tag -width 10n
.It Cm decrease
Decrease the specific
.Ar amount
percentage value (default: 10).
.It Cm get
Get the current level scaled to a percentage range.
.It Cm increase
Increase the specific
.Ar amount
percentage value (default: 10).
.It Cm set
Set brightness to the
.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.
.Pp
The source package comes with an example of udev rule that can be installed in
.Pa /usr/lib/udev/rules.d .
.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 by adding
.Sy acpi_video_load="YES"
in
.Pa /boot/loader.conf .
.Ss OpenBSD
On OpenBSD, the device
.Pa /dev/ttyC0
must be writable in your user but this is normally the case when you login.
Otherwise you may simply run the program as root.
.Pp
Note: you may need to specify a bigger
.Ar amount
with the
.Cm increase, decrease
commands if your system use small percentages.
.\" AUTHORS
.Sh AUTHORS
.Nm
was written by David Demelier <markand@malikania.fr>