18 lines
322 B
Bash
Executable file
18 lines
322 B
Bash
Executable file
#!/bin/zsh
|
|
|
|
source ${$(realpath "$0"):h:h}/lib/common.zsh
|
|
|
|
if ! exists column; then
|
|
column() { cat }
|
|
fi
|
|
|
|
{
|
|
echo -e "file\ttype\tdefault program"
|
|
for file in "$@"; do
|
|
mimetype=$(xdg-mime query filetype $file)
|
|
prog=$(xdg-mime query default $mimetype)
|
|
echo -e "$file\t$mimetype\t$prog"
|
|
done
|
|
} | column -t -s $'\t'
|
|
|