📜 "ZSH and Terminal"

July 4, 2017  

My Terminal Environment

I use a lightly modified version of oh-my-zsh

Different ZSH Configs per OS

I use a different configuration on all my Linux computers than on my Macbook. This are the packages I use for Arch/Debian and for MacOS. Also note how I change my config across operating systems.

case `uname` in
    # MacOS Config
		plugins=(zsh-autosuggestions git osx colored-man
        		colorize brew pip python command-not-found)
    # Linux Config
		plugins=(git zsh-autosuggestions colored-man autojump)

Automatically print ls on cd

I like to automatically print the directory listing when I change directories. This should be fixed at some stage so that after resources .zshrc it doesn’t print it twice.

auto-ls () {
	emulate -L zsh;
	# explicit sexy ls'ing as aliases arent honored in here.
	hash gls >/dev/null 2>&1 && CLICOLOR_FORCE=1 gls -aFh --color --group-directories-first || ls
chpwd_functions=( auto-ls $chpwd_functions )

Retrieving Local and Public IP

alias whatsmyip="wget -qO- http://ipecho.net/plain ; echo"
alias localip="ip a | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v ''"

Python Webserver Oneliner

alias pyhttp='python3 -m http.server 7420 || python -m SimpleHTTPServer 7420 || echo "Python not installed"'

Terminal Australian Radio

alias radioabcnews="mplayer -playlist http://www.abc.net.au/res/streaming/audio/mp3/news_radio.pls" #
alias radiobbcnews="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" #
alias radiorn="mplayer -playlist http://www.abc.net.au/res/streaming/audio/mp3/radio_national.pls" #
alias radiojjj="mplayer -playlist  http://www.abc.net.au/res/streaming/audio/mp3/triplej.pls" #
alias radiobbcnews="mplayer -playlist http://minnesota.publicradio.org/tools/play/streams/news.pls" #
alias radiosleepbot="mplayer -playlist http://sleepbot.com/ambience/cgi/listen.cgi/listen.pls" # Sleepbot Environmental Broadcast 56K MP3