aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2025-05-13 20:26:12 -0700
committerCaroline Larimore <caroline@larimo.re>2025-05-13 20:27:35 -0700
commitac49191802ada10deac71fe0ad2f9bf33099d8a5 (patch)
treedf38562c152bed2117031b40617b12dceb9462ca
parent029ab5a0abdb4c079db95a68e2d886af870b6f67 (diff)
Add basic documentationHEADmain
-rw-r--r--README.md11
-rw-r--r--cmd/corvid/main.go13
2 files changed, 23 insertions, 1 deletions
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 <id>`: 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 <id> - 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)
}
}