mirror of
https://github.com/imgurbot12/rmenu.git
synced 2025-02-26 11:44:42 +01:00
feat: better readme and examples
This commit is contained in:
parent
1de4531c3a
commit
317fdafe3b
3 changed files with 54 additions and 11 deletions
42
README.md
42
README.md
|
@ -1,11 +1,5 @@
|
||||||
## RMenu
|
## RMenu
|
||||||
|
|
||||||
<!--
|
|
||||||
TODO: improve documentation:
|
|
||||||
2. explain exchange format and rmenu-build tool
|
|
||||||
3. include more examples including fullscreen/transparent app-window
|
|
||||||
-->
|
|
||||||
|
|
||||||
Another customizable Application-Launcher written in Rust
|
Another customizable Application-Launcher written in Rust
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
@ -18,9 +12,19 @@ Another customizable Application-Launcher written in Rust
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
|
##### Nix
|
||||||
|
|
||||||
RMenu now has Nix support thanks to
|
RMenu now has Nix support thanks to
|
||||||
[@LordGrimmauld](https://github.com/LordGrimmauld)!
|
[@LordGrimmauld](https://github.com/LordGrimmauld)!
|
||||||
|
|
||||||
|
Try it on nix directly via
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix run github:imgurbot12/rmenu -- -r drun
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Other Platforms:
|
||||||
|
|
||||||
Install Dependencies (Ubuntu)
|
Install Dependencies (Ubuntu)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -35,12 +39,14 @@ $ make install
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
View all available options with the builtin help:
|
View all available options with the built-in help:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ rmenu --help
|
$ rmenu --help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Plugins
|
||||||
|
|
||||||
RMenu Comes with a few default plugins.
|
RMenu Comes with a few default plugins.
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description |
|
||||||
|
@ -66,11 +72,13 @@ Or even run plugins in combination if you'd like:
|
||||||
$ rmenu -r run -r drun
|
$ rmenu -r run -r drun
|
||||||
```
|
```
|
||||||
|
|
||||||
Custom Menus can also be passed much like Dmenu by passing items via an input.
|
##### Direct Input
|
||||||
The schema follows a standard as defined in [rmenu-plugin](./rmenu-plugin)
|
|
||||||
|
Custom Menus can also be passed via `/dev/stdin` or as an input file. The schema
|
||||||
|
follows a standard as defined in [rmenu-plugin](./rmenu-plugin)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ generate-my-menu.sh > input.json
|
$ ./examples/rmenu-build.sh > input.json
|
||||||
$ rmenu -i input.json
|
$ rmenu -i input.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -78,9 +86,21 @@ When neither a plugin nor an input are specified, rmenu defaults to reading from
|
||||||
stdin.
|
stdin.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ generate-my-menu.sh | rmenu
|
$ ./examples/rmenu-build.sh | rmenu
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### Supported Formats
|
||||||
|
|
||||||
|
RMenu has two supported input formats: dmenu-like and JSON. JSON is the default
|
||||||
|
provided by rmenu and allows for rich configuration and controls for dynamically
|
||||||
|
generated menus. You can switch between supported formats with `-f`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ printf 'foo\nbar\nbaz' | rmenu -f dmenu
|
||||||
|
```
|
||||||
|
|
||||||
|
Check the [examples](./examples) folder for more examples.
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|
||||||
Customize RMenu Behavior and Appearal in a
|
Customize RMenu Behavior and Appearal in a
|
||||||
|
|
10
examples/dmenu.sh
Executable file
10
examples/dmenu.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# basic dmenu-like implementation
|
||||||
|
eval "`printf 'ls /\ndf -h\nwho\nfoot -e top' | rmenu -f dmenu`"
|
||||||
|
|
||||||
|
# supports dmenu
|
||||||
|
echo "========="
|
||||||
|
echo try "\"printf 'foo\\\\nbar\\\\nbaz' | rmenu -f dmenu\""
|
||||||
|
echo try "\"exec \`dmenu_path | rmenu -f dmenu\`\""
|
||||||
|
|
13
examples/rmenu-build.sh
Executable file
13
examples/rmenu-build.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# customize rmenu options directly from stdin
|
||||||
|
rmenu-build options --placeholder 'placeholder'
|
||||||
|
|
||||||
|
# build entries for rmenu using rmenu-build tool to define json
|
||||||
|
rmenu-build entry -n foo -c 'run ls /' -a "`rmenu-build action ls / -c action-comment-1`"
|
||||||
|
rmenu-build entry -n foo -c 'run df -h' -a "`rmenu-build action -c baz -- df -h`"
|
||||||
|
rmenu-build entry -n baz -c 'run who' -a "`rmenu-build action who -c action-comment-3`"
|
||||||
|
|
||||||
|
# supports alternate action-modes like `echo` and `terminal`
|
||||||
|
rmenu-build entry -n hello -c 'echo helloworld' -a "`rmenu-build action --mode echo hello world!`"
|
||||||
|
rmenu-build entry -n term -c 'runs top in term' -a "`rmenu-build action --mode terminal top`"
|
Loading…
Add table
Reference in a new issue