A modest string writer

README 2.6KB

GMON
====

Generic plugin-based monitor, mainly for use with Xfce genmon

Generic plugin-based monitor, mainly for use with Xfce genmon.


SYNOPSIS
--------

gmon [options] command [args...]


DESCRIPTION
-----------

gmon is a plugin-based "pretty-printer" that allows adding own sub-commands
and use them with common interface.

Typical use case is when you have a space where only limited number of characters
can be displayed, but you want to display arbitrary amount of information (like
name of currently playing song or status of a task), either having it trimmed
gracefully or defining own way how to "squeeze" it in.

Apart from that, the plugin can define other modes of output that might suit
other targets better. For example, genmon Xfce plugin is able to periodically
display output of a command in desktop panel. Apart from displaying simple
string, it can parse XML-like content and use it to display tooltip or an icon.
You could implement mode in your plugin for this target, and use gmon both for
your Xfce panel and your terminal in a consistent manner.


OPTIONS
-------

`-c`, `--chars` *chars*
limit in charcters

`--format` *format*
output format: *plain* for plain text, *xgp* for xfce4-genmon-plugin. User-
defined format names must start with `x-` prefix.

`-p`, `--plain`
same as `--format=plain`

`-x`, `--xgp`
same as `--format=xgp`

`-h`, `--help`
print help message

`--version`
show version


EXAMPLE PLUGINS
---------------

These are pretty useless for real life, they only serve for illustration
of basic concept or as examples of how to implement your own plugin.

### sh ###

This one takes first argument as a command name and runs it as a new process,
passing the rest of arguments to it untouched:

$ gmon sh uname -a
Linux fullmoon.brq.redhat.com 3.13.6-...
$ gmon sh who
somebody tty1 2014-03-28 19:...

Note that arguments are untouched, so things like wildcards/glubs will not
work (unless the shell where you type the `gmon` command expands them).


### echo ###

Connects the arguments and prints them:

$ gmon echo hello
hello
$ gmon echo "one two" "three"
one twothree


### dump ###

Dumps the arguments as Python sees them (using repr() builtin)

$ gmon dump "one two" "three"
args = ['one two', 'three']
$ gmon dump uname -a
args = ['uname', '-a']


FILES
-----

*plugins*
folder where plugins are stored


ENVIRONMENT
-----------

`GMON_PLUGINS`
Alternate folder for plugins


AUTHOR
------

Alois Mahdal


SEE ALSO
--------

[xfce4-genmon-plugin page](http://goodies.xfce.org/projects/panel-plugins/xfce4-genmon-plugin)