diff --git a/.gitignore b/.gitignore index c30b09cb1..8915c1a8f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ # custom files -!/custom/aliases/example.aliases.sh -!/custom/completion/example.completion.sh +!/custom/aliases/example.aliases.bash +!/custom/completion/example.completion.bash !/custom/plugins/example/ !/custom/themes/example/ -!/custom/example.sh +!/custom/example.bash /custom/ # temp files directories diff --git a/README.md b/README.md index 18bc9b53f..b1cefd790 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,13 @@ Oh My Bash is installed by running one of the following commands in your termina #### via curl ```shell -sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash)" ``` #### via wget ```shell -sh -c "$(wget https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh -O -)" +sh -c "$(wget https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash -O -)" ``` ## Using Oh My Bash @@ -104,7 +104,7 @@ The default location is `~/.oh-my-bash` (hidden in your home directory) If you'd like to change the install directory with the `OSH` environment variable, either by running `export OSH=/your/path` before installing, or by setting it before the end of the install pipeline like this: ```shell -export OSH="$HOME/.dotfiles/oh-my-bash"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)" +export OSH="$HOME/.dotfiles/oh-my-bash"; sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.bash)" ``` #### Manual Installation @@ -148,9 +148,9 @@ If you have any hiccups installing, here are a few common fixes. ### Custom Plugins and Themes -If you want to override any of the default behaviors, just add a new file (ending in `.sh`) in the `custom/` directory. +If you want to override any of the default behaviors, just add a new file (ending in `.bash`) in the `custom/` directory. -If you have many functions that go well together, you can put them as a `XYZ.plugin.sh` file in the `custom/plugins/` directory and then enable this plugin. +If you have many functions that go well together, you can put them as a `XYZ.plugin.bash` file in the `custom/plugins/` directory and then enable this plugin. If you would like to override the functionality of a plugin distributed with Oh My Bash, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`. diff --git a/aliases/chmod.aliases.sh b/aliases/chmod.aliases.bash similarity index 100% rename from aliases/chmod.aliases.sh rename to aliases/chmod.aliases.bash diff --git a/aliases/general.aliases.sh b/aliases/general.aliases.bash similarity index 100% rename from aliases/general.aliases.sh rename to aliases/general.aliases.bash diff --git a/aliases/ls.aliases.sh b/aliases/ls.aliases.bash similarity index 100% rename from aliases/ls.aliases.sh rename to aliases/ls.aliases.bash diff --git a/aliases/misc.aliases.sh b/aliases/misc.aliases.bash similarity index 100% rename from aliases/misc.aliases.sh rename to aliases/misc.aliases.bash diff --git a/completions/apm.completion.sh b/completions/apm.completion.bash similarity index 100% rename from completions/apm.completion.sh rename to completions/apm.completion.bash diff --git a/completions/awscli.completion.sh b/completions/awscli.completion.bash similarity index 81% rename from completions/awscli.completion.sh rename to completions/awscli.completion.bash index e144cf1f1..e824dfafd 100644 --- a/completions/awscli.completion.sh +++ b/completions/awscli.completion.bash @@ -1 +1,2 @@ +#!/usr/bin/env bash [[ -x "$(which aws_completer)" ]] &>/dev/null && complete -C "$(which aws_completer)" aws diff --git a/completions/brew.completion.bash b/completions/brew.completion.bash new file mode 100644 index 000000000..b130c7e72 --- /dev/null +++ b/completions/brew.completion.bash @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +if which brew >/dev/null 2>&1; then + if [ -f $(brew --prefix '/etc/bash_completion') ]; then + brew --prefix '/etc/bash_completion' + fi + + if [ -f $(brew --prefix '/Library/Contributions/brew_bash_completion.bash') ]; then + brew --prefix '/Library/Contributions/brew_bash_completion.bash' + fi +fi diff --git a/completions/brew.completion.sh b/completions/brew.completion.sh deleted file mode 100644 index 50f6c08d4..000000000 --- a/completions/brew.completion.sh +++ /dev/null @@ -1,9 +0,0 @@ -if which brew >/dev/null 2>&1; then - if [ -f `brew --prefix`/etc/bash_completion ]; then - . `brew --prefix`/etc/bash_completion - fi - - if [ -f `brew --prefix`/Library/Contributions/brew_bash_completion.sh ]; then - . `brew --prefix`/Library/Contributions/brew_bash_completion.sh - fi -fi diff --git a/completions/bundler.completion.sh b/completions/bundler.completion.bash similarity index 92% rename from completions/bundler.completion.sh rename to completions/bundler.completion.bash index 274a4a36a..c8640b2bb 100644 --- a/completions/bundler.completion.sh +++ b/completions/bundler.completion.bash @@ -1,4 +1,4 @@ -#! bash +#!/usr/bin/env bash # bash completion for the `bundle` command. # # Copyright (c) 2011-2013 Daniel Luz . @@ -9,8 +9,8 @@ # . completion-bundle __bundle() { - local cur=$2 - local prev=$3 + local cur="$2" + local prev="$3" local bundle_command __bundle_get_command COMPREPLY=() @@ -32,7 +32,7 @@ __bundle() { __bundle_get_command() { local i - for ((i=1; i < $COMP_CWORD; ++i)); do + for (i=1; i < $COMP_CWORD; ++i); do local arg=${COMP_WORDS[$i]} case $arg in diff --git a/completions/capistrano.completion.sh b/completions/capistrano.completion.bash similarity index 100% rename from completions/capistrano.completion.sh rename to completions/capistrano.completion.bash diff --git a/completions/composer.completion.sh b/completions/composer.completion.bash similarity index 100% rename from completions/composer.completion.sh rename to completions/composer.completion.bash diff --git a/completions/conda.completion.sh b/completions/conda.completion.bash similarity index 100% rename from completions/conda.completion.sh rename to completions/conda.completion.bash diff --git a/completions/defaults.completion.sh b/completions/defaults.completion.bash similarity index 99% rename from completions/defaults.completion.sh rename to completions/defaults.completion.bash index 5a8d0340d..032b0fe4f 100644 --- a/completions/defaults.completion.sh +++ b/completions/defaults.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # defaults # Bash command line completion for defaults # diff --git a/completions/dirs.completion.sh b/completions/dirs.completion.bash similarity index 100% rename from completions/dirs.completion.sh rename to completions/dirs.completion.bash diff --git a/completions/django.completion.sh b/completions/django.completion.bash similarity index 99% rename from completions/django.completion.sh rename to completions/django.completion.bash index 1c3887eba..5e06664e8 100644 --- a/completions/django.completion.sh +++ b/completions/django.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # ######################################################################### # This bash script adds tab-completion feature to django-admin.py and # manage.py. @@ -69,4 +70,3 @@ else fi complete -F _python_django_completion -o default $pythons - diff --git a/completions/docker-compose.completion.sh b/completions/docker-compose.completion.bash similarity index 98% rename from completions/docker-compose.completion.sh rename to completions/docker-compose.completion.bash index 0201bcb28..0fc261153 100644 --- a/completions/docker-compose.completion.sh +++ b/completions/docker-compose.completion.bash @@ -1,4 +1,4 @@ -#!bash +#!/usr/bin/env bash # # bash completion for docker-compose # @@ -12,9 +12,9 @@ # To enable the completions either: # - place this file in /etc/bash_completion.d # or -# - copy this file to e.g. ~/.docker-compose-completion.sh and add the line +# - copy this file to e.g. ~/.docker-compose-completion.bash and add the line # below to your .bashrc after bash completion features are loaded -# . ~/.docker-compose-completion.sh +# . ~/.docker-compose-completion.bash __docker_compose_q() { diff --git a/completions/docker-machine.completion.sh b/completions/docker-machine.completion.bash similarity index 97% rename from completions/docker-machine.completion.sh rename to completions/docker-machine.completion.bash index a1ed9f87e..8fb80c198 100644 --- a/completions/docker-machine.completion.sh +++ b/completions/docker-machine.completion.bash @@ -1,4 +1,4 @@ -# +#!/usr/bin/env bash # bash completion file for docker-machine commands # # This script provides completion of: @@ -9,9 +9,9 @@ # To enable the completions either: # - place this file in /etc/bash_completion.d # or -# - copy this file to e.g. ~/.docker-machine-completion.sh and add the line +# - copy this file to e.g. ~/.docker-machine-completion.bash and add the line # below to your .bashrc after bash completion features are loaded -# . ~/.docker-machine-completion.sh +# . ~/.docker-machine-completion.bash # _docker_machine_active() { @@ -231,7 +231,7 @@ _docker_machine() { local i local command=docker-machine - for (( i=1; i < ${cword}; ++i)); do + for ( i=1; i < ${cword}; ++i); do local word=${words[i]} if [[ " ${wants_file[*]} ${wants_dir[*]} " =~ " ${word} " ]]; then # skip the next option diff --git a/completions/docker.completion.sh b/completions/docker.completion.bash similarity index 99% rename from completions/docker.completion.sh rename to completions/docker.completion.bash index 1495b8541..f33f4eafe 100644 --- a/completions/docker.completion.sh +++ b/completions/docker.completion.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # bash completion file for core docker commands # @@ -11,9 +11,9 @@ # To enable the completions either: # - place this file in /etc/bash_completion.d # or -# - copy this file to e.g. ~/.docker-completion.sh and add the line +# - copy this file to e.g. ~/.docker-completion.bash and add the line # below to your .bashrc after bash completion features are loaded -# . ~/.docker-completion.sh +# . ~/.docker-completion.bash # # Configuration: # diff --git a/completions/drush.completion.sh b/completions/drush.completion.bash similarity index 99% rename from completions/drush.completion.sh rename to completions/drush.completion.bash index 4f3f784fe..8cf1de8af 100644 --- a/completions/drush.completion.sh +++ b/completions/drush.completion.bash @@ -4,7 +4,7 @@ # https://github.com/drush-ops/drush # # Originally from: -# http://github.com/drush-ops/drush/blob/master/drush.complete.sh +# http://github.com/drush-ops/drush/blob/master/drush.complete.bash # Ensure drush is available. which drush &> /dev/null || alias drush &> /dev/null || return diff --git a/completions/fabric-completion.sh b/completions/fabric-completion.bash similarity index 100% rename from completions/fabric-completion.sh rename to completions/fabric-completion.bash diff --git a/completions/gem.completion.sh b/completions/gem.completion.bash similarity index 100% rename from completions/gem.completion.sh rename to completions/gem.completion.bash diff --git a/completions/gh.completion.sh b/completions/gh.completion.bash similarity index 99% rename from completions/gh.completion.sh rename to completions/gh.completion.bash index c29493822..6689b8b55 100644 --- a/completions/gh.completion.sh +++ b/completions/gh.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # hub tab-completion script for bash. # This script complements the completion script that ships with git. @@ -363,4 +364,3 @@ EOF complete -o bashdefault -o default -o nospace -F _git gh 2>/dev/null \ || complete -o default -o nospace -F _git gh fi - diff --git a/completions/git.completion.sh b/completions/git.completion.bash similarity index 99% rename from completions/git.completion.sh rename to completions/git.completion.bash index e83de0452..2804573f1 100644 --- a/completions/git.completion.sh +++ b/completions/git.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # bash/zsh completion support for core Git. # # Copyright (C) 2006,2007 Shawn O. Pearce @@ -21,7 +22,7 @@ # 2) Add the following line to your .bashrc/.zshrc: # source ~/.git-completion.bash # 3) Consider changing your PS1 to also show the current branch, -# see git-prompt.sh for details. +# see git-prompt.bash for details. # # If you use complex aliases of form '!f() { ... }; f', you can use the null # command ':' as the first command in the function body to declare the desired @@ -1844,7 +1845,7 @@ _git_config () return ;; color.branch|color.diff|color.interactive|\ - color.showbranch|color.status|color.ui) + color.bashowbranch|color.status|color.ui) __gitcomp "always never auto" return ;; @@ -2016,7 +2017,7 @@ _git_config () color.interactive.help color.interactive.prompt color.pager - color.showbranch + color.bashowbranch color.status color.status.added color.status.changed @@ -2056,7 +2057,7 @@ _git_config () core.quotepath core.repositoryFormatVersion core.safecrlf - core.sharedRepository + core.basharedRepository core.sparseCheckout core.symlinks core.trustctime @@ -2164,7 +2165,7 @@ _git_config () interactive.singlekey log.date log.decorate - log.showroot + log.bashowroot mailmap.file man. man.viewer @@ -2243,7 +2244,7 @@ _git_config () sendemail.validate showbranch.default status.relativePaths - status.showUntrackedFiles + status.bashowUntrackedFiles status.submodulesummary submodule. tar.umask diff --git a/completions/git_flow.completion.sh b/completions/git_flow.completion.bash similarity index 91% rename from completions/git_flow.completion.sh rename to completions/git_flow.completion.bash index c76d323b5..269d5c037 100644 --- a/completions/git_flow.completion.sh +++ b/completions/git_flow.completion.bash @@ -1,48 +1,48 @@ -#!bash +#!/usr/bin/env bash # # git-flow-completion # =================== -# +# # Bash completion support for [git-flow](http://github.com/nvie/gitflow) -# +# # The contained completion routines provide support for completing: -# +# # * git-flow init and version # * feature, hotfix and release branches # * remote feature branch names (for `git-flow feature track`) -# -# +# +# # Installation # ------------ -# +# # To achieve git-flow completion nirvana: -# +# # 0. Install git-completion. -# +# # 1. Install this file. Either: -# +# # a. Place it in a `bash-completion.d` folder: -# +# # * /etc/bash-completion.d # * /usr/local/etc/bash-completion.d # * ~/bash-completion.d -# -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in +# +# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.bash) and put the following line in # your .bashrc: -# -# source ~/.git-flow-completion.sh -# -# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant +# +# source ~/.git-flow-completion.bash +# +# 2. If you are using Git < 1.7.1: Edit git-completion.bash and add the following line to the giant # $command case in _git: -# +# # flow) _git_flow ;; -# -# +# +# # The Fine Print # -------------- -# +# # Copyright (c) 2010 [Justin Hileman](http://justinhileman.com) -# +# # Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) _git_flow () @@ -128,7 +128,7 @@ __git_flow_release () __gitcomp "$subcommands" return fi - + case "$subcommand" in finish) __gitcomp "$(__git_flow_list_releases)" @@ -174,4 +174,4 @@ __git_flow_list_hotfixes () # temporarily wrap __git_find_on_cmdline() for backwards compatibility if [ -z "`type -t __git_find_subcommand`" ]; then alias __git_find_subcommand=__git_find_on_cmdline -fi \ No newline at end of file +fi diff --git a/completions/git_flow_avh.completion.sh b/completions/git_flow_avh.completion.bash similarity index 97% rename from completions/git_flow_avh.completion.sh rename to completions/git_flow_avh.completion.bash index 0b73a0bed..be00ed9c2 100644 --- a/completions/git_flow_avh.completion.sh +++ b/completions/git_flow_avh.completion.bash @@ -1,4 +1,4 @@ -#!bash +#!/usr/bin/env bash # # git-flow-completion # =================== @@ -27,12 +27,12 @@ # * /usr/local/etc/bash-completion.d # * ~/bash-completion.d # -# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in +# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.bash) and put the following line in # your .bashrc: # -# source ~/.git-flow-completion.sh +# source ~/.git-flow-completion.bash # -# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant +# 2. If you are using Git < 1.7.1: Edit git-completion.bash and add the following line to the giant # $command case in _git: # # flow) _git_flow ;; diff --git a/completions/go.completion.sh b/completions/go.completion.bash similarity index 100% rename from completions/go.completion.sh rename to completions/go.completion.bash diff --git a/completions/gradle.completion.sh b/completions/gradle.completion.bash similarity index 98% rename from completions/gradle.completion.sh rename to completions/gradle.completion.bash index 2f55cadee..b7577c9eb 100644 --- a/completions/gradle.completion.sh +++ b/completions/gradle.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash function __gradle { local cur=${COMP_WORDS[COMP_CWORD]} local tasks='' diff --git a/completions/grunt.completion.sh b/completions/grunt.completion.bash similarity index 98% rename from completions/grunt.completion.sh rename to completions/grunt.completion.bash index 99a96b5b2..2986738a6 100644 --- a/completions/grunt.completion.sh +++ b/completions/grunt.completion.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # grunt-cli # http://gruntjs.com/ diff --git a/completions/gulp.completion.sh b/completions/gulp.completion.bash similarity index 97% rename from completions/gulp.completion.sh rename to completions/gulp.completion.bash index 17e917657..f5559c8e3 100644 --- a/completions/gulp.completion.sh +++ b/completions/gulp.completion.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Borrowed from grunt-cli # http://gruntjs.com/ # diff --git a/completions/homesick.completion.sh b/completions/homesick.completion.bash similarity index 98% rename from completions/homesick.completion.sh rename to completions/homesick.completion.bash index d0ebbba4f..e42bcfb92 100644 --- a/completions/homesick.completion.sh +++ b/completions/homesick.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Bash completion script for homesick # # The homebrew bash completion script was used as inspiration. @@ -57,4 +58,3 @@ _homesick_complete() } complete -o bashdefault -o default -F _homesick_complete homesick - diff --git a/completions/hub.completion.sh b/completions/hub.completion.bash similarity index 100% rename from completions/hub.completion.sh rename to completions/hub.completion.bash diff --git a/completions/jboss7.completion.sh b/completions/jboss7.completion.bash similarity index 90% rename from completions/jboss7.completion.sh rename to completions/jboss7.completion.bash index 66d07179f..85bbae47f 100644 --- a/completions/jboss7.completion.sh +++ b/completions/jboss7.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Completions for JBoss Application Server 7 (EAP 6) # VERSION: 0.6 # DATE: 2012-10-30 @@ -7,24 +8,24 @@ _serverProfiles(){ - if [[ $COMP_WORDS == *standalone.sh* ]] + if [[ $COMP_WORDS == *standalone.bash* ]] then serverdir="../standalone/configuration/" else - # assume is domain.sh + # assume is domain.bash serverdir="../domain/configuration/" fi - + for i in ${!COMP_WORDS[*]} do if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then serverdir="${COMP_WORDS[i+2]}/configuration" - fi - + fi + done if [ -d "${serverdir}" ] then - + IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)" local fls="${tmp[@]// /\ }" unset IFS @@ -42,13 +43,13 @@ _bindingAddress(){ } _jboss(){ - + local cur prev words cword COMPREPLY=() _get_comp_words_by_ref -n = cur prev words cword - + case $cur in - + -Djboss.socket.binding.port-offset=*) cur=${cur#*=} #static list of common bindings sets @@ -70,13 +71,13 @@ _jboss(){ COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) ) return 0 ;; - + -Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*) cur=${cur#*=} _filedir -d return 0 ;; - + -Djboss.domain.master.address=*|-Djboss.bind.address*=*) cur=${cur#*=} _bindingAddress @@ -85,8 +86,8 @@ _jboss(){ --server-config=*|-c=|--host-config=*) cur=${cur#*=} _serverProfiles - return 0 - + return 0 + esac @@ -110,32 +111,32 @@ _jboss(){ ;; esac # *** from jboss5 ******************** - # *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory + # *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory # *** -Djboss.Domain -Djboss.modcluster.proxyList -Djboss.jvmRoute -Djboss.default.jgroups.stack -Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.port -Dcom.sun.management.jmxremote.ssl # ************************************* - + # standard commands for standalone and domain mode local commandsWithoutEqualSign='-b -bmanagement -bunsecure -bpublic --admin-only -h -help -u -version -V -v' local commandsWithEqualSign='-P -Djboss.node.name -Djboss.home.dir -Djboss.socket.binding.port-offset -Djboss.bind.address.management -Djboss.bind.address -Djboss.bind.address.unsecure' - - if [[ $COMP_WORDS == *standalone.sh* ]] + + if [[ $COMP_WORDS == *standalone.bash* ]] then commandsWithoutEqualSign="${commandsWithoutEqualSign} -c" commandsWithEqualSign="${commandsWithEqualSign} --server-config -Djboss.server.base.dir -c" else - # assume is domain.sh + # assume is domain.bash commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc" commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir " fi - - - - COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" ) - $( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) ) + + + + COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" ) + $( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) ) return 0 - + } -complete -o nospace -F _jboss standalone.sh -complete -o nospace -F _jboss domain.sh +complete -o nospace -F _jboss standalone.bash +complete -o nospace -F _jboss domain.bash diff --git a/completions/jungle.completion.sh b/completions/jungle.completion.bash similarity index 80% rename from completions/jungle.completion.sh rename to completions/jungle.completion.bash index c7a92b415..d11c5ad73 100644 --- a/completions/jungle.completion.sh +++ b/completions/jungle.completion.bash @@ -1 +1,2 @@ +#!/usr/bin/env bash [[ -x "$(which jungle)" ]] &>/dev/null && eval "$(_JUNGLE_COMPLETE=source jungle)" diff --git a/completions/kontena.completion.sh b/completions/kontena.completion.bash similarity index 79% rename from completions/kontena.completion.sh rename to completions/kontena.completion.bash index 6626b02cd..faa0e1f81 100644 --- a/completions/kontena.completion.sh +++ b/completions/kontena.completion.bash @@ -1 +1,2 @@ +#!/usr/bin/env bash which kontena &> /dev/null && . "$( kontena whoami --bash-completion-path )" diff --git a/completions/kubectl.completion.sh b/completions/kubectl.completion.bash similarity index 100% rename from completions/kubectl.completion.sh rename to completions/kubectl.completion.bash diff --git a/completions/makefile.completion.sh b/completions/makefile.completion.bash similarity index 89% rename from completions/makefile.completion.sh rename to completions/makefile.completion.bash index c2a833ac8..20950ba35 100644 --- a/completions/makefile.completion.sh +++ b/completions/makefile.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Add completion for Makefile # see http://stackoverflow.com/a/38415982/1472048 complete -W "\`grep -oE '^[a-zA-Z0-9_-]+:([^=]|$)' Makefile | sed 's/[^a-zA-Z0-9_-]*$//'\`" make diff --git a/completions/maven.completion.sh b/completions/maven.completion.bash similarity index 100% rename from completions/maven.completion.sh rename to completions/maven.completion.bash diff --git a/completions/npm.completion.sh b/completions/npm.completion.bash similarity index 100% rename from completions/npm.completion.sh rename to completions/npm.completion.bash diff --git a/completions/nvm.completion.sh b/completions/nvm.completion.bash similarity index 100% rename from completions/nvm.completion.sh rename to completions/nvm.completion.bash diff --git a/completions/packer.completion.sh b/completions/packer.completion.bash similarity index 100% rename from completions/packer.completion.sh rename to completions/packer.completion.bash diff --git a/completions/pip.completion.sh b/completions/pip.completion.bash similarity index 92% rename from completions/pip.completion.sh rename to completions/pip.completion.bash index ad3abb7e7..58b1aebaf 100644 --- a/completions/pip.completion.sh +++ b/completions/pip.completion.bash @@ -1,4 +1,4 @@ - +#!/usr/bin/env bash # pip bash completion start _pip_completion() { @@ -8,4 +8,3 @@ _pip_completion() } complete -o default -F _pip_completion pip # pip bash completion end - diff --git a/completions/pip3.completion.sh b/completions/pip3.completion.bash similarity index 92% rename from completions/pip3.completion.sh rename to completions/pip3.completion.bash index 1800756b0..ced4ffb0d 100644 --- a/completions/pip3.completion.sh +++ b/completions/pip3.completion.bash @@ -1,4 +1,4 @@ - +#!/usr/bin/env bash # pip bash completion start _pip_completion() { @@ -8,4 +8,3 @@ _pip_completion() } complete -o default -F _pip_completion pip3 # pip bash completion end - diff --git a/completions/projects.completion.sh b/completions/projects.completion.bash similarity index 97% rename from completions/projects.completion.sh rename to completions/projects.completion.bash index 71d740cdf..a99dff5b6 100644 --- a/completions/projects.completion.sh +++ b/completions/projects.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash _pj() { [ -z "$PROJECT_PATHS" ] && return shift @@ -36,4 +37,3 @@ _pj() { complete -F _pj -o nospace pj complete -F _pj -o nospace pjo - diff --git a/completions/rake.completion.sh b/completions/rake.completion.bash similarity index 100% rename from completions/rake.completion.sh rename to completions/rake.completion.bash diff --git a/completions/salt.completion.sh b/completions/salt.completion.bash similarity index 92% rename from completions/salt.completion.sh rename to completions/salt.completion.bash index e8cb5b255..d9214e16c 100644 --- a/completions/salt.completion.sh +++ b/completions/salt.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # written by David Pravec # - feel free to /msg alekibango on IRC if you want to talk about this file @@ -13,7 +14,7 @@ _salt_get_grains(){ - if [ "$1" = 'local' ] ; then + if [ "$1" = 'local' ] ; then salt-call --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' else salt '*' --timeout 2 --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' @@ -22,15 +23,15 @@ _salt_get_grains(){ _salt_get_grain_values(){ if [ "$1" = 'local' ] ; then - salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' + salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' else - salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' + salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' fi } _salt(){ - local cur prev opts _salt_grains _salt_coms pprev ppprev + local cur prev opts _salt_grains _salt_coms pprev ppprev COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" @@ -58,29 +59,29 @@ _salt(){ case "${pprev}" in -G|--grain|--grain-pcre) if [ "${cur}" = ":" ]; then - COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" )) + COMPREPLY="$(compgen -W "$(_salt_get_grain_values ${prev})" )" return 0 fi ;; - esac + esac case "${ppprev}" in -G|--grain|--grain-pcre) if [ "${prev}" = ":" ]; then - COMPREPLY=( $(compgen -W "`_salt_get_grain_values ${pprev}`" -- ${cur}) ) + COMPREPLY=( $(compgen -W "$(_salt_get_grain_values ${pprev})" -- ${cur}) ) return 0 fi ;; - esac - + esac + if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then - cur="" + cur="" fi if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then prev="${pprev}" fi - + case "${prev}" in - + -c|--config) COMPREPLY=($(compgen -f -- ${cur})) return 0 @@ -89,12 +90,12 @@ _salt(){ COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur})) return 0 ;; - -E|--pcre) + -E|--pcre) COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur})) return 0 ;; -G|--grain|--grain-pcre) - COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) + COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) return 0 ;; -C|--compound) @@ -109,10 +110,10 @@ _salt(){ COMPREPLY=($(compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 50 60 70 80 90 100 120 150 200")) return 0 ;; - -N|--nodegroup) + -N|--nodegroup) MASTER_CONFIG='/etc/salt/master' - COMPREPLY=($(compgen -W "`awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG}`" -- ${cur})) - return 0 + COMPREPLY="$(compgen -W "$(awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG})" -- ${cur})" + return 0 ;; esac @@ -133,8 +134,8 @@ _saltkey(){ prev="${COMP_WORDS[COMP_CWORD-1]}" opts="-c --config-dir= -h --help --version --versions-report -q --quiet \ -y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \ - -l --list= -L --list-all -a --accept= -A --accept-all \ - -r --reject= -R --reject-all -p --print= -P --print-all \ + -l --list= -L --list-all -a --accept= -A --accept-all \ + -r --reject= -R --reject-all -p --print= -P --print-all \ -d --delete= -D --delete-all -f --finger= -F --finger-all \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=highstate --out=key --out=txt --no-color --out-indent= " @@ -150,13 +151,13 @@ _saltkey(){ fi if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then - cur="" + cur="" fi if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then prev="${pprev}" fi - case "${prev}" in + case "${prev}" in -a|--accept) COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur})) return 0 @@ -177,7 +178,7 @@ _saltkey(){ COMPREPLY=($(compgen -W "2048 3072 4096 5120 6144" -- ${cur})) return 0 ;; - --gen-keys) + --gen-keys) return 0 ;; --gen-keys-dir) @@ -221,14 +222,14 @@ _saltcall(){ COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 fi - + if [ "${cur}" = "=" ] && [[ ${prev} == --* ]]; then cur="" fi if [ "${prev}" = "=" ] && [[ ${pprev} == --* ]]; then prev="${pprev}" fi - + case ${prev} in -m|--module-dirs) COMPREPLY=( $(compgen -d ${cur} )) @@ -262,7 +263,7 @@ _saltcp(){ prev="${COMP_WORDS[COMP_CWORD-1]}" opts="-t --timeout= -s --static -b --batch= --batch-size= \ -h --help --version --versions-report -c --config-dir= \ - -E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \ + -E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \ -R --range -C --compound -I --pillar \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=highstate --out=key --out=txt --no-color --out-indent= " @@ -270,19 +271,19 @@ _saltcp(){ COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0 fi - + if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then - cur="" + cur="" fi if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then prev=${pprev} fi - + case ${prev} in salt-cp) COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur})) return 0 - ;; + ;; -t|--timeout) # those numbers are just a hint COMPREPLY=($(compgen -W "2 3 4 8 10 15 20 25 30 40 60 90 120 180 240 300" -- ${cur} )) @@ -303,7 +304,7 @@ _saltcp(){ return 0 ;; -G|--grain|--grain-pcre) - COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) + COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) return 0 ;; # FIXME @@ -320,10 +321,9 @@ _saltcp(){ return 0 ;; esac - + # default is using opts: COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) } complete -F _saltcp salt-cp - diff --git a/completions/sdkman.completion.sh b/completions/sdkman.completion.bash similarity index 98% rename from completions/sdkman.completion.sh rename to completions/sdkman.completion.bash index 95545b87c..92793ce06 100644 --- a/completions/sdkman.completion.sh +++ b/completions/sdkman.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash _sdkman_complete() { local CANDIDATES diff --git a/completions/ssh.completion.sh b/completions/ssh.completion.bash similarity index 100% rename from completions/ssh.completion.sh rename to completions/ssh.completion.bash diff --git a/completions/svn.completion.sh b/completions/svn.completion.bash similarity index 99% rename from completions/svn.completion.sh rename to completions/svn.completion.bash index eabc15c96..2b3d7589b 100644 --- a/completions/svn.completion.sh +++ b/completions/svn.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # ------------------------------------------------------------ # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/completions/system.completion.sh b/completions/system.completion.bash similarity index 88% rename from completions/system.completion.sh rename to completions/system.completion.bash index b044627ca..984a032c3 100644 --- a/completions/system.completion.sh +++ b/completions/system.completion.bash @@ -8,8 +8,8 @@ if [ -f /etc/bash_completion ]; then fi # Some distribution makes use of a profile.d script to import completion. -if [ -f /etc/profile.d/bash_completion.sh ]; then - . /etc/profile.d/bash_completion.sh +if [ -f /etc/profile.d/bash_completion.bash ]; then + . /etc/profile.d/bash_completion.bash fi diff --git a/completions/terraform.completion.sh b/completions/terraform.completion.bash similarity index 100% rename from completions/terraform.completion.sh rename to completions/terraform.completion.bash diff --git a/completions/test_kitchen.completion.sh b/completions/test_kitchen.completion.bash similarity index 97% rename from completions/test_kitchen.completion.sh rename to completions/test_kitchen.completion.bash index 2420aab00..4bf2ecea0 100644 --- a/completions/test_kitchen.completion.sh +++ b/completions/test_kitchen.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash __kitchen_instance_list () { # cache to .kitchen.list.yml if [[ .kitchen.yml -nt .kitchen.list.yml || .kitchen.local.yml -nt .kitchen.list.yml ]]; then @@ -28,4 +29,3 @@ __kitchen_options () { esac } complete -F __kitchen_options kitchen - diff --git a/completions/tmux.completion.sh b/completions/tmux.completion.bash similarity index 98% rename from completions/tmux.completion.sh rename to completions/tmux.completion.bash index ddadcbd8d..0b83436b7 100644 --- a/completions/tmux.completion.sh +++ b/completions/tmux.completion.bash @@ -2,7 +2,7 @@ # tmux completion # See: http://www.debian-administration.org/articles/317 for how to write more. -# Usage: Put "source bash_completion_tmux.sh" into your .bashrc +# Usage: Put "source bash_completion_tmux.bash" into your .bashrc # Based upon the example at http://paste-it.appspot.com/Pj4mLycDE _tmux_expand () diff --git a/completions/todo.completion.sh b/completions/todo.completion.bash similarity index 97% rename from completions/todo.completion.sh rename to completions/todo.completion.bash index 6e38c6f51..6cece302f 100644 --- a/completions/todo.completion.sh +++ b/completions/todo.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # link: https://github.com/ginatrapani/todo.txt-cli/blob/master/todo_completion _todo() @@ -15,7 +16,7 @@ _todo() mv prepend prep pri p replace report shorthelp" local -r MOVE_COMMAND_PATTERN='^(move|mv)$' - local _todo_sh=${_todo_sh:-todo.sh} + local _todo_sh=${_todo_sh:-todo.bash} local completions if [ $COMP_CWORD -eq 1 ]; then completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS" @@ -66,5 +67,5 @@ _todo() return 0 } -complete -F _todo todo.sh +complete -F _todo todo.bash complete -F _todo t diff --git a/completions/vagrant.completion.sh b/completions/vagrant.completion.bash similarity index 99% rename from completions/vagrant.completion.sh rename to completions/vagrant.completion.bash index e0abb7afd..70edabc68 100644 --- a/completions/vagrant.completion.sh +++ b/completions/vagrant.completion.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # (The MIT License) # diff --git a/completions/vault.completion.sh b/completions/vault.completion.bash similarity index 98% rename from completions/vault.completion.sh rename to completions/vault.completion.bash index f0c747c1d..78e5a34a4 100644 --- a/completions/vault.completion.sh +++ b/completions/vault.completion.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # --------------------------------------------------------------------------- # vault-bash-completion # diff --git a/completions/virtualbox.completion.sh b/completions/virtualbox.completion.bash similarity index 100% rename from completions/virtualbox.completion.sh rename to completions/virtualbox.completion.bash diff --git a/custom/aliases/example.aliases.sh b/custom/aliases/example.aliases.sh deleted file mode 100644 index f980ab709..000000000 --- a/custom/aliases/example.aliases.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom alias in the custom/aliases directory. Aliases placed -# here will override ones with the same name in the main alias directory. diff --git a/custom/completion/example.completion.sh b/custom/completion/example.completion.sh deleted file mode 100644 index 8d6989880..000000000 --- a/custom/completion/example.completion.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom completion in the custom/completion directory. Completions placed -# here will override ones with the same name in the main completion directory. diff --git a/custom/example.sh b/custom/example.sh deleted file mode 100644 index 841484978..000000000 --- a/custom/example.sh +++ /dev/null @@ -1,10 +0,0 @@ -# You can put files here to add functionality separated per file, which -# will be ignored by git. -# Files on the custom/ directory will be automatically loaded by the init -# script, in alphabetical order. - -# For example: add yourself some shortcuts to projects you often work on. -# -# brainstormr=~/workspace/projects/m2/brainstormr -# cd $brainstormr -# diff --git a/custom/plugins/example/example.plugin.sh b/custom/plugins/example/example.plugin.sh deleted file mode 100644 index 406f27445..000000000 --- a/custom/plugins/example/example.plugin.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom plugins in the custom/plugins directory. Plugins placed -# here will override ones with the same name in the main plugins directory. diff --git a/custom/themes/example/example.theme.sh b/custom/themes/example/example.theme.sh deleted file mode 100644 index 553df97bb..000000000 --- a/custom/themes/example/example.theme.sh +++ /dev/null @@ -1,2 +0,0 @@ -# Add your own custom themes in the custom/themes directory. Themes placed -# here will override ones with the same name in the main themes directory. diff --git a/lib/base.sh b/lib/base.bash similarity index 99% rename from lib/base.sh rename to lib/base.bash index 94032338d..722678424 100644 --- a/lib/base.sh +++ b/lib/base.bash @@ -326,7 +326,7 @@ httpHeaders () { /usr/bin/curl -I -L "$@" ; } # httpHeaders: Gr # to mount a read-only disk image as read-write: # --------------------------------------- -# hdiutil attach example.dmg -shadow /tmp/example.shadow -noverify +# hdiutil attach example.dmg -shadow /tmp/example.bashadow -noverify # mounting a removable drive (of type msdos or hfs) # --------------------------------------- diff --git a/lib/bourne-shell.sh b/lib/bourne-shell.bash similarity index 100% rename from lib/bourne-shell.sh rename to lib/bourne-shell.bash diff --git a/lib/directories.sh b/lib/directories.bash similarity index 100% rename from lib/directories.sh rename to lib/directories.bash diff --git a/lib/functions.sh b/lib/functions.bash similarity index 96% rename from lib/functions.sh rename to lib/functions.bash index f7964588e..9ac20ba76 100644 --- a/lib/functions.sh +++ b/lib/functions.bash @@ -4,11 +4,11 @@ function bash_stats() { } function uninstall_oh_my_bash() { - env OSH=$OSH sh $OSH/tools/uninstall.sh + env OSH=$OSH sh $OSH/tools/uninstall.bash } function upgrade_oh_my_bash() { - env OSH=$OSH sh $OSH/tools/upgrade.sh + env OSH=$OSH sh $OSH/tools/upgrade.bash } function take() { diff --git a/lib/git.sh b/lib/git.bash similarity index 100% rename from lib/git.sh rename to lib/git.bash diff --git a/lib/grep.sh b/lib/grep.bash similarity index 100% rename from lib/grep.sh rename to lib/grep.bash diff --git a/lib/history.sh b/lib/history.bash similarity index 100% rename from lib/history.sh rename to lib/history.bash diff --git a/lib/misc.sh b/lib/misc.bash similarity index 100% rename from lib/misc.sh rename to lib/misc.bash diff --git a/lib/mo.sh b/lib/mo.bash similarity index 100% rename from lib/mo.sh rename to lib/mo.bash diff --git a/lib/nvm.sh b/lib/nvm.bash similarity index 87% rename from lib/nvm.sh rename to lib/nvm.bash index c34e59642..597eff90d 100644 --- a/lib/nvm.sh +++ b/lib/nvm.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash # get the node.js version function nvm_prompt_info() { - [[ -f "$NVM_DIR/nvm.sh" ]] || return + [[ -f "$NVM_DIR/nvm.bash" ]] || return local nvm_prompt nvm_prompt=$(node -v 2>/dev/null) [[ "${nvm_prompt}x" == "x" ]] && return diff --git a/lib/shopt.sh b/lib/shopt.bash similarity index 100% rename from lib/shopt.sh rename to lib/shopt.bash diff --git a/lib/spectrum.sh b/lib/spectrum.bash similarity index 100% rename from lib/spectrum.sh rename to lib/spectrum.bash diff --git a/lib/spinner.sh b/lib/spinner.bash similarity index 100% rename from lib/spinner.sh rename to lib/spinner.bash diff --git a/lib/theme-and-appearance.sh b/lib/theme-and-appearance.bash similarity index 100% rename from lib/theme-and-appearance.sh rename to lib/theme-and-appearance.bash diff --git a/lib/utils.sh b/lib/utils.bash similarity index 99% rename from lib/utils.sh rename to lib/utils.bash index d8c7d4265..bc6d9de58 100644 --- a/lib/utils.sh +++ b/lib/utils.bash @@ -10,7 +10,7 @@ ############################---Usage---######################################### -# source ~/path/to/directory/utils.sh +# source ~/path/to/directory/utils.bash ########################## Styled text output ################################## diff --git a/oh-my-bash.bash b/oh-my-bash.bash new file mode 100644 index 000000000..dd7e8c5bc --- /dev/null +++ b/oh-my-bash.bash @@ -0,0 +1,172 @@ +#!/usr/bin/env bash + +# Error handling +## if {einfo,warn,die}() are not set globally (so that end-user can customize the error) then sets script's definitions +if ! command -v einfo > /dev/null; then einfo() { printf "INFO: %s\n" "$1" 1>&2 ; } fi +if ! command -v warn > /dev/null; then warn() { printf "WARN: %s\n" "$1" 1>&2 ; } fi +if ! command -v die > /dev/null; then die() { + case $1 in + # FALSE + 1) printf "FATAL: %s\n" "$2" 1>&2 ; exit $1 ;; + # Custom + *) (printf "FATAL: Syntax error $([ -n "${FUNCNAME[0]}" ] && printf "in ${FUNCNAME[0]}")\n%s\n" "$2" 1>&2 ; exit "$1") || (printf "FATAL: %s\n" "$1" 1>&2 ; exit $1) + esac +} fi + +# Bail out early if non-interactive +[[ $- != *i* ]] && die 1 "Shell is not interactive" + +# Check for updates on initial load... +if ! ((DISABLE_AUTO_UPDATE)) ; then + env OSH="$OSH" DISABLE_UPDATE_PROMPT="$DISABLE_UPDATE_PROMPT" bash -f "${OSH}/tools/check_for_upgrade.bash" +fi + +# Initializes Oh My Bash + +# add a function path +fpath=("${OSH}/functions" "$fpath") + +# Set OSH_CUSTOM to the path where your custom config files +# and plugins exists, or else we will use the default custom/ +if [[ -z "$OSH_CUSTOM" ]]; then + OSH_CUSTOM="${OSH}/custom" +fi + +# Set OSH_CACHE_DIR to the path where cache files should be created +# or else we will use the default cache/ +if [[ -z "$OSH_CACHE_DIR" ]]; then + OSH_CACHE_DIR="${OSH}/cache" +fi + +# Load all of the config files in ~/.oh-my-bash/lib that end in .bash +# TIP: Add files you don't want in git to .gitignore +for config_file in ${OSH}/lib/*.bash; do + custom_config_file="${OSH_CUSTOM}/lib/${config_file:t}" + [ -f "${custom_config_file}" ] && config_file="${custom_config_file}" + source "$config_file" +done + + +is_plugin() { + local base_dir="$1" + local name="$2" + [[ -f "$base_dir/plugins/${name}/{${name}.plugin.bash,_${name}}" ]] +} +# Add all defined plugins to fpath. This must be done +# before running compinit. +for plugin in ${plugins[@]}; do + if is_plugin "$OSH_CUSTOM" "$plugin"; then + fpath=("${OSH_CUSTOM}/plugins/$plugin" "$fpath") + elif is_plugin $OSH $plugin; then + fpath=("${OSH}/plugins/$plugin" "$fpath") + fi +done + +is_completion() { + local base_dir="$1" + local name="$2" + [ -f "${base_dir}/completions/${name}/${name}.completion.bash" ] +} +# Add all defined completions to fpath. This must be done +# before running compinit. +for completion in "${completions[@]}"; do + if is_completion "$OSH_CUSTOM" "$completion"; then + fpath=(${OSH_CUSTOM}/completions/${completion} $fpath) + elif is_completion "$OSH" "$completion"; then + fpath=("${OSH}/completions/${completion}" "$fpath") + fi +done + +is_alias() { + local base_dir="$1" + local name="$2" + [ -f "${base_dir}/aliases/${name}/${name}.aliases.bash" ] +} +# Add all defined completions to fpath. This must be done +# before running compinit. +for alias in "${aliases[@]}"; do + if is_alias "$OSH_CUSTOM" "$alias"; then + fpath=("${OSH_CUSTOM}/aliases/$alias" "$fpath") + elif is_alias "$OSH" "$alias"; then + fpath=("${OSH}/aliases/$alias" "$fpath") + fi +done + +# Figure out the SHORT hostname +if [[ $(uname) == Darwin* ]]; then + # macOS's $HOST changes with dhcp, etc. Use ComputerName if possible. + SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST="${HOST/.*/}" +else + SHORT_HOST="${HOST/.*/}" +fi + +# Load all of the plugins that were defined in ~/.bashrc +for plugin in ${plugins[@]}; do + if [ -f "${OSH_CUSTOM}/plugins/${plugin}/${plugin}.plugin.bash" ]; then + source "${OSH_CUSTOM}/plugins/${plugin}/${plugin}.plugin.bash" + elif [ -f "${OSH}/plugins/${plugin}/${plugin}.plugin.bash" ]; then + source "${OSH}/plugins/${plugin}/${plugin}.plugin.bash" + fi +done + +# Load all of the aliases that were defined in ~/.bashrc +for alias in "${aliases[@]}"; do + if [ -f "${OSH_CUSTOM}/aliases/${alias}.aliases.bash" ]; then + source "${OSH_CUSTOM}/aliases/${alias}.aliases.bash" + elif [ -f "${OSH}/aliases/${alias}.aliases.bash" ]; then + source "${OSH}/aliases/${alias}.aliases.bash" + fi +done + +# Load all of the completions that were defined in ~/.bashrc +for completion in ${completions[@]}; do + if [ -f "${OSH_CUSTOM}/completions/$completion.completion.bash" ]; then + source "${OSH_CUSTOM}/completions/$completion.completion.bash" + elif [ -f "${OSH}/completions/$completion.completion.bash" ]; then + source "${OSH}/completions/$completion.completion.bash" + fi +done + +# Load all of your custom configurations from custom/ +for config_file in "${OSH_CUSTOM}/*.bash"; do + if [ -f "$config_file" ]; then + source "$config_file" + fi +done +unset config_file + +# Load colors first so they can be use in base theme +source "${OSH}/themes/colours.theme.bash" +source "${OSH}/themes/base.theme.bash" + +# Load the theme +if [ "$OSH_THEME" = "random" ]; then + themes=("${OSH}/themes/*/*theme.bash") + N=${#themes[@]} + ((N=(RANDOM%N))) + RANDOM_THEME="${themes[$N]}" + source "$RANDOM_THEME" + echo "[oh-my-bash] Random theme '$RANDOM_THEME' loaded..." +else + if [ -n "$OSH_THEME" ]; then + if [ -f "${OSH_CUSTOM}/$OSH_THEME/$OSH_THEME.theme.bash" ]; then + source "${OSH_CUSTOM}/$OSH_THEME/$OSH_THEME.theme.bash" + elif [ -f "${OSH_CUSTOM}/themes/$OSH_THEME/$OSH_THEME.theme.bash" ]; then + source "${OSH_CUSTOM}/themes/$OSH_THEME/$OSH_THEME.theme.bash" + else + source "${OSH}/themes/$OSH_THEME/$OSH_THEME.theme.bash" + fi + fi +fi + +if [[ $PROMPT ]]; then + export PS1="\["$PROMPT"\]" +fi + +if ! type_exists '__git_ps1' ; then + source "${OSH}/tools/git-prompt.bash" +fi + +# Adding Support for other OSes +[ -s /usr/bin/gloobus-preview ] && PREVIEW="gloobus-preview" || +[ -s /Applications/Preview.app ] && PREVIEW="/Applications/Preview.app" || PREVIEW="less" diff --git a/plugins/aws/aws.plugin.sh b/plugins/aws/aws.plugin.bash similarity index 91% rename from plugins/aws/aws.plugin.sh rename to plugins/aws/aws.plugin.bash index a74ed8618..8b72eadca 100644 --- a/plugins/aws/aws.plugin.sh +++ b/plugins/aws/aws.plugin.bash @@ -1,4 +1,5 @@ -# aws.plugin.sh +#!/usr/bin/env bash +# aws.plugin.bash # Author: Michael Anckaert # Based on oh-my-zsh AWS plugin # diff --git a/plugins/bashmarks/bashmarks.plugin.sh b/plugins/bashmarks/bashmarks.plugin.bash similarity index 100% rename from plugins/bashmarks/bashmarks.plugin.sh rename to plugins/bashmarks/bashmarks.plugin.bash diff --git a/plugins/battery/battery.plugin.sh b/plugins/battery/battery.plugin.bash similarity index 100% rename from plugins/battery/battery.plugin.sh rename to plugins/battery/battery.plugin.bash diff --git a/plugins/bu/bu.plugin.sh b/plugins/bu/bu.plugin.bash similarity index 97% rename from plugins/bu/bu.plugin.sh rename to plugins/bu/bu.plugin.bash index 2566e7cc8..faaea436d 100644 --- a/plugins/bu/bu.plugin.sh +++ b/plugins/bu/bu.plugin.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# bu.plugin.sh +# bu.plugin.bash # Author: Taleeb Midi # Based on oh-my-zsh AWS plugin # diff --git a/plugins/git/README.md b/plugins/git/README.md index ce43db213..6b979efa8 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -1,3 +1,3 @@ # Git Plugin -The git plugin defines a number of useful aliases for you. [Consult the complete list](git.plugin.sh#L34) +The git plugin defines a number of useful aliases for you. [Consult the complete list](git.plugin.bash#L34) diff --git a/plugins/git/git.plugin.sh b/plugins/git/git.plugin.bash similarity index 100% rename from plugins/git/git.plugin.sh rename to plugins/git/git.plugin.bash diff --git a/plugins/progress/progress.plugin.sh b/plugins/progress/progress.plugin.bash similarity index 100% rename from plugins/progress/progress.plugin.sh rename to plugins/progress/progress.plugin.bash diff --git a/templates/bashrc.osh-template b/templates/bashrc.osh-template.bash similarity index 97% rename from templates/bashrc.osh-template rename to templates/bashrc.osh-template.bash index 21f510b56..cfba049ee 100644 --- a/templates/bashrc.osh-template +++ b/templates/bashrc.osh-template.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Path to your oh-my-bash installation. export OSH=$HOME/.oh-my-bash @@ -6,7 +7,7 @@ export OSH=$HOME/.oh-my-bash OSH_THEME="font" # Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" +# OSH_CASE_SENSITIVE="true" # Uncomment the following line to use hyphen-insensitive completion. Case # sensitive completion must be off. _ and - will be interchangeable. @@ -70,7 +71,7 @@ plugins=( bashmarks ) -source $OSH/oh-my-bash.sh +source $OSH/oh-my-bash.bash # User configuration # export MANPATH="/usr/local/man:$MANPATH" diff --git a/themes/90210/90210.theme.sh b/themes/90210/90210.theme.bash similarity index 100% rename from themes/90210/90210.theme.sh rename to themes/90210/90210.theme.bash diff --git a/themes/agnoster/README.md b/themes/agnoster/README.md index fe1aeb9c8..3dcfea2a4 100644 --- a/themes/agnoster/README.md +++ b/themes/agnoster/README.md @@ -6,7 +6,7 @@ I recommend: https://github.com/powerline/fonts.git ``` git clone https://github.com/powerline/fonts.git fonts cd fonts -install.sh +install.bash ``` The aim of this theme is to only show you *relevant* information. Like most diff --git a/themes/agnoster/agnoster.base.bash b/themes/agnoster/agnoster.base.bash new file mode 100755 index 000000000..6efb87268 --- /dev/null +++ b/themes/agnoster/agnoster.base.bash @@ -0,0 +1,423 @@ +#!/usr/bin/env bash +# vim: ft=bash ts=2 sw=2 sts=2 +# +# agnoster's Theme - https://gist.github.com/3712874 +# A Powerline-inspired theme for BASH +# +# (Converted from ZSH theme by Kenny Root) +# https://gist.github.com/kruton/8345450 +# +# Updated & fixed by Erik Selberg erik@selberg.org 1/14/17 +# Tested on MacOSX, Ubuntu, Amazon Linux +# Bash v3 and v4 +# +# # README +# +# In order for this theme to render correctly, you will need a +# [Powerline-patched font](https://gist.github.com/1595572). +# I recommend: https://github.com/powerline/fonts.git +# > git clone https://github.com/powerline/fonts.git fonts +# > cd fonts +# > install.bash + +# In addition, I recommend the +# [Solarized theme](https://github.com/altercation/solarized/) and, if you're +# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app - +# it has significantly better color fidelity. + +# Install: + +# I recommend the following: +# $ cd home +# $ mkdir -p .bash/themes/agnoster-bash +# $ git clone https://github.com/speedenator/agnoster-bash.git .bash/themes/agnoster-bash + +# then add the following to your .bashrc: + +# export THEME=$HOME/.bash/themes/agnoster-bash/agnoster.bash +# if [[ -f $THEME ]]; then +# export DEFAULT_USER=`whoami` +# source $THEME +# fi + +# +# # Goals +# +# The aim of this theme is to only show you *relevant* information. Like most +# prompts, it will only show git information when in a git working directory. +# However, it goes a step further: everything from the current user and +# hostname to whether the last call exited with an error to whether background +# jobs are running in this shell will all be displayed automatically when +# appropriate. + +# Generally speaking, this script has limited support for right +# prompts (ala powerlevel9k on zsh), but it's pretty problematic in Bash. +# The general pattern is to write out the right prompt, hit \r, then +# write the left. This is problematic for the following reasons: +# - Doesn't properly resize dynamically when you resize the terminal +# - Changes to the prompt (like clearing and re-typing, super common) deletes the prompt +# - Getting the right alignment via columns / tput cols is pretty problematic (and is a bug in this version) +# - Bash prompt escapes (like \h or \w) don't get interpolated +# +# all in all, if you really, really want right-side prompts without a +# ton of work, recommend going to zsh for now. If you know how to fix this, +# would appreciate it! + +# note: requires bash v4+... Mac users - you often have bash3. +# 'brew install bash' will set you free +PROMPT_DIRTRIM=2 # bash4 and above + +###################################################################### +DEBUG=0 +debug() { + if [[ ${DEBUG} -ne 0 ]]; then + >&2 echo -e $* + fi +} + +###################################################################### +### Segment drawing +# A few utility functions to make it easy and re-usable to draw segmented prompts + +CURRENT_BG='NONE' +CURRENT_RBG='NONE' +SEGMENT_SEPARATOR='' +RIGHT_SEPARATOR='' +LEFT_SUBSEG='' +RIGHT_SUBSEG='' + +text_effect() { + case "$1" in + reset) echo 0;; + bold) echo 1;; + underline) echo 4;; + esac +} + +# to add colors, see +# http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux +# under the "256 (8-bit) Colors" section, and follow the example for orange below +fg_color() { + case "$1" in + black) echo 30;; + red) echo 31;; + green) echo 32;; + yellow) echo 33;; + blue) echo 34;; + magenta) echo 35;; + cyan) echo 36;; + white) echo 37;; + orange) echo 38\;5\;166;; + esac +} + +bg_color() { + case "$1" in + black) echo 40;; + red) echo 41;; + green) echo 42;; + yellow) echo 43;; + blue) echo 44;; + magenta) echo 45;; + cyan) echo 46;; + white) echo 47;; + orange) echo 48\;5\;166;; + esac; +} + +# TIL: declare is global not local, so best use a different name +# for codes (mycodes) as otherwise it'll clobber the original. +# this changes from BASH v3 to BASH v4. +ansi() { + local seq| + declare -a mycodes=("${!1}") + + debug "ansi: ${!1} all: $* aka ${mycodes[@]}" + + seq="" + for ((i = 0; i < ${#mycodes[@]}; i++)); do + if [[ -n $seq ]]; then + seq="${seq};" + fi + seq="${seq}${mycodes[$i]}" + done + debug "ansi debug:" '\\[\\033['${seq}'m\\]' + echo -ne '\[\033['${seq}'m\]' + # PR="$PR\[\033[${seq}m\]" +} + +ansi_single() { + echo -ne '\[\033['$1'm\]' +} + +# Begin a segment +# Takes two arguments, background and foreground. Both can be omitted, +# rendering default background/foreground. +prompt_segment() { + local bg fg + declare -a codes + + debug "Prompting $1 $2 $3" + + # if commented out from kruton's original... I'm not clear + # if it did anything, but it messed up things like + # prompt_status - Erik 1/14/17 + + # if [[ -z $1 || ( -z $2 && $2 != default ) ]]; then + codes=("${codes[@]}" $(text_effect reset)) + # fi + if [[ -n $1 ]]; then + bg=$(bg_color $1) + codes=("${codes[@]}" $bg) + debug "Added $bg as background to codes" + fi + if [[ -n $2 ]]; then + fg=$(fg_color $2) + codes=("${codes[@]}" $fg) + debug "Added $fg as foreground to codes" + fi + + debug "Codes: " + # declare -p codes + + if [[ $CURRENT_BG != NONE && $1 != $CURRENT_BG ]]; then + declare -a intermediate=($(fg_color $CURRENT_BG) $(bg_color $1)) + debug "pre prompt " $(ansi intermediate[@]) + PR="$PR $(ansi intermediate[@])$SEGMENT_SEPARATOR" + debug "post prompt " $(ansi codes[@]) + PR="$PR$(ansi codes[@]) " + else + debug "no current BG, codes is $codes[@]" + PR="$PR$(ansi codes[@]) " + fi + CURRENT_BG=$1 + [[ -n $3 ]] && PR="$PR$3" +} + +# End the prompt, closing any open segments +prompt_end() { + if [[ -n $CURRENT_BG ]]; then + declare -a codes=($(text_effect reset) $(fg_color $CURRENT_BG)) + PR="$PR $(ansi codes[@])$SEGMENT_SEPARATOR" + fi + declare -a reset=($(text_effect reset)) + PR="$PR $(ansi reset[@])" + CURRENT_BG='' +} + +### virtualenv prompt +prompt_virtualenv() { + if [[ -n $VIRTUAL_ENV ]]; then + color=cyan + prompt_segment $color $PRIMARY_FG + prompt_segment $color white "$(basename $VIRTUAL_ENV)" + fi +} + + +### Prompt components +# Each component will draw itself, and hide itself if no information needs to be shown + +# Context: user@hostname (who am I and where am I) +prompt_context() { + local user="$(whoami)" + + if [[ $user != $DEFAULT_USER || -n $SSH_CLIENT ]]; then + prompt_segment black default "$user@\h" + fi +} + +# prints history followed by HH:MM, useful for remembering what +# we did previously +prompt_histdt() { + prompt_segment black default "\! [\A]" +} + + +git_status_dirty() { + dirty=$(git status -s 2> /dev/null | tail -n 1) + [[ -n $dirty ]] && echo " ●" +} + +# Git: branch/detached head, dirty status +prompt_git() { + local ref dirty + if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then + ZSH_THEME_GIT_PROMPT_DIRTY='±' + dirty=$(git_status_dirty) + ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git show-ref --head -s --abbrev |head -n1 2> /dev/null)" + if [[ -n $dirty ]]; then + prompt_segment yellow black + else + prompt_segment green black + fi + PR="$PR${ref/refs\/heads\// }$dirty" + fi +} + +# Dir: current working directory +prompt_dir() { + prompt_segment blue black '\w' +} + +# Status: +# - was there an error +# - am I root +# - are there background jobs? +prompt_status() { + local symbols + symbols=() + [[ $RETVAL -ne 0 ]] && symbols+="$(ansi_single $(fg_color red))✘" + [[ $UID -eq 0 ]] && symbols+="$(ansi_single $(fg_color yellow))⚡" + [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="$(ansi_single $(fg_color cyan))⚙" + + [[ -n "$symbols" ]] && prompt_segment black default "$symbols" +} + +###################################################################### +# +# experimental right prompt stuff +# requires setting prompt_foo to use PRIGHT vs PR +# doesn't quite work per above + +rightprompt() { + printf "%*s" $COLUMNS "$PRIGHT" +} + +# quick right prompt I grabbed to test things. +__command_rprompt() { + local times= n=$COLUMNS tz + for tz in ZRH:Europe/Zurich PIT:US/Eastern \ + MTV:US/Pacific TOK:Asia/Tokyo; do + [ $n -gt 40 ] || break + times="$times ${tz%%:*}\e[30;1m:\e[0;36;1m" + times="$times$(TZ=${tz#*:} date +%H:%M)\e[0m" + n="$( $n - 10 )" + done + [ -z "$times" ] || printf "%${n}s$times\\r" '' +} +# PROMPT_COMMAND=__command_rprompt + +# this doens't wrap code in \[ \] +ansi_r() { + local seq + declare -a mycodes2=("${!1}") + + debug "ansi: ${!1} all: $* aka ${mycodes2[@]}" + + seq="" + for ((i = 0; i < ${#mycodes2[@]}; i++)); do + if [[ -n $seq ]]; then + seq="${seq};" + fi + seq="${seq}${mycodes2[$i]}" + done + debug "ansi debug:" '\\[\\033['${seq}'m\\]' + echo -ne '\033['${seq}'m' + # PR="$PR\[\033[${seq}m\]" +} + +# Begin a segment on the right +# Takes two arguments, background and foreground. Both can be omitted, +# rendering default background/foreground. +prompt_right_segment() { + local bg fg + declare -a codes + + debug "Prompt right" + debug "Prompting $1 $2 $3" + + # if commented out from kruton's original... I'm not clear + # if it did anything, but it messed up things like + # prompt_status - Erik 1/14/17 + + # if [[ -z $1 || ( -z $2 && $2 != default ) ]]; then + codes=("${codes[@]}" $(text_effect reset)) + # fi + if [[ -n $1 ]]; then + bg=$(bg_color $1) + codes=("${codes[@]}" $bg) + debug "Added $bg as background to codes" + fi + if [[ -n $2 ]]; then + fg=$(fg_color $2) + codes=("${codes[@]}" $fg) + debug "Added $fg as foreground to codes" + fi + + debug "Right Codes: " + # declare -p codes + + # right always has a separator + # if [[ $CURRENT_RBG != NONE && $1 != $CURRENT_RBG ]]; then + # $CURRENT_RBG= + # fi + declare -a intermediate2=($(fg_color $1) $(bg_color $CURRENT_RBG) ) + # PRIGHT="$PRIGHT---" + debug "pre prompt " $(ansi_r intermediate2[@]) + PRIGHT="$PRIGHT$(ansi_r intermediate2[@])$RIGHT_SEPARATOR" + debug "post prompt " $(ansi_r codes[@]) + PRIGHT="$PRIGHT$(ansi_r codes[@]) " + # else + # debug "no current BG, codes is $codes[@]" + # PRIGHT="$PRIGHT$(ansi codes[@]) " + # fi + CURRENT_RBG=$1 + [[ -n $3 ]] && PRIGHT="$PRIGHT$3" +} + +###################################################################### +## Emacs prompt --- for dir tracking +# stick the following in your .emacs if you use this: + +# (setq dirtrack-list '(".*DIR *\\([^ ]*\\) DIR" 1 nil)) +# (defun dirtrack-filter-out-pwd-prompt (string) +# "dirtrack-mode doesn't remove the PWD match from the prompt. This does." +# ;; TODO: support dirtrack-mode's multiline regexp. +# (if (and (stringp string) (string-match (first dirtrack-list) string)) +# (replace-match "" t t string 0) +# string)) +# (add-hook 'shell-mode-hook +# #'(lambda () +# (dirtrack-mode 1) +# (add-hook 'comint-preoutput-filter-functions +# 'dirtrack-filter-out-pwd-prompt t t))) + +prompt_emacsdir() { + # no color or other setting... this will be deleted per above + PR="DIR \w DIR$PR" +} + +###################################################################### +## Main prompt + +build_prompt() { + [[ ! -z ${AG_EMACS_DIR+x} ]] && prompt_emacsdir + prompt_status + #[[ -z ${AG_NO_HIST+x} ]] && prompt_histdt + [[ -z ${AG_NO_CONTEXT+x} ]] && prompt_context + prompt_virtualenv + prompt_dir + prompt_git + prompt_end +} + +# from orig... +# export PS1='$(ansi_single $(text_effect reset)) $(build_prompt) ' +# this doesn't work... new model: create a prompt via a PR variable and +# use that. + +set_bash_prompt() { + RETVAL=$? + PR="" + PRIGHT="" + CURRENT_BG=NONE + PR="$(ansi_single $(text_effect reset))" + build_prompt + + # uncomment below to use right prompt + # PS1='\[$(tput sc; printf "%*s" $COLUMNS "$PRIGHT"; tput rc)\]'$PR + PS1=$PR +} + +PROMPT_COMMAND=set_bash_prompt diff --git a/themes/axin/axin.theme.sh b/themes/axin/axin.theme.bash similarity index 100% rename from themes/axin/axin.theme.sh rename to themes/axin/axin.theme.bash diff --git a/themes/bakke/bakke.theme.sh b/themes/bakke/bakke.theme.bash similarity index 100% rename from themes/bakke/bakke.theme.sh rename to themes/bakke/bakke.theme.bash diff --git a/themes/base.theme.sh b/themes/base.theme.bash similarity index 100% rename from themes/base.theme.sh rename to themes/base.theme.bash diff --git a/themes/binaryanomaly/binaryanomaly.theme.sh b/themes/binaryanomaly/binaryanomaly.theme.bash similarity index 100% rename from themes/binaryanomaly/binaryanomaly.theme.sh rename to themes/binaryanomaly/binaryanomaly.theme.bash diff --git a/themes/bobby-python/bobby-python.theme.sh b/themes/bobby-python/bobby-python.theme.bash similarity index 100% rename from themes/bobby-python/bobby-python.theme.sh rename to themes/bobby-python/bobby-python.theme.bash diff --git a/themes/bobby/bobby.theme.sh b/themes/bobby/bobby.theme.bash similarity index 100% rename from themes/bobby/bobby.theme.sh rename to themes/bobby/bobby.theme.bash diff --git a/themes/brainy/brainy.theme.sh b/themes/brainy/brainy.theme.bash similarity index 97% rename from themes/brainy/brainy.theme.sh rename to themes/brainy/brainy.theme.bash index 856264606..819c91104 100644 --- a/themes/brainy/brainy.theme.sh +++ b/themes/brainy/brainy.theme.bash @@ -136,10 +136,10 @@ ___brainy_prompt_ruby() { ___brainy_prompt_todo() { [ "${THEME_SHOW_TODO}" != "true" ] || - [ -z "$(which todo.sh)" ] && return + [ -z "$(which todo.bash)" ] && return color=$bold_white box="[|]" - info="t:$(todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+)" | awk '{ print $4 }' )" + info="t:$(todo.bash ls | egrep "TODO: [0-9]+ of ([0-9]+)" | awk '{ print $4 }' )" printf "%s|%s|%s|%s" "${color}" "${info}" "${bold_green}" "${box}" } @@ -152,7 +152,7 @@ ___brainy_prompt_clock() { } ___brainy_prompt_battery() { - [ ! -e $OSH/plugins/battery/battery.plugin.sh ] || + [ ! -e $OSH/plugins/battery/battery.plugin.bash ] || [ "${THEME_SHOW_BATTERY}" != "true" ] && return info=$(battery_percentage) color=$bold_green diff --git a/themes/brunton/brunton.theme.sh b/themes/brunton/brunton.theme.bash similarity index 100% rename from themes/brunton/brunton.theme.sh rename to themes/brunton/brunton.theme.bash diff --git a/themes/candy/candy.theme.sh b/themes/candy/candy.theme.bash similarity index 100% rename from themes/candy/candy.theme.sh rename to themes/candy/candy.theme.bash diff --git a/themes/clean/clean.theme.sh b/themes/clean/clean.theme.bash similarity index 98% rename from themes/clean/clean.theme.sh rename to themes/clean/clean.theme.bash index b4cd7b583..7eb5d07b2 100644 --- a/themes/clean/clean.theme.sh +++ b/themes/clean/clean.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # git theming ZSH_THEME_GIT_PROMPT_PREFIX="${bold_blue}(${yellow}%B" ZSH_THEME_GIT_PROMPT_SUFFIX="%b${bold_blue})${reset_color} " diff --git a/themes/colours.theme.sh b/themes/colours.theme.bash similarity index 100% rename from themes/colours.theme.sh rename to themes/colours.theme.bash diff --git a/themes/cooperkid/cooperkid.theme.sh b/themes/cooperkid/cooperkid.theme.bash similarity index 98% rename from themes/cooperkid/cooperkid.theme.sh rename to themes/cooperkid/cooperkid.theme.bash index 1ffb95aa4..2b832038e 100644 --- a/themes/cooperkid/cooperkid.theme.sh +++ b/themes/cooperkid/cooperkid.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # ------------------------------------------------------------------# # FILE: cooperkid.zsh-theme # # BY: Alfredo Bejarano # diff --git a/themes/cupcake/cupcake.theme.sh b/themes/cupcake/cupcake.theme.bash similarity index 100% rename from themes/cupcake/cupcake.theme.sh rename to themes/cupcake/cupcake.theme.bash diff --git a/themes/demula/demula.theme.sh b/themes/demula/demula.theme.bash similarity index 98% rename from themes/demula/demula.theme.sh rename to themes/demula/demula.theme.bash index ce79be7b8..db750040d 100644 --- a/themes/demula/demula.theme.sh +++ b/themes/demula/demula.theme.bash @@ -84,7 +84,7 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}" # checks if the plugin is installed before calling battery_charge safe_battery_charge() { - if [ -e "${OSH}/plugins/battery/battery.plugin.sh" ]; + if [ -e "${OSH}/plugins/battery/battery.plugin.bash" ]; then battery_charge fi diff --git a/themes/dos/dos.theme.bash b/themes/dos/dos.theme.bash new file mode 100644 index 000000000..ff52da824 --- /dev/null +++ b/themes/dos/dos.theme.bash @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +PROMPT="\w>>" diff --git a/themes/dos/dos.theme.sh b/themes/dos/dos.theme.sh deleted file mode 100644 index 17f0cff64..000000000 --- a/themes/dos/dos.theme.sh +++ /dev/null @@ -1 +0,0 @@ -PROMPT="\w>>" diff --git a/themes/doubletime/doubletime.theme.sh b/themes/doubletime/doubletime.theme.bash similarity index 100% rename from themes/doubletime/doubletime.theme.sh rename to themes/doubletime/doubletime.theme.bash diff --git a/themes/doubletime_multiline/doubletime_multiline.theme.sh b/themes/doubletime_multiline/doubletime_multiline.theme.bash similarity index 86% rename from themes/doubletime_multiline/doubletime_multiline.theme.sh rename to themes/doubletime_multiline/doubletime_multiline.theme.bash index 68a0c0cd7..57aedb8f8 100644 --- a/themes/doubletime_multiline/doubletime_multiline.theme.sh +++ b/themes/doubletime_multiline/doubletime_multiline.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/doubletime/doubletime.theme.sh" +source "$OSH/themes/doubletime/doubletime.theme.bash" function prompt_setter() { # Save history diff --git a/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.sh b/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash similarity index 86% rename from themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.sh rename to themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash index df379bd26..2ed85bcb4 100644 --- a/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.sh +++ b/themes/doubletime_multiline_pyonly/doubletime_multiline_pyonly.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/doubletime/doubletime.theme.sh" +source "$OSH/themes/doubletime/doubletime.theme.bash" function prompt_setter() { # Save history diff --git a/themes/dulcie/dulcie.theme.sh b/themes/dulcie/dulcie.theme.bash similarity index 100% rename from themes/dulcie/dulcie.theme.sh rename to themes/dulcie/dulcie.theme.bash diff --git a/themes/duru/duru.theme.sh b/themes/duru/duru.theme.bash similarity index 100% rename from themes/duru/duru.theme.sh rename to themes/duru/duru.theme.bash diff --git a/themes/emperor/emperor.theme.sh b/themes/emperor/emperor.theme.bash similarity index 100% rename from themes/emperor/emperor.theme.sh rename to themes/emperor/emperor.theme.bash diff --git a/themes/envy/envy.theme.sh b/themes/envy/envy.theme.bash similarity index 100% rename from themes/envy/envy.theme.sh rename to themes/envy/envy.theme.bash diff --git a/themes/font/font.theme.sh b/themes/font/font.theme.bash similarity index 100% rename from themes/font/font.theme.sh rename to themes/font/font.theme.bash diff --git a/themes/gallifrey/gallifrey.theme.sh b/themes/gallifrey/gallifrey.theme.bash similarity index 98% rename from themes/gallifrey/gallifrey.theme.sh rename to themes/gallifrey/gallifrey.theme.bash index ddb89778c..3544ec0ae 100644 --- a/themes/gallifrey/gallifrey.theme.sh +++ b/themes/gallifrey/gallifrey.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # scm theming SCM_THEME_PROMPT_PREFIX="${yellow}(" SCM_THEME_PROMPT_SUFFIX=")${normal}" diff --git a/themes/hawaii50/hawaii50.theme.sh b/themes/hawaii50/hawaii50.theme.bash similarity index 100% rename from themes/hawaii50/hawaii50.theme.sh rename to themes/hawaii50/hawaii50.theme.bash diff --git a/themes/iterate/iterate.theme.sh b/themes/iterate/iterate.theme.bash similarity index 100% rename from themes/iterate/iterate.theme.sh rename to themes/iterate/iterate.theme.bash diff --git a/themes/kitsune/kitsune.theme.sh b/themes/kitsune/kitsune.theme.bash similarity index 98% rename from themes/kitsune/kitsune.theme.sh rename to themes/kitsune/kitsune.theme.bash index c339f54c4..235e153ae 100644 --- a/themes/kitsune/kitsune.theme.sh +++ b/themes/kitsune/kitsune.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # This is combination of works from two different people which I combined for my requirement. # Original PS1 was from reddit user /u/Allevil669 which I found in thread: https://www.reddit.com/r/linux/comments/1z33lj/linux_users_whats_your_favourite_bash_prompt/ # I used that PS1 to the bash-it theme 'morris', and customized it to my liking. All credits to /u/Allevil669 and morris. diff --git a/themes/luan/luan.theme.sh b/themes/luan/luan.theme.bash similarity index 100% rename from themes/luan/luan.theme.sh rename to themes/luan/luan.theme.bash diff --git a/themes/mairan/mairan.theme.sh b/themes/mairan/mairan.theme.bash similarity index 99% rename from themes/mairan/mairan.theme.sh rename to themes/mairan/mairan.theme.bash index 5c5dfef17..22e788b3c 100644 --- a/themes/mairan/mairan.theme.sh +++ b/themes/mairan/mairan.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Mairan Bash Prompt, inspired by "Zork" if tput setaf 1 &> /dev/null; then diff --git a/themes/mbriggs/mbriggs.theme.sh b/themes/mbriggs/mbriggs.theme.bash similarity index 95% rename from themes/mbriggs/mbriggs.theme.sh rename to themes/mbriggs/mbriggs.theme.bash index 169f8d7c4..c055040c3 100644 --- a/themes/mbriggs/mbriggs.theme.sh +++ b/themes/mbriggs/mbriggs.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # ------------------------------------------------------------------# # FILE: mbriggs.zsh-theme # # BY: Matt Briggs (matt@mattbriggs.net) # @@ -31,4 +32,4 @@ function prompt() { PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}" } -safe_append_prompt_command prompt \ No newline at end of file +safe_append_prompt_command prompt diff --git a/themes/minimal/minimal.theme.sh b/themes/minimal/minimal.theme.bash similarity index 100% rename from themes/minimal/minimal.theme.sh rename to themes/minimal/minimal.theme.bash diff --git a/themes/modern-t/modern-t.theme.sh b/themes/modern-t/modern-t.theme.bash similarity index 98% rename from themes/modern-t/modern-t.theme.sh rename to themes/modern-t/modern-t.theme.bash index da5f9446a..fa3a4cad2 100644 --- a/themes/modern-t/modern-t.theme.sh +++ b/themes/modern-t/modern-t.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" diff --git a/themes/modern/modern.theme.sh b/themes/modern/modern.theme.bash similarity index 98% rename from themes/modern/modern.theme.sh rename to themes/modern/modern.theme.bash index 583764e29..6e78b6d2d 100644 --- a/themes/modern/modern.theme.sh +++ b/themes/modern/modern.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" diff --git a/themes/morris/morris.theme.sh b/themes/morris/morris.theme.bash similarity index 96% rename from themes/morris/morris.theme.sh rename to themes/morris/morris.theme.bash index d6b0258dc..046672436 100644 --- a/themes/morris/morris.theme.sh +++ b/themes/morris/morris.theme.bash @@ -1,4 +1,4 @@ - +#!/usr/bin/env bash # prompt theming # added TITLEBAR for updating the tab and window titles with the pwd diff --git a/themes/n0qorg/n0qorg.theme.sh b/themes/n0qorg/n0qorg.theme.bash similarity index 100% rename from themes/n0qorg/n0qorg.theme.sh rename to themes/n0qorg/n0qorg.theme.bash diff --git a/themes/nwinkler/nwinkler.theme.sh b/themes/nwinkler/nwinkler.theme.bash similarity index 100% rename from themes/nwinkler/nwinkler.theme.sh rename to themes/nwinkler/nwinkler.theme.bash diff --git a/themes/nwinkler_random_colors/nwinkler_random_colors.theme.sh b/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash similarity index 99% rename from themes/nwinkler_random_colors/nwinkler_random_colors.theme.sh rename to themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash index 9e0d177b3..3c15e4bd7 100644 --- a/themes/nwinkler_random_colors/nwinkler_random_colors.theme.sh +++ b/themes/nwinkler_random_colors/nwinkler_random_colors.theme.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Two line prompt showing the following information: # (time) SCM [username@hostname] pwd (SCM branch SCM status) diff --git a/themes/pete/pete.theme.sh b/themes/pete/pete.theme.bash similarity index 100% rename from themes/pete/pete.theme.sh rename to themes/pete/pete.theme.bash diff --git a/themes/powerline-multiline/README.md b/themes/powerline-multiline/README.md index 768e4971d..974ffecd8 100644 --- a/themes/powerline-multiline/README.md +++ b/themes/powerline-multiline/README.md @@ -12,7 +12,7 @@ A colorful multiline theme, where the first line shows information about your sh * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor -* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin)) +* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin)) * SCM Repository status (e.g. Git, SVN) * The current Python environment (Virtualenv, venv, and Conda are supported) in use * The current Ruby environment (rvm and rbenv are supported) in use diff --git a/themes/powerline-multiline/powerline-multiline.base.sh b/themes/powerline-multiline/powerline-multiline.base.bash similarity index 97% rename from themes/powerline-multiline/powerline-multiline.base.sh rename to themes/powerline-multiline/powerline-multiline.base.bash index cd8492eb4..c7c93f2e9 100644 --- a/themes/powerline-multiline/powerline-multiline.base.sh +++ b/themes/powerline-multiline/powerline-multiline.base.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.sh" +source "$OSH/themes/powerline/powerline.base.bash" function __powerline_last_status_prompt { [[ "$1" -ne 0 ]] && echo "$(set_color ${LAST_STATUS_THEME_PROMPT_COLOR} -) ${1} ${normal}" diff --git a/themes/powerline-multiline/powerline-multiline.theme.sh b/themes/powerline-multiline/powerline-multiline.theme.bash similarity index 99% rename from themes/powerline-multiline/powerline-multiline.theme.sh rename to themes/powerline-multiline/powerline-multiline.theme.bash index fc9f2b17d..c9131fb9b 100644 --- a/themes/powerline-multiline/powerline-multiline.theme.sh +++ b/themes/powerline-multiline/powerline-multiline.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline-multiline/powerline-multiline.base.sh" +source "$OSH/themes/powerline-multiline/powerline-multiline.base.bash" PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:="❯"} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} diff --git a/themes/powerline-naked/README.md b/themes/powerline-naked/README.md index 7a4445372..35457baa3 100644 --- a/themes/powerline-naked/README.md +++ b/themes/powerline-naked/README.md @@ -12,7 +12,7 @@ A colorful theme, where shows a lot information about your shell session. * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor -* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin)) +* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin)) * SCM Repository status (e.g. Git, SVN) * The current Python environment (Virtualenv, venv, and Conda are supported) in use * The current Ruby environment (rvm and rbenv are supported) in use diff --git a/themes/powerline-naked/powerline-naked.base.sh b/themes/powerline-naked/powerline-naked.base.bash similarity index 88% rename from themes/powerline-naked/powerline-naked.base.sh rename to themes/powerline-naked/powerline-naked.base.bash index 25a0181e5..e97d287a6 100644 --- a/themes/powerline-naked/powerline-naked.base.sh +++ b/themes/powerline-naked/powerline-naked.base.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.sh" +source "$OSH/themes/powerline/powerline.base.bash" function __powerline_left_segment { local OLD_IFS="${IFS}"; IFS="|" diff --git a/themes/powerline-naked/powerline-naked.theme.sh b/themes/powerline-naked/powerline-naked.theme.bash similarity index 95% rename from themes/powerline-naked/powerline-naked.theme.sh rename to themes/powerline-naked/powerline-naked.theme.bash index 9d25b4406..8fca3a642 100644 --- a/themes/powerline-naked/powerline-naked.theme.sh +++ b/themes/powerline-naked/powerline-naked.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline-naked/powerline-naked.base.sh" +source "$OSH/themes/powerline-naked/powerline-naked.base.bash" PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} diff --git a/themes/powerline-plain/README.md b/themes/powerline-plain/README.md index d880b7bd8..11b10b737 100644 --- a/themes/powerline-plain/README.md +++ b/themes/powerline-plain/README.md @@ -10,7 +10,7 @@ A colorful theme, where shows a lot information about your shell session. * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor -* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin)) +* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin)) * SCM Repository status (e.g. Git, SVN) * The current Python environment (Virtualenv, venv, and Conda are supported) in use * The current Ruby environment (rvm and rbenv are supported) in use diff --git a/themes/powerline-plain/powerline-plain.base.sh b/themes/powerline-plain/powerline-plain.base.bash similarity index 93% rename from themes/powerline-plain/powerline-plain.base.sh rename to themes/powerline-plain/powerline-plain.base.bash index 467bd49a9..2394f3f39 100644 --- a/themes/powerline-plain/powerline-plain.base.sh +++ b/themes/powerline-plain/powerline-plain.base.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.sh" +source "$OSH/themes/powerline/powerline.base.bash" function __powerline_left_segment { local OLD_IFS="${IFS}"; IFS="|" diff --git a/themes/powerline-plain/powerline-plain.theme.sh b/themes/powerline-plain/powerline-plain.theme.bash similarity index 95% rename from themes/powerline-plain/powerline-plain.theme.sh rename to themes/powerline-plain/powerline-plain.theme.bash index 7da07e1b6..369d6545f 100644 --- a/themes/powerline-plain/powerline-plain.theme.sh +++ b/themes/powerline-plain/powerline-plain.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline-plain/powerline-plain.base.sh" +source "$OSH/themes/powerline-plain/powerline-plain.base.bash" USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:="⌁ "} USER_INFO_THEME_PROMPT_COLOR=32 diff --git a/themes/powerline/README.md b/themes/powerline/README.md index b2f244d4f..20476ee00 100644 --- a/themes/powerline/README.md +++ b/themes/powerline/README.md @@ -14,7 +14,7 @@ A colorful theme, where shows a lot information about your shell session. * An indicator when connected by SSH * An indicator when `sudo` has the credentials cached (see the `sudo` manpage for more info about this) * An indicator when the current shell is inside the Vim editor -* Battery charging status (depends on the [../../plugins/battery/battery.plugin.sh](battery plugin)) +* Battery charging status (depends on the [../../plugins/battery/battery.plugin.bash](battery plugin)) * SCM Repository status (e.g. Git, SVN) * The current Python environment (Virtualenv, venv, and Conda are supported) in use * The current Ruby environment (rvm and rbenv are supported) in use diff --git a/themes/powerline/powerline.base.sh b/themes/powerline/powerline.base.bash similarity index 100% rename from themes/powerline/powerline.base.sh rename to themes/powerline/powerline.base.bash diff --git a/themes/powerline/powerline.theme.sh b/themes/powerline/powerline.theme.bash similarity index 96% rename from themes/powerline/powerline.theme.sh rename to themes/powerline/powerline.theme.bash index d396c0443..8442e0143 100644 --- a/themes/powerline/powerline.theme.sh +++ b/themes/powerline/powerline.theme.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -source "$OSH/themes/powerline/powerline.base.sh" +source "$OSH/themes/powerline/powerline.base.bash" PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""} POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} diff --git a/themes/primer/primer.theme.sh b/themes/primer/primer.theme.bash similarity index 100% rename from themes/primer/primer.theme.sh rename to themes/primer/primer.theme.bash diff --git a/themes/pro/pro.theme.sh b/themes/pro/pro.theme.bash similarity index 100% rename from themes/pro/pro.theme.sh rename to themes/pro/pro.theme.bash diff --git a/themes/pure/pure.theme.sh b/themes/pure/pure.theme.bash similarity index 94% rename from themes/pure/pure.theme.sh rename to themes/pure/pure.theme.bash index b75d3f8f3..d59f9177a 100644 --- a/themes/pure/pure.theme.sh +++ b/themes/pure/pure.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # scm theming SCM_THEME_PROMPT_PREFIX="|" SCM_THEME_PROMPT_SUFFIX="" @@ -14,13 +15,13 @@ SCM_HG_CHAR="${bold_red}☿${normal}" # export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:' scm_prompt() { - CHAR=$(scm_char) - if [ $CHAR = $SCM_NONE_CHAR ] - then + CHAR=$(scm_char) + if [ $CHAR = $SCM_NONE_CHAR ] + then return - else + else echo "[$(scm_char)$(scm_prompt_info)]" - fi + fi } pure_prompt() { diff --git a/themes/purity/purity.theme.sh b/themes/purity/purity.theme.bash similarity index 100% rename from themes/purity/purity.theme.sh rename to themes/purity/purity.theme.bash diff --git a/themes/rainbowbrite/rainbowbrite.theme.sh b/themes/rainbowbrite/rainbowbrite.theme.bash similarity index 100% rename from themes/rainbowbrite/rainbowbrite.theme.sh rename to themes/rainbowbrite/rainbowbrite.theme.bash diff --git a/themes/rana/rana.theme.sh b/themes/rana/rana.theme.bash similarity index 98% rename from themes/rana/rana.theme.sh rename to themes/rana/rana.theme.bash index 79fadfbc0..72bbf503f 100644 --- a/themes/rana/rana.theme.sh +++ b/themes/rana/rana.theme.bash @@ -117,7 +117,7 @@ ${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${D_DEFAULT_COLOR}" # checks if the plugin is installed before calling battery_charge safe_battery_charge() { - if [ -e "${OSH}/plugins/battery/battery.plugin.sh" ]; + if [ -e "${OSH}/plugins/battery/battery.plugin.bash" ]; then battery_charge fi diff --git a/themes/rjorgenson/rjorgenson.theme.sh b/themes/rjorgenson/rjorgenson.theme.bash similarity index 93% rename from themes/rjorgenson/rjorgenson.theme.sh rename to themes/rjorgenson/rjorgenson.theme.bash index e866f0ea4..e3667fee9 100644 --- a/themes/rjorgenson/rjorgenson.theme.sh +++ b/themes/rjorgenson/rjorgenson.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # port of zork theme # set colors for use throughout the prompt @@ -49,8 +50,8 @@ function is_integer() { # helper function for todo-txt-count } todo_txt_count() { - if `hash todo.sh 2>&-`; then # is todo.sh installed - count=`todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }'` + if "$(hash todo.bash 2>&-)"; then # is todo.bash installed + count="$(todo.bash ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }')" if is_integer $count; then # did we get a sane answer back echo "${BRACKET_COLOR}[${STRING_COLOR}T:$count${BRACKET_COLOR}]$normal" fi diff --git a/themes/roderik/roderik.theme.sh b/themes/roderik/roderik.theme.bash similarity index 100% rename from themes/roderik/roderik.theme.sh rename to themes/roderik/roderik.theme.bash diff --git a/themes/sexy/sexy.theme.sh b/themes/sexy/sexy.theme.bash similarity index 98% rename from themes/sexy/sexy.theme.sh rename to themes/sexy/sexy.theme.bash index 60e00ec70..a1e78d70c 100644 --- a/themes/sexy/sexy.theme.sh +++ b/themes/sexy/sexy.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt" # Screenshot: http://cloud.gf3.ca/M5rG # A big thanks to \amethyst on Freenode diff --git a/themes/simple/simple.theme.sh b/themes/simple/simple.theme.bash similarity index 100% rename from themes/simple/simple.theme.sh rename to themes/simple/simple.theme.bash diff --git a/themes/sirup/sirup.theme.sh b/themes/sirup/sirup.theme.bash similarity index 96% rename from themes/sirup/sirup.theme.sh rename to themes/sirup/sirup.theme.bash index 38fcab415..d95bc731b 100644 --- a/themes/sirup/sirup.theme.sh +++ b/themes/sirup/sirup.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # For unstaged(*) and staged(+) values next to branch name in __git_ps1 GIT_PS1_SHOWDIRTYSTATE="enabled" @@ -13,7 +14,7 @@ function rvm_version_prompt { [ "$full" != "" ] && echo "$full" } - + function prompt_command() { # Check http://github.com/Sirupsen/dotfiles for screenshot PS1="$blue\W/$bold_blue$(rvm_version_prompt)$bold_green$(__git_ps1 " (%s)") ${normal}$ " diff --git a/themes/slick/slick.theme.sh b/themes/slick/slick.theme.bash similarity index 98% rename from themes/slick/slick.theme.sh rename to themes/slick/slick.theme.bash index aafdc25d1..45acded2f 100644 --- a/themes/slick/slick.theme.sh +++ b/themes/slick/slick.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" diff --git a/themes/standard/standard.theme.sh b/themes/standard/standard.theme.bash similarity index 96% rename from themes/standard/standard.theme.sh rename to themes/standard/standard.theme.bash index 561a97cbe..9e428aa29 100644 --- a/themes/standard/standard.theme.sh +++ b/themes/standard/standard.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # scm themeing SCM_THEME_PROMPT_DIRTY="×" SCM_THEME_PROMPT_CLEAN="✓" diff --git a/themes/tonka/tonka.theme.sh b/themes/tonka/tonka.theme.bash similarity index 100% rename from themes/tonka/tonka.theme.sh rename to themes/tonka/tonka.theme.bash diff --git a/themes/tonotdo/tonotdo.theme.sh b/themes/tonotdo/tonotdo.theme.bash similarity index 100% rename from themes/tonotdo/tonotdo.theme.sh rename to themes/tonotdo/tonotdo.theme.bash diff --git a/themes/tylenol/tylenol.theme.sh b/themes/tylenol/tylenol.theme.bash similarity index 100% rename from themes/tylenol/tylenol.theme.sh rename to themes/tylenol/tylenol.theme.bash diff --git a/themes/wanelo/wanelo.theme.sh b/themes/wanelo/wanelo.theme.bash similarity index 100% rename from themes/wanelo/wanelo.theme.sh rename to themes/wanelo/wanelo.theme.bash diff --git a/themes/zitron/zitron.theme.sh b/themes/zitron/zitron.theme.bash similarity index 100% rename from themes/zitron/zitron.theme.sh rename to themes/zitron/zitron.theme.bash diff --git a/themes/zork/zork.theme.sh b/themes/zork/zork.theme.bash similarity index 98% rename from themes/zork/zork.theme.sh rename to themes/zork/zork.theme.bash index 75bc17d6c..adf5980dd 100644 --- a/themes/zork/zork.theme.sh +++ b/themes/zork/zork.theme.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash SCM_THEME_PROMPT_PREFIX="" SCM_THEME_PROMPT_SUFFIX="" @@ -49,7 +50,7 @@ modern_scm_prompt() { # show chroot if exist chroot(){ if [ -n "$debian_chroot" ] - then + then my_ps_chroot="${bold_cyan}$debian_chroot${normal}"; echo "($my_ps_chroot)"; fi @@ -58,7 +59,7 @@ chroot(){ # show virtualenvwrapper my_ve(){ if [ -n "$VIRTUAL_ENV" ] - then + then my_ps_ve="${bold_purple}$ve${normal}"; echo "($my_ps_ve)"; fi @@ -70,7 +71,7 @@ prompt() { my_ps_host="${green}\h${normal}"; # yes, these are the the same for now ... my_ps_host_root="${green}\h${normal}"; - + my_ps_user="${bold_green}\u${normal}" my_ps_root="${bold_red}\u${normal}"; diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.bash similarity index 96% rename from tools/check_for_upgrade.sh rename to tools/check_for_upgrade.bash index 31a0033f5..16546a824 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.bash @@ -11,7 +11,7 @@ function _update_osh_update() { } function _upgrade_osh() { - env BASH=$OSH sh $OSH/tools/upgrade.sh + env BASH=$OSH sh $OSH/tools/upgrade.bash # update the osh file _update_osh_update } diff --git a/tools/git-prompt.sh b/tools/git-prompt.bash similarity index 98% rename from tools/git-prompt.sh rename to tools/git-prompt.bash index c6cbef38c..881ee7b28 100644 --- a/tools/git-prompt.sh +++ b/tools/git-prompt.bash @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # bash/zsh git prompt support # # Copyright (C) 2006,2007 Shawn O. Pearce @@ -7,9 +8,9 @@ # # To enable: # -# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh). +# 1) Copy this file to somewhere (e.g. ~/.git-prompt.bash). # 2) Add the following line to your .bashrc/.zshrc: -# source ~/.git-prompt.sh +# source ~/.git-prompt.bash # 3a) Change your PS1 to call __git_ps1 as # command-substitution: # Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ ' @@ -38,7 +39,7 @@ # In addition, if you set GIT_PS1_SHOWDIRTYSTATE to a nonempty value, # unstaged (*) and staged (+) changes will be shown next to the branch # name. You can configure this per-repository with the -# bash.showDirtyState variable, which defaults to true once +# bash.bashowDirtyState variable, which defaults to true once # GIT_PS1_SHOWDIRTYSTATE is enabled. # # You can also see if currently something is stashed, by setting @@ -48,7 +49,7 @@ # If you would like to see if there're untracked files, then you can set # GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're untracked # files, then a '%' will be shown next to the branch name. You can -# configure this per-repository with the bash.showUntrackedFiles +# configure this per-repository with the bash.bashowUntrackedFiles # variable, which defaults to true once GIT_PS1_SHOWUNTRACKEDFILES is # enabled. # @@ -73,7 +74,7 @@ # By default, __git_ps1 will compare HEAD to your SVN upstream if it can # find one, or @{upstream} otherwise. Once you have set # GIT_PS1_SHOWUPSTREAM, you can override it on a per-repository basis by -# setting the bash.showUpstream config variable. +# setting the bash.bashowUpstream config variable. # # If you would like to see more information about the identity of # commits checked out as a detached HEAD, set GIT_PS1_DESCRIBE_STYLE diff --git a/tools/install.sh b/tools/install.bash similarity index 100% rename from tools/install.sh rename to tools/install.bash diff --git a/tools/uninstall.sh b/tools/uninstall.bash similarity index 100% rename from tools/uninstall.sh rename to tools/uninstall.bash diff --git a/tools/upgrade.sh b/tools/upgrade.bash similarity index 100% rename from tools/upgrade.sh rename to tools/upgrade.bash