diff --git a/README.md b/README.md index 823c0ac..fe59eb6 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,5 @@ ## RMenu - - Another customizable Application-Launcher written in Rust ### Features @@ -18,9 +12,19 @@ Another customizable Application-Launcher written in Rust ### Installation +##### Nix + RMenu now has Nix support thanks to [@LordGrimmauld](https://github.com/LordGrimmauld)! +Try it on nix directly via + +```bash +nix run github:imgurbot12/rmenu -- -r drun +``` + +##### Other Platforms: + Install Dependencies (Ubuntu) ```bash @@ -35,12 +39,14 @@ $ make install ### Usage -View all available options with the builtin help: +View all available options with the built-in help: ```bash $ rmenu --help ``` +##### Plugins + RMenu Comes with a few default plugins. | Name | Description | @@ -66,11 +72,13 @@ Or even run plugins in combination if you'd like: $ rmenu -r run -r drun ``` -Custom Menus can also be passed much like Dmenu by passing items via an input. -The schema follows a standard as defined in [rmenu-plugin](./rmenu-plugin) +##### Direct Input + +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 -$ generate-my-menu.sh > input.json +$ ./examples/rmenu-build.sh > 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. ```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 Customize RMenu Behavior and Appearal in a diff --git a/examples/dmenu.sh b/examples/dmenu.sh new file mode 100755 index 0000000..47a0455 --- /dev/null +++ b/examples/dmenu.sh @@ -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\`\"" + diff --git a/examples/rmenu-build.sh b/examples/rmenu-build.sh new file mode 100755 index 0000000..c79844f --- /dev/null +++ b/examples/rmenu-build.sh @@ -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`"