Compare commits
4 Commits
0db1486d27
...
7fb495cab5
| Author | SHA1 | Date |
|---|---|---|
|
|
7fb495cab5 | |
|
|
779f02a78b | |
|
|
2cff35a45d | |
|
|
64484169e2 |
|
|
@ -1,7 +1,7 @@
|
|||
#compdef xdg-mime
|
||||
|
||||
# Description:
|
||||
# ZSH Completion for xdg-mime 1.2.1 from
|
||||
# Description:
|
||||
# ZSH Completion for xdg-mime 1.2.1 from
|
||||
# xdg-utils (https://gitlab.freedesktop.org/xdg/xdg-utils)
|
||||
#
|
||||
# Authors:
|
||||
|
|
@ -10,21 +10,21 @@
|
|||
_xdg-mime_query() {
|
||||
_arguments \
|
||||
"1:Query Type:((
|
||||
filetype\:'Returns mime-type of a file'
|
||||
filetype\:'Returns mime-type of a file'
|
||||
default\:'Returns default application for a mime-type'))" \
|
||||
"*::arg:->args"
|
||||
|
||||
case $line[1] in
|
||||
filetype) _arguments '*: :_files' ;;
|
||||
default) _arguments '*: :_mime_types' ;;
|
||||
filetype) _files ;;
|
||||
default) _mime_types ;;
|
||||
esac
|
||||
}
|
||||
|
||||
_xdg-mime() {
|
||||
local line
|
||||
local -A appdirs=(
|
||||
local -a appdirs=(
|
||||
/usr/share/applications
|
||||
$HOME/.local/share/applications
|
||||
"$HOME/.local/share/applications"
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
|
|
@ -38,7 +38,7 @@ _xdg-mime() {
|
|||
query) _xdg-mime_query ;;
|
||||
default)
|
||||
_arguments \
|
||||
"1:Application:_files -W '$appdirs' -g '*.desktop'" \
|
||||
"1:Application:_files -W appdirs -g '*.desktop'" \
|
||||
'2: :_mime_types'
|
||||
;;
|
||||
install)
|
||||
|
|
@ -59,4 +59,12 @@ _xdg-mime() {
|
|||
esac
|
||||
}
|
||||
|
||||
# vim: filetype=zsh expandtab softtabstop=2 tabstop=2 shiftwidth=2
|
||||
_xdg-mime "$@"
|
||||
|
||||
# Local Variables:
|
||||
# mode: Shell-Script
|
||||
# sh-indentation: 2
|
||||
# indent-tabs-mode: nil
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: filetype=zsh expandtab softtabstop=2 tabstop=2 shiftwidth=2
|
||||
|
|
|
|||
Loading…
Reference in New Issue