~novakane/agertu

cfff0323d592c508a70719ca0fd2cf9e404e51c6 — Hugo Machet a month ago bb3b224
doc: Remove scdoc deps, just install the man page
5 files changed, 255 insertions(+), 212 deletions(-)

M .gitignore
M README.md
M build.zig
A doc/agertu.1
D doc/agertu.1.scd
M .gitignore => .gitignore +0 -1
@@ 1,4 1,3 @@
zig-cache/
zig-out/
doc/*.[1-9]
.valgrindrc

M README.md => README.md +0 -1
@@ 15,7 15,6 @@ Requirements:
-   [river]
-   [zig] 0.9
-   [fcft] 3.0
-   scdoc (optional, required for man pages)

Init submodules:


M build.zig => build.zig +1 -43
@@ 8,23 8,6 @@ pub fn build(b: *Builder) !void {
    const target = b.standardTargetOptions(.{});
    const mode = b.standardReleaseOptions();

    const man_pages = b.option(
        bool,
        "man-pages",
        "Set to true to build man pages. Requires scdoc. Defaults to true if scdoc is found.",
    ) orelse scdoc_found: {
        _ = b.findProgram(&[_][]const u8{"scdoc"}, &[_][]const u8{}) catch |err| switch (err) {
            error.FileNotFound => break :scdoc_found false,
            else => return err,
        };
        break :scdoc_found true;
    };

    if (man_pages) {
        const scdoc_step = try ScdocStep.create(b);
        try scdoc_step.install();
    }

    const scanner = ScanProtocolsStep.create(b);
    scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml");
    scanner.addProtocolPath("protocol/river-status-unstable-v1.xml");


@@ 76,6 59,7 @@ pub fn build(b: *Builder) !void {
    scanner.addCSource(exe);

    exe.install();
    b.installFile("doc/agertu.1", "share/man/man1/agertu.1");

    const run_cmd = exe.run();
    run_cmd.step.dependOn(b.getInstallStep());


@@ 83,29 67,3 @@ pub fn build(b: *Builder) !void {
    const run_step = b.step("run", "Run the app");
    run_step.dependOn(&run_cmd.step);
}

const ScdocStep = struct {
    builder: *Builder,
    step: Step,

    fn create(builder: *Builder) !*ScdocStep {
        const self = try builder.allocator.create(ScdocStep);
        self.* = .{
            .builder = builder,
            .step = Step.init(.custom, "Generate man pages", builder.allocator, make),
        };
        return self;
    }

    fn make(step: *Step) !void {
        const self = @fieldParentPtr(ScdocStep, "step", step);
        _ = try self.builder.exec(
            &[_][]const u8{ "sh", "-c", "scdoc < doc/agertu.1.scd > doc/agertu.1" },
        );
    }

    fn install(self: *ScdocStep) !void {
        self.builder.getInstallStep().dependOn(&self.step);
        self.builder.installFile("doc/agertu.1", "share/man/man1/agertu.1");
    }
};

A doc/agertu.1 => doc/agertu.1 +254 -0
@@ 0,0 1,254 @@
.TH AGERTU 1 2022-05-05 "git.sr.ht/~novakane/agertu" "General Commands Manual"
.
.SH NAME
.P
.BR agertu
\- popup information for
.BR river (1)
Wayland compositor
.
.SH SYNOPSIS
.P
.BR agertu
.
.SH DESCRIPTION
.P
.BR agertu
is a popup with tags information for
.BR river (1).
.P
It appears every time a new tag is focused or when a tag gain urgency. It
displays information about \fIfocused, occupied\fR and \fIurgent\fR tags as
well as the tags number.
.
.SH CONFIGURATION
.P
On startup agertu will look for a file at
\fI$XDG_CONFIG_HOME/agertu/config.ini\fR. If unset
.IR $XDG_CONFIG_HOME
defaults to \fI\(ti/.config/\fR. If the file is not found default values
will be used.
.P
An example config with the default value is provided in the \fIexample/\fR
directory.
.P
Format is:
.P
.RS 4
.EE
# This is a commentary (Note that \(aq;\(aq is not a commentary)
<option-name> = <value>;
.EX
.RE
.
.SS Surface
.P
.B surface_borders_size
<int>
.RS 4
Set the surface borders size.
.P
Default: 0
.P
.RE
.B surface_anchors
<top>:<right>:<bottom>:<left>
.RS 4
Set the surface anchors.
.P
Default: 0:1:1:0
.P
.RE
.B surface_margins
<top>:<right>:<bottom>:<left>
.RS 4
Set the surface margins from the anchors point.
.P
Default: 0:10:10:0
.P
.RE
.B surface_background_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the surface background color.
.P
Default: 0x202325
.P
.RE
.B surface_borders_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the surface borders color.
.P
Default: 0x9e2f59
.P
.RE
.SS Tags
.P
.B tags_amounts
<amount>
.RS 4
Set the number of tags displayed. The maximum number of tags in
.BR river (1)
is 32.
.P
Default: 9
.P
.RE
.B tags_number_text
<true|false>
.RS 4
Enable or disable text number in tags.
.P
.RE
.B tags_square_size
<int>
.RS 4
Set the size of the tags square.
.P
Default: 50
.P
.RE
.B tags_borders_size
<int>
.RS 4
Set the size of the square borders.
.P
Default: 2
.P
.RE
.B tags_margins
<int>
.RS 4
Set the size of the margins between square.
.P
Default: 5
.P
.RE
.B tags_background_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the tags square default background color.
.P
Default: 0x3a4043
.P
.RE
.B tags_foreground_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the tags square default foreground color.
.P
Default: 0xdce1e4
.P
.RE
.B tags_borders_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the tags square default borders color.
.P
Default: 0x646e73
.P
.RE
.B tags_focused_background_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square background color for focused tags.
.P
Default: 0xf9f9fa
.P
.RE
.B tags_focused_foreground_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square foreground color for focused tags.
.P
Default: 0x202325
.P
.RE
.B tags_focused_borders_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square borders color for focused tags.
.P
Default: 0xdce1e4
.P
.RE
.B tags_occupied_background_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square background color for occupied tags.
.P
Default: 0x2e3f9f
.P
.RE
.B tags_occupied_foreground_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square foreground color for occupied tags.
.P
Default: 0xdce1e4
.P
.RE
.B tags_occupied_borders_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square borders color for occupied tags.
.P
Default: 0xdbf1fd
.P
.RE
.B tags_urgent_background_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square background color for urgent tags.
.P
Default: 0x9e2f59
.P
.RE
.B tags_urgent_foreground_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square foreground color for urgent tags.
.P
Default: 0x202325
.P
.RE
.B tags_urgent_borders_color
<0xRRGGBB|0xRRGGBBAA>
.RS 4
Set the square borders color for urgent tags.
.P
Default: 0xfde7f6
.P
.RE
.SS Fonts
.P
.B fonts
"<first-font>, <other-font>"
.RS 4
Comma separated list of fonts to use, in
.I fontconfig
format. That is,
a font name followed by a list of colon separated options.
.P
The first-font is the primary font, the remaining fonts are fallback
fonts that will be used whenever a glyph cannot be found in the primary font.
.P
Examples:
.RE
.IP
.EX
\- VictorMono Mono:size=14, Noto Color Emoji:size=8.5
\- Dina:weight=bold:slant=italic
\- Fantasque Sans Mono:fontfeatures=ss01
.EE
.P
.RS 4
Default: monospace:size=18
.P
.RE
.SH AUTHORS
.P
.MT mail@hmachet.com
Hugo Machet
.ME

D doc/agertu.1.scd => doc/agertu.1.scd +0 -167
@@ 1,167 0,0 @@
AGERTU(1)

# NAME

agertu - popup information for *river*(1) Wayland compositor

# SYNOPSIS

*agertu*

# DESCRIPTION

agertu is a popup with information for *river*(1). Currently it only displays
information about tags. It appears every time a new tag is focused or when
a tag gain urgency.

# CONFIGURATION

On startup agertu will look for a file at *$XDG_CONFIG_HOME/agertu/config.ini*.
If unset _$XDG_CONFIG_HOME_ defaults to *~/.config/*. If the file is not found
default values will be used.

An example config with the default value is provided in the *example/*
directory.

Format is:

	```
	# This is a commentary (Note that ';' is not a commentary)
	<option-name> = <value>;
	```

## SURFACE

*surface_borders_size* <int>
	Set the surface borders size.

	Default: 0

*surface_anchors* <top>:<right>:<bottom>:<left>
	Set the surface anchors.

	Default: 0:1:1:0

*surface_margins* <top>:<right>:<bottom>:<left>
	Set the surface margins from the anchors point.

	Default: 0:10:10:0

*surface_background_color* <0xRRGGBB|0xRRGGBBAA>
	Set the surface background color.

	Default: 0x202325

*surface_borders_color* <0xRRGGBB|0xRRGGBBAA>
	Set the surface borders color.

	Default: 0x9e2f59

## TAGS

*tags_amounts* <amount>
	Set the number of tags displayed. The maximum number of tags in
	*river*(1) is 32.

	Default: 9

*tags_number_text* <true|false>
	Enable or disable text number in tags.

*tags_square_size* <int>
	Set the size of the tags square.

	Default: 50

*tags_borders_size* <int>
	Set the size of the square borders.

	Default: 2

*tags_margins* <int>
	Set the size of the margins between square.

	Default: 5

*tags_background_color* <0xRRGGBB|0xRRGGBBAA>
	Set the tags square default background color.

	Default: 0x3a4043

*tags_foreground_color* <0xRRGGBB|0xRRGGBBAA>
	Set the tags square default foreground color.

	Default: 0xdce1e4

*tags_borders_color* <0xRRGGBB|0xRRGGBBAA>
	Set the tags square default borders color.

	Default: 0x646e73

*tags_focused_background_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square background color for focused tags.

	Default: 0xf9f9fa

*tags_focused_foreground_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square foreground color for focused tags.

	Default: 0x202325

*tags_focused_borders_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square borders color for focused tags.

	Default: 0xdce1e4

*tags_occupied_background_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square background color for occupied tags.

	Default: 0x2e3f9f

*tags_occupied_foreground_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square foreground color for occupied tags.

	Default: 0xdce1e4

*tags_occupied_borders_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square borders color for occupied tags.

	Default: 0xdbf1fd

*tags_urgent_background_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square background color for urgent tags.

	Default: 0x9e2f59

*tags_urgent_foreground_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square foreground color for urgent tags.

	Default: 0x202325

*tags_urgent_borders_color* <0xRRGGBB|0xRRGGBBAA>
	Set the square borders color for urgent tags.

	Default: 0xfde7f6

## FONTS

*fonts* <first-font>, <other-font>
	Comma separated list of fonts to use, in _fontconfig_ format. That
	is, a font name followed by a list of colon separated options.

	The _first-font_ is the primary font, the remaining fonts are
	fallback fonts that will be used whenever a glyph cannot be found
	in the primary font.

	Examples:
		- VictorMono Mono:size=14, Noto Color Emoji:size=8.5
		- Dina:weight=bold:slant=italic
		- Fantasque Sans Mono:fontfeatures=ss01

	Default: monospace:size=18

# AUTHORS

Maintained by Hugo Machet <mail@hmachet.com>, who is assisted by other
open-source contributors. For more information about agertu development, see
<https://sr.ht/~novakane/agertu/>.