From ac88ca791197a0b477816a6c6da879aa99bb7221 Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Mon, 9 Jan 2023 09:08:32 +0100 Subject: Set environment for KDESRC-build --- bashrc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 bashrc diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..15834a8 --- /dev/null +++ b/bashrc @@ -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 -- cgit v1.2.3