diff options
author | Marek Paśnikowski <marekpasnikowski@protonmail.com> | 2023-01-09 09:08:32 +0100 |
---|---|---|
committer | Marek Paśnikowski <marek@marekpasnikowski.pl> | 2023-01-09 09:08:32 +0100 |
commit | de394c6c412de98dc6b1f5671eb498c9150da704 (patch) | |
tree | 30a17813acc7371208dfcdc84f7829333a6cfa7f /bashrc | |
parent | 83894ab2da07c4a84a7acce3122e86bd6566904e (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 |