Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebe59c9adc | ||
|
|
a6e2c2fc13 | ||
|
|
6678788f19 | ||
|
|
4f0fa7ebe7 | ||
|
|
905abd37f8 | ||
|
|
a8b43620f8 | ||
|
|
0239ab8c31 | ||
|
|
1dfaf36d91 | ||
|
|
e06066c367 | ||
|
|
035fc920ad | ||
|
|
ab011cd9ba | ||
|
|
d42a1206f9 | ||
|
|
ce854255b4 | ||
|
|
9524bf85ae | ||
|
|
6866648ac6 | ||
|
|
514a753901 | ||
|
|
0b808b17f1 | ||
|
|
4860fb8c60 | ||
|
|
cda81f3d74 | ||
|
|
7331cd2676 | ||
|
|
399b5199b0 | ||
|
|
64c4c30706 | ||
|
|
ea444459cf | ||
|
|
682d6d728d | ||
|
|
e25e371ba7 | ||
|
|
e4e0c151b2 |
@@ -7,3 +7,4 @@ alias dco="docker-compose"
|
||||
alias dcofresh="docker-compose-fresh"
|
||||
alias dcol="docker-compose logs -f --tail 100"
|
||||
alias dcou="docker-compose up"
|
||||
alias dcouns="dcou --no-start"
|
||||
|
||||
@@ -7,4 +7,4 @@ alias tf='terraform'
|
||||
alias tfv='terraform validate'
|
||||
alias tfp='terraform plan'
|
||||
alias tfa='terraform apply'
|
||||
alias tfd='terraform destory'
|
||||
alias tfd='terraform destroy'
|
||||
|
||||
@@ -43,7 +43,9 @@ themes/bobby-python
|
||||
themes/brainy
|
||||
themes/brunton
|
||||
themes/command_duration.theme.bash
|
||||
themes/easy
|
||||
themes/modern
|
||||
themes/purity
|
||||
|
||||
# plugins
|
||||
#
|
||||
@@ -82,6 +84,7 @@ completion/available/kubectl.completion.bash
|
||||
completion/available/lerna.completion.bash
|
||||
completion/available/minikube.completion.bash
|
||||
completion/available/notify-send.completion.bash
|
||||
completion/available/ngrok.completion.bash
|
||||
completion/available/npm.completion.bash
|
||||
completion/available/packer.completion.bash
|
||||
completion/available/pip.completion.bash
|
||||
|
||||
45
completion/available/ngrok.completion.bash
Normal file
45
completion/available/ngrok.completion.bash
Normal file
@@ -0,0 +1,45 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
__ngrok_completion() {
|
||||
local prev=$(_get_pword)
|
||||
local curr=$(_get_cword)
|
||||
|
||||
local BASE_NO_CONF="--log --log-format --log-level --help"
|
||||
local BASE="--config $BASE_NO_CONF"
|
||||
local DEFAULT="$BASE --authtoken --region"
|
||||
|
||||
case $prev in
|
||||
authtoken)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$BASE" -- "$curr"))
|
||||
;;
|
||||
http)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$DEFAULT --auth --bind-tls --host-header --hostname --inspect --subdomain" -- "$curr"))
|
||||
;;
|
||||
start)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$DEFAULT --all --none" -- "$curr"))
|
||||
;;
|
||||
tcp)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$DEFAULT --remote-addr" -- "$curr"))
|
||||
;;
|
||||
tls)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$DEFAULT --client-cas --crt --hostname --key --subdomain" -- "$curr"))
|
||||
;;
|
||||
update)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "$BASE_NO_CONF --channel" -- "$curr"))
|
||||
;;
|
||||
ngrok)
|
||||
# shellcheck disable=SC2207
|
||||
COMPREPLY=($(compgen -W "authtoken credits http start tcp tls update version help" -- "$curr"))
|
||||
;;
|
||||
*) ;;
|
||||
|
||||
esac
|
||||
}
|
||||
|
||||
complete -F __ngrok_completion ngrok
|
||||
@@ -9,7 +9,7 @@
|
||||
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
|
||||
|
||||
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
|
||||
If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
|
||||
If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
|
||||
Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-it and start hacking away.
|
||||
|
||||
- [Main Page](https://bash-it.readthedocs.io/en/latest)
|
||||
@@ -55,4 +55,8 @@ please feel free to read through this page if you're interested in how Bash-it l
|
||||
|
||||
* [List of contributors][contribute]
|
||||
|
||||
## License
|
||||
|
||||
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).
|
||||
|
||||
[contribute]: https://github.com/Bash-it/bash-it/contributors
|
||||
|
||||
@@ -8,7 +8,7 @@ Welcome to Bash-it's documentation!
|
||||
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
|
||||
|
||||
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
|
||||
If you're using the *Bourne Again Shell* (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
|
||||
If you're using the *Bourne Again Shell* (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
|
||||
Stop polluting your ``~/bin`` directory and your ``.bashrc`` file, fork/clone Bash-it and start hacking away.
|
||||
|
||||
.. toctree::
|
||||
|
||||
14
docs/themes-list/easy.rst
Normal file
14
docs/themes-list/easy.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
.. _easy:
|
||||
|
||||
Easy Theme
|
||||
==========
|
||||
|
||||
A simple theme
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
user@hostname ~/.bash_it
|
||||
[ master ✓ ] ❯
|
||||
@@ -187,6 +187,22 @@ Doubletime Multiline Python Only
|
||||
:alt:
|
||||
|
||||
|
||||
----
|
||||
|
||||
Easy
|
||||
^^^^
|
||||
|
||||
|
||||
.. image:: https://bash-it.github.io/bash-it/docs/images/easy-black.jpg
|
||||
:target: https://bash-it.github.io/bash-it/docs/images/easy-black.jpg
|
||||
:alt:
|
||||
|
||||
|
||||
.. image:: https://bash-it.github.io/bash-it/docs/images/easy-white.jpg
|
||||
:target: https://bash-it.github.io/bash-it/docs/images/easy-white.jpg
|
||||
:alt:
|
||||
|
||||
|
||||
----
|
||||
|
||||
Envy
|
||||
|
||||
@@ -171,7 +171,8 @@ while getopts "hsinaf" opt; do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(("$OPTIND" - 1))
|
||||
|
||||
shift $((OPTIND - 1))
|
||||
|
||||
if [[ $silent ]] && [[ $interactive ]]; then
|
||||
echo -e "\033[91mOptions --silent and --interactive are mutually exclusive. Please choose one or the other.\033[m"
|
||||
|
||||
@@ -37,7 +37,7 @@ End-Of-Usage
|
||||
|
||||
local -r filename=$(basename -- $1)
|
||||
local -r filedirname=$(dirname -- $1)
|
||||
local targetdirname=$(sed 's/\(\.tar\.bz2$\|\.tbz$\|\.tbz2$\|\.tar\.gz$\|\.tgz$\|\.tar$\|\.tar\.xz$\|\.txz$\|\.tar\.Z$\|\.7z$\)//g' <<< $filename)
|
||||
local targetdirname=$(sed 's/\(\.tar\.bz2$\|\.tbz$\|\.tbz2$\|\.tar\.gz$\|\.tgz$\|\.tar$\|\.tar\.xz$\|\.txz$\|\.tar\.Z$\|\.7z$\|\.nupkg$\|\.zip$\|\.war$\|\.jar$\)//g' <<< $filename)
|
||||
if [ "$filename" = "$targetdirname" ]; then
|
||||
# archive type either not supported or it doesn't need dir creation
|
||||
targetdirname=""
|
||||
@@ -61,9 +61,9 @@ End-Of-Usage
|
||||
*.rpm) rpm2cpio "$1" | cpio -idm${verbose} ;;
|
||||
*.tar) tar "x${verbose}f" "$1" -C "$filedirname/$targetdirname" ;;
|
||||
*.xz) xz --decompress "$1" ;;
|
||||
*.zip|*.war|*.jar) unzip "$1" ;;
|
||||
*.zip|*.war|*.jar|*.nupkg) unzip "$1" -d "$filedirname/$targetdirname" ;;
|
||||
*.Z) uncompress "$1" ;;
|
||||
*.7z) 7za x "$1" ;;
|
||||
*.7z) 7za x -o"$filedirname/$targetdirname" "$1" ;;
|
||||
*) echo "'$1' cannot be extracted via extract" >&2;;
|
||||
esac
|
||||
fi
|
||||
|
||||
19
themes/easy/easy.theme.bash
Normal file
19
themes/easy/easy.theme.bash
Normal file
@@ -0,0 +1,19 @@
|
||||
# shellcheck shell=bash
|
||||
|
||||
SCM_THEME_PROMPT_PREFIX="${bold_green}[ ${normal}"
|
||||
SCM_THEME_PROMPT_SUFFIX="${bold_green} ] "
|
||||
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||
|
||||
prompt_command() {
|
||||
if [ "$(whoami)" = root ]; then
|
||||
cursor_color="${bold_red}"
|
||||
user_color="${green}"
|
||||
else
|
||||
cursor_color="${bold_green}"
|
||||
user_color="${white}"
|
||||
fi
|
||||
PS1="${user_color}\u${normal}@${white}\h ${bold_black}\w\n${reset_color}$(scm_prompt_info)${cursor_color}❯ ${normal}"
|
||||
}
|
||||
|
||||
safe_append_prompt_command prompt_command
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}⊘${normal}"
|
||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}"
|
||||
@@ -14,9 +14,21 @@ STATUS_THEME_PROMPT_BAD="${bold_red}❯${reset_color}${normal} "
|
||||
STATUS_THEME_PROMPT_OK="${bold_green}❯${reset_color}${normal} "
|
||||
PURITY_THEME_PROMPT_COLOR="${PURITY_THEME_PROMPT_COLOR:=$blue}"
|
||||
|
||||
venv_prompt() {
|
||||
python_venv=""
|
||||
# Detect python venv
|
||||
if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then
|
||||
python_venv="($PYTHON_VENV_CHAR${CONDA_DEFAULT_ENV}) "
|
||||
elif [[ -n "${VIRTUAL_ENV}" ]]; then
|
||||
python_venv="($PYTHON_VENV_CHAR$(basename "${VIRTUAL_ENV}")) "
|
||||
fi
|
||||
[[ -n "${python_venv}" ]] && echo "${python_venv}"
|
||||
}
|
||||
|
||||
function prompt_command() {
|
||||
local ret_status="$( [ $? -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")"
|
||||
PS1="\n${PURITY_THEME_PROMPT_COLOR}\w $(scm_prompt_info)\n${ret_status} "
|
||||
retval=$?
|
||||
local ret_status="$([ $retval -eq 0 ] && echo -e "$STATUS_THEME_PROMPT_OK" || echo -e "$STATUS_THEME_PROMPT_BAD")"
|
||||
PS1="\n${PURITY_THEME_PROMPT_COLOR}\w $(scm_prompt_info)\n${ret_status}$(venv_prompt)"
|
||||
}
|
||||
|
||||
safe_append_prompt_command prompt_command
|
||||
|
||||
Reference in New Issue
Block a user