Hello folks, as you get more and more lazy, you just want to lie on your couch and do everything via the remote of your vdr without the need to power on your office computer. And many tasks you do with computers follow the scheme: "do something with some file{,s} and maybe write a result anywhere". So here is a file browser plugin that lets you do just this: Browsing files and execute arbitrary actions on them.
Here is the link: http://www.stud.uni-karlsruhe.de/~uqg8/vdr/filebrowser
I would appreciate any comments, reviews, tips, bug reports, patches, whatever.
Regards, Holger
And here a quick copy&paste from README:
------------ Description: ------------
This plugin is a filebrowser with user-defined commands to execute on files. Commands run asynchronously, so you can have longer tasks without the need of at and friends while being able to see current output and to kill them if appropriate.
------------- Installation: -------------
There are no special requirements despite of a simple patch to be applied to vdr sources: cd [vdr source dir] && patch < PLUGINS/src/filebrowser/patches/vdr-menuitems-protected-members.diff (Makes a member protected that is private) Then build as usual. [Tested with vdr 1.3.34]
-------------- Configuration: --------------
Configuration files are located in a directory named "filebrowser" in your plugin configuration directory, i.e. /var/lib/vdr/plugins/filebrowser. Example configuration files are provided in this package in directory "examples", which also contains some scripts that could be used as commands. To the config files:
* commands.conf * A file defining commands to be run on files, roughly based on vdr's original commands.conf syntax: Columns are separated by colons, first column is the name of the command. When it ends with a question mark, you will be asked whether you really want to execute this command. The second column contains a filename pattern, that you only see commands useful in current context. The third column contains the command to be executed, where following expansions are made: %f: current file %d: if available, a destination file must be choosed, which is inserted here %D: if available, a destination file must be choosed, with the possibility to create a new one %m: expands to currently marked files, separated by a space. If no file is marked, current file is used %M: the same as %m, but this will chage some time - don't use it %%: % %:: :
Examples: Remove?:*:rm -rf %m Move:*.c:mv %m %D
* order.conf * A file to reorder commands. Usually you will see internal commands first, then commands from commands.conf and then a command to show the thread list. To reorder, just insert the names of the commands in this file, one per line. Attention: Internal command names are localized, so your order.conf needs to be changed when you switch from english to french, and again when you switch from french to german. Attention2: For custom commands, remove the question mark and escaped colons. Commands not mentioned in order.conf are appended to ordered commands.
Example (uses commands.conf-snippet from above): Remove #shows remove first Threads #an internal command to see currently executing commands Mark #an internal command
Please note that those comments aren't supported in order.conf at the time!
* Setup parameters * Here we have two: Base Directory: The path where browsing starts (and is limited to) - this will be superceded by the sources approach known from other plugins somewhen (default: /) Show hidden files: Determines whether to show hidden files or not (default: no)
------ Usage: ------ When selecting the plugin, you can browse your files as you would do it with mp3/mplayer and friends. The only difference is that entering a directory is considered opening a new menu, so pressing back will send you to the parent directory and not to main menu as in some plugins. I think that enhanches user experience. You can execute commands using the color keys of your remote, if there are more than 4, you have to "scroll" using the blue key (it's shown as ">>"). That will be improved by opening a menu with commands some time (See HISTORY->TODO). Usually, commands are run against the current file, but you can also mark/unmark files and execute a command for more files. Note that this only works when the command is configured to use marked files (see section Configuration above). When a command is executed, you will see the output in a scrolling text menu. The menu tries to scroll to the bottom automaticially, that you see the most recent lines of output. So if you want to scroll up to inspect currently invisible lines, you should pause updates (yellow key) to prevent automated scrolling after the next update. Pressing the blue key kills the command, Back closes the output menu (but the command is still running if it was not killed). This output menu is available for every started command when selecting command "Threads" in the browsing menu. This menu also enables you to kill a runnig command, or to remove a finished command from the list.