Saturday, February 27, 2016

Slight resurrection

Okay, I'll admit it.  I've mostly forgotten about this blog.  I got going with good steam and like so many other things I've started and never finished, I lost interest.  I'm going to start working on a series of entries including source in repositories.  Right now I'm hosting at Github, but with the latest rounds of weird going on there, I'm looking for another host.

Since the latest postings, we are still cord-free.  We've switched up from attached boxes to TV's with Smart apps installed, phones and personal media devices.  The kids favor Youtube, while my wife and I tend to watch more Netflix.  I've completely dropped Hulu after realizing there wasn't much on there I actually wanted to watch that was not available on Netflix already (and without advertisements).  My wife is now an IT geek as well, having spent the last decade trying to ignore her geekish tendencies, has joined the dark side and is a technology coordinator in a local school system.

Now on to something completely different.

I love my .rc files.  I get irritated when I leave a job and lose that .rc file that I spent the last couple years tweaking out to fulfill my needs.  After the last batch of that, I went ahead and started a github repository where I keep my local rc files.  As I make tweaks, I push them back upstream and they're always up to date.  Recently, we added a Mac to the arsenal at the house and after upgrading bash to a more modern version, I grabbed my rcfiles to only discover they weren't working as I anticipated.

Add a couple lines and everything's working again.

#MacOS is different - set some variables.
if [ "$(uname)" == "Darwin" ]; then
    export CLICOLOR=1
    alias ls='ls -GFh'
fi

Saved, committed and pushed upstream.  Now any new Mac I encounter, ready to roll.

Full .bashrc below.

# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

#MacOS is different - set some variables.
if [ "$(uname)" == "Darwin" ]; then
    export CLICOLOR=1
    alias ls='ls -GFh'
fi

# User specific aliases and functions
LS_COLORS='di=01;35:fi=00:ln=01;36'
# Prompt Stuff below
NO_COLOR="\[\033[0m\]"
CYAN="\[\033[0;36m\]"
GREEN="\[\033[0;32m\]"
RED="\[\033[0;31m\]"
ORANGE="\[\033[1;31m\]"
YELLOW="\[\033[1;33m\]"
GREY="\[\033[0;37m\]"

if [[ $EUID == "0" ]];
then
    USER_COLOR=$RED
else
    USER_COLOR=$GREY
fi

PS1="$GREEN[$USER_COLOR\u$CYAN@$YELLOW\h$GREEN] $ORANGE:$CYAN\w$GREY\$ $NO_COLOR"

# Use vim whenever possible, if not, then use vi
if [ `which vim` ] ; then
    export EDITOR=vim
else
    export EDITOR=vi
fi

No comments:

Post a Comment

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.