From 81b00ad52b801b51a6199b9931b189b7037feb5e Mon Sep 17 00:00:00 2001
From: Kirottu <arnovaara@gmail.com>
Date: Tue, 2 May 2023 08:37:43 +0300
Subject: [PATCH] Added a README to each of the plugins, giving an overview on
 how they work

---
 README.md                      | 16 ++++++++--------
 plugins/applications/README.md | 13 +++++++++----
 plugins/dictionary/README.md   | 16 ++++++++++++++++
 plugins/kidex/README.md        | 16 ++++++++++++++++
 plugins/randr/README.md        | 18 ++++++++++++++++++
 plugins/rink/README.md         |  7 +++++++
 plugins/shell/README.md        | 18 ++++++++++++++++++
 plugins/stdin/README.md        |  9 +++++++++
 plugins/symbols/README.md      | 16 ++++++++++++----
 plugins/translate/README.md    | 17 +++++++++++++++++
 10 files changed, 130 insertions(+), 16 deletions(-)
 create mode 100644 plugins/dictionary/README.md
 create mode 100644 plugins/kidex/README.md
 create mode 100644 plugins/randr/README.md
 create mode 100644 plugins/rink/README.md
 create mode 100644 plugins/shell/README.md
 create mode 100644 plugins/stdin/README.md
 create mode 100644 plugins/translate/README.md

diff --git a/README.md b/README.md
index 1553a1e..a076897 100644
--- a/README.md
+++ b/README.md
@@ -126,24 +126,24 @@ cp examples/config.ron ~/.config/anyrun/config.ron # Copy the default config fil
 
 Anyrun requires plugins to function, as they provide the results for input. The list of plugins in this repository is as follows:
 
-- [Applications](plugins/applications)
+- [Applications](plugins/applications/README.md)
   - Search and run system & user specific desktop entries.
