Skip to content

Commit 74d6e56

Browse files
committed
readme html -> rst
1 parent 86550e8 commit 74d6e56

File tree

2 files changed

+116
-110
lines changed

2 files changed

+116
-110
lines changed

README.html

-110
This file was deleted.

README.rst

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
=======================================
2+
Apple Cinema Display Brightness Control
3+
=======================================
4+
5+
Compiling
6+
---------
7+
8+
Clone this repository::
9+
10+
git clone https://github.com/warvariuc/acdcontrol.git
11+
12+
Change to program directory and compile it::
13+
14+
cd acdcontrol
15+
make
16+
17+
A new file ``acdcontrol`` should appear in the same directory. If compiling failed, check if you
18+
have installed packages necessary for compiling (e.g. ``build-essential``).
19+
20+
Usage
21+
-----
22+
23+
::
24+
25+
./acdcontrol [--silent|-s] [--brief|-b] [--help|-h] [--about|-a] [--detect|-d] [--list-all|-l] <hid device(s)> [<brightness>]
26+
27+
28+
NOTE: You must have write permissions to this device in order to control the display being a
29+
user, not root. If you have no such permissions, you can either grant read/write permission to
30+
the world::
31+
32+
sudo chmod a+rw /dev/usb/hiddevX
33+
34+
or change the ownership::
35+
36+
sudo chown <your user name>:users /dev/usb/hiddevX
37+
38+
39+
NOTE: It should be safe to run the program on other device than Apple Cinema/Studio display as
40+
the program checks whether the device is Apple display and warns about it.
41+
42+
43+
Parameters
44+
----------
45+
46+
\-s, --silent
47+
Suppress non-functional program output
48+
49+
\-b, --brief
50+
Print brightness value only when in query mode, otherwise ignored.
51+
52+
\-h, --help
53+
Show short help message and quit.
54+
55+
\-a, --about
56+
Show information about the program, some credits and thanks.
57+
58+
\-d, --detect
59+
Run program in the detection mode. In this mode no writes are performed to device so you can
60+
use any number of files if you are not sure that your monitor(s) are supported.
61+
62+
\-l, --list-all
63+
Lists all "officially" supported monitors and quits. If you do not see the device, this does
64+
not mean that it won't work it simply means that I did not tested it on such a device. I'll
65+
appreciate if you submit your information in the forum for any display that works hid device
66+
device that represents your Apple Cinema display. It should be one of ``/dev/usb/hiddevX`` or
67+
``/dev/hiddevX``.
68+
69+
brightness
70+
When this option is specified, the operation is to set brightness, otherwise, the current
71+
brightness is retrieved. If brightness starts with ``+`` or ``-``, the current brightness is
72+
increased or decreased by that value. (Note: You have to place -- before the negative value!)
73+
74+
Brightness is a parameter ranged ``[0-255]``.
75+
Note, that not every value toggles the backlight power; different Apple Display models have
76+
different granularity. I use Apple Cinema 20" (clear plastic) and I'm feeling comfortable with
77+
the value of 160. I set 0, however, to see films in the darkness.
78+
79+
See also: ``--brief`` option and "Known Limitations" section.
80+
81+
82+
Usage examples
83+
--------------
84+
85+
In the following examples I assume that your HID device is ``/dev/hiddev0``. You may have it as
86+
``/dev/hiddevX`` or ``/dev/usb/hiddevX``.
87+
88+
acdcontrol --help
89+
Show long help message.
90+
91+
acdcontrol --detect /dev/hiddev*
92+
Perform detection, which HID device is actually your display to be controlled.
93+
94+
acdcontrol /dev/hiddev0
95+
Read current brightness parameter
96+
97+
acdcontrol /dev/hiddev0 160
98+
Set brightness to 160. Note, that brightness setting depends on your model. Generally, this
99+
parameter may get values in the range ``[0-255]``.
100+
101+
acdcontrol /dev/hiddev0 +10
102+
Increment current brightness by 10.
103+
104+
acdcontrol /dev/hiddev0 -- -10
105+
Decrement current brightness by 10. Please,note ``--``!
106+
107+
108+
Known Limitations
109+
-----------------
110+
111+
Currently, the display detection process is not fully automated as you need to specify a HID
112+
device path.
113+
114+
First time (after boot up) brightness is retrieved *incorrectly* (zero value), however, after it is
115+
set, the return value is correct. It shouldn't concern you much as Cinema/Studio Display stores
116+
actual brightness settings between the sessions.

0 commit comments

Comments
 (0)