From ac24a64df0ce9462d721259d07eb67876b2706b8 Mon Sep 17 00:00:00 2001 From: Geoffrey Washburn Date: Sun, 1 Dec 2024 11:11:39 -0500 Subject: [PATCH] Add a table of contents and update rust version --- Cargo.toml | 2 +- README.md | 52 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 424771f..98305d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" license = "MIT" repository = "https://github.com/gawashburn/knoll" categories = ["command-line-utilities"] -rust-version = "1.77" +rust-version = "1.83.0" [dev-dependencies] coverage-helper = "0.2" diff --git a/README.md b/README.md index d54eea1..a0fd021 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,32 @@ Crates.io version Testing action Coverage report -MIT License +MIT License

A simple command-line tool for manipulating the configuration of macOS displays. - -

Installation

+## Table of contents + +- [Installation](#installation) + - [Cargo](#cargo) + - [launchd](#launchd) + - [Nix](#nix) +- [Usage](#usage) + - [Pipeline mode](#pipeline_mode) + - [Listing mode](#listing_mode) + - [Daemon mode](#daemon_mode) +- [Configuration reference](#configuration_reference) +- [Future work](#future_work) +- [Development](#development) +- [What's in a name?](#whats_in_a_name) + +## Installation Until someone creates packages for knoll, probably the most common way to install it will be to use cargo or Nix. -#### Cargo +### Cargo If you already have a Rust environment set up, you can use the `cargo install` command: @@ -24,7 +38,7 @@ If you already have a Rust environment set up, you can use the cargo install knoll ``` -#### launchd +### launchd The recommended solution for running knoll as a daemon is to make use of [ @@ -72,7 +86,7 @@ launchctl enable gui/$(id -u)/my.service.knoll` launchctl start gui/$(id -u)/my.service.knoll` ```` -#### Nix +### Nix The knoll repository contains a [Nix Flake](https://nixos.wiki/wiki/Flakes) that can be used to integrate knoll into your @@ -116,13 +130,12 @@ use the following `launchd` definition like: }; ``` - -

Usage

+## Usage knoll has three primary usage modes: pipeline mode, listing mode, and daemon mode. -#### Pipeline mode +### Pipeline mode knoll's default mode supports reporting and updating the current display configuration. In the simplest case, you can just run it with no argument: @@ -299,7 +312,7 @@ host$ echo $? 1 ``` -#### Listing mode +### Listing mode knoll's second mode of operation allows inspecting the allowed display mode of attached displays: @@ -337,7 +350,7 @@ host$ knoll list This is useful for determining which display configurations may successfully be used in an input to knoll. -#### Daemon mode +### Daemon mode Finally, knoll also supports a "daemon" mode. @@ -369,8 +382,8 @@ level of responsiveness, it can be configured: host$ knoll daemon --wait=500ms --input=my_config.json ``` - -

Configuration reference

+## Configuration reference + A configuration may contain the following fields: * `uuid` In JSON: `"uuid": "b00184f4c1ee4cdf8ccfea3fca2f93b2"`. In RON @@ -401,8 +414,7 @@ A configuration may contain the following fields: specifies the current or requested rotation of the display in degrees. At present, only 0, 90, 180, and 270 degree rotations are supported. - -

Future work

+## Future work So far knoll has been working successfully for my specific use cases. However, there is still room for additional improvements: @@ -426,11 +438,10 @@ there is still room for additional improvements: Wayland, etc. It is just a matter of finding the appropriate APIs and perhaps making some additional generalizations to the configuration data structures. - -

Development

+## Development -
- Rust 1.71.0+ + + Rust 1.83.0+ @@ -450,8 +461,7 @@ entirely possible there are better or more idiomatic ways to write some of this code. I have endeavoured to write knoll in a way that is conducive to unit testing. So please try to add appropriate tests for submitted changes. - -

What's in a name?

+## What's in a name? knoll's name derives from the term [knolling](https://en.wikipedia.org/wiki/|knolling):