1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-27 08:10:08 +00:00

common-aliases: Replace static document program associations with calls to (xdg-)open

This commit is contained in:
Alexander Schlarb 2018-08-09 22:36:03 +02:00
parent f246f4612a
commit b58bf31444

View file

@ -136,12 +136,28 @@ if is-at-least 4.2.0; then
for ft in $_media_fts; do alias -s $ft=$XMVIEWER; done
fi
#read documents
alias -s pdf=acroread
alias -s ps=gv
alias -s dvi=xdvi
alias -s chm=xchm
alias -s djvu=djview
#open complex document formats using the system viewer
_document_fts=(
# Long-term storage formats
djvu dvi fb2 epub pdf ps rtf
# Office Binary & Office OpenXML
doc docx docm ppt pptx pptm xls xlsx xlsm
# OpenDocument
odt fodt ods fods odp fodp odg fodg odf
# Uniform Office Format
uof uot uos uop
# StarOffice
sdw sxw sdc sxc sdd sci sda sxd smf sxm
# WordPerfect
wpd wp wp4 wp5 wp6 wp7
# Others
abw gnm gnumeric pages hwp
)
if type xdg-open >/dev/null; then
for ft in $_document_fts; do alias -s $ft=xdg-open; done
elif type open >/dev/null; then
for ft in $_document_fts; do alias -s $ft=open; done
fi
#list whats inside packed file
alias -s zip="unzip -l"