A small POSIX shell script that shows a rich, human‑readable report about one or more files. It aggregates metadata from common CLI tools (mimetype, file, exiftool, mediainfo, gio) and displays the result in a GUI dialog (yad, zenity, Xdialog, xmessage, gxmessage) or prints it to stdout.
Works great with lightweight file managers that lack a built‑in “Properties / detailed metadata” view. A desktop file is included so that file managers can expose “Open With → Simple File Info”.
- Shell: pure POSIX sh (tested on ksh “The Original AT&T Korn Shell”)
- Lint: passes shellcheck -s sh
- No hard dependencies; it uses whatever tools you have installed
- Collects file information from:
- MimeInfo DB via
mimetype filedatabase (file -iand description)exiftool(rich metadata for many file types)mediainfo(audio/video metadata, some image metadata)gio info(GIO/GVFS attributes)
- MimeInfo DB via
- Shows the combined report in a GUI dialog using the first available backend:
- gxmessage, yad, Xdialog, zenity, xmessage (in that default order)
- CLI mode to print reports to stdout
- Automatic tool detection with per‑tool overrides via environment variables
- Desktop integration (Open With)
-
Copy the script somewhere in your PATH and make it executable:
# system-wide: install -m 0755 simple-file-info /usr/local/bin/ # or per-user: cp simple-file-info ~/.local/bin/simple-file-info && chmod +x ~/.local/bin/simple-file-info
-
Optional: install the provided .desktop file for “Open With” integration:
# system-wide: simple-file-info --desktop-entry > /usr/local/share/applications/simple-file-info.desktop # or per-user: simple-file-info --desktop-entry > ~/.local/share/applications/simple-file-info.desktop
simple-file-info [command] files...
Commands:
--show-reportShow a GUI window with the report for each file (default if no command is given)--print-reportPrint the report to stdout--show-helpShow the help text in a GUI window--helpPrint the help text to stdout and exit--versionPrint program version and exit--licensePrint license text and exit--check-toolsPrint a diagnostic report about external tools--desktop-entryPrint the contents of the built-in desktop entry.
Examples:
# Open a GUI report window for one file
simple-file-info --show-report ./movie.mkv
# Open multiple windows (one per file)
simple-file-info file1.jpg file2.mp4 file3.pdf
# Print to stdout (no GUI required)
simple-file-info --print-report ./photo.jpg
# Troubleshoot detection of tools
simple-file-info --check-toolsNote:
- When multiple files are given with
--show-report, the script opens one window per file.
You can control which reporting tools and which dialog backends are used, and in what order.
- Reporting tools (defaults):
SIMPLE_FILE_INFO_REPORT_TOOLS='MIMETYPE FILE EXIFTOOL MEDIAINFO GIO' - Dialog backends (defaults):
SIMPLE_FILE_INFO_DIALOG_TOOLS='GXMESSAGE YAD XDIALOG ZENITY XMESSAGE'
Override the order or disable a tool by adjusting environment variables before running the script:
# Prefer YAD, then ZENITY, then fall back to GXMESSAGE
export SIMPLE_FILE_INFO_DIALOG_TOOLS='YAD ZENITY GXMESSAGE'
# Use only file(1) and exiftool for the report
export SIMPLE_FILE_INFO_REPORT_TOOLS='FILE EXIFTOOL'Each tool is controlled by a few environment variables:
- Command name/path:
MIMETYPE,FILE,EXIFTOOL,MEDIAINFO,GIO,YAD,ZENITY,XDIALOG,XMESSAGE,GXMESSAGE - Version check option:
<TOOL>_VEROPT(e.g.EXIFTOOL_VEROPT=-ver) - Expected exit code of the version check (rarely needed):
<TOOL>_VEROPT_EXIT_CODE - You can also force-disable a tool by setting
<TOOL>_ENABLED=f(or force-enable witht)
Examples:
# Point to a non-default exiftool binary
export EXIFTOOL=/opt/exiftool/bin/exiftool
# YAD reports its version with a non-zero exit; this is already handled by default:
# export YAD_VEROPT=--version
# export YAD_VEROPT_EXIT_CODE=252
# Completely disable mediainfo
export MEDIAINFO_ENABLED=fThe script will only include sections for tools that are detected and successfully run.
- Tested on Arch Linux with “The Original AT&T Korn Shell” (http://kornshell.org/)
- Should run on any POSIX‑compliant
sh - Linted with
shellcheck -s sh
GUI mode requires at least one dialog backend (gxmessage, yad, Xdialog, zenity, xmessage). CLI mode (--print-report) requires none of those.
- YAD
- Does not choose a sensible default window size/position
- ZENITY
- Does not choose a sensible default window size/position
- Cannot change the window icon
- GNOME look & feel may not match the intended style
- Xdialog
--fixed-fontmay not work on some systems- May show on the “primary” monitor instead of the one with the active window
- Cannot change the window icon
- xmessage
- No CLIPBOARD copy support (PRIMARY only)
- Cannot change the window icon
- No line wrapping for long lines
- No Unicode support
- gxmessage
- Cannot change the window icon
- User‑defined custom action buttons in the dialog
- Pluggable, user‑defined report handlers inside
generate_report - Smarter window sizing and positioning for yad/zenity
Contributions are welcome!
See LICENSE for details.