about summary refs log tree commit diff
path: root/Completion/X/_x_colormapid
blob: 20e82fa444ccdf5ca3bb460ed274711e68ddf452 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#autoload

local expl list desc

_wanted colormapids || return 1

list=(${(f)"$(xprop -root -f RGB_COLOR_MAP 32xcccccccxx ': $0\n'|awk -F'[ ():]' '/^[a-zA-Z_]+\(RGB_COLOR_MAP\)/ {print $5, "--", $1}')"})

if zstyle -T ":completion:${curcontext}:colormap-id" verbose; then
  desc=(-ld list)
else
  desc=()
fi

_loop colormapids expl 'colormap id' compadd "$@" "$desc[@]" - "${(@)list%% *}"