From 683233ac7b27c16af141f9452cf49307beebbe16 Mon Sep 17 00:00:00 2001 From: Marek Paśnikowski Date: Sun, 14 Jan 2024 11:17:12 +0100 Subject: Set environment for KDESRC-build --- bashrc | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 bashrc (limited to '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