~novakane/rivercarro

87d0ba62a684e6f68d246170f97b2984be3d0f9e — Hugo Machet 5 months ago 890afb2
Update to zig 0.9.0
5 files changed, 62 insertions(+), 54 deletions(-)

M README.md
M build.zig
M deps/zig-wayland
M doc/rivercarro.1.scd
M src/main.zig
M README.md => README.md +25 -32
@@ 1,7 1,7 @@
# Rivercarro

A slightly modified version of _rivertile_ layout generator for
**[river][]**
**[river]**

Compared to _rivertile_, _rivercarro_ add:



@@ 13,15 13,11 @@ I don't want to add too much complexity, the only thing I intend
to add now is `smart borders`, after that I'll consider _rivercarro_
features complete. If you want a layout generator with more features
and configuration, have a look at some others great community
contributions like [stacktile][] or [kile][].
contributions like [stacktile] or [kile].

[river]: https://github.com/ifreund/river
[stacktile]: https://sr.ht/~leon_plickat/stacktile/
[kile]: https://gitlab.com/snakedye/kile

# Building
## Building

Same requirements as **[river][]**, use [zig 0.8.1][], if **[river][]** and
Same requirements as **[river]**, use [zig] 0.9, if **[river]** and
_rivertile_ works on your machine you shouldn't have any problems.

Init submodules:


@@ 34,16 30,11 @@ Build, `e.g.`

Note that _rivercarro_ use pkgconfig for the `river-layout-v3`
protocol so if you did not installed _river_ system wide you need to
set `PKG_CONFIG_PATH` in your shell rc.

e.g.
set `PKG_CONFIG_PATH` in your shell rc, e.g.

    export PKG_CONFIG_PATH="$HOME/.local/share/pkgconfig"

[river]: https://github.com/ifreund/river#building
[zig 0.8.1]: https://ziglang.org/download/

# Usage
## Usage

Works exactly as _rivertile_, you can just replace _rivertile_ name by
_rivercarro_ in your config, and read `rivertile(1)` man page


@@ 73,7 64,7 @@ riverctl default-layout rivercarro
exec rivercarro
```

## Command line options
### Command line options

```
$ rivercarro -help


@@ 96,19 87,19 @@ Usage: rivercarro [options]
  -no-smart-gaps  Disable smart gaps
```

# Contributing
## Contributing

For patches, questions or discussion send a [plain text] mail to my
[public inbox][] [~novakane/public-inbox@lists.sr.ht][] with project
[public inbox] [~novakane/public-inbox@lists.sr.ht] with project
prefix set to `rivercarro`:

```
```bash
git config sendemail.to "~novakane/public-inbox@lists.sr.ht"
git config format.subjectPrefix "PATCH rivercarro"
```

See [here] for some great resource on how to use `git send-email`
if you're not used to it, and my [wiki][].
if you're not used to it, and my [wiki].

Run `zig fmt` and wrap line at 100 columns unless it helps the
readability.


@@ 116,23 107,25 @@ readability.
You can also found me on _IRC_ `irc.libera.chat` as `novakane`, mostly on
`#river`.

## Thanks

Almost all credits go to [Isaac Freund] and [Leon Henrik Plickat]

**Thanks to them!**

## License

[GNU General Public License v3.0 or later]

[river]: https://github.com/ifreund/river
[stacktile]: https://sr.ht/~leon_plickat/stacktile/
[kile]: https://gitlab.com/snakedye/kile
[zig]: https://ziglang.org/download/
[plain text]: https://useplaintext.email/
[public inbox]: https://lists.sr.ht/~novakane/public-inbox
[~novakane/public-inbox@lists.sr.ht]: mailto:~novakane/public-inbox@lists.sr.ht
[here]: https://git-send-email.io
[wiki]: https://man.sr.ht/~novakane/guides/

# Thanks

Almost all credits go to [Isaac Freund][] and [Leon Henrik Plickat][]

**Thanks to them!**

[isaac freund]: https://github.com/ifreund
[leon henrik plickat]: https://sr.ht/~leon_plickat/

# License

[GNU General Public License v3.0 or later][]

[gnu general public license v3.0 or later]: COPYING

M build.zig => build.zig +11 -4
@@ 6,7 6,7 @@ const mem = std.mem;

const ScanProtocolsStep = @import("deps/zig-wayland/build.zig").ScanProtocolsStep;

/// While a river release is in development, this string should contain the version in development
/// While a rivercarror release is in development, this string should contain the version in development
/// with the "-dev" suffix.
/// When a release is tagged, the "-dev" suffix should be removed for the commit that gets tagged.
/// Directly after the tagged commit, the version should be bumped and the "-dev" suffix added.


