52 lines
2.0 KiB
Plaintext
52 lines
2.0 KiB
Plaintext
# gnome-control-center tab completion for bash.
|
|
|
|
_gnome_control_center()
|
|
{
|
|
local cur prev command_list i v
|
|
|
|
cur=${COMP_WORDS[COMP_CWORD]}
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
|
|
|
case "$prev" in
|
|
*)
|
|
if [ $prev = "gnome-control-center" ] ; then
|
|
command_list="--verbose --version"
|
|
command_list="$command_list applications background camera color connectivity datetime default-apps diagnostics display info-overview keyboard location lock microphone mouse multitasking notifications online-accounts power printers region removable-media search sharing sound ubuntu universal-access usage user-accounts wwan network wifi bluetooth thunderbolt wacom"
|
|
elif [ $prev = "--verbose" ]; then
|
|
command_list="applications background camera color connectivity datetime default-apps diagnostics display info-overview keyboard location lock microphone mouse multitasking notifications online-accounts power printers region removable-media search sharing sound ubuntu universal-access usage user-accounts wwan network wifi bluetooth thunderbolt wacom"
|
|
fi
|
|
|
|
for i in --version applications background camera color connectivity datetime default-apps diagnostics display info-overview keyboard location lock microphone mouse multitasking notifications online-accounts power printers region removable-media search sharing sound ubuntu universal-access usage user-accounts wwan network wifi bluetooth thunderbolt wacom; do
|
|
if [ $i = $prev ]; then
|
|
case $i in
|
|
keyboard)
|
|
command_list="shortcuts typing"
|
|
;;
|
|
network)
|
|
# FIXME
|
|
# The first 3 commands need an object path like
|
|
# /org/freedesktop/NetworkManager/Devices/1
|
|
command_list="connect-3g connect-8021x-wifi show-device connect-hidden-wifi create-wifi"
|
|
;;
|
|
sound)
|
|
command_list="applications effects hardware input outputs"
|
|
;;
|
|
*)
|
|
command_list=""
|
|
;;
|
|
esac
|
|
fi
|
|
done
|
|
;;
|
|
esac
|
|
|
|
for i in $command_list; do
|
|
if [ -z "${i/$cur*}" ]; then
|
|
COMPREPLY=( ${COMPREPLY[@]} $i )
|
|
fi
|
|
done
|
|
}
|
|
|
|
# load the completion
|
|
complete -F _gnome_control_center gnome-control-center
|