here is WDTVExt plugin which enables you to create "snippets" of command line commands and run them from OSD.
Functional snippets for reboot, pinging localhost (yes, localhost
educational purposes. Stoping/starting rtorrent is of course possible, just to make a "snippet" for it
INSTALL:
- as usual and all other wdtvext plugins, unpack it into .wdtvext-plugins folder, reboot
HOW IT WORKS:
- should be understandable from PING.snippet
- reload snippet will reload all (max 9 currently) snippets in plugin directory
- each line starts with description what it means
[SNIPPETNAME|name of snippet to display in menu]
[NAME|Snippet action name to display]
[ICON|path to not focused image]
[ICONSELECTED|path to focused image]
[NAME|Action name]
- Action name can use variables referenced
[VAR|is editable|type|variable name|variable display name|value/command to evaluate]
- is editable accepted values [N - not editable, E - editable via webend, A - askable via osd]
- type [TEXT, NUMBER, EVALUATE - value of variable is evaluated in runtime, LIST - shows predefined list via osd, LISTEVALUATE - shows list populated using command]
- variablename - reference name to other variables/commands/regexps
- variabledisplayname - variable label to be displayed
- value/command to evaluate - if type is one of evaluated, value is interpreted as shell command an result become value, can use other variables referenced...
[VAROPTION|label|value]
- adds list item to variable
[COMMAND|command in/out display|command to execute, can use variables defined in VAR section referenced as [$varname$]]
[REGEXP|value to be found|Message to be displayed when found|regular expression, can use variables referenced...]
- basically, every COMMAND is executed with [$varname$] replaced with actual value of VAR, then every line of command output is checked against all REGEXP
and when successfull, displaying message defined with that regexp. Message could also contain [$varname$] which will be replaced with acttual values.
v100802: http://www.megaupload.com/?d=X8H4MAST
- first release
- check PING.snippet
v100829: http://www.megaupload.com/?d=5CHNSK4A
- now there are 4 lines of messages which scrolls as new messages are outed
- now variables can be used in regexp also
- added MOUNTSHARES snippet to see how can it work
v100829_2 http://www.megaupload.com/?d=MYS4YHM2
- resolved osd freezing (and reboot required afterwards)
- extended out lines to 7, now it looks like "do you remember iddqd"? you have to see it on ping
- now you can output to "console" also command to be executed and command results
- see attached PING, MOUNTSHARES snippets
- now command has new attribute, which
1: output command
2: output result
3: output both
v100829_3: http://www.megaupload.com/?d=QSQ4X9ZR
- VAR/COMMAND/NAME now accepts pipe "|" characters - see PIPETEST.snippet
- max snippet count raised to 20
- code polishing, less debugg info (depdends on log level)
- small osd changes
v100830: http://www.megaupload.com/?d=34VZVVUI
- added Enable/Disable, Delete snippets (what will guess what could be next action?
- don't mind osd acting under List control... this isn't bug, so please don't post it. If you don't like it, use previous version. Anyway this shouldn't have any negative side effect
- seems stable to me, hasn't freezed the box for a while (for anyone interested, it's not good idea to remove displayed menu items from menu
v100831: http://www.megaupload.com/?d=AIUDV74O
- added Download snippets from SVN (though no snippets in SVN yet)
- reorganized menu, now it has only Execute/Manage on second level
- few bugs removed
- processing of REGEXP changed, now only REGEXP following COMMAND are processed, so every command can have its regexp to evaluate -> easier snippet code
- added snippets for rTorrent start/stop/status
v100903: http://www.megaupload.com/?d=0KGCXW6X
- webend - basic snippet variable configuration (need two reboots to work as it is adding itself to config)
- multi action snippets - now snippets can contain multiple actions selectable on execute via List.
- new SNIPPETNAME entry added - this is displayed on menu entry
- NAME used as action name in List
- every action can have it's own VAR|COMMAND|REGEXP
- a lot of effort into code stability -> now List survives even screensaver display
- no snippets added in this release -> Download them from SVN (Manage/Download snippets)
- rTorrent snippet now contains previous single snippets for START/STOP/STATUS and Move completed
v100905_2 http://www.megaupload.com/?d=DNOLYYEK
- now LIST variable could be "ASKABLE" via osd (ENTER shows next variable if exist, RETURN returns to previous variable)
- new VAR types - EVALUATE/LISTEVALUATE - those values/list items are populated runtime when displaying, even these commands could be dependent on other variables values
- check TESTVAR snippet
- added construct for S00options with some variables
v100907: [version in SVN]
- added multiline commands
v101017:
- variable evaluation optimised
- update via Reloader
- changed snippet SVN repository to separate plugin from snippets
- added MediaNavigation 2.5 configration snippet
TODO:
- webend configuration of snippet variables
(is anyone willing to do it for us? please, you just have to load text file and enable to edit VAR entries in webend, then save file back)
- OSD configuration of snippet variables
...post your snippets here
Enjoy...
...and post comments.
T.




