[
  {
    "path": ".gitignore",
    "content": "# certain dirs #\n################\n.dotfiles\n\n# Backup files#\n###############\n*~\n*.#*\n*#\n.bak/\n\n# Compiled source #\n###################\n*.com\n*.class\n*.dll\n*.exe\n*.o\n*.so\n*.elc\n\n# Packages #\n############\n# it's better to unpack these files and commit the raw source\n# git has its own built in compression methods\n*.7z\n*.dmg\n*.gz\n*.iso\n*.jar\n*.rar\n*.tar\n*.zip\n\n# Logs and databases #\n######################\n*.log\n*.sql\n*.sqlite\n\n# OS generated files #\n######################\n.DS_Store\n.DS_Store?\n._*\n.Spotlight-V100\n.Trashes\nehthumbs.db\nThumbs.db\n.emacs.desktop\n\n#########\n# MacOS #\n#########\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Thumbnails\n._*\n\n# Files that might appear on external disk\n.Spotlight-V100\n.Trashes\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\n############\n# Security #\n############\nid_rsa\n\n###########\n# Tooling #\n###########\n.vagrant/\n\n#######\n# VIM #\n#######\n[._]*.s[a-w][a-z]\n[._]s[a-w][a-z]\n*.un~\nSession.vim\n.netrwhist\n*~\n\n#########\n# Maven #\n#########\ntarget/\npom.xml.tag\npom.xml.releaseBackup\npom.xml.versionsBackup\npom.xml.next\nrelease.properties\n\n\n########\n# Node #\n########\n# Logs\n*.log\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directory\n# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-\nnode_modules\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2012-2021 Erik Selberg and contributors (https://github.com/speedenator/agnoster-bash/contributors)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# agnoster-bash\nAgnoster Theme for Bash\n\nagnoster's Theme - https://gist.github.com/3712874\nA Powerline-inspired theme for BASH\n\n(Converted from ZSH theme by Kenny Root)\nhttps://gist.github.com/kruton/8345450\n\nUpdated & fixed by Hanish K H on oct-05-2017\n\n# UPDATE\nFixed the virtualenv prompt in bash\n\n# README\n\nIn order for this theme to render correctly, you will need a\n[Powerline-patched font](https://gist.github.com/1595572).\nI recommend: https://github.com/powerline/fonts.git\n```\ngit clone https://github.com/powerline/fonts.git fonts\ncd fonts\nsh install.sh\n```\n\nIn addition, I recommend the\n[Solarized theme](https://github.com/altercation/solarized/) and, if you're\nusing it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app -\nit has significantly better color fidelity.\n\nInstall:\n\nI recommend the following:\n```\ncd $HOME\nmkdir -p .bash/themes/agnoster-bash\ngit clone https://github.com/speedenator/agnoster-bash.git .bash/themes/agnoster-bash\n```\n\nthen add the following to your .bashrc:\n\n```\nexport THEME=$HOME/.bash/themes/agnoster-bash/agnoster.bash\nif [[ -f $THEME ]]; then\n    export DEFAULT_USER=`whoami`\n    source $THEME\nfi\n```\n\n# Goals\n\nThe aim of this theme is to only show you *relevant* information. Like most\nprompts, it will only show git information when in a git working directory.\nHowever, it goes a step further: everything from the current user and\nhostname to whether the last call exited with an error to whether background\njobs are running in this shell will all be displayed automatically when\nappropriate.\n\nGenerally speaking, this script has limited support for right\nprompts (ala powerlevel9k on zsh), but it's pretty problematic in Bash.\nThe general pattern is to write out the right prompt, hit \\r, then\nwrite the left. This is problematic for the following reasons:\n- Doesn't properly resize dynamically when you resize the terminal\n- Changes to the prompt (like clearing and re-typing, super common) deletes the prompt\n- Getting the right alignment via columns / tput cols is pretty problematic (and is a bug in this version)\n- Bash prompt escapes (like \\h or \\w) don't get interpolated\n\nall in all, if you really, really want right-side prompts without a\nton of work, recommend going to zsh for now. If you know how to fix this,\nwould appreciate it!\n\n![ScreenShot](agnoster-bash-sshot.png)\n"
  },
  {
    "path": "agnoster.bash",
    "content": "#!/usr/bin/env bash\n# vim: ft=bash ts=2 sw=2 sts=2\n#\n# agnoster's Theme - https://gist.github.com/3712874\n# A Powerline-inspired theme for BASH\n#\n# (Converted from ZSH theme by Kenny Root)\n# https://gist.github.com/kruton/8345450\n#\n# Updated & fixed by Erik Selberg erik@selberg.org 1/14/17\n# Tested on MacOSX, Ubuntu, Amazon Linux\n# Bash v3 and v4\n#\n# # README\n#\n# In order for this theme to render correctly, you will need a\n# [Powerline-patched font](https://gist.github.com/1595572).\n# I recommend: https://github.com/powerline/fonts.git\n# > git clone https://github.com/powerline/fonts.git fonts\n# > cd fonts\n# > install.sh\n\n# In addition, I recommend the\n# [Solarized theme](https://github.com/altercation/solarized/) and, if you're\n# using it on Mac OS X, [iTerm 2](http://www.iterm2.com/) over Terminal.app -\n# it has significantly better color fidelity.\n\n# Install:\n\n# I recommend the following:\n# $ cd home\n# $ mkdir -p .bash/themes/agnoster-bash\n# $ git clone https://github.com/speedenator/agnoster-bash.git .bash/themes/agnoster-bash\n\n# then add the following to your .bashrc:\n\n# export THEME=$HOME/.bash/themes/agnoster-bash/agnoster.bash\n# if [[ -f $THEME ]]; then\n#     export DEFAULT_USER=`whoami`\n#     source $THEME\n# fi\n\n#\n# # Goals\n#\n# The aim of this theme is to only show you *relevant* information. Like most\n# prompts, it will only show git information when in a git working directory.\n# However, it goes a step further: everything from the current user and\n# hostname to whether the last call exited with an error to whether background\n# jobs are running in this shell will all be displayed automatically when\n# appropriate.\n\n# Generally speaking, this script has limited support for right\n# prompts (ala powerlevel9k on zsh), but it's pretty problematic in Bash.\n# The general pattern is to write out the right prompt, hit \\r, then\n# write the left. This is problematic for the following reasons:\n# - Doesn't properly resize dynamically when you resize the terminal\n# - Changes to the prompt (like clearing and re-typing, super common) deletes the prompt\n# - Getting the right alignment via columns / tput cols is pretty problematic (and is a bug in this version)\n# - Bash prompt escapes (like \\h or \\w) don't get interpolated\n#\n# all in all, if you really, really want right-side prompts without a\n# ton of work, recommend going to zsh for now. If you know how to fix this,\n# would appreciate it!\n\n# note: requires bash v4+... Mac users - you often have bash3.\n# 'brew install bash' will set you free\nPROMPT_DIRTRIM=2 # bash4 and above\n\n######################################################################\nDEBUG=0\ndebug() {\n    if [[ ${DEBUG} -ne 0 ]]; then\n        >&2 echo -e $*\n    fi\n}\n\n######################################################################\n### Segment drawing\n# A few utility functions to make it easy and re-usable to draw segmented prompts\n\nCURRENT_BG='NONE'\nCURRENT_RBG='NONE'\nSEGMENT_SEPARATOR=''\nRIGHT_SEPARATOR=''\nLEFT_SUBSEG=''\nRIGHT_SUBSEG=''\n\ntext_effect() {\n    case \"$1\" in\n        reset)      echo 0;;\n        bold)       echo 1;;\n        underline)  echo 4;;\n    esac\n}\n\n# to add colors, see\n# http://bitmote.com/index.php?post/2012/11/19/Using-ANSI-Color-Codes-to-Colorize-Your-Bash-Prompt-on-Linux\n# under the \"256 (8-bit) Colors\" section, and follow the example for orange below\nfg_color() {\n    case \"$1\" in\n        black)          echo 30;;\n        darkred)        echo 31;;\n        darkgreen)      echo 32;;\n        yellow)         echo 33;;\n        darkblue)       echo 34;;\n        darkmagenta)    echo 35;;\n        darkcyan)       echo 36;;\n        white)          echo 37;;\n        darkgray)       echo 90;;\n        red)            echo 91;;\n        green)          echo 92;;\n        orange)         echo 93;;\n        blue)           echo 94;;\n        magenta)        echo 95;;\n        cyan)           echo 96\\;5\\;166;;\n    esac\n}\n\nbg_color() {\n    case \"$1\" in\n        black)          echo 40;;\n        darkred)        echo 41;;\n        darkgreen)      echo 42;;\n        yellow)         echo 43;;\n        darkblue)       echo 44;;\n        darkmagenta)    echo 45;;\n        darkcyan)       echo 46;;\n        white)          echo 47;;\n        darkgray)       echo 100;;\n        red)            echo 101;;\n        green)          echo 102;;\n        orange)         echo 103;;\n        blue)           echo 104;;\n        magenta)        echo 105;;\n        cyan)           echo 106\\;5\\;166;;\n    esac;\n}\n\n# TIL: declare is global not local, so best use a different name\n# for codes (mycodes) as otherwise it'll clobber the original.\n# this changes from BASH v3 to BASH v4.\nansi() {\n    local seq\n    declare -a mycodes=(\"${!1}\")\n\n    debug \"ansi: ${!1} all: $* aka ${mycodes[@]}\"\n\n    seq=\"\"\n    for ((i = 0; i < ${#mycodes[@]}; i++)); do\n        if [[ -n $seq ]]; then\n            seq=\"${seq};\"\n        fi\n        seq=\"${seq}${mycodes[$i]}\"\n    done\n    debug \"ansi debug:\" '\\\\[\\\\033['${seq}'m\\\\]'\n    echo -ne '\\[\\033['${seq}'m\\]'\n    # PR=\"$PR\\[\\033[${seq}m\\]\"\n}\n\nansi_single() {\n    echo -ne '\\[\\033['$1'm\\]'\n}\n\n# Begin a segment\n# Takes two arguments, background and foreground. Both can be omitted,\n# rendering default background/foreground.\nprompt_segment() {\n    local bg fg\n    declare -a codes\n\n    debug \"Prompting $1 $2 $3\"\n\n    # if commented out from kruton's original... I'm not clear\n    # if it did anything, but it messed up things like\n    # prompt_status - Erik 1/14/17\n\n    #    if [[ -z $1 || ( -z $2 && $2 != default ) ]]; then\n    codes=(\"${codes[@]}\" $(text_effect reset))\n    #    fi\n    if [[ -n $1 ]]; then\n        bg=$(bg_color $1)\n        codes=(\"${codes[@]}\" $bg)\n        debug \"Added $bg as background to codes\"\n    fi\n    if [[ -n $2 ]]; then\n        fg=$(fg_color $2)\n        codes=(\"${codes[@]}\" $fg)\n        debug \"Added $fg as foreground to codes\"\n    fi\n\n    debug \"Codes: \"\n    # declare -p codes\n\n    if [[ $CURRENT_BG != NONE && $1 != $CURRENT_BG ]]; then\n        declare -a intermediate=($(fg_color $CURRENT_BG) $(bg_color $1))\n        debug \"pre prompt \" $(ansi intermediate[@])\n        PR=\"$PR $(ansi intermediate[@])$SEGMENT_SEPARATOR\"\n        debug \"post prompt \" $(ansi codes[@])\n        PR=\"$PR$(ansi codes[@]) \"\n    else\n        debug \"no current BG, codes is $codes[@]\"\n        PR=\"$PR$(ansi codes[@]) \"\n    fi\n    CURRENT_BG=$1\n    [[ -n $3 ]] && PR=\"$PR$3\"\n}\n\n# End the prompt, closing any open segments\nprompt_end() {\n    if [[ -n $CURRENT_BG ]]; then\n        declare -a codes=($(text_effect reset) $(fg_color $CURRENT_BG))\n        PR=\"$PR $(ansi codes[@])$SEGMENT_SEPARATOR\"\n    fi\n    declare -a reset=($(text_effect reset))\n    PR=\"$PR $(ansi reset[@])\"\n    CURRENT_BG=''\n}\n\n### virtualenv prompt\nprompt_virtualenv() {\n    if [[ -n $VIRTUAL_ENV ]]; then\n        color=darkcyan\n        prompt_segment $color $PRIMARY_FG\n        prompt_segment $color white \"$(basename $VIRTUAL_ENV)\"\n    fi\n}\n\n\n### Prompt components\n# Each component will draw itself, and hide itself if no information needs to be shown\n\n# Context: user@hostname (who am I and where am I)\nprompt_context() {\n    local user=`whoami`\n\n    if [[ $user != $DEFAULT_USER || -n $SSH_CLIENT ]]; then\n        prompt_segment black default \"$user@\\h\"\n    fi\n}\n\n# prints history followed by HH:MM, useful for remembering what\n# we did previously\nprompt_histdt() {\n    prompt_segment black default \"\\! [\\A]\"\n}\n\n\ngit_status_dirty() {\n    dirty=$(git status -s 2> /dev/null | tail -n 1)\n    [[ -n $dirty ]] && echo \" ●\"\n}\n\ngit_stash_dirty() {\n    stash=$(git stash list 2> /dev/null | tail -n 1)\n    [[ -n $stash ]] && echo \" ⚑\"\n}\n\n# Git: branch/detached head, dirty status\nprompt_git() {\n    local ref dirty\n    if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then\n        ZSH_THEME_GIT_PROMPT_DIRTY='±'\n        dirty=$(git_status_dirty)\n        stash=$(git_stash_dirty)\n        ref=$(git symbolic-ref HEAD 2> /dev/null) \\\n            || ref=\"➦ $(git describe --exact-match --tags HEAD 2> /dev/null)\" \\\n            || ref=\"➦ $(git show-ref --head -s --abbrev | head -n1 2> /dev/null)\"\n        if [[ -n $dirty ]]; then\n            prompt_segment yellow black\n        else\n            prompt_segment darkgreen black\n        fi\n        PR=\"$PR${ref/refs\\/heads\\// }$stash$dirty\"\n    fi\n}\n\n# Mercurial: clean, modified and uncomitted files\nprompt_hg() {\n    local rev st branch\n    if $(hg id >/dev/null 2>&1); then\n        if $(hg prompt >/dev/null 2>&1); then\n            if [[ $(hg prompt \"{status|unknown}\") = \"?\" ]]; then\n                # if files are not added\n                prompt_segment darkred white\n                st='±'\n            elif [[ -n $(hg prompt \"{status|modified}\") ]]; then\n                # if any modification\n                prompt_segment yellow black\n                st='±'\n            else\n                # if working copy is clean\n                prompt_segment darkgreen black $CURRENT_FG\n            fi\n            PR=\"$PR$(hg prompt \"☿ {rev}@{branch}\") $st\"\n        else\n            st=\"\"\n            rev=$(hg id -n 2>/dev/null | sed 's/[^-0-9]//g')\n            branch=$(hg id -b 2>/dev/null)\n            if `hg st | grep -q \"^\\?\"`; then\n                prompt_segment darkred white\n                st='±'\n            elif `hg st | grep -q \"^[MA]\"`; then\n                prompt_segment yellow black\n                st='±'\n            else\n                prompt_segment darkgreen black $CURRENT_FG\n            fi\n            PR=\"$PR☿ $rev@$branch $st\"\n        fi\n    fi\n}\n\n# Dir: current working directory\nprompt_dir() {\n    prompt_segment darkblue black '\\w'\n}\n\n# Status:\n# - was there an error\n# - am I root\n# - are there background jobs?\nprompt_status() {\n    local symbols\n    symbols=()\n    [[ $RETVAL -ne 0 ]] && symbols+=\"$(ansi_single $(fg_color darkred))✘\"\n    [[ $UID -eq 0 ]] && symbols+=\"$(ansi_single $(fg_color yellow))⚡\"\n    [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+=\"$(ansi_single $(fg_color darkcyan))⚙\"\n\n    [[ -n \"$symbols\" ]] && prompt_segment black default \"$symbols\"\n}\n\n######################################################################\n#\n# experimental right prompt stuff\n# requires setting prompt_foo to use PRIGHT vs PR\n# doesn't quite work per above\n\nrightprompt() {\n    printf \"%*s\" $COLUMNS \"$PRIGHT\"\n}\n\n# quick right prompt I grabbed to test things.\n__command_rprompt() {\n    local times= n=$COLUMNS tz\n    for tz in ZRH:Europe/Zurich PIT:US/Eastern \\\n              MTV:US/Pacific TOK:Asia/Tokyo; do\n        [ $n -gt 40 ] || break\n        times=\"$times ${tz%%:*}\\e[30;1m:\\e[0;36;1m\"\n        times=\"$times$(TZ=${tz#*:} date +%H:%M)\\e[0m\"\n        n=$(( $n - 10 ))\n    done\n    [ -z \"$times\" ] || printf \"%${n}s$times\\\\r\" ''\n}\n# PROMPT_COMMAND=__command_rprompt\n\n# this doens't wrap code in \\[ \\]\nansi_r() {\n    local seq\n    declare -a mycodes2=(\"${!1}\")\n\n    debug \"ansi: ${!1} all: $* aka ${mycodes2[@]}\"\n\n    seq=\"\"\n    for ((i = 0; i < ${#mycodes2[@]}; i++)); do\n        if [[ -n $seq ]]; then\n            seq=\"${seq};\"\n        fi\n        seq=\"${seq}${mycodes2[$i]}\"\n    done\n    debug \"ansi debug:\" '\\\\[\\\\033['${seq}'m\\\\]'\n    echo -ne '\\033['${seq}'m'\n    # PR=\"$PR\\[\\033[${seq}m\\]\"\n}\n\n# Begin a segment on the right\n# Takes two arguments, background and foreground. Both can be omitted,\n# rendering default background/foreground.\nprompt_right_segment() {\n    local bg fg\n    declare -a codes\n\n    debug \"Prompt right\"\n    debug \"Prompting $1 $2 $3\"\n\n    # if commented out from kruton's original... I'm not clear\n    # if it did anything, but it messed up things like\n    # prompt_status - Erik 1/14/17\n\n    #    if [[ -z $1 || ( -z $2 && $2 != default ) ]]; then\n    codes=(\"${codes[@]}\" $(text_effect reset))\n    #    fi\n    if [[ -n $1 ]]; then\n        bg=$(bg_color $1)\n        codes=(\"${codes[@]}\" $bg)\n        debug \"Added $bg as background to codes\"\n    fi\n    if [[ -n $2 ]]; then\n        fg=$(fg_color $2)\n        codes=(\"${codes[@]}\" $fg)\n        debug \"Added $fg as foreground to codes\"\n    fi\n\n    debug \"Right Codes: \"\n    # declare -p codes\n\n    # right always has a separator\n    # if [[ $CURRENT_RBG != NONE && $1 != $CURRENT_RBG ]]; then\n    #     $CURRENT_RBG=\n    # fi\n    declare -a intermediate2=($(fg_color $1) $(bg_color $CURRENT_RBG) )\n    # PRIGHT=\"$PRIGHT---\"\n    debug \"pre prompt \" $(ansi_r intermediate2[@])\n    PRIGHT=\"$PRIGHT$(ansi_r intermediate2[@])$RIGHT_SEPARATOR\"\n    debug \"post prompt \" $(ansi_r codes[@])\n    PRIGHT=\"$PRIGHT$(ansi_r codes[@]) \"\n    # else\n    #     debug \"no current BG, codes is $codes[@]\"\n    #     PRIGHT=\"$PRIGHT$(ansi codes[@]) \"\n    # fi\n    CURRENT_RBG=$1\n    [[ -n $3 ]] && PRIGHT=\"$PRIGHT$3\"\n}\n\n######################################################################\n## Emacs prompt --- for dir tracking\n# stick the following in your .emacs if you use this:\n\n# (setq dirtrack-list '(\".*DIR *\\\\([^ ]*\\\\) DIR\" 1 nil))\n# (defun dirtrack-filter-out-pwd-prompt (string)\n#   \"dirtrack-mode doesn't remove the PWD match from the prompt.  This does.\"\n#   ;; TODO: support dirtrack-mode's multiline regexp.\n#   (if (and (stringp string) (string-match (first dirtrack-list) string))\n#       (replace-match \"\" t t string 0)\n#     string))\n# (add-hook 'shell-mode-hook\n#           #'(lambda ()\n#               (dirtrack-mode 1)\n#               (add-hook 'comint-preoutput-filter-functions\n#                         'dirtrack-filter-out-pwd-prompt t t)))\n\nprompt_emacsdir() {\n    # no color or other setting... this will be deleted per above\n    PR=\"DIR \\w DIR$PR\"\n}\n\n######################################################################\n## Main prompt\n\nbuild_prompt() {\n    [[ ! -z ${AG_EMACS_DIR+x} ]] && prompt_emacsdir\n    prompt_status\n    #[[ -z ${AG_NO_HIST+x} ]] && prompt_histdt\n    [[ -z ${AG_NO_CONTEXT+x} ]] && prompt_context\n    prompt_virtualenv\n    prompt_dir\n    prompt_git\n    prompt_hg\n    prompt_end\n}\n\n# from orig...\n# export PS1='$(ansi_single $(text_effect reset)) $(build_prompt) '\n# this doesn't work... new model: create a prompt via a PR variable and\n# use that.\n\nset_bash_prompt() {\n    RETVAL=$?\n    PR=\"\"\n    PRIGHT=\"\"\n    CURRENT_BG=NONE\n    PR=\"$(ansi_single $(text_effect reset))\"\n    build_prompt\n\n    # uncomment below to use right prompt\n    #     PS1='\\[$(tput sc; printf \"%*s\" $COLUMNS \"$PRIGHT\"; tput rc)\\]'$PR\n    PS1=$PR\n}\n\nPROMPT_COMMAND=set_bash_prompt\n"
  }
]