From ac49191802ada10deac71fe0ad2f9bf33099d8a5 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Tue, 13 May 2025 20:26:12 -0700 Subject: Add basic documentation --- README.md | 11 ++++++++++- cmd/corvid/main.go | 13 +++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 80af138..c37ab80 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # corvid -A DBus Notification server that outputs JSON. Intended for use with [eww](https://github.com/elkowar/eww). I may eventually actually document this, but it's fairly simple. \ No newline at end of file +a dbus notification server that outputs json. intended for use with [eww](https://github.com/elkowar/eww). + +## subcommands +- `server`: run the server +- `dismiss `: dismiss specific notification +- `dismiss-all`: dismiss all notifications + +## environment variables +- `CORVID_DEFAULT_EXPIRATION`: default notification expiration in ms. `-1` = never (default: `5000`) +- `CORVID_SORT_DIRECTION`: notification sort direction, either `NEWEST_FIRST` or `OLDEST_FIRST` (default: `NEWEST_FIRST`) diff --git a/cmd/corvid/main.go b/cmd/corvid/main.go index 7fffbd1..b434010 100644 --- a/cmd/corvid/main.go +++ b/cmd/corvid/main.go @@ -32,8 +32,21 @@ func main() { call("Dismiss", uint32(id)) case "dismiss-all": call("DismissAll") + case "help": + fmt.Printf("subcommands:\n") + fmt.Printf(" server (default) - run the server\n") + fmt.Printf(" dismiss - dismiss specific notification\n") + fmt.Printf(" dismiss-all - dismiss all notifications\n") + fmt.Printf("\n") + fmt.Printf("environment vars:\n") + fmt.Printf(" CORVID_DEFAULT_EXPIRATION - default notification expiration in\n") + fmt.Printf(" ms. -1 = never (default: 5000)\n") + fmt.Printf(" CORVID_SORT_DIRECTION - notification sort direction, either\n") + fmt.Printf(" NEWEST_FIRST or OLDEST_FIRST\n") + fmt.Printf(" (default: NEWEST_FIRST)\n") default: fmt.Printf("unknown subcommand: %s\n", os.Args[1]) + fmt.Printf("run corvid help for command list\n") os.Exit(1) } } -- cgit v1.2.3