@@ 57,10 57,16 @@ pub fn build(b: *Builder) !void {
    const exe = b.addExecutable("rivercarro", "src/main.zig");
    exe.setTarget(target);
    exe.setBuildMode(mode);
    exe.addBuildOption([:0]const u8, "version", full_version);

    const options = b.addOptions();
    options.addOption([]const u8, "version", full_version);
    exe.addOptions("build_options", options);

    exe.step.dependOn(&scanner.step);
    exe.addPackage(scanner.getPkg());
    exe.addPackage(.{
        .name = "wayland",
        .path = .{ .generated = &scanner.result },
    });
    exe.linkLibC();
    exe.linkSystemLibrary("wayland-client");



@@ 82,6 88,7 @@ pub fn build(b: *Builder) !void {
    const run_step = b.step("run", "Run the app");
    run_step.dependOn(&run_cmd.step);
}

const ScdocStep = struct {
    const scd_paths = [_][]const u8{"doc/rivercarro.1.scd"};



@@ 97,7 104,7 @@ const ScdocStep = struct {
    fn init(builder: *Builder) ScdocStep {
        return ScdocStep{
            .builder = builder,
            .step = Step.init(.Custom, "Generate man pages", builder.allocator, make),
            .step = Step.init(.custom, "Generate man pages", builder.allocator, make),
        };
    }


M deps/zig-wayland => deps/zig-wayland +1 -1
@@ 1,1 1,1 @@
Subproject commit a8e1efcfd34ac798f19d8a62ebe3bb368c17f585
Subproject commit 80166ba1d5b4f94c7972d6922587ba769be93f8a

M doc/rivercarro.1.scd => doc/rivercarro.1.scd +23 -15
@@ 6,11 6,11 @@ rivercarro - tiled layout generator for river

# SYNOPSIS

*rivercarro* [_options_]
*rivercarro* [options...]

# DESCRIPTION

*rivercarro* is a fork of *rivertile*(1) layout generator for *river*(1).
rivercarro is a fork of *rivertile*(1) layout generator for *river*(1).
It provides a simple tiled layout with split main/secondary stacks. The
initial state may be configured with various options passed on startup. Some
values may additionally be modified while rivercarro is running with the


@@ 30,24 30,32 @@ In addition to *rivertile*(1), *rivercarro* provides:
*-version*
	Print the version number and exit.

*-view-padding* _pixels_
	Set the padding around views in pixels. (Default: 6)
*-view-padding* <pixels>
	Set the padding around views in pixels.

*-outer-padding* _pixels_
	Default: 6

*-outer-padding* <pixels>
	Set the padding around the edge of the layout area in pixels.
	(Default: 6)

*-main-location* [*top*|*bottom*|*left*|*right*|*monocle*]
	Default: 6

*-main-location* <top|bottom|left|right|monocle>
	Set the initial location of the main area in the layout.
	(Default: *left*)

*-main-count* _count_
	Default: left

*-main-count* <count>
	Set the initial number of views in the main area of the
	layout. (Default: 1)
	layout.

*-main-ratio* _ratio_
	Default: 1

*-main-ratio* <ratio>
	Set the initial ratio of the main area to total layout area. The
	_ratio_ must be between 0.1 and 0.9, inclusive. (Default: 0.6)
	_ratio_ must be between 0.1 and 0.9, inclusive.

	Default: 0.6

*-no-smart-gaps*
	Disable smart gaps.


@@ 57,15 65,15 @@ In addition to *rivertile*(1), *rivercarro* provides:
These commands may be sent to rivercarro at runtime with the help of
*riverctl*(1).

*main-location* [*top*|*bottom*|*left*|*right*|*monocle*]
*main-location* <top|bottom|left|right|monocle>
	Set the location of the main area in the layout.

*main-count* _value_
*main-count* <value>
	Set or modify the number of views in the main area of the layout. If
	_value_ is prefixed by a +/- sign, _value_ is added/subtracted from the
	current count. If there is no sign, the main count is set to _value_.

*main-ratio* _value_
*main-ratio* <value>
	Set or modify the ratio of the main area to total layout area. If
	_value_ is prefixed by a +/- sign, _value_ is added/subtracted from
	the current ratio. If there is no sign, the main ratio is set to

M src/main.zig => src/main.zig +2 -2
@@ 136,7 136,7 @@ const Output = struct {
            .namespace_in_use => fatal("namespace 'rivercarro' already in use.", .{}),

            .user_command => |ev| {
                var it = mem.tokenize(mem.span(ev.command), " ");
                var it = mem.tokenize(u8, mem.span(ev.command), " ");
                const raw_cmd = it.next() orelse {
                    log.err("not enough arguments", .{});
                    return;


@@ 396,7 396,7 @@ pub fn main() !void {
    }

    const display = wl.Display.connect(null) catch {
        std.debug.warn("Unable to connect to Wayland server.\n", .{});
        std.debug.print("Unable to connect to Wayland server.\n", .{});
        os.exit(1);
    };
    defer display.disconnect();