diff --git a/sources/gui/CMakeLists.txt b/sources/gui/CMakeLists.txt index 47bafab..3d7a689 100644 --- a/sources/gui/CMakeLists.txt +++ b/sources/gui/CMakeLists.txt @@ -23,4 +23,4 @@ configure_file (${SUBPROJECT_MAN_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MA install (FILES ${SUBPROJECT}.desktop DESTINATION share/applications/) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN} DESTINATION share/man/man1/) install (FILES bash-completions DESTINATION share/bash-completion/completions/ RENAME _${SUBPROJECT}) -install (FILES zsh-completions DESTINATION share/zsh/site-functions/ RENAME _${SUBPROJECT}) +install (FILES zsh-completions DESTINATION share/zsh/site-functions/ RENAME ${SUBPROJECT}) diff --git a/sources/gui/bash-completions b/sources/gui/bash-completions index 8a4f2ae..f50ccd2 100644 --- a/sources/gui/bash-completions +++ b/sources/gui/bash-completions @@ -68,7 +68,9 @@ _netctl_gui_tabs=( '3' ) -_netctl_profiles=($(find /etc/netctl -maxdepth 1 -type f -printf "%f\n")) +_netctl_profiles() { + echo $(find /etc/netctl -maxdepth 1 -type f -printf "%f\n") +} # work block @@ -79,12 +81,12 @@ _netctl_gui() { wantsettings='-@(-set-opts)' wantstring='-@(e|-essid)' wanttabs='-@(t|-tab)' - _get_comp_words_by_ref cur prev + _get_comp_words_by_ref cur prev words cword if [[ $prev = $wantfiles ]]; then _filedir elif [[ $prev = $wantprofiles ]]; then - COMPREPLY=($(compgen -W '${_netctl_profiles[@]}' -- "$cur")) + COMPREPLY=($(compgen -W '$(_netctl_profiles)' -- "$cur")) elif [[ $prev = $wantsettings ]]; then COMPREPLY=($(compgen -S ',' -W '${_netctl_gui_settings[@]}' -- "$cur")) elif [[ $prev = $wantstring ]]; then