|Alois Mahdal cc58a8979f Use UTF-8 by default in Dropbox plugin||6 years ago|
|include||6 years ago|
|plugins||6 years ago|
|.travis.yml||7 years ago|
|INSTALL.md||7 years ago|
|README.md||7 years ago|
|TODO.md||7 years ago|
|requirements.txt||7 years ago|
|sardine||6 years ago|
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.
limit in charcters
output format: plain for plain text, xgp for xfce4-genmon-plugin. User-
defined format names must start with
print help message
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/globs 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)
Alternate folder for plugins
Alois Mahdal email@example.com