diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 14:36:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 14:36:24 +0000 |
commit | 9b6d8e63db85c30007b463e91f91a791969fa83f (patch) | |
tree | 0899af51d73c1bf986f73ae39a03c4436083018a /shell/completions | |
parent | Initial commit. (diff) | |
download | gnome-control-center-upstream.tar.xz gnome-control-center-upstream.zip |
Adding upstream version 1:3.38.4.upstream/1%3.38.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'shell/completions')
-rw-r--r-- | shell/completions/gnome-control-center.in | 51 | ||||
-rw-r--r-- | shell/completions/meson.build | 12 |
2 files changed, 63 insertions, 0 deletions
diff --git a/shell/completions/gnome-control-center.in b/shell/completions/gnome-control-center.in new file mode 100644 index 0000000..51ce4fd --- /dev/null +++ b/shell/completions/gnome-control-center.in @@ -0,0 +1,51 @@ +# 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 @PANELS@" + elif [ $prev = "--verbose" ]; then + command_list="@PANELS@" + fi + + for i in --version @PANELS@; 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 diff --git a/shell/completions/meson.build b/shell/completions/meson.build new file mode 100644 index 0000000..951d060 --- /dev/null +++ b/shell/completions/meson.build @@ -0,0 +1,12 @@ +completion_conf = configuration_data() +completion_conf.set('PANELS', ' '.join(panels_list)) + +desktop = 'gnome-control-center' + +desktop_in = configure_file( + input: desktop + '.in', + output: desktop, + configuration: completion_conf, + install: true, + install_dir: join_paths(control_center_datadir, 'bash-completion', 'completions') +) |