diff options
author | Marek Paśnikowski <marekpasnikowski@protonmail.com> | 2023-01-09 09:08:32 +0100 |
---|---|---|
committer | Marek Paśnikowski <marekpasnikowski@protonmail.com> | 2023-01-09 09:08:32 +0100 |
commit | ac88ca791197a0b477816a6c6da879aa99bb7221 (patch) | |
tree | dc0070b8ab3b22502c415ed1d3ca6aa5cc471609 /bashrc | |
parent | 826328f8489153db52e99af00767a5960f625e6b (diff) |
Set environment for KDESRC-build
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +# kdesrc-build ################################################################# + +## Add kdesrc-build to PATH +export PATH="$HOME/kde/src/kdesrc-build:$PATH" + + +## Autocomplete for kdesrc-run +function _comp_kdesrc_run +{ + local cur + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + + # Complete only the first argument + if [[ $COMP_CWORD != 1 ]]; then + return 0 + fi + + # Retrieve build modules through kdesrc-run + # If the exit status indicates failure, set the wordlist empty to avoid + # unrelated messages. + local modules + if ! modules=$(kdesrc-run --list-installed); + then + modules="" + fi + + # Return completions that match the current word + COMPREPLY=( $(compgen -W "${modules}" -- "$cur") ) + + return 0 +} + +## Register autocomplete function +complete -o nospace -F _comp_kdesrc_run kdesrc-run + +################################################################################
\ No newline at end of file |