mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-12-02 12:18:41 -05:00
12 lines
458 B
Bash
Executable File
12 lines
458 B
Bash
Executable File
#!/bin/sh
|
|
|
|
selected=$(fzf --no-multi --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null')
|
|
mimetype=$(file -b --mime-type "$selected")
|
|
|
|
case "$mimetype" in
|
|
*.doc|*.docx|*.odt|*.ott|*.xls|*.xlsx|*.xlsmx|*.ods|*.odp|*.sxc|*.ppt|*.pptx) libreoffice "$selected" & ;;
|
|
*.pdf|*.cbz|*.cbr|*.cbt|*.cba|*.djvu) zathura "$selected" & ;;
|
|
text/* | */xml) $EDITOR "$selected" ;;
|
|
*) xdg-open "$selected" >/dev/null 2>&1 & ;;
|
|
esac
|