Quellcode durchsuchen

Merge pull request #41 from troglobit/man-page

Add proper light.1 man page, removes help2man dependency
Joachim Nilsson vor 5 Jahren
Ursprung
Commit
033486bf9a
Es ist kein Account mit dieser Commiter-Email verbunden
3 geänderte Dateien mit 115 neuen und 14 gelöschten Zeilen
  1. 2
    11
      Makefile
  2. 1
    3
      README.md
  3. 112
    0
      light.1

+ 2
- 11
Makefile Datei anzeigen

@@ -6,24 +6,15 @@ MANDIR=$(DESTDIR)$(PREFIX)/share/man/man1
6 6
 
7 7
 CC=gcc
8 8
 CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include" -D_XOPEN_SOURCE=500
9
-MANFLAGS=-h -h -v -V -N
10
-
11
-HELP2MAN_VERSION := $(shell help2man --version 2>/dev/null)
12 9
 
13 10
 light: src/helpers.c src/light.c src/main.c
14 11
 	$(CC) $(CFLAGS) -g -o $@ $^
15 12
 
16
-man: light
17
-ifndef HELP2MAN_VERSION
18
-$(error "help2man is not installed")
19
-endif
20
-	help2man $(MANFLAGS) ./light | gzip - > light.1.gz
21
-
22
-install: light man
13
+install: light
23 14
 	install -dZ $(BINDIR)
24 15
 	install -DZ -m 4755 ./light -t $(BINDIR)
25 16
 	install -dZ $(MANDIR)
26
-	install -DZ light.1.gz -t $(MANDIR)
17
+	install -DZ light.1 -t $(MANDIR)
27 18
 
28 19
 uninstall:
29 20
 	rm -f $(BINDIR)/light

+ 1
- 3
README.md Datei anzeigen

@@ -29,9 +29,7 @@ I recommend you go with light-git as you might miss important features and bugfi
29 29
 
30 30
 ### Manual
31 31
 
32
-You need the `help2man` package, required for install.
33
-
34
-`make && make install`
32
+`make && sudo make install`
35 33
 
36 34
 **Optional:** If you want to use udev rules instead of suid to manage sysfs permissions, you may skip the `make install` step and instead add something like the following to `/etc/udev/rules.d/90-backlight.rules` after copying your binaries:
37 35
 ```

+ 112
- 0
light.1 Datei anzeigen

@@ -0,0 +1,112 @@
1
+.\"  -*- nroff -*-
2
+.Dd August 4, 2018
3
+.Os GNU/Linux
4
+.Dt LIGHT 1 URM
5
+.Sh NAME
6
+.Nm light
7
+.Nd a program to control backlight controllers
8
+.Sh SYNOPSIS
9
+.Nm light
10
+.Op Fl abcGhHkIlLmOprV
11
+.Op Fl s Ar ARG
12
+.Op Fl v Ar LEVEL
13
+.Op Fl A Ar VAL
14
+.Op Fl S Ar VAL
15
+.Op Fl U Ar VAL
16
+.Sh DESCRIPTION
17
+.Nm
18
+is a program to control backlight display and keyboard controllers under
19
+GNU/Linux.
20
+.Pp
21
+.Bl -bullet -compact
22
+.It
23
+Operates independently of X (X-Window)
24
+.It
25
+Can automatically figure out the best controller to use, making full use
26
+of the underlying hardware
27
+.It
28
+Supports a minimum cap on the brightness value, as some controllers set
29
+the display to be pitch black at a vaĺue of 0 (or higher)
30
+.El
31
+.Sh COMMANDS
32
+The following unique commands are supported:
33
+.Pp
34
+.Bl -tag -width Ds
35
+.It Fl A Ar VAL
36
+Add value
37
+.It Fl G
38
+Get value, default
39
+.It Fl H , Fl h
40
+Show help text and exit
41
+.It Fl I
42
+Restore brightness
43
+.It Fl L
44
+List controllers
45
+.It Fl O
46
+Save brightness
47
+.It Fl S Ar VAL
48
+Set value
49
+.It Fl U Ar VAL
50
+Subtract value
51
+.It Fl V
52
+Show program version and exit
53
+.El
54
+.Sh OPTIONS
55
+The behavior of the above commands can be modified using these options:
56
+.Pp
57
+.Bl -tag -width Ds
58
+.It Fl b
59
+Set
60
+.Fl S ,
61
+Get
62
+.Fl G ,
63
+Add
64
+.Fl A ,
65
+or Subtract
66
+.Fl U
67
+active brightness, default
68
+.It Fl k
69
+Act on keyboard backlight
70
+.It Fl l
71
+Act on display backlight, default
72
+.It Fl m
73
+Get 
74
+.Fl G
75
+maximum brightness
76
+.It Fl c
77
+Set
78
+.Fl S
79
+or get
80
+.Fl G
81
+minimum cap for brightness
82
+.It Fl a
83
+Select controller automatically, default
84
+.It Fl p
85
+Interpret input and output values in percent, default
86
+.It Fl r
87
+Interpret input and output values in raw mode
88
+.It Fl s Ar ARG
89
+Specify controller to use.  Use
90
+.Fl L
91
+to list available controllers
92
+.It Fl v Ar ARG
93
+Set verbosity level, by default
94
+.Nm
95
+only outputs read values:
96
+.Pp
97
+.Bl -tag -width 0: -compact
98
+.It 0:
99
+Read values
100
+.It 1:
101
+Read values, Errors
102
+.It 2:
103
+Read values, Errors, Warnings
104
+.It 3:
105
+Read values, Errors, Warnings, Notices
106
+.El
107
+.El
108
+.Sh AUTHORS
109
+Copyright \(co 2014 Fredrik Haikarainen
110
+.Pp
111
+This is free software, see the source for copying conditions.  There is NO
112
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE