Add manpage

master
Rohan Kumar 2020-10-26 13:56:51 -07:00 committed by Kenny Levinsen
parent 0569fb45bd
commit fa2bd44253
3 changed files with 79 additions and 1 deletions

View File

@ -51,5 +51,32 @@ executable(
'wlsunset',
['main.c', 'color_math.c'],
dependencies: [protocols_dep, m, rt],
install: true
install: true,
)
scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7')
if scdoc.found()
sh = find_program('sh')
man_pages = ['wlsunset.1.scd']
mandir = get_option('mandir')
foreach src : man_pages
topic = src.split('.')[0]
section = src.split('.')[1]
output = '@0@.@1@'.format(topic, section)
custom_target(
output,
input: src,
output: output,
command: [
sh, '-c', '@0@ < @INPUT@ > @1@'.format(scdoc.get_pkgconfig_variable('scdoc'), output)
],
install: true,
install_dir: '@0@/man@1@'.format(mandir, section)
)
endforeach
endif

View File

@ -0,0 +1 @@
option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')

50
wlsunset.1.scd 100644
View File

@ -0,0 +1,50 @@
wlsunset(1)
# NAME
wlsunet - Day/night gamma adjustments for Wayland compositors supporting wlr-gamma-control-unstable-v1
# SYNOPSIS
*wlsunset* [options...]
# OPTIONS
*-h*
show this help message
*-T* <temp>
set high temperature (default: 6500)
*-t* <temp>
set low temperature (default: 4000)
*-l* <lat>
set latitude (e.g. 39.9)
*-L* <long>
set longitude (e.g. 116.3)
*-s* <start>
set manual start time (e.g. 06:30)
*-S* <stop>
set manual stop time (e.g. 19:30)
*-g* <gamma>
set gamma (default: 1.0)
# EXAMPLE
```
# Beijing lat/long.
wlsunset -l 39.9 -L 116.3
```
Greater precision than one decimal place serves no purpose
(https://xkcd.com/2170/) other than padding the command-line.
# AUTHORS
Maintained by Kenny Levinsen <contact@kl.wtf>. For more information about
wlsunset development, see https://sr.ht/~kennylevinsen/wlsunset.