From f82adabc114e38803e8de0d68e3f33a2ab0965be Mon Sep 17 00:00:00 2001 From: Dylan Date: Sat, 6 Feb 2016 10:49:06 +1100 Subject: [PATCH] Added usage for stdout mode --- 1.1.md | 37 +++++++++++++++++++++++++++++++++++++ README.md | 9 +++++++++ fetch | 10 ++++++++++ 3 files changed, 56 insertions(+) diff --git a/1.1.md b/1.1.md index b6bc0d81..cbc9debf 100644 --- a/1.1.md +++ b/1.1.md @@ -69,6 +69,43 @@ the distro ascii art and the automatic config creation. - Fetch now has a Gentoo/Funtoo e-build courtesy of @z1lt0id +### Stdout + +- Added `stdout` mode which allows you to fetch info in a plain text format that works
+with lemonbar and in your scripts. You can use it by launching fetch with `--stdout` to print all functions enabled
+in your `printinfo` function. You can selectively print functions by passing arguments to `--stdout`
+like so: + +```sh +# Print the output of all info functions enabled in printinfo +fetch --stdout + +# Print the output of memory +fetch --stdout memory + +# Print the output of memory and disk +fetch --stdout disk + +``` + +- Added `--stdout_seperator` and `$stdout_seperator` which takes a string and adds it
+as a seperator between the output. +- Added `--stdout_title` and `$stdout_title` which allow you to toggle the `title@hostname`
+from appearing in the output. +- Added `--stdout_subtitles` which allow you to toggle the `Info:` titles from appearing in
+the output. + +```sh +# Hiding subtitles +fetch --stdout --stdout_subtitles off + +# Custom seperator +fetch --stdout disk gpu --stdout_seperator " | " + +``` + +**NOTE:** `stdout_subtitles` and `stdout_title` only work when `--stdout` is used on its own. + ### Info - You can now display info without a subtitle. eg. `info memory` diff --git a/README.md b/README.md index b1a904fa..e49eeae1 100644 --- a/README.md +++ b/README.md @@ -297,6 +297,15 @@ alias fetch2="fetch \ --ascii_distro distro Which Distro\'s ascii art to print + Stdout: + --stdout info info Launch fetch in stdout mode which prints the info + in a plain-text format that you can use with + lemonbar etc. + --stdout_title on/off Hide/Show the title in stdout mode. + --stdout_seperator string String to use as a seperator in stdout mode. + --stdout_subtitles on/off Hide/Show the subtitles in stdout mode. + + Screenshot: --scrot /path/to/img Take a screenshot, if path is left empty the screen- shot function will use \$scrot_dir and \$scrot_name. diff --git a/fetch b/fetch index f79d8303..f85576d2 100755 --- a/fetch +++ b/fetch @@ -2101,11 +2101,21 @@ usage () { cat << EOF --ascii_distro distro Which Distro\'s ascii art to print + Stdout: + --stdout info info Launch fetch in stdout mode which prints the info + in a plain-text format that you can use with + lemonbar etc. + --stdout_title on/off Hide/Show the title in stdout mode. + --stdout_seperator string String to use as a seperator in stdout mode. + --stdout_subtitles on/off Hide/Show the subtitles in stdout mode. + + Screenshot: --scrot /path/to/img Take a screenshot, if path is left empty the screen- shot function will use \$scrot_dir and \$scrot_name. --scrot_cmd cmd Screenshot program to launch + Other: --config /path/to/config Specify a path to a custom config file --config none Launch the script without a config file