mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-12-02 04:08:30 -05:00
12 lines
427 B
Plaintext
12 lines
427 B
Plaintext
|
#!/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) zathura "$selected" & ;;
|
||
|
text/* | */xml) $EDITOR "$selected" ;;
|
||
|
*) xdg-open "$selected" >/dev/null 2>&1 & ;;
|
||
|
esac
|