2005-05-25 01:58:08 -07:00
|
|
|
# $Id$
|
|
|
|
# bash-completion script for enlightenment_remote
|
|
|
|
# By Justin Rocha (Xenith)
|
2005-09-27 11:01:05 -07:00
|
|
|
# Additions by Sebastian Dransfeld
|
2005-05-25 01:58:08 -07:00
|
|
|
|
2005-09-27 15:31:29 -07:00
|
|
|
# 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
|
|
|
|
|
2005-05-25 01:58:08 -07:00
|
|
|
_enlightenment_remote() {
|
|
|
|
local cur prev opts
|
|
|
|
COMPREPLY=()
|
|
|
|
cur=${COMP_WORDS[COMP_CWORD]}
|
|
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
2005-09-27 11:01:05 -07:00
|
|
|
action=${COMP_WORDS[1]}
|
2005-09-21 09:47:02 -07:00
|
|
|
opts=`enlightenment_remote -h | awk '{print $1}' | grep -v "OPTIONS:" | xargs`
|
2005-09-27 11:01:05 -07:00
|
|
|
CONTEXT="NONE BORDER ZONE CONTAINER MANAGER MENU WINLIST POPUP ANY"
|
|
|
|
MODIFIERS="NONE SHIFT| SHIFT CONTROL| CONTROL ALT| ALT WIN| WIN"
|
2005-09-27 15:31:29 -07:00
|
|
|
DIRS="data images fonts themes init icons modules backgrounds"
|
|
|
|
THEME_CATEGORIES="theme"
|
2005-09-27 11:01:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
case "${action}" in
|
|
|
|
-h|-help|--help)
|
|
|
|
COMPREPLY=($(compgen -W "${opts/-h -help --help}" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-always-click-to-raise-set| \
|
|
|
|
-border-shade-animate-set| \
|
|
|
|
-edge-flip-set| \
|
2005-09-27 15:31:29 -07:00
|
|
|
-focus-last-focused-per-desktop-set| \
|
|
|
|
-focus-revert-on-hide-or-close-set| \
|
2005-09-27 11:01:05 -07:00
|
|
|
-kill-if-close-not-possible-set| \
|
|
|
|
-kill-process-set| \
|
|
|
|
-modal-windows-set| \
|
|
|
|
-move-info-follows-set| \
|
|
|
|
-pass-click-on-set| \
|
|
|
|
-ping-clients-set| \
|
|
|
|
-resize-info-follows-set| \
|
|
|
|
-transient-*-set| \
|
|
|
|
-use-*-set| \
|
|
|
|
-winlist-list-*-set| \
|
2005-09-27 15:31:29 -07:00
|
|
|
-winlist-scroll-animate-set| \
|
2005-09-27 11:01:05 -07:00
|
|
|
-winlist-warp-at-end-set| \
|
|
|
|
-winlist-warp-while-selecting-set)
|
|
|
|
COMPREPLY=($(compgen -W " 0 1" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-binding-key-add)
|
|
|
|
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
|
|
|
COMPREPLY=($(compgen -W "${CONTEXT}" -- "${cur}"))
|
|
|
|
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
|
|
|
COMPREPLY=()
|
|
|
|
elif [[ ${COMP_CWORD} -eq 4 ]]; then
|
|
|
|
# Find the selected modifiers
|
|
|
|
selected=${cur#\'}
|
|
|
|
selected=$(echo $selected | sed -e 's/\(.*|\)\?.*/\1/')
|
|
|
|
# create updated modifier list
|
|
|
|
if [[ "${selected}" ]]; then
|
|
|
|
for modifier in ${MODIFIERS}; do
|
|
|
|
if ! echo $selected | grep -q $modifier; then
|
|
|
|
curmod="${curmod} ${selected}${modifier}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
else
|
|
|
|
curmod=${MODIFIERS}
|
|
|
|
fi
|
|
|
|
|
|
|
|
COMPREPLY=($(compgen -P "'" -S "'" -W "${curmod}" -- "${cur}"))
|
|
|
|
elif [[ ${COMP_CWORD} -eq 5 ]]; then
|
|
|
|
COMPREPLY=($(compgen -W "0 1" -- "${cur}"))
|
|
|
|
elif [[ ${COMP_CWORD} -eq 6 ]]; then
|
|
|
|
COMPREPLY=()
|
|
|
|
elif [[ ${COMP_CWORD} -eq 7 ]]; then
|
|
|
|
COMPREPLY=()
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-binding-key-del)
|
|
|
|
context=${COMP_WORDS[2]}
|
|
|
|
key=${COMP_WORDS[3]}
|
|
|
|
modifiers=${COMP_WORDS[4]}
|
|
|
|
modifiers=${modifiers#\'}
|
|
|
|
modifiers=${modifiers%\'}
|
|
|
|
any_mod=${COMP_WORDS[5]}
|
|
|
|
action=${COMP_WORDS[6]}
|
|
|
|
params=${COMP_WORDS[7]}
|
2005-09-27 12:12:11 -07:00
|
|
|
SIFS=$IFS
|
|
|
|
IFS=$'\n'
|
2005-09-27 11:01:05 -07:00
|
|
|
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
2005-09-27 12:12:11 -07:00
|
|
|
binding=$(enlightenment_remote -binding-key-list|grep 'REPLY:'|sed -e "s/.*CONTEXT=\(\S\+\)\s\+KEY=\"\(\S\+\)\"\s\+MODIFIERS=\(\S\+\)\s\+ANY_MOD=\(\S\+\)\s\+ACTION=\"\(\S\+\)\"\s\+PARAMS=\"\(\S\+\)\".*/'\1 \2 \3 \4 \5 \6'/"|grep -v 'REPLY:')
|
2005-09-27 11:01:05 -07:00
|
|
|
COMPREPLY=($(compgen -W "${binding}" -- "${cur}"))
|
|
|
|
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
2005-09-27 12:12:11 -07:00
|
|
|
binding=$(enlightenment_remote -binding-key-list|grep 'REPLY:'|sed -e "s/.*CONTEXT=${context}\s\+KEY=\"\(\S\+\)\"\s\+MODIFIERS=\(\S\+\)\s\+ANY_MOD=\(\S\+\)\s\+ACTION=\"\(\S\+\)\"\s\+PARAMS=\"\(\S\+\)\".*/'\1 \2 \3 \4 \5'/"|grep -v 'REPLY:')
|
2005-09-27 11:01:05 -07:00
|
|
|
COMPREPLY=($(compgen -W "${binding}" -- "${cur}"))
|
|
|
|
elif [[ ${COMP_CWORD} -eq 4 ]]; then
|
2005-09-27 12:12:11 -07:00
|
|
|
binding=$(enlightenment_remote -binding-key-list|grep 'REPLY:'|sed -e "s/.*CONTEXT=${context}\s\+KEY=\"${key}\"\s\+MODIFIERS=\(\S\+\)\s\+ANY_MOD=\(\S\+\)\s\+ACTION=\"\(\S\+\)\"\s\+PARAMS=\"\(\S\+\)\".*/'\1 \2 \3 \4'/"|grep -v 'REPLY:')
|
|
|
|
COMPREPLY=($(compgen -W "${binding}" -- "${cur}"))
|
2005-09-27 11:01:05 -07:00
|
|
|
elif [[ ${COMP_CWORD} -eq 5 ]]; then
|
2005-09-27 12:12:11 -07:00
|
|
|
binding=$(enlightenment_remote -binding-key-list|grep 'REPLY:'|sed -e "s/.*CONTEXT=${context}\s\+KEY=\"${key}\"\s\+MODIFIERS=${modifiers}\s\+ANY_MOD=\(\S\+\)\s\+ACTION=\"\(\S\+\)\"\s\+PARAMS=\"\(\S\+\)\".*/'\1 \2 \3'/"|grep -v 'REPLY:')
|
2005-09-27 11:01:05 -07:00
|
|
|
COMPREPLY=($(compgen -W "${binding}" -- "${cur}"))
|
|
|
|
elif [[ ${COMP_CWORD} -eq 6 ]]; then
|
2005-09-27 12:12:11 -07:00
|
|
|
binding=$(enlightenment_remote -binding-key-list|grep 'REPLY:'|sed -e "s/.*CONTEXT=${context}\s\+KEY=\"${key}\"\s\+MODIFIERS=${modifiers}\s\+ANY_MOD=${any_mod}\s\+ACTION=\"\(\S\+\)\"\s\+PARAMS=\"\(\S\+\)\".*/'\1 \2'/"|grep -v 'REPLY:')
|
2005-09-27 11:01:05 -07:00
|
|
|
COMPREPLY=($(compgen -W "${binding}" -- "${cur}"))
|
|
|
|
elif [[ ${COMP_CWORD} -eq 7 ]]; then
|
2005-09-27 12:12:11 -07:00
|
|
|
binding=$(enlightenment_remote -binding-key-list|grep 'REPLY:'|sed -e "s/.*CONTEXT=${context}\s\+KEY=\"${key}\"\s\+MODIFIERS=${modifiers}\s\+ANY_MOD=${any_mod}\s\+ACTION=\"${action}\"\s\+PARAMS=\"\(\S\+\)\".*/'\1'/"|grep -v 'REPLY:')
|
2005-09-27 11:01:05 -07:00
|
|
|
COMPREPLY=($(compgen -W "${binding}" -- "${cur}"))
|
|
|
|
fi
|
2005-09-27 12:12:11 -07:00
|
|
|
IFS=$SIFS
|
2005-09-27 11:01:05 -07:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-border-shade-transition-set)
|
|
|
|
COMPREPLY=($(compgen -W " 0 1 2 3" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2005-09-27 15:31:29 -07:00
|
|
|
-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
|
|
|
|
;;
|
2005-09-27 11:01:05 -07:00
|
|
|
-focus-policy-set)
|
|
|
|
COMPREPLY=($(compgen -W "CLICK MOUSE SLOPPY" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-focus-setting-set)
|
|
|
|
COMPREPLY=($(compgen -W "NONE NEW_WINDOW NEW_DIALOG NEW_DIALOG_IF_OWNER_FOCUSED" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2005-09-27 15:31:29 -07:00
|
|
|
-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
|
|
|
|
;;
|
2005-09-27 11:01:05 -07:00
|
|
|
-maximize-policy-set)
|
|
|
|
COMPREPLY=($(compgen -W "FULLSCREEN SMART EXPAND FILL" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-module-enable)
|
|
|
|
modules=$(enlightenment_remote -module-list|grep REPLY:|grep 0$|awk '{print $2}')
|
|
|
|
COMPREPLY=($(compgen -W "${modules}" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-module-disable)
|
|
|
|
modules=$(enlightenment_remote -module-list|grep REPLY:|grep 1$|awk '{print $2}')
|
|
|
|
COMPREPLY=($(compgen -W "${modules}" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2005-09-27 15:31:29 -07:00
|
|
|
-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
|
|
|
|
;;
|
2005-09-27 11:01:05 -07:00
|
|
|
-module-unload)
|
|
|
|
modules=$(enlightenment_remote -module-list|grep REPLY:|awk '{print $2}')
|
|
|
|
COMPREPLY=($(compgen -W "${modules}" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
2005-09-27 15:31:29 -07:00
|
|
|
-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
|
|
|
|
;;
|
2005-09-27 11:01:05 -07:00
|
|
|
-window-placement-policy-set)
|
|
|
|
COMPREPLY=($(compgen -W "SMART CURSOR MANUAL" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
2005-05-25 01:58:08 -07:00
|
|
|
|
|
|
|
if [[ "${cur}" == -* ]] || [[ ${COMP_CWORD} -eq 1 ]]; then
|
|
|
|
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
complete -F _enlightenment_remote enlightenment_remote
|
2005-09-21 09:47:02 -07:00
|
|
|
|