diff options
author | Amin Bandali <bandali@gnu.org> | 2022-11-25 18:55:14 -0500 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2022-11-27 00:15:31 -0500 |
commit | 55b397e4adc0b67a076fb1de7d6dfe3a52bac537 (patch) | |
tree | 79cac5c37d5f7ee1cab34f4a65dbadf17d869713 | |
parent | 1fb89b3237d4d7e9a16e189fb4d43e06557e2cec (diff) | |
download | configs-55b397e4adc0b67a076fb1de7d6dfe3a52bac537.tar.gz configs-55b397e4adc0b67a076fb1de7d6dfe3a52bac537.tar.xz configs-55b397e4adc0b67a076fb1de7d6dfe3a52bac537.zip |
* .bashrc: Only source completions if available.
For both quilt and now pass-otp as well.
-rw-r--r-- | .bashrc | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -141,9 +141,19 @@ alias alert='notify-send --urgency=low \ alias da='change-theme dark' alias li='change-theme light' +bash_completions_dir=/usr/share/bash-completion/completions/ + alias dquilt="quilt --quiltrc=${XDG_CONFIG_HOME}/quilt/quiltrc-dpkg" -. /usr/share/bash-completion/completions/quilt -complete -F _quilt_completion -o filenames dquilt +quilt_comps="${bash_completions_dir}/quilt" +if [ -f "${quilt_comps}" ]; then + . "${quilt_comps}" + complete -F _quilt_completion -o filenames dquilt +fi + +pass_otp_comps="${bash_completions_dir}/pass-otp" +if [ -f "${pass_otp_comps}" ]; then + . "${pass_otp_comps}" +fi function t { cd $(mktemp -d /tmp/$1.XXXX) |