From 92b8d6d9cfade500e4d514163b5c18a1df71113d Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Wed, 24 Nov 2010 16:22:05 +0100 Subject: [PATCH 1/6] added n0qorg theme --- themes/n0qorg/n0qorg.theme.bash | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 themes/n0qorg/n0qorg.theme.bash diff --git a/themes/n0qorg/n0qorg.theme.bash b/themes/n0qorg/n0qorg.theme.bash new file mode 100644 index 00000000..fcaca43f --- /dev/null +++ b/themes/n0qorg/n0qorg.theme.bash @@ -0,0 +1,22 @@ +#!/bin/bash +# n0qorg theme by Florian Baumann + +## look-a-like +# host directory (branch*)» +# for example: +# ananas ~/Code/bash-it/themes (master*)» +PROMPT="${bold_blue}\[\$(hostname)\]${normal} \w${normal} ${bold_white}\[\$(git_prompt_info)\]${normal}» " + +## git-theme +# feel free to change git chars. +GIT_THEME_PROMPT_DIRTY="${bold_blue}*${bold_white}" +GIT_THEME_PROMPT_CLEAN="" +GIT_THEME_PROMPT_PREFIX="${bold_blue}(${bold_white}" +GIT_THEME_PROMPT_SUFFIX="${bold_blue})" + +## alternate chars +# +SCM_THEME_PROMPT_DIRTY="*" +SCM_THEME_PROMPT_CLEAN="" +SCM_THEME_PROMPT_PREFIX="(" +SCM_THEME_PROMPT_SUFFIX=")" From 6cf9a4b03c5ddfa9bb74508242cd9610836c7f09 Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sat, 27 Nov 2010 21:00:50 -0600 Subject: [PATCH 2/6] Added link to oh-my-zsh in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 742daf1e..8b8994ef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Bash it -'Bash it' is a mash up of my own bash commands and scripts, other bash stuff I have found and a shameless ripoff of oh-my-zsh. :) +'Bash it' is a mash up of my own bash commands and scripts, other bash stuff I have found and a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh). :) Includes some autocompletion tools, theming support, aliases, custom functions, a few stolen pieces from Steve Losh, and more. From 835bcabf04f405dc97b7082f7d49d7f5cc87e5cd Mon Sep 17 00:00:00 2001 From: Mark Szymanski Date: Sun, 28 Nov 2010 12:37:31 -0600 Subject: [PATCH 3/6] Added Link post type. --- plugins/jekyll.plugins.bash | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/plugins/jekyll.plugins.bash b/plugins/jekyll.plugins.bash index 9b0d5c1e..3ad9d0da 100644 --- a/plugins/jekyll.plugins.bash +++ b/plugins/jekyll.plugins.bash @@ -12,7 +12,7 @@ newpost() { # If the user is using markdown formatting, let them choose what type of post they want. Sort of like Tumblr. - OPTIONS="Text Quote Image Audio Video" + OPTIONS="Text Quote Image Audio Video Link" if [ $JEKYLL_FORMATTING = "markdown" -o $JEKYLL_FORMATTING = "textile" ] then @@ -47,6 +47,12 @@ newpost() { POST_TYPE="Video" break fi + + if [[ $OPTION = "Link" ]] + then + POST_TYPE="Link" + break + fi done fi @@ -122,6 +128,15 @@ newpost() { then echo "" >> $FNAME fi + + if [[ $POST_TYPE = "Link" ]] + then + echo "[link][1]" >> $FNAME + echo >> $FNAME + echo "> Quote" >> $FNAME + echo >> $FNAME + echo "[1]: url" >> $FNAME + fi fi if [[ $JEKYLL_FORMATTING = "textile" ]] @@ -152,6 +167,13 @@ newpost() { then echo "" >> $FNAME fi + + if [[ $POST_TYPE = "Link" ]] + then + echo "\"Site\":url" >> $FNAME + echo >> $FNAME + echo "bq. Quote" >> $FNAME + fi fi # Open the file in your favorite editor From aa228fb0c37da5525482194f322541ddafd6a2df Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Tue, 30 Nov 2010 16:33:10 +0100 Subject: [PATCH 4/6] added handmade commandline history tool --- plugins/hcht.plugin.bash | 121 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 plugins/hcht.plugin.bash diff --git a/plugins/hcht.plugin.bash b/plugins/hcht.plugin.bash new file mode 100644 index 00000000..c83f6b43 --- /dev/null +++ b/plugins/hcht.plugin.bash @@ -0,0 +1,121 @@ +#!/bin/bash +# hch.plugin.bash: the handmade commandline history tool +# Copyright: (C) 2010 Florian Baumann +# License: GPL-3 +# Date: Dienstag 2010-11-30 + +### readme +# basiclly the handmade commandline history tool was made for storing +# informations. yeah, you're right. sounds a bit boring. many other +# applications can do this much better. but storing things from commandline? +# +# hcht was fitted to work at your terminal. +# your daily stuff like notices, todos, commands or output from a +# all these things will be stored without complex syntax. +# +# once you defined your storing-directory you will be able to easily +# save all the stuff listed above. +# + +### create a file +# the basic feature. open a file, do stuff and save. +# *.hch trailor is required. +# +# $ hcht evilcommand.hch +# +# this will create a new file or edit a existing one. +# paste your command or notice in your favorite editor + +### show all stored informations +# to get an overview of your storedir: +# +# $ hcht + +### todo with a whole sentence +# you can give hcht a bunch of parameters +# +# $ hcht this is a long reminder about a anything + +### save last executed command +# lets say you did a great hack at your system and you +# want to save it without complicated use of coping: +# +# $ hcht !! +# +# the "!!" will repeat the _last_ command you executed at +# your terminal. after asking you about a name the hch file +# will be saved. + +### read from stdin +# hcht is also able to read anything from stdin. +# +# $ cat any_important_logfile | hcht anylog +# +# "anylog" will be the name of the saved file. + +### configure store dir +# like /home/user/.hcht/ or something +hchtstoredir="" + +hcht() { + # configured? + if [ -z $hchtstoredir ]; then + echo "ERROR: handmade commandline history tool isn't configured." + return 1 + else + hchtstoredir=$(echo $hchtstoredir | sed -e 's/\/$//') + fi + + # dir available? + if [ ! -d $hchtstoredir ]; then + echo "ERROR: No such directory: $hchtstoredir" + return 1 + fi + + # get favorite editor + if [ -z $EDITOR ]; then + EDITOR=$(which vim || which nano) + fi + + # check if stdin-data is present and save content + if [ "$(tty)" = "not a tty" ]; then + hchname=$(echo $1 | sed -e 's/\ //g') + if [ -z $hchname ]; then + cat < /dev/stdin >> $hchtstoredir/$(date +%Y%m%d%H%M%S).hch + else + cat < /dev/stdin >> $hchtstoredir/$hchname.hch + fi + return 0 + fi + + # list all hch files if no parameter is given + if [ $# -eq 0 ]; then + for file in $(ls $hchtstoredir); do + echo $file + done + return 0 + fi + + # if a *.hch file is given start editing or creating it + if [ "$#" -eq "1" ]; then + if echo "$1" | grep -q -e ".*.hch$" ; then + $EDITOR ${hchtstoredir}/${1} + return 0 + else + $EDITOR ${hchtstoredir}/${1}.hch + return 0 + fi + fi + + # autocreate a new hch + if [ "$#" -gt "1" ]; then + echo -n "define a name: " ; read hchname + hchname=$(echo $hchname | sed -e 's/\ /_/g') + if [ -z "$hchname" ]; then + echo "$*" > $hchtstoredir/${1}-$(date +%Y%m%d%H%M%S).hch + else + echo "$*" > ${hchtstoredir}/${hchname}.hch + fi + return 0 + fi +} From d25288fdd3a6dbf2553a703321b40c80f25c9b68 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Tue, 30 Nov 2010 16:41:41 +0100 Subject: [PATCH 5/6] fixed readme --- plugins/hcht.plugin.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/hcht.plugin.bash b/plugins/hcht.plugin.bash index c83f6b43..d9f99d5f 100644 --- a/plugins/hcht.plugin.bash +++ b/plugins/hcht.plugin.bash @@ -10,7 +10,7 @@ # applications can do this much better. but storing things from commandline? # # hcht was fitted to work at your terminal. -# your daily stuff like notices, todos, commands or output from a +# your daily stuff like notices, todos, commands or output from a command. # all these things will be stored without complex syntax. # # once you defined your storing-directory you will be able to easily @@ -19,7 +19,6 @@ ### create a file # the basic feature. open a file, do stuff and save. -# *.hch trailor is required. # # $ hcht evilcommand.hch # From c00bde6bbdf3762d6d1574b0dfc87ad165d856bd Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Wed, 1 Dec 2010 06:45:42 +0100 Subject: [PATCH 6/6] moved config of hcht to bash_profile template --- plugins/hcht.plugin.bash | 6 +----- template/bash_profile.template.bash | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/hcht.plugin.bash b/plugins/hcht.plugin.bash index d9f99d5f..cdab44fb 100644 --- a/plugins/hcht.plugin.bash +++ b/plugins/hcht.plugin.bash @@ -1,5 +1,5 @@ #!/bin/bash -# hch.plugin.bash: the handmade commandline history tool +# hcht.plugin.bash: the handmade commandline history tool # Copyright: (C) 2010 Florian Baumann # License: GPL-3 # Date: Dienstag 2010-11-30 @@ -52,10 +52,6 @@ # # "anylog" will be the name of the saved file. -### configure store dir -# like /home/user/.hcht/ or something -hchtstoredir="" - hcht() { # configured? if [ -z $hchtstoredir ]; then diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index a98e65c8..17853b1a 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -47,5 +47,8 @@ export IRC_CLIENT='irssi' export TODO="t" +# Set store directory for handmade commandline history tool +export hchtstoredir="$HOME/.hcht" + # Load Bash It source $BASH/bash_it.sh