More completion

SVN revision: 17002
This commit is contained in:
sebastid 2005-09-27 22:31:29 +00:00 committed by sebastid
parent 260934e277
commit 5c814cf9ee
1 changed files with 102 additions and 0 deletions

View File

@ -3,6 +3,18 @@
# By Justin Rocha (Xenith)
# Additions by Sebastian Dransfeld
# TODO:
# Add here:
# -binding-mouse-add, -binding-mouse-del
# -binding-signal-add, -binding-signal-del
# -binding-wheel-add, -binding-wheel-del
# -desktop-bg-add, -desktop-bg-del
# -desktop-name-add, -desktop-name-del
# -exec-action
#
# Add in enlightenment_remote
# -action-list
_enlightenment_remote() {
local cur prev opts
COMPREPLY=()
@ -12,6 +24,8 @@ _enlightenment_remote() {
opts=`enlightenment_remote -h | awk '{print $1}' | grep -v "OPTIONS:" | xargs`
CONTEXT="NONE BORDER ZONE CONTAINER MANAGER MENU WINLIST POPUP ANY"
MODIFIERS="NONE SHIFT| SHIFT CONTROL| CONTROL ALT| ALT WIN| WIN"
DIRS="data images fonts themes init icons modules backgrounds"
THEME_CATEGORIES="theme"
case "${action}" in
@ -22,6 +36,8 @@ _enlightenment_remote() {
-always-click-to-raise-set| \
-border-shade-animate-set| \
-edge-flip-set| \
-focus-last-focused-per-desktop-set| \
-focus-revert-on-hide-or-close-set| \
-kill-if-close-not-possible-set| \
-kill-process-set| \
-modal-windows-set| \
@ -32,6 +48,7 @@ _enlightenment_remote() {
-transient-*-set| \
-use-*-set| \
-winlist-list-*-set| \
-winlist-scroll-animate-set| \
-winlist-warp-at-end-set| \
-winlist-warp-while-selecting-set)
COMPREPLY=($(compgen -W " 0 1" -- "${cur}"))
@ -104,6 +121,43 @@ _enlightenment_remote() {
COMPREPLY=($(compgen -W " 0 1 2 3" -- "${cur}"))
return 0
;;
-default-bg-set)
# TODO Add filename expansion, and only match dirs and .edj files
return 0
;;
-default-profile-set)
profiles=$(enlightenment_remote -profile-list|grep REPLY:|awk '{print $2}')
COMPREPLY=($(compgen -W "${profiles}" -- "${cur}"))
return 0
;;
-dirs-list)
COMPREPLY=($(compgen -W "${DIRS}" -- "${cur}"))
return 0
;;
-dirs-list-append|-dirs-list-prepend)
if [[ ${COMP_CWORD} -eq 2 ]]; then
COMPREPLY=($(compgen -W "${DIRS}" -- "${cur}"))
elif [[ ${COMP_CWORD} -eq 3 ]]; then
# TODO Add filename expansion, and only match dirs
COMPREPLY=()
fi
return 0
;;
-dirs-list-remove)
dir=${COMP_WORDS[2]}
if [[ ${COMP_CWORD} -eq 2 ]]; then
COMPREPLY=($(compgen -W "${DIRS}" -- "${cur}"))
elif [[ ${COMP_CWORD} -eq 3 ]]; then
dirs=$(enlightenment_remote -dirs-list ${dir}|grep REPLY:|awk '{print $2}')
COMPREPLY=($(compgen -W "${dirs}" -- "${cur}"))
fi
return 0
;;
-display)
displays=$(/bin/ls $HOME/.ecore/enlightenment-\(*\)/0|sed -e 's+.*enlightenment-(\(.*\))/.*+\1+')
COMPREPLY=($(compgen -W "${displays}" -- "${cur}"))
return 0
;;
-focus-policy-set)
COMPREPLY=($(compgen -W "CLICK MOUSE SLOPPY" -- "${cur}"))
return 0
@ -112,6 +166,33 @@ _enlightenment_remote() {
COMPREPLY=($(compgen -W "NONE NEW_WINDOW NEW_DIALOG NEW_DIALOG_IF_OWNER_FOCUSED" -- "${cur}"))
return 0
;;
-font-default-get|-font-default-remove)
classes=$(enlightenment_remote -font-default-list|grep REPLY:|sed -e 's/.*TEXT_CLASS=\"\(\S\+\)\".*/\1/')
COMPREPLY=($(compgen -W "${classes}" -- "${cur}"))
return 0
;;
-font-default-set)
if [[ ${COMP_CWORD} -eq 2 ]]; then
classes=$(enlightenment_remote -font-default-list|grep REPLY:|sed -e 's/.*TEXT_CLASS=\"\(\S\+\)\".*/\1/')
COMPREPLY=($(compgen -W "${classes}" -- "${cur}"))
elif [[ ${COMP_CWORD} -eq 3 ]]; then
fonts=$(enlightenment_remote -font-available-list|grep REPLY:|awk '{print $2}')
COMPREPLY=($(compgen -W "${fonts}" -- "${cur}"))
elif [[ ${COMP_CWORD} -eq 4 ]]; then
COMPREPLY=()
fi
return 0
;;
-font-fallback-remove)
fonts=$(enlightenment_remote -font-fallback-list|grep REPLY:|awk '{print $2}')
COMPREPLY=($(compgen -W "${fonts}" -- "${cur}"))
return 0
;;
-lang-set)
languages=$(enlightenment_remote -lang-list|grep REPLY:|awk '{print $2}')
COMPREPLY=($(compgen -W "${languages}" -- "${cur}"))
return 0
;;
-maximize-policy-set)
COMPREPLY=($(compgen -W "FULLSCREEN SMART EXPAND FILL" -- "${cur}"))
return 0
@ -126,11 +207,32 @@ _enlightenment_remote() {
COMPREPLY=($(compgen -W "${modules}" -- "${cur}"))
return 0
;;
-module-load)
extra_dir=$(enlightenment-config --module-dir)
# This is a hack. enlightenment-config should return extra dir and standard dir
dir=${extra_dir%_extra}
modules=$(cd ${dir} && /bin/ls && cd ${extra_dir} && /bin/ls)
COMPREPLY=($(compgen -W "${modules}" -- "${cur}"))
return 0
;;
-module-unload)
modules=$(enlightenment_remote -module-list|grep REPLY:|awk '{print $2}')
COMPREPLY=($(compgen -W "${modules}" -- "${cur}"))
return 0
;;
-theme-get|-theme-remove)
COMPREPLY=($(compgen -W "${THEME_CATEGORIES}" -- "${cur}"))
return 0
;;
-theme-set)
if [[ ${COMP_CWORD} -eq 2 ]]; then
COMPREPLY=($(compgen -W "${THEME_CATEGORIES}" -- "${cur}"))
elif [[ ${COMP_CWORD} -eq 3 ]]; then
# TODO Add filename expansion, and only match dirs and .edj files
COMPREPLY=()
fi
return 0
;;
-window-placement-policy-set)
COMPREPLY=($(compgen -W "SMART CURSOR MANUAL" -- "${cur}"))
return 0