~kennylevinsen/public-inbox

wlsunset: Add manpage v2 APPLIED

Rohan Kumar: 1
 Add manpage

 3 files changed, 79 insertions(+), 1 deletions(-)
#328705 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kennylevinsen/public-inbox/patches/14532/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH wlsunset v2] Add manpage Export this patch

---
Fixed a mention of the wrong project in the AUTHORS section
 meson.build       | 29 ++++++++++++++++++++++++++-
 meson_options.txt |  1 +
 wlsunset.1.scd    | 50 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 79 insertions(+), 1 deletion(-)
 create mode 100644 meson_options.txt
 create mode 100644 wlsunset.1.scd

diff --git a/meson.build b/meson.build
index e78b203..585d895 100644
--- a/meson.build
+++ b/meson.build
@@ -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
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..e40a23d
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')
diff --git a/wlsunset.1.scd b/wlsunset.1.scd
new file mode 100644
index 0000000..ab53726
--- /dev/null
+++ b/wlsunset.1.scd
@@ -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.
-- 
2.26.2
builds.sr.ht
wlsunset/patches/.build.yml: SUCCESS in 18s

[Add manpage][0] v2 from [Rohan Kumar][1]

[0]: https://lists.sr.ht/~kennylevinsen/public-inbox/patches/14532
[1]: mailto:seirdy@seirdy.one

✓ #328705 SUCCESS wlsunset/patches/.build.yml https://builds.sr.ht/~kennylevinsen/job/328705
Applied after removing the currently unimplemented -s/-S options.

Thanks!