-- [Symbols](plugins/symbols)
+- [Symbols](plugins/symbols/README.md)
   - Search unicode symbols.
   - [User defined symbols](plugins/symbols/README.md#User-defined-symbols)
-- [Rink](plugins/rink)
+- [Rink](plugins/rink/README.md)
   - Calculator & unit conversion.
-- [Shell](plugins/shell)
+- [Shell](plugins/shell/README.md)
   - Run shell commands.
-- [Kidex](plugins/kidex)
+- [Kidex](plugins/kidex/README.md)
   - File search provided by [Kidex](https://github.com/Kirottu/kidex).
-- [Randr](plugins/randr)
+- [Randr](plugins/randr/README.md)
   - Rotate and resize; quickly change monitor configurations on the fly.
   - TODO: Only supports Hyprland, needs support for other compositors.
-- [Stdin](plugins/stdin)
+- [Stdin](plugins/stdin/README.md)
   - Turn Anyrun into a dmenu like fuzzy selector.
   - Should generally be used exclusively with the `-o` argument.
-- [Dictionary](plugins/dictionary)
+- [Dictionary](plugins/dictionary/README.md)
   - Look up definitions for words
 
 ## Configuration
diff --git a/plugins/applications/README.md b/plugins/applications/README.md
index 8baa7d2..43db6a6 100644
--- a/plugins/applications/README.md
+++ b/plugins/applications/README.md
@@ -1,13 +1,18 @@
 # Applications
 
-## Desktop Actions
+Launch applications.
 
-To enable desktop actions support, set `desktop_actions` in the applications plugin config
-file to `true` like so:
+## Usage
+
+Simply search for the application you wish to launch.
+
+## Configuration
 
-`<anyrun config directory>/applications.ron`:
 ```ron
+// <Anyrun config dir>/applications.ron
 Config(
+  // Also show the Desktop Actions defined in the desktop files, e.g. "New Window" from LibreWolf
   desktop_actions: true,
+  max_entries: 5, 
 )
 ```
\ No newline at end of file
diff --git a/plugins/dictionary/README.md b/plugins/dictionary/README.md
new file mode 100644
index 0000000..fb8a8b1
--- /dev/null
+++ b/plugins/dictionary/README.md
@@ -0,0 +1,16 @@
+# Dictionary
+
+Look up word definitions using the [Free Dictionary API](https://dictionaryapi.dev/).
+
+## Usage
+
+Type in `<prefix><word to define>`, where prefix is the configured prefix (default in [Configuration](#Configuration)).
+
+## Configuration
+
+```ron
+// <Anyrun config dir>/dictionary.ron
+Config(
+  prefix: ":def",
+)
+```
\ No newline at end of file
diff --git a/plugins/kidex/README.md b/plugins/kidex/README.md
new file mode 100644
index 0000000..cebe4a2
--- /dev/null
+++ b/plugins/kidex/README.md
@@ -0,0 +1,16 @@
+# Kidex
+
+A plugin to search files using the [Kidex](https://github.com/Kirottu/kidex) file indexing daemon.
+
+## Usage
+
+As long as the Kidex daemon is running, simply look up the file names.
+
+## Configuration
+
+```ron
+// <Anyrun config directory>/kidex.ron
+Config(
+  max_entries: 3,
+)
+```
\ No newline at end of file
diff --git a/plugins/randr/README.md b/plugins/randr/README.md
new file mode 100644
index 0000000..3e03eba
--- /dev/null
+++ b/plugins/randr/README.md
@@ -0,0 +1,18 @@
+# Randr
+
+A plugin to quickly change monitor configurations on the fly.
+
+## Usage
+
+Type in the configured prefix (default is in [Configuration](#Configuration)), and select from the options. Fuzzy matching is enabled so it can be
+used to narrow down the options.
+
+## Configuration
+
+```ron
+//<Anyrun config dir>/randr.ron
+Config(
+  prefix: ":dp",
+  max_entries: 5, 
+)
+```
\ No newline at end of file
diff --git a/plugins/rink/README.md b/plugins/rink/README.md
new file mode 100644
index 0000000..c438d96
--- /dev/null
+++ b/plugins/rink/README.md
@@ -0,0 +1,7 @@
+# Rink
+
+A simple calculator plugin powered by [Rink](https://github.com/tiffany352/rink-rs).
+
+## Usage
+
+Just type in your calculations/unit conversions.
\ No newline at end of file
diff --git a/plugins/shell/README.md b/plugins/shell/README.md
new file mode 100644
index 0000000..9c5a45c
--- /dev/null
+++ b/plugins/shell/README.md
@@ -0,0 +1,18 @@
+# Shell
+
+Run shell commands.
+
+## Usage
+
+Type in `<prefix><command>`, where `<prefix>` is the configured prefix (default in [Configuration](#Configuration)) and `<command>` is the command you want to run.
+
+## Configuration
+
+```ron
+// <Anyrun config dir>/shell.ron
+Config(
+  prefix: ":sh",
+  // Override the shell used to launch the command
+  shell: None,
+)
+```
\ No newline at end of file
diff --git a/plugins/stdin/README.md b/plugins/stdin/README.md
new file mode 100644
index 0000000..497a7a1
--- /dev/null
+++ b/plugins/stdin/README.md
@@ -0,0 +1,9 @@
+# Stdin
+
+Reads lines from the standard input and fuzzy matches on those. The selected one is printed to stdout.
+Allows for easy integration into scripts that have been made with something like dmenu in mind.
+
+## Usage
+
+This plugin should generally be used alone, if a dmenu replacement is needed. This can be done with `anyrun -o libstdin.so`.
+The content to fuzzy match on needs to be piped into Anyrun.
\ No newline at end of file
diff --git a/plugins/symbols/README.md b/plugins/symbols/README.md
index beab5f2..ef723af 100644
--- a/plugins/symbols/README.md
+++ b/plugins/symbols/README.md
@@ -1,13 +1,21 @@
 # Symbols
 
-## User defined symbols
+Look up unicode symbols and custom user defined symbols.
+
+## Usage
+
+Simply search for the symbol's name.
+
+## Configuration
 
-User defined symbols are defined in the `symbols.ron` file inside the anyrun configuration directory. The structure of the file is as follows:
 ```ron
+// <Anyrun config dir>/symbols.ron
 Config(
+  // Custom user defined symbols to be included along the unicode symbols
   symbols: {
-    // "search-term": "text to be copied"
+    // "name": "text to be copied"
     "shrug": "¯\_(ツ)_/¯",
-  }
+  },
+  max_entries: 3,
 )
 ```
diff --git a/plugins/translate/README.md b/plugins/translate/README.md
new file mode 100644
index 0000000..c7d5e1a
--- /dev/null
+++ b/plugins/translate/README.md
@@ -0,0 +1,17 @@
+# Translate
+
+Quickly translate text using the Google Translate API.
+
+## Usage
+
+Type in `<prefix><target lang> <text to translate>`, where prefix is the configured prefix (default is in [Configuration](#Configuration)) and the rest are pretty obvious.
+
+## Configuration
+
+```ron
+// <Anyrun config dir>/translate.ron
+Config(
+  prefix: ":",
+  max_entries: 3,
+)
+```
\ No newline at end of file