Alois Mahdal e92439cc85 Use proper ellipsis (U+2026) | преди 10 години | |
---|---|---|
include | преди 10 години | |
plugins | преди 10 години | |
INSTALL.md | преди 10 години | |
README.md | преди 10 години | |
sardine | преди 10 години |
Generic plugin-based monitor, mainly for use with Xfce genmon
Generic plugin-based monitor, mainly for use with Xfce genmon.
sardine [options] command [args...]
sardine 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 sardine both for your Xfce panel and your terminal in a consistent manner.
-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
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.
This one takes first argument as a command name and runs it as a new process, passing the rest of arguments to it untouched:
$ sardine sh uname -a
Linux fullmoon.brq.redhat.com 3.13.6-...
$ sardine 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 sardine
command expands them).
Connects the arguments and prints them:
$ sardine echo hello
hello
$ sardine echo "one two" "three"
one twothree
Dumps the arguments as Python sees them (using repr() builtin)
$ sardine dump "one two" "three"
args = ['one two', 'three']
$ sardine dump uname -a
args = ['uname', '-a']
plugins folder where plugins are stored
/etc/sardine/config system-wide configuration file
~/.config/sardine/config user's personal config
~/.local/share/sardine/plugins/ plugin local storage (if needed)
SARDINE_PLUGINS
Alternate folder for plugins
Alois Mahdal alois.mahdal@zxcvb.cz