From: Geoff Y. <g...@in...> - 2002-08-31 22:50:49
|
Just a small patch to: * Include icons in the infobox * Put the application info in a separate tab * Allow filetype specific output (in the same way as for 'file(1) says...', but is designed to handle more verbose output) * Allow previewing of images in the infobox. * Fix to ensure (hopefully) UTF-8 valid strings from file(1) and MoreInfo scripts It makes the infobox more like the MacOS X 'Show Info' in finder. The image preview size is configurable. The filetype specific output is designed to allow scripts to extract format specific data which file(1) doescn't provide: e.g. MP3 tag info, the output of dpkg -I <package>, etc. It is implemented in a similar way to the Send To menu: The output of scripts stored in Choices/MoreInfo is captured, where the script name is in the form '<media_type>_<sub_type>'. If an exact match is not made, then just the media type is tried. (So, for example, a script which calls ImageMagick's identify could be used for all image/* files). e.g. All text files: =============== file = ~/Choices/MoreInfo/text ----8<---- #!/bin/sh L=`wc -l < "$@" | tr -cd [:digit:]` echo "$L lines" echo "" if [[ $L > 20 ]]; then echo "First 20 lines:"; E="..."; else E=""; fi echo "------------------" head -qn 20 "$@" echo "$E" ----8<---- Displays the number of lines in a text file and the contents of the first 20 without needing to load a text editor. MP3 files: ========== ~/Choices/MoreInfo/audio_x-mp3 ----8<---- #!/bin/sh mp3info -F -x "$@" ----8<---- Displays verbose information about an MP3 file etc. |