From 22d711a746804473f1fe40b2cb4f0ee8bfe4b864 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Sat, 25 Apr 2015 21:11:28 +0200 Subject: Added checks to bashrc --- bash/.bashrc | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/bash/.bashrc b/bash/.bashrc index d6c2996..21ffeed 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -5,8 +5,10 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return +export PS1='[\d][\t]\u on \h\n\w => ' +export TERM="xterm-256color" + alias ls='ls --color=auto' -alias jblive='mpv rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream 2> /dev/null &' man() { env LESS_TERMCAP_mb=$'\E[01;31m' \ @@ -19,6 +21,10 @@ man() { man "$@" } +exists() { + hash $@ 2> /dev/null +} + vim() { if [[ -z $@ ]]; then /usr/bin/vim @@ -30,14 +36,34 @@ vim() { fi } -export PS1='[\d][\t]\u on \h\n\w => ' -export GOPATH="$HOME/programming/go" -export GEM_HOME="$(ruby -e 'print Gem.user_dir')/bin" -export PATH="$PATH:$GEM_HOME:$GOPATH/bin" -export EDITOR="vim" -export TERM="xterm-256color" +if exists mpv; then + alias jblive='mpv rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' +elif exists vlc; then + alias jblive='vlc rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' +fi + +if exists vim; then + export EDITOR="vim" +fi + +if exists go; then + export GOPATH="$HOME/programming/go" + export PATH="$PATH:$GOPATH/bin" +fi + +if exists gem; then + export GEM_HOME="$(ruby -e 'print Gem.user_dir')/bin" + export PATH="$PATH:$GEM_HOME" +fi + +if exists liquidprompt; then + source liquidprompt +fi -source liquidprompt -archey3 +if exists archey3; then + archey3 +elif exists screenfetch; then + screenfetch +fi # vim: set ts=8 sw=8 tw=0 noet : -- cgit v1.2.3