Update 2017-05-22 (see also initial post)
I consider this the most important update so far because it gives real power to this little script.
Commandbox
This emulates ROX-filer's "Shell command box" which opens when the user presses Shift+!. It allows to execute any command, script or application.
In ROX-Filer this feature is severely crippled by the lack of any output. Hard to tell if a command was successful or not. More a nuisance is its habit of closing the box after the command has finished, which makes repeated runs cumbersome. And lastly there is a danger of freezing the computer completely by an unsuitable (interactive) command.
In MMview these shortcomings are fixed. Commands are run in a visible terminal emulator and commands can easily be repeated for other selected files by pressing F4 (in MS Excel F4 is the tremendously useful shortcut to repeat a previous command or macro). As for stability it should always be possible to stop a command gone berserk by pressing Ctrl+C or - as a last resort - by closing MMview altogether.
F4 allows efficient workflows. Examples:
- View image files and rotate selected images (e.g. with imagemagick)
- Copy or symlink selected files into a specified directory
- Send selected files to trash
For a comparison between ROX-Filer and MMview see below table.
Terminal
Gtkdialog's terminal widget is rarely used and not fully documented. A good chance to try its features and discover its bugs. By default it is limited to a dismal 100 lines of output. With the undocumented tag attribut "scrollback-lines" this value can be changed. I set it to 1024 lines, the urxvt default.
All options are accessible from the Terminal menu. Tooltips try to explain them. Shortcut Ctrl+T toggles visibility on/off.
Which of the options is most suitable depends on the commands. Some commands like "hexdump" or "stat" are useless without a visible terminal, so "Keep open" should be a useful option. For other commands like "cp" or "mv" the opening of a terminal could be rather distracting, making "Never open" a better choice.
Of course the terminal can be used like any other terminal emulator, with commands entered directly into the terminal pane. Still there are advantages by using the command box. Editing and copy/paste is easier. The command never scrolls off the screen and the output keeps tidy. The command box also sets the tab width of the terminal to 4 characters, thus compatible with Geany, while the "raw" terminal uses the traditional 8 character width.
Other changes
Some menu items changed location. Audio/video play is not a saved preference anymore. WIth Ctrl+Z there is now a convenient way (at least with a US keyboard layout) to start/stop audio.
Comparison of "Shell command box" features in ROX-Filer and MMview
Code: Select all
Feature | ROX | MMview
-------------------------------------------------------------
Open command box with keyboard | Shift+! | Shift+!
Open command box with mouse | yes | yes
Close command box with keyboard | Esc | Esc
Close command box with mouse | no | yes
C.box closes when command starts | yes | no
Execute command with keyboard | Enter | Enter or F4
Execute command with mouse | no | yes
Command output visible | no | yes
Command execution interruptable | no | yes
Interactive cmd can freeze computer| yes | no
Alert user when error occurs | no | yes
Template when opened | "$@" | "$@"
Template configurable | no | yes
Procedure "Select another file | |
and repeat command" |1)select file |1)select file
|2)press Shift+! |2)press F4
|3)press Up key |
|4)press Enter |