Several new scripts added

This commit is contained in:
Alexander Gehrke 2020-07-29 14:58:50 +02:00
parent 1809ffacb3
commit cdbcc9692a
5 changed files with 82 additions and 0 deletions

17
misc/xdg-info Executable file
View file

@ -0,0 +1,17 @@
#!/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'