From 9f4b3494700eeb2061dfd840e8d030f66088b173 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sat, 8 Mar 2014 19:58:06 +0100 Subject: structure --- .gitignore | 13 + .rtorrent.rc | 121 -- .zshrc | 3323 --------------------------------------------- .zshrc_orig | 37 - bin/dirhistory.sh | 2 + bin/play | 122 ++ bin/playf | 3 + bin/screenfetch | 3199 ++++++++++++++++++++++++++++++++++++++++++++ bin/updatekernel.sh | 50 + config | 14 - dirhistory.sh | 2 - input.conf | 2 - mpv/config | 14 + mpv/input.conf | 2 + play | 122 -- playf | 3 - rtorrent/.rtorrent.rc | 121 ++ screenfetch | 3199 -------------------------------------------- updatekernel.sh | 50 - vim/.vimrc | 15 + vim/plugin/autoclose.vim | 189 +++ zsh/.zsh_aliases | 17 + zsh/.zsh_dirstack | 20 + zsh/.zshrc | 3327 ++++++++++++++++++++++++++++++++++++++++++++++ zsh/.zshrc_orig | 37 + zsh_aliases | 17 - zsh_dirstack | 20 - 27 files changed, 7131 insertions(+), 6910 deletions(-) create mode 100644 .gitignore delete mode 100755 .rtorrent.rc delete mode 100644 .zshrc delete mode 100644 .zshrc_orig create mode 100644 bin/dirhistory.sh create mode 100755 bin/play create mode 100755 bin/playf create mode 100755 bin/screenfetch create mode 100755 bin/updatekernel.sh delete mode 100644 config delete mode 100644 dirhistory.sh delete mode 100644 input.conf create mode 100644 mpv/config create mode 100644 mpv/input.conf delete mode 100755 play delete mode 100755 playf create mode 100755 rtorrent/.rtorrent.rc delete mode 100755 screenfetch delete mode 100755 updatekernel.sh create mode 100644 vim/.vimrc create mode 100644 vim/plugin/autoclose.vim create mode 100644 zsh/.zsh_aliases create mode 100644 zsh/.zsh_dirstack create mode 100644 zsh/.zshrc create mode 100644 zsh/.zshrc_orig delete mode 100644 zsh_aliases delete mode 100644 zsh_dirstack diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d2ef92e --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +*.db +*.sqlite +*~ +*.save +*.bak +*.tmp +*.log +*-journal +.classpath +.settings/ +tmp/ +bin/ + diff --git a/.rtorrent.rc b/.rtorrent.rc deleted file mode 100755 index 772ad75..0000000 --- a/.rtorrent.rc +++ /dev/null @@ -1,121 +0,0 @@ -# This is an example resource file for rTorrent. Copy to -# ~/.rtorrent.rc and enable/modify the options as needed. Remember to -# uncomment the options you wish to enable. - -# Maximum and minimum number of peers to connect to per torrent. -#min_peers = 40 -max_peers = 100 - -# Same as above but for seeding completed torrents (-1 = same as downloading) -min_peers_seed = -1 -max_peers_seed = -1 - -# Maximum number of simultanious uploads per torrent. -max_uploads = 50 - -# Global upload and download rate in KiB. "0" for unlimited. -download_rate = 500 -upload_rate = 50 - -# Default directory to save the downloaded torrents. -#directory = /home/horus/Downloads - -# Default session directory. Make sure you don't run multiple instance -# of rtorrent using the same session directory. Perhaps using a -# relative path? -session = /home/horus/.session - -# Watch a directory for new torrents, and stop those that have been -# deleted. -#schedule = watch_directory,5,5,load_start=/media/watashino/Downloads/*.torrent,d.set_directory=/media/watashino/Animebytes/" -#schedule = untied_directory,5,5,stop_untied= -### watch another directory with a different destination -#schedule = watch_directory_2,5,5,"load_start=/media/watashino/Animebytes/*.torrent,d.set_directory=/media/watashino/Animebytes/" -#schedule = watch_directory_3,5,5,"load_start=/media/watashino/Summer\ Season/*torrent - -### send mail when torrent is completed -system.method.set_key = event.download.finished,notify_me,"execute=/home/horus/.scripte/rtorrent_mail.sh,$d.get_name=" - - -# Close torrents when diskspace is low. -schedule = low_diskspace,5,60,close_low_diskspace=100M - -# Stop torrents when reaching upload ratio in percent, -# when also reaching total upload in bytes, or when -# reaching final upload ratio in percent. -# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0 -#schedule = ratio,60,60,stop_on_ratio=200,200M,2000 - -# The ip address reported to the tracker. -#ip = 127.0.0.1 -#ip = rakshasa.no - -# The ip address the listening socket and outgoing connections is -# bound to. -#bind = 127.0.0.1 -#bind = rakshasa.no - -# Port range to use for listening. -port_range = 6890-6999 - -# Start opening ports at a random position within the port range. -#port_random = no - -# Check hash for finished torrents. Might be usefull until the bug is -# fixed that causes lack of diskspace not to be properly reported. -#check_hash = no - -# Set whetever the client should try to connect to UDP trackers. -#use_udp_trackers = yes - -# Alternative calls to bind and ip that should handle dynamic ip's. -#schedule = ip_tick,0,1800,ip=rakshasa -#schedule = bind_tick,0,1800,bind=rakshasa - -# Encryption options, set to none (default) or any combination of the following: -# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext -# -# The example value allows incoming encrypted connections, starts unencrypted -# outgoing connections but retries with encryption if they fail, preferring -# plaintext to RC4 encryption after the encrypted handshake -# - encryption = allow_incoming,enable_retry,prefer_plaintext - - dht = disable - -# -# Do not modify the following parameters unless you know what you're doing. -# - -# Hash read-ahead controls how many MB to request the kernel to read -# ahead. If the value is too low the disk may not be fully utilized, -# while if too high the kernel might not be able to keep the read -# pages in memory thus end up trashing. -#hash_read_ahead = 10 - -# Interval between attempts to check the hash, in milliseconds. -#hash_interval = 100 - -# Number of attempts to check the hash while using the mincore status, -# before forcing. Overworked systems might need lower values to get a -# decent hash checking rate. -#hash_max_tries = 10 - -# Max number of files to keep open simultaniously. -#max_open_files = 128 - -# Number of sockets to simultaneously keep open. -#max_open_sockets = - - -# Example of scheduling commands: Switch between two ip's every 5 -# seconds. -#schedule = "ip_tick1,5,10,ip=torretta" -#schedule = "ip_tick2,10,10,ip=lampedusa" - -# Remove a scheduled event. -#schedule_remove = "ip_tick1" - -scgi_port = 127.0.0.1:5000 - -log.execute = /tmp/rtorrent_exec.log diff --git a/.zshrc b/.zshrc deleted file mode 100644 index cdcb46e..0000000 --- a/.zshrc +++ /dev/null @@ -1,3323 +0,0 @@ -# Filename: /etc/zsh/zshrc -# Purpose: config file for zsh (z shell) -# Authors: grml-team (grml.org), (c) Michael Prokop -# Bug-Reports: see http://grml.org/bugs/ -# License: This file is licensed under the GPL v2. -################################################################################ -# This file is sourced only for interactive shells. It -# should contain commands to set up aliases, functions, -# options, key bindings, etc. -# -# Global Order: zshenv, zprofile, zshrc, zlogin -################################################################################ - -# USAGE -# If you are using this file as your ~/.zshrc file, please use ~/.zshrc.pre -# and ~/.zshrc.local for your own customisations. The former file is read -# before ~/.zshrc, the latter is read after it. Also, consider reading the -# refcard and the reference manual for this setup, both available from: -# - -# Contributing: -# If you want to help to improve grml's zsh setup, clone the grml-etc-core -# repository from git.grml.org: -# git clone git://git.grml.org/grml-etc-core.git -# -# Make your changes, commit them; use 'git format-patch' to create a series -# of patches and send those to the following address via 'git send-email': -# grml-etc-core@grml.org -# -# Doing so makes sure the right people get your patches for review and -# possibly inclusion. - -# zsh-refcard-tag documentation: -# You may notice strange looking comments in this file. -# These are there for a purpose. grml's zsh-refcard can now be -# automatically generated from the contents of the actual configuration -# file. However, we need a little extra information on which comments -# and what lines of code to take into account (and for what purpose). -# -# Here is what they mean: -# -# List of tags (comment types) used: -# #a# Next line contains an important alias, that should -# be included in the grml-zsh-refcard. -# (placement tag: @@INSERT-aliases@@) -# #f# Next line contains the beginning of an important function. -# (placement tag: @@INSERT-functions@@) -# #v# Next line contains an important variable. -# (placement tag: @@INSERT-variables@@) -# #k# Next line contains an important keybinding. -# (placement tag: @@INSERT-keybindings@@) -# #d# Hashed directories list generation: -# start denotes the start of a list of 'hash -d' -# definitions. -# end denotes its end. -# (placement tag: @@INSERT-hasheddirs@@) -# #A# Abbreviation expansion list generation: -# start denotes the beginning of abbreviations. -# end denotes their end. -# Lines within this section that end in '#d .*' provide -# extra documentation to be included in the refcard. -# (placement tag: @@INSERT-abbrev@@) -# #m# This tag allows you to manually generate refcard entries -# for code lines that are hard/impossible to parse. -# Example: -# #m# k ESC-h Call the run-help function -# That would add a refcard entry in the keybindings table -# for 'ESC-h' with the given comment. -# So the syntax is: #m#
-# #o# This tag lets you insert entries to the 'other' hash. -# Generally, this should not be used. It is there for -# things that cannot be done easily in another way. -# (placement tag: @@INSERT-other-foobar@@) -# -# All of these tags (except for m and o) take two arguments, the first -# within the tag, the other after the tag: -# -# #
# -# -# Where
is really just a number, which are defined by the -# @secmap array on top of 'genrefcard.pl'. The reason for numbers -# instead of names is, that for the reader, the tag should not differ -# much from a regular comment. For zsh, it is a regular comment indeed. -# The numbers have got the following meanings: -# 0 -> "default" -# 1 -> "system" -# 2 -> "user" -# 3 -> "debian" -# 4 -> "search" -# 5 -> "shortcuts" -# 6 -> "services" -# -# So, the following will add an entry to the 'functions' table in the -# 'system' section, with a (hopefully) descriptive comment: -# #f1# Edit an alias via zle -# edalias() { -# -# It will then show up in the @@INSERT-aliases-system@@ replacement tag -# that can be found in 'grml-zsh-refcard.tex.in'. -# If the section number is omitted, the 'default' section is assumed. -# Furthermore, in 'grml-zsh-refcard.tex.in' @@INSERT-aliases@@ is -# exactly the same as @@INSERT-aliases-default@@. If you want a list of -# *all* aliases, for example, use @@INSERT-aliases-all@@. - -# zsh profiling -# just execute 'ZSH_PROFILE_RC=1 zsh' and run 'zprof' to get the details -if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then - zmodload zsh/zprof -fi - -# load .zshrc.pre to give the user the chance to overwrite the defaults -[[ -r ${ZDOTDIR:-${HOME}}/.zshrc.pre ]] && source ${ZDOTDIR:-${HOME}}/.zshrc.pre - -# check for version/system -# check for versions (compatibility reasons) -is4(){ - [[ $ZSH_VERSION == <4->* ]] && return 0 - return 1 -} - -is41(){ - [[ $ZSH_VERSION == 4.<1->* || $ZSH_VERSION == <5->* ]] && return 0 - return 1 -} - -is42(){ - [[ $ZSH_VERSION == 4.<2->* || $ZSH_VERSION == <5->* ]] && return 0 - return 1 -} - -is425(){ - [[ $ZSH_VERSION == 4.2.<5->* || $ZSH_VERSION == 4.<3->* || $ZSH_VERSION == <5->* ]] && return 0 - return 1 -} - -is43(){ - [[ $ZSH_VERSION == 4.<3->* || $ZSH_VERSION == <5->* ]] && return 0 - return 1 -} - -is433(){ - [[ $ZSH_VERSION == 4.3.<3->* || $ZSH_VERSION == 4.<4->* \ - || $ZSH_VERSION == <5->* ]] && return 0 - return 1 -} - -is437(){ - [[ $ZSH_VERSION == 4.3.<7->* || $ZSH_VERSION == 4.<4->* \ - || $ZSH_VERSION == <5->* ]] && return 0 - return 1 -} - -is439(){ - [[ $ZSH_VERSION == 4.3.<9->* || $ZSH_VERSION == 4.<4->* \ - || $ZSH_VERSION == <5->* ]] && return 0 - return 1 -} - -#f1# Checks whether or not you're running grml -isgrml(){ - [[ -f /etc/grml_version ]] && return 0 - return 1 -} - -#f1# Checks whether or not you're running a grml cd -isgrmlcd(){ - [[ -f /etc/grml_cd ]] && return 0 - return 1 -} - -if isgrml ; then -#f1# Checks whether or not you're running grml-small - isgrmlsmall() { - if [[ ${${${(f)"$( autologin -# Thanks go to Bart Schaefer! -isgrml && checkhome() { - if [[ -z "$ALREADY_DID_CD_HOME" ]] ; then - export ALREADY_DID_CD_HOME=$HOME - cd - fi -} - -# check for zsh v3.1.7+ - -if ! [[ ${ZSH_VERSION} == 3.1.<7->* \ - || ${ZSH_VERSION} == 3.<2->.<->* \ - || ${ZSH_VERSION} == <4->.<->* ]] ; then - - printf '-!-\n' - printf '-!- In this configuration we try to make use of features, that only\n' - printf '-!- require version 3.1.7 of the shell; That way this setup can be\n' - printf '-!- used with a wide range of zsh versions, while using fairly\n' - printf '-!- advanced features in all supported versions.\n' - printf '-!-\n' - printf '-!- However, you are running zsh version %s.\n' "$ZSH_VERSION" - printf '-!-\n' - printf '-!- While this *may* work, it might as well fail.\n' - printf '-!- Please consider updating to at least version 3.1.7 of zsh.\n' - printf '-!-\n' - printf '-!- DO NOT EXPECT THIS TO WORK FLAWLESSLY!\n' - printf '-!- If it does today, you'\''ve been lucky.\n' - printf '-!-\n' - printf '-!- Ye been warned!\n' - printf '-!-\n' - - function zstyle() { : } -fi - -# autoload wrapper - use this one instead of autoload directly -# We need to define this function as early as this, because autoloading -# 'is-at-least()' needs it. -function zrcautoload() { - emulate -L zsh - setopt extended_glob - local fdir ffile - local -i ffound - - ffile=$1 - (( ffound = 0 )) - for fdir in ${fpath} ; do - [[ -e ${fdir}/${ffile} ]] && (( ffound = 1 )) - done - - (( ffound == 0 )) && return 1 - if [[ $ZSH_VERSION == 3.1.<6-> || $ZSH_VERSION == <4->* ]] ; then - autoload -U ${ffile} || return 1 - else - autoload ${ffile} || return 1 - fi - return 0 -} - -# Load is-at-least() for more precise version checks Note that this test will -# *always* fail, if the is-at-least function could not be marked for -# autoloading. -zrcautoload is-at-least || is-at-least() { return 1 } - -# set some important options (as early as possible) - -# append history list to the history file; this is the default but we make sure -# because it's required for share_history. -setopt append_history - -# import new commands from the history file also in other zsh-session -is4 && setopt share_history - -# save each command's beginning timestamp and the duration to the history file -setopt extended_history - -# If a new command line being added to the history list duplicates an older -# one, the older command is removed from the list -is4 && setopt histignorealldups - -# remove command lines from the history list when the first character on the -# line is a space -setopt histignorespace - -# if a command is issued that can't be executed as a normal command, and the -# command is the name of a directory, perform the cd command to that directory. -setopt auto_cd - -# in order to use #, ~ and ^ for filename generation grep word -# *~(*.gz|*.bz|*.bz2|*.zip|*.Z) -> searches for word not in compressed files -# don't forget to quote '^', '~' and '#'! -setopt extended_glob - -# display PID when suspending processes as well -setopt longlistjobs - -# try to avoid the 'zsh: no matches found...' -setopt nonomatch - -# report the status of backgrounds jobs immediately -setopt notify - -# whenever a command completion is attempted, make sure the entire command path -# is hashed first. -setopt hash_list_all - -# not just at the end -setopt completeinword - -# Don't send SIGHUP to background processes when the shell exits. -setopt nohup - -# make cd push the old directory onto the directory stack. -setopt auto_pushd - -# avoid "beep"ing -setopt nobeep - -# don't push the same dir twice. -setopt pushd_ignore_dups - -# * shouldn't match dotfiles. ever. -setopt noglobdots - -# use zsh style word splitting -setopt noshwordsplit - -# don't error out when unset parameters are used -setopt unset - -# setting some default values -NOCOR=${NOCOR:-0} -NOMENU=${NOMENU:-0} -NOPRECMD=${NOPRECMD:-0} -COMMAND_NOT_FOUND=${COMMAND_NOT_FOUND:-0} -GRML_ZSH_CNF_HANDLER=${GRML_ZSH_CNF_HANDLER:-/usr/share/command-not-found/command-not-found} -BATTERY=${BATTERY:-0} -GRMLSMALL_SPECIFIC=${GRMLSMALL_SPECIFIC:-1} -ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0} - -typeset -ga ls_options -typeset -ga grep_options -if ls --help 2> /dev/null | grep -q GNU; then - ls_options=( --color=auto ) -elif [[ $OSTYPE == freebsd* ]]; then - ls_options=( -G ) -fi -if grep --help 2> /dev/null | grep -q GNU || \ - [[ $OSTYPE == freebsd* ]]; then - grep_options=( --color=auto ) -fi - -# utility functions -# this function checks if a command exists and returns either true -# or false. This avoids using 'which' and 'whence', which will -# avoid problems with aliases for which on certain weird systems. :-) -# Usage: check_com [-c|-g] word -# -c only checks for external commands -# -g does the usual tests and also checks for global aliases -check_com() { - emulate -L zsh - local -i comonly gatoo - - if [[ $1 == '-c' ]] ; then - (( comonly = 1 )) - shift - elif [[ $1 == '-g' ]] ; then - (( gatoo = 1 )) - else - (( comonly = 0 )) - (( gatoo = 0 )) - fi - - if (( ${#argv} != 1 )) ; then - printf 'usage: check_com [-c] \n' >&2 - return 1 - fi - - if (( comonly > 0 )) ; then - [[ -n ${commands[$1]} ]] && return 0 - return 1 - fi - - if [[ -n ${commands[$1]} ]] \ - || [[ -n ${functions[$1]} ]] \ - || [[ -n ${aliases[$1]} ]] \ - || [[ -n ${reswords[(r)$1]} ]] ; then - - return 0 - fi - - if (( gatoo > 0 )) && [[ -n ${galiases[$1]} ]] ; then - return 0 - fi - - return 1 -} - -# creates an alias and precedes the command with -# sudo if $EUID is not zero. -salias() { - emulate -L zsh - local only=0 ; local multi=0 - local key val - while [[ $1 == -* ]] ; do - case $1 in - (-o) only=1 ;; - (-a) multi=1 ;; - (--) shift ; break ;; - (-h) - printf 'usage: salias [-h|-o|-a] \n' - printf ' -h shows this help text.\n' - printf ' -a replace '\'' ; '\'' sequences with '\'' ; sudo '\''.\n' - printf ' be careful using this option.\n' - printf ' -o only sets an alias if a preceding sudo would be needed.\n' - return 0 - ;; - (*) printf "unkown option: '%s'\n" "$1" ; return 1 ;; - esac - shift - done - - if (( ${#argv} > 1 )) ; then - printf 'Too many arguments %s\n' "${#argv}" - return 1 - fi - - key="${1%%\=*}" ; val="${1#*\=}" - if (( EUID == 0 )) && (( only == 0 )); then - alias -- "${key}=${val}" - elif (( EUID > 0 )) ; then - (( multi > 0 )) && val="${val// ; / ; sudo }" - alias -- "${key}=sudo ${val}" - fi - - return 0 -} - -# a "print -l ${(u)foo}"-workaround for pre-4.2.0 shells -# usage: uprint foo -# Where foo is the *name* of the parameter you want printed. -# Note that foo is no typo; $foo would be wrong here! -if ! is42 ; then - uprint () { - emulate -L zsh - local -a u - local w - local parameter=$1 - - if [[ -z ${parameter} ]] ; then - printf 'usage: uprint \n' - return 1 - fi - - for w in ${(P)parameter} ; do - [[ -z ${(M)u:#$w} ]] && u=( $u $w ) - done - - builtin print -l $u - } -fi - -# Check if we can read given files and source those we can. -xsource() { - if (( ${#argv} < 1 )) ; then - printf 'usage: xsource FILE(s)...\n' >&2 - return 1 - fi - - while (( ${#argv} > 0 )) ; do - [[ -r "$1" ]] && source "$1" - shift - done - return 0 -} - -# Check if we can read a given file and 'cat(1)' it. -xcat() { - emulate -L zsh - if (( ${#argv} != 1 )) ; then - printf 'usage: xcat FILE\n' >&2 - return 1 - fi - - [[ -r $1 ]] && cat $1 - return 0 -} - -# Remove these functions again, they are of use only in these -# setup files. This should be called at the end of .zshrc. -xunfunction() { - emulate -L zsh - local -a funcs - funcs=(salias xcat xsource xunfunction zrcautoload zrcautozle) - for func in $funcs ; do - [[ -n ${functions[$func]} ]] \ - && unfunction $func - done - return 0 -} - -# this allows us to stay in sync with grml's zshrc and put own -# modifications in ~/.zshrc.local -zrclocal() { - xsource "/etc/zsh/zshrc.local" - xsource "${ZDOTDIR:-${HOME}}/.zshrc.local" - return 0 -} - -# locale setup -if (( ZSH_NO_DEFAULT_LOCALE == 0 )); then - xsource "/etc/default/locale" -fi - -for var in LANG LC_ALL LC_MESSAGES ; do - [[ -n ${(P)var} ]] && export $var -done - -xsource "/etc/sysconfig/keyboard" - -TZ=$(xcat /etc/timezone) - -# set some variables -if check_com -c vim ; then -#v# - export EDITOR=${EDITOR:-vim} -else - export EDITOR=${EDITOR:-vi} -fi - -#v# -export PAGER=${PAGER:-less} - -#v# -export MAIL=${MAIL:-/var/mail/$USER} - -# if we don't set $SHELL then aterm, rxvt,.. will use /bin/sh or /bin/bash :-/ -export SHELL='/bin/zsh' - -# color setup for ls: -check_com -c dircolors && eval $(dircolors -b) -# color setup for ls on OS X / FreeBSD: -isdarwin && export CLICOLOR=1 -isfreebsd && export CLICOLOR=1 - -# do MacPorts setup on darwin -if isdarwin && [[ -d /opt/local ]]; then - # Note: PATH gets set in /etc/zprofile on Darwin, so this can't go into - # zshenv. - PATH="/opt/local/bin:/opt/local/sbin:$PATH" - MANPATH="/opt/local/share/man:$MANPATH" -fi -# do Fink setup on darwin -isdarwin && xsource /sw/bin/init.sh - -# load our function and completion directories -for fdir in /usr/share/grml/zsh/completion /usr/share/grml/zsh/functions; do - fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} ) - if [[ ${fdir} == '/usr/share/grml/zsh/functions' ]] ; then - for func in ${fdir}/**/[^_]*[^~](N.) ; do - zrcautoload ${func:t} - done - fi -done -unset fdir func - -# support colors in less -export LESS_TERMCAP_mb=$'\E[01;31m' -export LESS_TERMCAP_md=$'\E[01;31m' -export LESS_TERMCAP_me=$'\E[0m' -export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[01;44;33m' -export LESS_TERMCAP_ue=$'\E[0m' -export LESS_TERMCAP_us=$'\E[01;32m' - -# mailchecks -MAILCHECK=30 - -# report about cpu-/system-/user-time of command if running longer than -# 5 seconds -REPORTTIME=5 - -# watch for everyone but me and root -watch=(notme root) - -# automatically remove duplicates from these arrays -typeset -U path cdpath fpath manpath - -# Load a few modules -is4 && \ -for mod in parameter complist deltochar mathfunc ; do - zmodload -i zsh/${mod} 2>/dev/null || print "Notice: no ${mod} available :(" -done - -# autoload zsh modules when they are referenced -if is4 ; then - zmodload -a zsh/stat zstat - zmodload -a zsh/zpty zpty - zmodload -ap zsh/mapfile mapfile -fi - -# completion system -if zrcautoload compinit ; then - compinit || print 'Notice: no compinit available :(' -else - print 'Notice: no compinit available :(' - function compdef { } -fi - -# completion system - -# called later (via is4 && grmlcomp) -# note: use 'zstyle' for getting current settings -# press ^xh (control-x h) for getting tags in context; ^x? (control-x ?) to run complete_debug with trace output -grmlcomp() { - # TODO: This could use some additional information - - # Make sure the completion system is initialised - (( ${+_comps} )) || return 1 - - # allow one error for every three characters typed in approximate completer - zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )' - - # don't complete backup files as executables - zstyle ':completion:*:complete:-command-::commands' ignored-patterns '(aptitude-*|*\~)' - - # start menu completion only if it could find no unambiguous initial string - zstyle ':completion:*:correct:*' insert-unambiguous true - zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}' - zstyle ':completion:*:correct:*' original true - - # activate color-completion - zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} - - # format on completion - zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' - - # automatically complete 'cd -' and 'cd -' with menu - # zstyle ':completion:*:*:cd:*:directory-stack' menu yes select - - # insert all expansions for expand completer - zstyle ':completion:*:expand:*' tag-order all-expansions - zstyle ':completion:*:history-words' list false - - # activate menu - zstyle ':completion:*:history-words' menu yes - - # ignore duplicate entries - zstyle ':completion:*:history-words' remove-all-dups yes - zstyle ':completion:*:history-words' stop yes - - # match uppercase from lowercase - zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' - - # separate matches into groups - zstyle ':completion:*:matches' group 'yes' - zstyle ':completion:*' group-name '' - - if [[ "$NOMENU" -eq 0 ]] ; then - # if there are more than 5 options allow selecting from a menu - zstyle ':completion:*' menu select=5 - else - # don't use any menus at all - setopt no_auto_menu - fi - - zstyle ':completion:*:messages' format '%d' - zstyle ':completion:*:options' auto-description '%d' - - # describe options in full - zstyle ':completion:*:options' description 'yes' - - # on processes completion complete all user processes - zstyle ':completion:*:processes' command 'ps -au$USER' - - # offer indexes before parameters in subscripts - zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters - - # provide verbose completion information - zstyle ':completion:*' verbose true - - # recent (as of Dec 2007) zsh versions are able to provide descriptions - # for commands (read: 1st word in the line) that it will list for the user - # to choose from. The following disables that, because it's not exactly fast. - zstyle ':completion:*:-command-:*:' verbose false - - # set format for warnings - zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for:%{\e[0m%} %d' - - # define files to ignore for zcompile - zstyle ':completion:*:*:zcompile:*' ignored-patterns '(*~|*.zwc)' - zstyle ':completion:correct:' prompt 'correct to: %e' - - # Ignore completion functions for commands you don't have: - zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*' - - # Provide more processes in completion of programs like killall: - zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq' - - # complete manual by their section - zstyle ':completion:*:manuals' separate-sections true - zstyle ':completion:*:manuals.*' insert-sections true - zstyle ':completion:*:man:*' menu yes select - - # Search path for sudo completion - zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \ - /usr/local/bin \ - /usr/sbin \ - /usr/bin \ - /sbin \ - /bin \ - /usr/X11R6/bin - - # provide .. as a completion - zstyle ':completion:*' special-dirs .. - - # run rehash on completion so new installed program are found automatically: - _force_rehash() { - (( CURRENT == 1 )) && rehash - return 1 - } - - ## correction - # some people don't like the automatic correction - so run 'NOCOR=1 zsh' to deactivate it - if [[ "$NOCOR" -gt 0 ]] ; then - zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _files _ignored - setopt nocorrect - else - # try to be smart about when to use what completer... - setopt correct - zstyle -e ':completion:*' completer ' - if [[ $_last_try != "$HISTNO$BUFFER$CURSOR" ]] ; then - _last_try="$HISTNO$BUFFER$CURSOR" - reply=(_complete _match _ignored _prefix _files) - else - if [[ $words[1] == (rm|mv) ]] ; then - reply=(_complete _files) - else - reply=(_oldlist _expand _force_rehash _complete _ignored _correct _approximate _files) - fi - fi' - fi - - # command for process lists, the local web server details and host completion - zstyle ':completion:*:urls' local 'www' '/var/www/' 'public_html' - - # caching - [[ -d $ZSHDIR/cache ]] && zstyle ':completion:*' use-cache yes && \ - zstyle ':completion::complete:*' cache-path $ZSHDIR/cache/ - - # host completion - if is42 ; then - [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() - [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(, Bernhard Tittelbach -beginning-or-end-of-somewhere() { - local hno=$HISTNO - if [[ ( "${LBUFFER[-1]}" == $'\n' && "${WIDGET}" == beginning-of* ) || \ - ( "${RBUFFER[1]}" == $'\n' && "${WIDGET}" == end-of* ) ]]; then - zle .${WIDGET:s/somewhere/buffer-or-history/} "$@" - else - zle .${WIDGET:s/somewhere/line-hist/} "$@" - if (( HISTNO != hno )); then - zle .${WIDGET:s/somewhere/buffer-or-history/} "$@" - fi - fi -} -zle -N beginning-of-somewhere beginning-or-end-of-somewhere -zle -N end-of-somewhere beginning-or-end-of-somewhere - -## toggle the ,. abbreviation feature on/off -# NOABBREVIATION: default abbreviation-state -# 0 - enabled (default) -# 1 - disabled -NOABBREVIATION=${NOABBREVIATION:-0} - -grml_toggle_abbrev() { - if (( ${NOABBREVIATION} > 0 )) ; then - NOABBREVIATION=0 - else - NOABBREVIATION=1 - fi -} -zle -N grml_toggle_abbrev - -# add a command line to the shells history without executing it -commit-to-history() { - print -s ${(z)BUFFER} - zle send-break -} -zle -N commit-to-history - -# only slash should be considered as a word separator: -slash-backward-kill-word() { - local WORDCHARS="${WORDCHARS:s@/@}" - # zle backward-word - zle backward-kill-word -} -zle -N slash-backward-kill-word - -# a generic accept-line wrapper - -# This widget can prevent unwanted autocorrections from command-name -# to _command-name, rehash automatically on enter and call any number -# of builtin and user-defined widgets in different contexts. -# -# For a broader description, see: -# -# -# The code is imported from the file 'zsh/functions/accept-line' from -# , which -# distributed under the same terms as zsh itself. - -# A newly added command will may not be found or will cause false -# correction attempts, if you got auto-correction set. By setting the -# following style, we force accept-line() to rehash, if it cannot -# find the first word on the command line in the $command[] hash. -zstyle ':acceptline:*' rehash true - -function Accept-Line() { - setopt localoptions noksharrays - local -a subs - local -xi aldone - local sub - local alcontext=${1:-$alcontext} - - zstyle -a ":acceptline:${alcontext}" actions subs - - (( ${#subs} < 1 )) && return 0 - - (( aldone = 0 )) - for sub in ${subs} ; do - [[ ${sub} == 'accept-line' ]] && sub='.accept-line' - zle ${sub} - - (( aldone > 0 )) && break - done -} - -function Accept-Line-getdefault() { - emulate -L zsh - local default_action - - zstyle -s ":acceptline:${alcontext}" default_action default_action - case ${default_action} in - ((accept-line|)) - printf ".accept-line" - ;; - (*) - printf ${default_action} - ;; - esac -} - -function Accept-Line-HandleContext() { - zle Accept-Line - - default_action=$(Accept-Line-getdefault) - zstyle -T ":acceptline:${alcontext}" call_default \ - && zle ${default_action} -} - -function accept-line() { - setopt localoptions noksharrays - local -ax cmdline - local -x alcontext - local buf com fname format msg default_action - - alcontext='default' - buf="${BUFFER}" - cmdline=(${(z)BUFFER}) - com="${cmdline[1]}" - fname="_${com}" - - Accept-Line 'preprocess' - - zstyle -t ":acceptline:${alcontext}" rehash \ - && [[ -z ${commands[$com]} ]] \ - && rehash - - if [[ -n ${com} ]] \ - && [[ -n ${reswords[(r)$com]} ]] \ - || [[ -n ${aliases[$com]} ]] \ - || [[ -n ${functions[$com]} ]] \ - || [[ -n ${builtins[$com]} ]] \ - || [[ -n ${commands[$com]} ]] ; then - - # there is something sensible to execute, just do it. - alcontext='normal' - Accept-Line-HandleContext - - return - fi - - if [[ -o correct ]] \ - || [[ -o correctall ]] \ - && [[ -n ${functions[$fname]} ]] ; then - - # nothing there to execute but there is a function called - # _command_name; a completion widget. Makes no sense to - # call it on the commandline, but the correct{,all} options - # will ask for it nevertheless, so warn the user. - if [[ ${LASTWIDGET} == 'accept-line' ]] ; then - # Okay, we warned the user before, he called us again, - # so have it his way. - alcontext='force' - Accept-Line-HandleContext - - return - fi - - if zstyle -t ":acceptline:${alcontext}" nocompwarn ; then - alcontext='normal' - Accept-Line-HandleContext - else - # prepare warning message for the user, configurable via zstyle. - zstyle -s ":acceptline:${alcontext}" compwarnfmt msg - - if [[ -z ${msg} ]] ; then - msg="%c will not execute and completion %f exists." - fi - - zformat -f msg "${msg}" "c:${com}" "f:${fname}" - - zle -M -- "${msg}" - fi - return - elif [[ -n ${buf//[$' \t\n']##/} ]] ; then - # If we are here, the commandline contains something that is not - # executable, which is neither subject to _command_name correction - # and is not empty. might be a variable assignment - alcontext='misc' - Accept-Line-HandleContext - - return - fi - - # If we got this far, the commandline only contains whitespace, or is empty. - alcontext='empty' - Accept-Line-HandleContext -} - -zle -N accept-line -zle -N Accept-Line -zle -N Accept-Line-HandleContext - -# power completion / abbreviation expansion / buffer expansion -# see http://zshwiki.org/home/examples/zleiab for details -# less risky than the global aliases but powerful as well -# just type the abbreviation key and afterwards 'ctrl-x .' to expand it -declare -A abk -setopt extendedglob -setopt interactivecomments -abk=( -# key # value (#d additional doc string) -#A# start - '...' '../..' - '....' '../../..' - 'BG' '& exit' - 'C' '| wc -l' - 'G' '|& grep '${grep_options:+"${grep_options[*]}"} - 'H' '| head' - 'Hl' ' --help |& less -r' #d (Display help in pager) - 'L' '| less' - 'LL' '|& less -r' - 'M' '| most' - 'N' '&>/dev/null' #d (No Output) - 'R' '| tr A-z N-za-m' #d (ROT13) - 'SL' '| sort | less' - 'S' '| sort -u' - 'T' '| tail' - 'V' '|& vim -' -#A# end - 'co' './configure && make && sudo make install' -) - -zleiab() { - emulate -L zsh - setopt extendedglob - local MATCH - - if (( NOABBREVIATION > 0 )) ; then - LBUFFER="${LBUFFER},." - return 0 - fi - - LBUFFER=${LBUFFER%%(#m)[.\-+:|_a-zA-Z0-9]#} - LBUFFER+=${abk[$MATCH]:-$MATCH} -} - -zle -N zleiab - -help-show-abk() -{ - zle -M "$(print "Type ,. after these abbreviations to expand them:"; print -a -C 2 ${(kv)abk})" -} - -zle -N help-show-abk - -# press "ctrl-e d" to insert the actual date in the form yyyy-mm-dd -insert-datestamp() { LBUFFER+=${(%):-'%D{%Y-%m-%d}'}; } -zle -N insert-datestamp - -# press esc-m for inserting last typed word again (thanks to caphuso!) -insert-last-typed-word() { zle insert-last-word -- 0 -1 }; -zle -N insert-last-typed-word; - -function grml-zsh-fg() { - if (( ${#jobstates} )); then - zle .push-input - [[ -o hist_ignore_space ]] && BUFFER=' ' || BUFFER='' - BUFFER="${BUFFER}fg" - zle .accept-line - else - zle -M 'No background jobs. Doing nothing.' - fi -} -zle -N grml-zsh-fg - -# run command line as user root via sudo: -sudo-command-line() { - [[ -z $BUFFER ]] && zle up-history - if [[ $BUFFER != sudo\ * ]]; then - BUFFER="sudo $BUFFER" - CURSOR=$(( CURSOR+5 )) - fi -} -zle -N sudo-command-line - -### jump behind the first word on the cmdline. -### useful to add options. -function jump_after_first_word() { - local words - words=(${(z)BUFFER}) - - if (( ${#words} <= 1 )) ; then - CURSOR=${#BUFFER} - else - CURSOR=${#${words[1]}} - fi -} -zle -N jump_after_first_word - -#f5# Create directory under cursor or the selected area -inplaceMkDirs() { - # Press ctrl-xM to create the directory under the cursor or the selected area. - # To select an area press ctrl-@ or ctrl-space and use the cursor. - # Use case: you type "mv abc ~/testa/testb/testc/" and remember that the - # directory does not exist yet -> press ctrl-XM and problem solved - local PATHTOMKDIR - if ((REGION_ACTIVE==1)); then - local F=$MARK T=$CURSOR - if [[ $F -gt $T ]]; then - F=${CURSOR} - T=${MARK} - fi - # get marked area from buffer and eliminate whitespace - PATHTOMKDIR=${BUFFER[F+1,T]%%[[:space:]]##} - PATHTOMKDIR=${PATHTOMKDIR##[[:space:]]##} - else - local bufwords iword - bufwords=(${(z)LBUFFER}) - iword=${#bufwords} - bufwords=(${(z)BUFFER}) - PATHTOMKDIR="${(Q)bufwords[iword]}" - fi - [[ -z "${PATHTOMKDIR}" ]] && return 1 - PATHTOMKDIR=${~PATHTOMKDIR} - if [[ -e "${PATHTOMKDIR}" ]]; then - zle -M " path already exists, doing nothing" - else - zle -M "$(mkdir -p -v "${PATHTOMKDIR}")" - zle end-of-line - fi -} - -#k# mkdir -p from string under cursor or marked area -zle -N inplaceMkDirs - -#v1# set number of lines to display per page -HELP_LINES_PER_PAGE=20 -#v1# set location of help-zle cache file -HELP_ZLE_CACHE_FILE=~/.cache/zsh_help_zle_lines.zsh -# helper function for help-zle, actually generates the help text -help_zle_parse_keybindings() -{ - emulate -L zsh - setopt extendedglob - unsetopt ksharrays #indexing starts at 1 - - #v1# choose files that help-zle will parse for keybindings - ((${+HELPZLE_KEYBINDING_FILES})) || HELPZLE_KEYBINDING_FILES=( /etc/zsh/zshrc ~/.zshrc.pre ~/.zshrc ~/.zshrc.local ) - - if [[ -r $HELP_ZLE_CACHE_FILE ]]; then - local load_cache=0 - for f ($HELPZLE_KEYBINDING_FILES) [[ $f -nt $HELP_ZLE_CACHE_FILE ]] && load_cache=1 - [[ $load_cache -eq 0 ]] && . $HELP_ZLE_CACHE_FILE && return - fi - - #fill with default keybindings, possibly to be overwriten in a file later - #Note that due to zsh inconsistency on escaping assoc array keys, we encase the key in '' which we will remove later - local -A help_zle_keybindings - help_zle_keybindings['@']="set MARK" - help_zle_keybindings['xj']="vi-join lines" - help_zle_keybindings['xb']="jump to matching brace" - help_zle_keybindings['xu']="undo" - help_zle_keybindings['_']="undo" - help_zle_keybindings['xf']="find in cmdline" - help_zle_keybindings['a']="goto beginning of line" - help_zle_keybindings['e']="goto end of line" - help_zle_keybindings['t']="transpose charaters" - help_zle_keybindings['t']="transpose words" - help_zle_keybindings['s']="spellcheck word" - help_zle_keybindings['k']="backward kill buffer" - help_zle_keybindings['u']="forward kill buffer" - help_zle_keybindings['y']="insert previously killed word/string" - help_zle_keybindings["'"]="quote line" - help_zle_keybindings['"']="quote from mark to cursor" - help_zle_keybindings['']="repeat next cmd/char times (-10a -> -10 times 'a')" - help_zle_keybindings['u']="make next word Uppercase" - help_zle_keybindings['l']="make next word lowercase" - help_zle_keybindings['xd']="preview expansion under cursor" - help_zle_keybindings['q']="push current CL into background, freeing it. Restore on next CL" - help_zle_keybindings['.']="insert (and interate through) last word from prev CLs" - help_zle_keybindings[',']="complete word from newer history (consecutive hits)" - help_zle_keybindings['m']="repeat last typed word on current CL" - help_zle_keybindings['v']="insert next keypress symbol literally (e.g. for bindkey)" - help_zle_keybindings['!!:n*']="insert last n arguments of last command" - help_zle_keybindings['!!:n-']="insert arguments n..N-2 of last command (e.g. mv s s d)" - help_zle_keybindings['h']="show help/manpage for current command" - - #init global variables - unset help_zle_lines help_zle_sln - typeset -g -a help_zle_lines - typeset -g help_zle_sln=1 - - local k v - local lastkeybind_desc contents #last description starting with #k# that we found - local num_lines_elapsed=0 #number of lines between last description and keybinding - #search config files in the order they a called (and thus the order in which they overwrite keybindings) - for f in $HELPZLE_KEYBINDING_FILES; do - [[ -r "$f" ]] || continue #not readable ? skip it - contents="$(<$f)" - for cline in "${(f)contents}"; do - #zsh pattern: matches lines like: #k# .............. - if [[ "$cline" == (#s)[[:space:]]#\#k\#[[:space:]]##(#b)(*)[[:space:]]#(#e) ]]; then - lastkeybind_desc="$match[*]" - num_lines_elapsed=0 - #zsh pattern: matches lines that set a keybinding using bind2map, bindkey or compdef -k - # ignores lines that are commentend out - # grabs first in '' or "" enclosed string with length between 1 and 6 characters - elif [[ "$cline" == [^#]#(bind2maps[[:space:]](*)-s|bindkey|compdef -k)[[:space:]](*)(#b)(\"((?)(#c1,6))\"|\'((?)(#c1,6))\')(#B)(*) ]]; then - #description prevously found ? description not more than 2 lines away ? keybinding not empty ? - if [[ -n $lastkeybind_desc && $num_lines_elapsed -lt 2 && -n $match[1] ]]; then - #substitute keybinding string with something readable - k=${${${${${${${match[1]/\\e\^h/}/\\e\^\?/}/\\e\[5~/}/\\e\[6~/}//(\\e|\^\[)/}//\^/}/3~/} - #put keybinding in assoc array, possibly overwriting defaults or stuff found in earlier files - #Note that we are extracting the keybinding-string including the quotes (see Note at beginning) - help_zle_keybindings[${k}]=$lastkeybind_desc - fi - lastkeybind_desc="" - else - ((num_lines_elapsed++)) - fi - done - done - unset contents - #calculate length of keybinding column - local kstrlen=0 - for k (${(k)help_zle_keybindings[@]}) ((kstrlen < ${#k})) && kstrlen=${#k} - #convert the assoc array into preformated lines, which we are able to sort - for k v in ${(kv)help_zle_keybindings[@]}; do - #pad keybinding-string to kstrlen chars and remove outermost characters (i.e. the quotes) - help_zle_lines+=("${(r:kstrlen:)k[2,-2]}${v}") - done - #sort lines alphabetically - help_zle_lines=("${(i)help_zle_lines[@]}") - [[ -d ${HELP_ZLE_CACHE_FILE:h} ]] || mkdir -p "${HELP_ZLE_CACHE_FILE:h}" - echo "help_zle_lines=(${(q)help_zle_lines[@]})" >| $HELP_ZLE_CACHE_FILE - zcompile $HELP_ZLE_CACHE_FILE -} -typeset -g help_zle_sln -typeset -g -a help_zle_lines - -# Provides (partially autogenerated) help on keybindings and the zsh line editor -help-zle() -{ - emulate -L zsh - unsetopt ksharrays #indexing starts at 1 - #help lines already generated ? no ? then do it - [[ ${+functions[help_zle_parse_keybindings]} -eq 1 ]] && {help_zle_parse_keybindings && unfunction help_zle_parse_keybindings} - #already displayed all lines ? go back to the start - [[ $help_zle_sln -gt ${#help_zle_lines} ]] && help_zle_sln=1 - local sln=$help_zle_sln - #note that help_zle_sln is a global var, meaning we remember the last page we viewed - help_zle_sln=$((help_zle_sln + HELP_LINES_PER_PAGE)) - zle -M "${(F)help_zle_lines[sln,help_zle_sln-1]}" -} -zle -N help-zle - -## complete word from currently visible Screen or Tmux buffer. -if check_com -c screen || check_com -c tmux; then - _complete_screen_display() { - [[ "$TERM" != "screen" ]] && return 1 - - local TMPFILE=$(mktemp) - local -U -a _screen_display_wordlist - trap "rm -f $TMPFILE" EXIT - - # fill array with contents from screen hardcopy - if ((${+TMUX})); then - #works, but crashes tmux below version 1.4 - #luckily tmux -V option to ask for version, was also added in 1.4 - tmux -V &>/dev/null || return - tmux -q capture-pane \; save-buffer -b 0 $TMPFILE \; delete-buffer -b 0 - else - screen -X hardcopy $TMPFILE - # screen sucks, it dumps in latin1, apparently always. so recode it - # to system charset - check_com recode && recode latin1 $TMPFILE - fi - _screen_display_wordlist=( ${(QQ)$(<$TMPFILE)} ) - # remove PREFIX to be completed from that array - _screen_display_wordlist[${_screen_display_wordlist[(i)$PREFIX]}]="" - compadd -a _screen_display_wordlist - } - #m# k CTRL-x\,\,\,S Complete word from GNU screen buffer - bindkey -r "^xS" - compdef -k _complete_screen_display complete-word '^xS' -fi - -# Load a few more functions and tie them to widgets, so they can be bound: - -function zrcautozle() { - emulate -L zsh - local fnc=$1 - zrcautoload $fnc && zle -N $fnc -} - -function zrcgotwidget() { - (( ${+widgets[$1]} )) -} - -function zrcgotkeymap() { - [[ -n ${(M)keymaps:#$1} ]] -} - -zrcautozle insert-files -zrcautozle edit-command-line -zrcautozle insert-unicode-char -if zrcautoload history-search-end; then - zle -N history-beginning-search-backward-end history-search-end - zle -N history-beginning-search-forward-end history-search-end -fi -zle -C hist-complete complete-word _generic -zstyle ':completion:hist-complete:*' completer _history - -# The actual terminal setup hooks and bindkey-calls: - -# An array to note missing features to ease diagnosis in case of problems. -typeset -ga grml_missing_features - -function zrcbindkey() { - if (( ARGC )) && zrcgotwidget ${argv[-1]}; then - bindkey "$@" - fi -} - -function bind2maps () { - local i sequence widget - local -a maps - - while [[ "$1" != "--" ]]; do - maps+=( "$1" ) - shift - done - shift - - if [[ "$1" == "-s" ]]; then - shift - sequence="$1" - else - sequence="${key[$1]}" - fi - widget="$2" - - [[ -z "$sequence" ]] && return 1 - - for i in "${maps[@]}"; do - zrcbindkey -M "$i" "$sequence" "$widget" - done -} - -if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then - function zle-smkx () { - emulate -L zsh - printf '%s' ${terminfo[smkx]} - } - function zle-rmkx () { - emulate -L zsh - printf '%s' ${terminfo[rmkx]} - } - function zle-line-init () { - zle-smkx - } - function zle-line-finish () { - zle-rmkx - } - zle -N zle-line-init - zle -N zle-line-finish -else - for i in {s,r}mkx; do - (( ${+terminfo[$i]} )) || grml_missing_features+=($i) - done - unset i -fi - -typeset -A key -key=( - Home "${terminfo[khome]}" - End "${terminfo[kend]}" - Insert "${terminfo[kich1]}" - Delete "${terminfo[kdch1]}" - Up "${terminfo[kcuu1]}" - Down "${terminfo[kcud1]}" - Left "${terminfo[kcub1]}" - Right "${terminfo[kcuf1]}" - PageUp "${terminfo[kpp]}" - PageDown "${terminfo[knp]}" - BackTab "${terminfo[kcbt]}" -) - -# Guidelines for adding key bindings: -# -# - Do not add hardcoded escape sequences, to enable non standard key -# combinations such as Ctrl-Meta-Left-Cursor. They are not easily portable. -# -# - Adding Ctrl characters, such as '^b' is okay; note that '^b' and '^B' are -# the same key. -# -# - All keys from the $key[] mapping are obviously okay. -# -# - Most terminals send "ESC x" when Meta-x is pressed. Thus, sequences like -# '\ex' are allowed in here as well. - -bind2maps emacs -- Home beginning-of-somewhere -bind2maps viins vicmd -- Home vi-beginning-of-line -bind2maps emacs -- End end-of-somewhere -bind2maps viins vicmd -- End vi-end-of-line -bind2maps emacs viins -- Insert overwrite-mode -bind2maps vicmd -- Insert vi-insert -bind2maps emacs -- Delete delete-char -bind2maps viins vicmd -- Delete vi-delete-char -bind2maps emacs viins vicmd -- Up up-line-or-search -bind2maps emacs viins vicmd -- Down down-line-or-search -bind2maps emacs -- Left backward-char -bind2maps viins vicmd -- Left vi-backward-char -bind2maps emacs -- Right forward-char -bind2maps viins vicmd -- Right vi-forward-char -bind2maps viins vicmd -- Right vi-forward-char -#k# Display list of abbreviations that expand when followed by ,. -bind2maps emacs viins -- -s '^x.' zleiab -bind2maps emacs viins -- -s '^xb' help-show-abk -bind2maps emacs viins -- -s '^xM' inplaceMkDirs -#k# display help for keybindings and ZLE -bind2maps emacs viins -- -s '^xz' help-zle -#k# Insert files and test globbing -bind2maps emacs viins -- -s "^xf" insert-files -#k# Edit the current line in \kbd{\$EDITOR} -bind2maps emacs viins -- -s '\ee' edit-command-line -#k# search history backward for entry beginning with typed text -bind2maps emacs viins -- -s '^xp' history-beginning-search-backward-end -#k# search history forward for entry beginning with typed text -bind2maps emacs viins -- -s '^xP' history-beginning-search-forward-end -#k# search history backward for entry beginning with typed text -bind2maps emacs viins -- PageUp history-beginning-search-backward-end -#k# search history forward for entry beginning with typed text -bind2maps emacs viins -- PageDown history-beginning-search-forward-end -#k# Toggle abbreviation expansion on/off -bind2maps emacs viins -- -s '^xA' grml_toggle_abbrev -bind2maps emacs viins -- -s "^x^h" commit-to-history -#k# Kill left-side word or everything up to next slash -bind2maps emacs viins -- -s '\ev' slash-backward-kill-word -#k# Kill left-side word or everything up to next slash -bind2maps emacs viins -- -s '\e^h' slash-backward-kill-word -#k# Kill left-side word or everything up to next slash -bind2maps emacs viins -- -s '\e^?' slash-backward-kill-word -# Do history expansion on space: -bind2maps emacs viins -- -s ' ' magic-space -#k# Trigger menu-complete -bind2maps emacs viins -- -s '\ei' menu-complete # menu completion via esc-i -#k# Insert a timestamp on the command line (yyyy-mm-dd) -bind2maps emacs viins -- -s '^ed' insert-datestamp -#k# Insert last typed word -bind2maps emacs viins -- -s "\em" insert-last-typed-word -#k# A smart shortcut for \kbd{fg} -bind2maps emacs viins -- -s '^z' grml-zsh-fg -#k# prepend the current command with "sudo" -bind2maps emacs viins -- -s "^os" sudo-command-line -#k# jump to after first word (for adding options) -bind2maps emacs viins -- -s '^x1' jump_after_first_word -#k# complete word from history with menu -bind2maps emacs viins -- -s "^x^x" hist-complete - -# insert unicode character -# usage example: 'ctrl-x i' 00A7 'ctrl-x i' will give you an § -# See for example http://unicode.org/charts/ for unicode characters code -#k# Insert Unicode character -bind2maps emacs viins -- -s '^xi' insert-unicode-char - -# use the new *-pattern-* widgets for incremental history search -if zrcgotwidget history-incremental-pattern-search-backward; then - for seq wid in '^r' history-incremental-pattern-search-backward \ - '^s' history-incremental-pattern-search-forward - do - bind2maps emacs viins vicmd -- -s $seq $wid - done -fi - -if zrcgotkeymap menuselect; then - #m# k Shift-tab Perform backwards menu completion - bind2maps menuselect -- BackTab reverse-menu-complete - - #k# menu selection: pick item but stay in the menu - bind2maps menuselect -- -s '\e^M' accept-and-menu-complete - # also use + and INSERT since it's easier to press repeatedly - bind2maps menuselect -- -s '+' accept-and-menu-complete - bind2maps menuselect -- Insert accept-and-menu-complete - - # accept a completion and try to complete again by using menu - # completion; very useful with completing directories - # by using 'undo' one's got a simple file browser - bind2maps menuselect -- -s '^o' accept-and-infer-next-history -fi - -# Finally, here are still a few hardcoded escape sequences; Special sequences -# like Ctrl- etc do suck a fair bit, because they are not -# standardised and most of the time are not available in a terminals terminfo -# entry. -# -# While we do not encourage adding bindings like these, we will keep these for -# backward compatibility. - -## use Ctrl-left-arrow and Ctrl-right-arrow for jumping to word-beginnings on -## the command line. -# URxvt sequences: -bind2maps emacs viins vicmd -- -s '\eOc' forward-word -bind2maps emacs viins vicmd -- -s '\eOd' backward-word -# These are for xterm: -bind2maps emacs viins vicmd -- -s '\e[1;5C' forward-word -bind2maps emacs viins vicmd -- -s '\e[1;5D' backward-word -## the same for alt-left-arrow and alt-right-arrow -# URxvt again: -bind2maps emacs viins vicmd -- -s '\e\e[C' forward-word -bind2maps emacs viins vicmd -- -s '\e\e[D' backward-word -# Xterm again: -bind2maps emacs viins vicmd -- -s '^[[1;3C' forward-word -bind2maps emacs viins vicmd -- -s '^[[1;3D' backward-word -# Also try ESC Left/Right: -bind2maps emacs viins vicmd -- -s '\e'${key[Right]} forward-word -bind2maps emacs viins vicmd -- -s '\e'${key[Left]} backward-word - -# autoloading - -zrcautoload zmv -zrcautoload zed - -# we don't want to quote/espace URLs on our own... -# if autoload -U url-quote-magic ; then -# zle -N self-insert url-quote-magic -# zstyle ':url-quote-magic:*' url-metas '*?[]^()~#{}=' -# else -# print 'Notice: no url-quote-magic available :(' -# fi -alias url-quote='autoload -U url-quote-magic ; zle -N self-insert url-quote-magic' - -#m# k ESC-h Call \kbd{run-help} for the 1st word on the command line -alias run-help >&/dev/null && unalias run-help -for rh in run-help{,-git,-svk,-svn}; do - zrcautoload $rh -done; unset rh - -# command not found handling - -(( ${COMMAND_NOT_FOUND} == 1 )) && -function command_not_found_handler() { - emulate -L zsh - if [[ -x ${GRML_ZSH_CNF_HANDLER} ]] ; then - ${GRML_ZSH_CNF_HANDLER} $1 - fi - return 1 -} - -# history - -ZSHDIR=${ZDOTDIR:-${HOME}/.zsh} - -#v# -HISTFILE=${ZDOTDIR:-${HOME}}/.zsh_history -isgrmlcd && HISTSIZE=500 || HISTSIZE=5000 -isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history - -# dirstack handling - -DIRSTACKSIZE=${DIRSTACKSIZE:-20} -DIRSTACKFILE=${DIRSTACKFILE:-${ZDOTDIR:-${HOME}}/.zdirs} - -if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then - dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) - # "cd -" won't work after login by just setting $OLDPWD, so - [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD -fi - -chpwd() { - local -ax my_stack - my_stack=( ${PWD} ${dirstack} ) - if is42 ; then - builtin print -l ${(u)my_stack} >! ${DIRSTACKFILE} - else - uprint my_stack >! ${DIRSTACKFILE} - fi -} - -# directory based profiles - -if is433 ; then - -# chpwd_profiles(): Directory Profiles, Quickstart: -# -# In .zshrc.local: -# -# zstyle ':chpwd:profiles:/usr/src/grml(|/|/*)' profile grml -# zstyle ':chpwd:profiles:/usr/src/debian(|/|/*)' profile debian -# chpwd_profiles -# -# For details see the `grmlzshrc.5' manual page. -function chpwd_profiles() { - local profile context - local -i reexecute - - context=":chpwd:profiles:$PWD" - zstyle -s "$context" profile profile || profile='default' - zstyle -T "$context" re-execute && reexecute=1 || reexecute=0 - - if (( ${+parameters[CHPWD_PROFILE]} == 0 )); then - typeset -g CHPWD_PROFILE - local CHPWD_PROFILES_INIT=1 - (( ${+functions[chpwd_profiles_init]} )) && chpwd_profiles_init - elif [[ $profile != $CHPWD_PROFILE ]]; then - (( ${+functions[chpwd_leave_profile_$CHPWD_PROFILE]} )) \ - && chpwd_leave_profile_${CHPWD_PROFILE} - fi - if (( reexecute )) || [[ $profile != $CHPWD_PROFILE ]]; then - (( ${+functions[chpwd_profile_$profile]} )) && chpwd_profile_${profile} - fi - - CHPWD_PROFILE="${profile}" - return 0 -} - -chpwd_functions=( ${chpwd_functions} chpwd_profiles ) - -fi # is433 - -# Prompt setup for grml: - -# set colors for use in prompts (modern zshs allow for the use of %F{red}foo%f -# in prompts to get a red "foo" embedded, but it's good to keep these for -# backwards compatibility). -if zrcautoload colors && colors 2>/dev/null ; then - BLUE="%{${fg[blue]}%}" - RED="%{${fg_bold[red]}%}" - GREEN="%{${fg[green]}%}" - CYAN="%{${fg[cyan]}%}" - MAGENTA="%{${fg[magenta]}%}" - YELLOW="%{${fg[yellow]}%}" - WHITE="%{${fg[white]}%}" - NO_COLOR="%{${reset_color}%}" -else - BLUE=$'%{\e[1;34m%}' - RED=$'%{\e[1;31m%}' - GREEN=$'%{\e[1;32m%}' - CYAN=$'%{\e[1;36m%}' - WHITE=$'%{\e[1;37m%}' - MAGENTA=$'%{\e[1;35m%}' - YELLOW=$'%{\e[1;33m%}' - NO_COLOR=$'%{\e[0m%}' -fi - -# First, the easy ones: PS2..4: - -# secondary prompt, printed when the shell needs more information to complete a -# command. -PS2='\`%_> ' -# selection prompt used within a select loop. -PS3='?# ' -# the execution trace prompt (setopt xtrace). default: '+%N:%i>' -PS4='+%N:%i:%_> ' - -# Some additional features to use with our prompt: -# -# - battery status -# - debian_chroot -# - vcs_info setup and version specific fixes - -# display battery status on right side of prompt via running 'BATTERY=1 zsh' -if [[ $BATTERY -gt 0 ]] ; then - if ! check_com -c acpi ; then - BATTERY=0 - fi -fi - -battery() { -if [[ $BATTERY -gt 0 ]] ; then - PERCENT="${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]#Battery <->: [^0-9]##, (<->)%*/${match[1]}}" - if [[ -z "$PERCENT" ]] ; then - PERCENT='acpi not present' - else - if [[ "$PERCENT" -lt 20 ]] ; then - PERCENT="warning: ${PERCENT}%%" - else - PERCENT="${PERCENT}%%" - fi - fi -fi -} - -# set variable debian_chroot if running in a chroot with /etc/debian_chroot -if [[ -z "$debian_chroot" ]] && [[ -r /etc/debian_chroot ]] ; then - debian_chroot=$( ]] ; then - function VCS_INFO_realpath () { - setopt localoptions NO_shwordsplit chaselinks - ( builtin cd -q $1 2> /dev/null && pwd; ) - } - fi - - zstyle ':vcs_info:*' max-exports 2 - - if [[ -o restricted ]]; then - zstyle ':vcs_info:*' enable NONE - fi -fi - -# Change vcs_info formats for the grml prompt. The 2nd format sets up -# $vcs_info_msg_1_ to contain "zsh: repo-name" used to set our screen title. -# TODO: The included vcs_info() version still uses $VCS_INFO_message_N_. -# That needs to be the use of $VCS_INFO_message_N_ needs to be changed -# to $vcs_info_msg_N_ as soon as we use the included version. -if [[ "$TERM" == dumb ]] ; then - zstyle ':vcs_info:*' actionformats "(%s%)-[%b|%a] " "zsh: %r" - zstyle ':vcs_info:*' formats "(%s%)-[%b] " "zsh: %r" -else - # these are the same, just with a lot of colors: - zstyle ':vcs_info:*' actionformats "${MAGENTA}(${NO_COLOR}%s${MAGENTA})${YELLOW}-${MAGENTA}[${GREEN}%b${YELLOW}|${RED}%a${MAGENTA}]${NO_COLOR} " \ - "zsh: %r" - zstyle ':vcs_info:*' formats "${MAGENTA}(${NO_COLOR}%s${MAGENTA})${YELLOW}-${MAGENTA}[${GREEN}%b${MAGENTA}]${NO_COLOR}%} " \ - "zsh: %r" - zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b${RED}:${YELLOW}%r" -fi - -# Now for the fun part: The grml prompt themes in `promptsys' mode of operation - -# This actually defines three prompts: -# -# - grml -# - grml-large -# - grml-chroot -# -# They all share the same code and only differ with respect to which items they -# contain. The main source of documentation is the `prompt_grml_help' function -# below, which gets called when the user does this: prompt -h grml - -function prompt_grml_help () { - cat <<__EOF0__ - prompt grml - - This is the prompt as used by the grml-live system . It is - a rather simple one-line prompt, that by default looks something like this: - - @ [ ]% - - The prompt itself integrates with zsh's prompt themes system (as you are - witnessing right now) and is configurable to a certain degree. In - particular, these aspects are customisable: - - - The items used in the prompt (e.g. you can remove \`user' from - the list of activated items, which will cause the user name to - be omitted from the prompt string). - - - The attributes used with the items are customisable via strings - used before and after the actual item. - - The available items are: at, battery, change-root, date, grml-chroot, - history, host, jobs, newline, path, percent, rc, rc-always, sad-smiley, - shell-level, time, user, vcs - - The actual configuration is done via zsh's \`zstyle' mechanism. The - context, that is used while looking up styles is: - - ':prompt:grml::' - - Here is either \`left' or \`right', signifying whether the - style should affect the left or the right prompt. is either - \`setup' or 'items:', where \`' is one of the available items. - - The styles: - - - use-rprompt (boolean): If \`true' (the default), print a sad smiley - in $RPROMPT if the last command a returned non-successful error code. - (This in only valid if is "right"; ignored otherwise) - - - items (list): The list of items used in the prompt. If \`vcs' is - present in the list, the theme's code invokes \`vcs_info' - accordingly. Default (left): rc change-root user at host path vcs - percent; Default (right): sad-smiley - - Available styles in 'items:' are: pre, post. These are strings that - are inserted before (pre) and after (post) the item in question. Thus, the - following would cause the user name to be printed in red instead of the - default blue: - - zstyle ':prompt:grml:*:items:user' pre '%F{red}' - - Note, that the \`post' style may remain at its default value, because its - default value is '%f', which turns the foreground text attribute off (which - is exactly, what is still required with the new \`pre' value). -__EOF0__ -} - -function prompt_grml-chroot_help () { - cat <<__EOF0__ - prompt grml-chroot - - This is a variation of the grml prompt, see: prompt -h grml - - The main difference is the default value of the \`items' style. The rest - behaves exactly the same. Here are the defaults for \`grml-chroot': - - - left: grml-chroot user at host path percent - - right: (empty list) -__EOF0__ -} - -function prompt_grml-large_help () { - cat <<__EOF0__ - prompt grml-large - - This is a variation of the grml prompt, see: prompt -h grml - - The main difference is the default value of the \`items' style. In - particular, this theme uses _two_ lines instead of one with the plain - \`grml' theme. The rest behaves exactly the same. Here are the defaults - for \`grml-large': - - - left: rc jobs history shell-level change-root time date newline user - at host path vcs percent - - right: sad-smiley -__EOF0__ -} - -function grml_prompt_setup () { - emulate -L zsh - autoload -Uz vcs_info - autoload -Uz add-zsh-hook - add-zsh-hook precmd prompt_$1_precmd -} - -function prompt_grml_setup () { - grml_prompt_setup grml -} - -function prompt_grml-chroot_setup () { - grml_prompt_setup grml-chroot -} - -function prompt_grml-large_setup () { - grml_prompt_setup grml-large -} - -# These maps define default tokens and pre-/post-decoration for items to be -# used within the themes. All defaults may be customised in a context sensitive -# matter by using zsh's `zstyle' mechanism. -typeset -gA grml_prompt_pre_default \ - grml_prompt_post_default \ - grml_prompt_token_default \ - grml_prompt_token_function - -grml_prompt_pre_default=( - at '' - battery ' ' - change-root '' - date '%F{blue}' - grml-chroot '%F{red}' - history '%F{green}' - host '' - jobs '%F{cyan}' - newline '' - path '%B' - percent '' - rc '%B%F{red}' - rc-always '' - sad-smiley '' - shell-level '%F{red}' - time '%F{blue}' - user '%B%F{blue}' - vcs '' -) - -grml_prompt_post_default=( - at '' - battery '' - change-root '' - date '%f' - grml-chroot '%f ' - history '%f' - host '' - jobs '%f' - newline '' - path '%b' - percent '' - rc '%f%b' - rc-always '' - sad-smiley '' - shell-level '%f' - time '%f' - user '%f%b' - vcs '' -) - -grml_prompt_token_default=( - at '@' - battery 'PERCENT' - change-root 'debian_chroot' - date '%D{%Y-%m-%d}' - grml-chroot 'GRML_CHROOT' - history '{history#%!} ' - host '%m ' - jobs '[%j running job(s)] ' - newline $'\n' - path '%40<..<%~%<< ' - percent '%# ' - rc '%(?..%? )' - rc-always '%?' - sad-smiley '%(?..:()' - shell-level '%(3L.+ .)' - time '%D{%H:%M:%S} ' - user '%n' - vcs '0' -) - -function grml_theme_has_token () { - if (( ARGC != 1 )); then - printf 'usage: grml_theme_has_token \n' - return 1 - fi - (( ${+grml_prompt_token_default[$1]} )) -} - -function GRML_theme_add_token_usage () { - cat <<__EOF__ - Usage: grml_theme_add_token [-f|-i] [
 ]
-
-     is the name for the newly added token. If the \`-f' or \`-i' options
-    are used,  is the name of the function (see below for
-    details). Otherwise it is the literal token string to be used. 
 and
-     are optional.
-
-  Options:
-
-    -f    Use a function named \`' each time the token
-                    is to be expanded.
-
-    -i    Use a function named \`' to initialise the
-                    value of the token _once_ at runtime.
-
-    The functions are called with one argument: the token's new name. The
-    return value is expected in the \$REPLY parameter. The use of these
-    options is mutually exclusive.
-
-    There is a utility function \`grml_theme_has_token', which you can use
-    to test if a token exists before trying to add it. This can be a guard
-    for situations in which a \`grml_theme_add_token' call may happen more
-    than once.
-
-  Example:
-
-    To add a new token \`day' that expands to the current weekday in the
-    current locale in green foreground colour, use this:
-
-      grml_theme_add_token day '%D{%A}' '%F{green}' '%f'
-
-    Another example would be support for \$VIRTUAL_ENV:
-
-      function virtual_env_prompt () {
-        REPLY=\${VIRTUAL_ENV+\${VIRTUAL_ENV:t} }
-      }
-      grml_theme_add_token virtual-env -f virtual_env_prompt
-
-    After that, you will be able to use a changed \`items' style to
-    assemble your prompt.
-__EOF__
-}
-
-function grml_theme_add_token () {
-    emulate -L zsh
-    local name token pre post
-    local -i init funcall
-
-    if (( ARGC == 0 )); then
-        GRML_theme_add_token_usage
-        return 0
-    fi
-
-    init=0
-    funcall=0
-    pre=''
-    post=''
-    name=$1
-    shift
-    if [[ $1 == '-f' ]]; then
-        funcall=1
-        shift
-    elif [[ $1 == '-i' ]]; then
-        init=1
-        shift
-    fi
-
-    if (( ARGC == 0 )); then
-        printf '
-grml_theme_add_token: No token-string/function-name provided!\n\n'
-        GRML_theme_add_token_usage
-        return 1
-    fi
-    token=$1
-    shift
-    if (( ARGC != 0 && ARGC != 2 )); then
-        printf '
-grml_theme_add_token: 
 and  need to by specified _both_!\n\n'
-        GRML_theme_add_token_usage
-        return 1
-    fi
-    if (( ARGC )); then
-        pre=$1
-        post=$2
-        shift 2
-    fi
-
-    if grml_theme_has_token $name; then
-        printf '
-grml_theme_add_token: Token `%s'\'' exists! Giving up!\n\n' $name
-        GRML_theme_add_token_usage
-        return 2
-    fi
-    if (( init )); then
-        $token $name
-        token=$REPLY
-    fi
-    grml_prompt_pre_default[$name]=$pre
-    grml_prompt_post_default[$name]=$post
-    if (( funcall )); then
-        grml_prompt_token_function[$name]=$token
-        grml_prompt_token_default[$name]=23
-    else
-        grml_prompt_token_default[$name]=$token
-    fi
-}
-
-function grml_typeset_and_wrap () {
-    emulate -L zsh
-    local target="$1"
-    local new="$2"
-    local left="$3"
-    local right="$4"
-
-    if (( ${+parameters[$new]} )); then
-        typeset -g "${target}=${(P)target}${left}${(P)new}${right}"
-    fi
-}
-
-function grml_prompt_addto () {
-    emulate -L zsh
-    local target="$1"
-    local lr it apre apost new v
-    local -a items
-    shift
-
-    [[ $target == PS1 ]] && lr=left || lr=right
-    zstyle -a ":prompt:${grmltheme}:${lr}:setup" items items || items=( "$@" )
-    typeset -g "${target}="
-    for it in "${items[@]}"; do
-        zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" pre apre \
-            || apre=${grml_prompt_pre_default[$it]}
-        zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" post apost \
-            || apost=${grml_prompt_post_default[$it]}
-        zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" token new \
-            || new=${grml_prompt_token_default[$it]}
-        typeset -g "${target}=${(P)target}${apre}"
-        if (( ${+grml_prompt_token_function[$it]} )); then
-            ${grml_prompt_token_function[$it]} $it
-            typeset -g "${target}=${(P)target}${REPLY}"
-        else
-            case $it in
-            battery)
-                grml_typeset_and_wrap $target $new '' ''
-                ;;
-            change-root)
-                grml_typeset_and_wrap $target $new '(' ')'
-                ;;
-            grml-chroot)
-                if [[ -n ${(P)new} ]]; then
-                    typeset -g "${target}=${(P)target}(CHROOT)"
-                fi
-                ;;
-            vcs)
-                v="vcs_info_msg_${new}_"
-                if (( ! vcscalled )); then
-                    vcs_info
-                    vcscalled=1
-                fi
-                if (( ${+parameters[$v]} )) && [[ -n "${(P)v}" ]]; then
-                    typeset -g "${target}=${(P)target}${(P)v}"
-                fi
-                ;;
-            *) typeset -g "${target}=${(P)target}${new}" ;;
-            esac
-        fi
-        typeset -g "${target}=${(P)target}${apost}"
-    done
-}
-
-function prompt_grml_precmd () {
-    emulate -L zsh
-    local grmltheme=grml
-    local -a left_items right_items
-    left_items=(rc change-root user at host path vcs percent)
-    right_items=(sad-smiley)
-
-    prompt_grml_precmd_worker
-}
-
-function prompt_grml-chroot_precmd () {
-    emulate -L zsh
-    local grmltheme=grml-chroot
-    local -a left_items right_items
-    left_items=(grml-chroot user at host path percent)
-    right_items=()
-
-    prompt_grml_precmd_worker
-}
-
-function prompt_grml-large_precmd () {
-    emulate -L zsh
-    local grmltheme=grml-large
-    local -a left_items right_items
-    left_items=(rc jobs history shell-level change-root time date newline
-                user at host path vcs percent)
-    right_items=(sad-smiley)
-
-    prompt_grml_precmd_worker
-}
-
-function prompt_grml_precmd_worker () {
-    emulate -L zsh
-    local -i vcscalled=0
-
-    grml_prompt_addto PS1 "${left_items[@]}"
-    if zstyle -T ":prompt:${grmltheme}:right:setup" use-rprompt; then
-        grml_prompt_addto RPS1 "${right_items[@]}"
-    fi
-}
-
-grml_prompt_fallback() {
-    setopt prompt_subst
-    precmd() {
-        (( ${+functions[vcs_info]} )) && vcs_info
-    }
-
-    p0="${RED}%(?..%? )${WHITE}${debian_chroot:+($debian_chroot)}"
-    p1="${BLUE}%n${NO_COLOR}@%m %40<...<%B%~%b%<< "'${vcs_info_msg_0_}'"%# "
-    if (( EUID == 0 )); then
-        PROMPT="${BLUE}${p0}${RED}${p1}"
-    else
-        PROMPT="${RED}${p0}${BLUE}${p1}"
-    fi
-    unset p0 p1
-}
-
-if zrcautoload promptinit && promptinit 2>/dev/null ; then
-    # Since we define the required functions in here and not in files in
-    # $fpath, we need to stick the theme's name into `$prompt_themes'
-    # ourselves, since promptinit does not pick them up otherwise.
-    prompt_themes+=( grml grml-chroot grml-large )
-    # Also, keep the array sorted...
-    prompt_themes=( "${(@on)prompt_themes}" )
-else
-    print 'Notice: no promptinit available :('
-    grml_prompt_fallback
-fi
-
-if is437; then
-    # The prompt themes use modern features of zsh, that require at least
-    # version 4.3.7 of the shell. Use the fallback otherwise.
-    if [[ $BATTERY -gt 0 ]]; then
-        zstyle ':prompt:grml:right:setup' items sad-smiley battery
-        add-zsh-hook precmd battery
-    fi
-    if [[ "$TERM" == dumb ]] ; then
-        zstyle ":prompt:grml(|-large|-chroot):*:items:grml-chroot" pre ''
-        zstyle ":prompt:grml(|-large|-chroot):*:items:grml-chroot" post ' '
-        for i in rc user path jobs history date time shell-level; do
-            zstyle ":prompt:grml(|-large|-chroot):*:items:$i" pre ''
-            zstyle ":prompt:grml(|-large|-chroot):*:items:$i" post ''
-        done
-        unset i
-        zstyle ':prompt:grml(|-large|-chroot):right:setup' use-rprompt false
-    elif (( EUID == 0 )); then
-        zstyle ':prompt:grml(|-large|-chroot):*:items:user' pre '%B%F{red}'
-    fi
-
-    # Finally enable one of the prompts.
-    if [[ -n $GRML_CHROOT ]]; then
-        prompt grml-chroot
-    elif [[ $GRMLPROMPT -gt 0 ]]; then
-        prompt grml-large
-    else
-        prompt grml
-    fi
-else
-    grml_prompt_fallback
-fi
-
-# Terminal-title wizardry
-
-function ESC_print () {
-    info_print $'\ek' $'\e\\' "$@"
-}
-function set_title () {
-    info_print  $'\e]0;' $'\a' "$@"
-}
-
-function info_print () {
-    local esc_begin esc_end
-    esc_begin="$1"
-    esc_end="$2"
-    shift 2
-    printf '%s' ${esc_begin}
-    printf '%s' "$*"
-    printf '%s' "${esc_end}"
-}
-
-function grml_reset_screen_title () {
-    # adjust title of xterm
-    # see http://www.faqs.org/docs/Linux-mini/Xterm-Title.html
-    [[ ${NOTITLE:-} -gt 0 ]] && return 0
-    case $TERM in
-        (xterm*|rxvt*)
-            set_title ${(%):-"%n@%m: %~"}
-            ;;
-    esac
-}
-
-function grml_vcs_to_screen_title () {
-    if [[ $TERM == screen* ]] ; then
-        if [[ -n ${vcs_info_msg_1_} ]] ; then
-            ESC_print ${vcs_info_msg_1_}
-        else
-            ESC_print "zsh"
-        fi
-    fi
-}
-
-function grml_maintain_name () {
-    # set hostname if not running on host with name 'grml'
-    if [[ -n "$HOSTNAME" ]] && [[ "$HOSTNAME" != $(hostname) ]] ; then
-       NAME="@$HOSTNAME"
-    fi
-}
-
-function grml_cmd_to_screen_title () {
-    # get the name of the program currently running and hostname of local
-    # machine set screen window title if running in a screen
-    if [[ "$TERM" == screen* ]] ; then
-        local CMD="${1[(wr)^(*=*|sudo|ssh|-*)]}$NAME"
-        ESC_print ${CMD}
-    fi
-}
-
-function grml_control_xterm_title () {
-    case $TERM in
-        (xterm*|rxvt*)
-            set_title "${(%):-"%n@%m:"}" "$1"
-            ;;
-    esac
-}
-
-zrcautoload add-zsh-hook || add-zsh-hook () { :; }
-if [[ $NOPRECMD -eq 0 ]]; then
-    add-zsh-hook precmd grml_reset_screen_title
-    add-zsh-hook precmd grml_vcs_to_screen_title
-    add-zsh-hook preexec grml_maintain_name
-    add-zsh-hook preexec grml_cmd_to_screen_title
-    if [[ $NOTITLE -eq 0 ]]; then
-        add-zsh-hook preexec grml_control_xterm_title
-    fi
-fi
-
-# 'hash' some often used directories
-#d# start
-hash -d deb=/var/cache/apt/archives
-hash -d doc=/usr/share/doc
-hash -d linux=/lib/modules/$(command uname -r)/build/
-hash -d log=/var/log
-hash -d slog=/var/log/syslog
-hash -d src=/usr/src
-hash -d templ=/usr/share/doc/grml-templates
-hash -d tt=/usr/share/doc/texttools-doc
-hash -d www=/var/www
-#d# end
-
-# some aliases
-if check_com -c screen ; then
-    if [[ $UID -eq 0 ]] ; then
-        if [[ -r /etc/grml/screenrc ]]; then
-            alias screen="${commands[screen]} -c /etc/grml/screenrc"
-        fi
-    elif [[ -r $HOME/.screenrc ]] ; then
-        alias screen="${commands[screen]} -c $HOME/.screenrc"
-    else
-        if [[ -r /etc/grml/screenrc_grml ]]; then
-            alias screen="${commands[screen]} -c /etc/grml/screenrc_grml"
-        else
-            if [[ -r /etc/grml/screenrc ]]; then
-                alias screen="${commands[screen]} -c /etc/grml/screenrc"
-            fi
-        fi
-    fi
-fi
-
-# do we have GNU ls with color-support?
-if [[ "$TERM" != dumb ]]; then
-    #a1# List files with colors (\kbd{ls -b -CF \ldots})
-    alias ls='ls -b -CF '${ls_options:+"${ls_options[*]}"}
-    #a1# List all files, with colors (\kbd{ls -la \ldots})
-    alias la='ls -la '${ls_options:+"${ls_options[*]}"}
-    #a1# List files with long colored list, without dotfiles (\kbd{ls -l \ldots})
-    alias ll='ls -l '${ls_options:+"${ls_options[*]}"}
-    #a1# List files with long colored list, human readable sizes (\kbd{ls -hAl \ldots})
-    alias lh='ls -hAl '${ls_options:+"${ls_options[*]}"}
-    #a1# List files with long colored list, append qualifier to filenames (\kbd{ls -lF \ldots})\\&\quad(\kbd{/} for directories, \kbd{@} for symlinks ...)
-    alias l='ls -lF '${ls_options:+"${ls_options[*]}"}
-else
-    alias ls='ls -b -CF'
-    alias la='ls -la'
-    alias ll='ls -l'
-    alias lh='ls -hAl'
-    alias l='ls -lF'
-fi
-
-alias mdstat='cat /proc/mdstat'
-alias ...='cd ../../'
-
-# generate alias named "$KERNELVERSION-reboot" so you can use boot with kexec:
-if [[ -x /sbin/kexec ]] && [[ -r /proc/cmdline ]] ; then
-    alias "$(uname -r)-reboot"="kexec -l --initrd=/boot/initrd.img-"$(uname -r)" --command-line=\"$(cat /proc/cmdline)\" /boot/vmlinuz-"$(uname -r)""
-fi
-
-# see http://www.cl.cam.ac.uk/~mgk25/unicode.html#term for details
-alias term2iso="echo 'Setting terminal to iso mode' ; print -n '\e%@'"
-alias term2utf="echo 'Setting terminal to utf-8 mode'; print -n '\e%G'"
-
-# make sure it is not assigned yet
-[[ -n ${aliases[utf2iso]} ]] && unalias utf2iso
-utf2iso() {
-    if isutfenv ; then
-        for ENV in $(env | command grep -i '.utf') ; do
-            eval export "$(echo $ENV | sed 's/UTF-8/iso885915/ ; s/utf8/iso885915/')"
-        done
-    fi
-}
-
-# make sure it is not assigned yet
-[[ -n ${aliases[iso2utf]} ]] && unalias iso2utf
-iso2utf() {
-    if ! isutfenv ; then
-        for ENV in $(env | command grep -i '\.iso') ; do
-            eval export "$(echo $ENV | sed 's/iso.*/UTF-8/ ; s/ISO.*/UTF-8/')"
-        done
-    fi
-}
-
-# especially for roadwarriors using GNU screen and ssh:
-if ! check_com asc &>/dev/null ; then
-  asc() { autossh -t "$@" 'screen -RdU' }
-  compdef asc=ssh
-fi
-
-#f1# Hints for the use of zsh on grml
-zsh-help() {
-    print "$bg[white]$fg[black]
-zsh-help - hints for use of zsh on grml
-=======================================$reset_color"
-
-    print '
-Main configuration of zsh happens in /etc/zsh/zshrc.
-That file is part of the package grml-etc-core, if you want to
-use them on a non-grml-system just get the tar.gz from
-http://deb.grml.org/ or (preferably) get it from the git repository:
-
-  http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
-
-This version of grml'\''s zsh setup does not use skel/.zshrc anymore.
-The file is still there, but it is empty for backwards compatibility.
-
-For your own changes use these two files:
-    $HOME/.zshrc.pre
-    $HOME/.zshrc.local
-
-The former is sourced very early in our zshrc, the latter is sourced
-very lately.
-
-System wide configuration without touching configuration files of grml
-can take place in /etc/zsh/zshrc.local.
-
-For information regarding zsh start at http://grml.org/zsh/
-
-Take a look at grml'\''s zsh refcard:
-% xpdf =(zcat /usr/share/doc/grml-docs/zsh/grml-zsh-refcard.pdf.gz)
-
-Check out the main zsh refcard:
-% '$BROWSER' http://www.bash2zsh.com/zsh_refcard/refcard.pdf
-
-And of course visit the zsh-lovers:
-% man zsh-lovers
-
-You can adjust some options through environment variables when
-invoking zsh without having to edit configuration files.
-Basically meant for bash users who are not used to the power of
-the zsh yet. :)
-
-  "NOCOR=1    zsh" => deactivate automatic correction
-  "NOMENU=1   zsh" => do not use auto menu completion
-                      (note: use ctrl-d for completion instead!)
-  "NOPRECMD=1 zsh" => disable the precmd + preexec commands (set GNU screen title)
-  "NOTITLE=1  zsh" => disable setting the title of xterms without disabling
-                      preexec() and precmd() completely
-  "BATTERY=1  zsh" => activate battery status (via acpi) on right side of prompt
-  "COMMAND_NOT_FOUND=1 zsh"
-                   => Enable a handler if an external command was not found
-                      The command called in the handler can be altered by setting
-                      the GRML_ZSH_CNF_HANDLER variable, the default is:
-                      "/usr/share/command-not-found/command-not-found"
-
-A value greater than 0 is enables a feature; a value equal to zero
-disables it. If you like one or the other of these settings, you can
-add them to ~/.zshrc.pre to ensure they are set when sourcing grml'\''s
-zshrc.'
-
-    print "
-$bg[white]$fg[black]
-Please report wishes + bugs to the grml-team: http://grml.org/bugs/
-Enjoy your grml system with the zsh!$reset_color"
-}
-
-# debian stuff
-if [[ -r /etc/debian_version ]] ; then
-    #a3# Execute \kbd{apt-cache search}
-    alias acs='apt-cache search'
-    #a3# Execute \kbd{apt-cache show}
-    alias acsh='apt-cache show'
-    #a3# Execute \kbd{apt-cache policy}
-    alias acp='apt-cache policy'
-    #a3# Execute \kbd{apt-get dist-upgrade}
-    salias adg="apt-get dist-upgrade"
-    #a3# Execute \kbd{apt-get install}
-    salias agi="apt-get install"
-    #a3# Execute \kbd{aptitude install}
-    salias ati="aptitude install"
-    #a3# Execute \kbd{apt-get upgrade}
-    salias ag="apt-get upgrade"
-    #a3# Execute \kbd{apt-get update}
-    salias au="apt-get update"
-    #a3# Execute \kbd{aptitude update ; aptitude safe-upgrade}
-    salias -a up="aptitude update ; aptitude safe-upgrade"
-    #a3# Execute \kbd{dpkg-buildpackage}
-    alias dbp='dpkg-buildpackage'
-    #a3# Execute \kbd{grep-excuses}
-    alias ge='grep-excuses'
-
-    # get a root shell as normal user in live-cd mode:
-    if isgrmlcd && [[ $UID -ne 0 ]] ; then
-       alias su="sudo su"
-     fi
-
-    #a1# Take a look at the syslog: \kbd{\$PAGER /var/log/syslog}
-    salias llog="$PAGER /var/log/syslog"     # take a look at the syslog
-    #a1# Take a look at the syslog: \kbd{tail -f /var/log/syslog}
-    salias tlog="tail -f /var/log/syslog"    # follow the syslog
-fi
-
-# sort installed Debian-packages by size
-if check_com -c dpkg-query ; then
-    #a3# List installed Debian-packages sorted by size
-    alias debs-by-size="dpkg-query -Wf 'x \${Installed-Size} \${Package} \${Status}\n' | sed -ne '/^x  /d' -e '/^x \(.*\) install ok installed$/s//\1/p' | sort -nr"
-fi
-
-# if cdrecord is a symlink (to wodim) or isn't present at all warn:
-if [[ -L /usr/bin/cdrecord ]] || ! check_com -c cdrecord; then
-    if check_com -c wodim; then
-        cdrecord() {
-            cat <\n' "$0" && return 1
-    for file in "$@" ; do
-        while [[ -h "$file" ]] ; do
-            ls -l $file
-            file=$(readlink "$file")
-        done
-    done
-}
-
-# TODO: Is it supported to use pager settings like this?
-#   PAGER='less -Mr' - If so, the use of $PAGER here needs fixing
-# with respect to wordsplitting. (ie. ${=PAGER})
-if check_com -c $PAGER ; then
-    #f3# View Debian's changelog of a given package
-    dchange() {
-        emulate -L zsh
-        if [[ -r /usr/share/doc/$1/changelog.Debian.gz ]] ; then
-            $PAGER /usr/share/doc/$1/changelog.Debian.gz
-        elif [[ -r /usr/share/doc/$1/changelog.gz ]] ; then
-            $PAGER /usr/share/doc/$1/changelog.gz
-        else
-            if check_com -c aptitude ; then
-                echo "No changelog for package $1 found, using aptitude to retrieve it."
-                if isgrml ; then
-                    aptitude -t unstable changelog $1
-                else
-                    aptitude changelog $1
-                fi
-            else
-                echo "No changelog for package $1 found, sorry."
-                return 1
-            fi
-        fi
-    }
-    _dchange() { _files -W /usr/share/doc -/ }
-    compdef _dchange dchange
-
-    #f3# View Debian's NEWS of a given package
-    dnews() {
-        emulate -L zsh
-        if [[ -r /usr/share/doc/$1/NEWS.Debian.gz ]] ; then
-            $PAGER /usr/share/doc/$1/NEWS.Debian.gz
-        else
-            if [[ -r /usr/share/doc/$1/NEWS.gz ]] ; then
-                $PAGER /usr/share/doc/$1/NEWS.gz
-            else
-                echo "No NEWS file for package $1 found, sorry."
-                return 1
-            fi
-        fi
-    }
-    _dnews() { _files -W /usr/share/doc -/ }
-    compdef _dnews dnews
-
-    #f3# View Debian's copyright of a given package
-    dcopyright() {
-        emulate -L zsh
-        if [[ -r /usr/share/doc/$1/copyright ]] ; then
-            $PAGER /usr/share/doc/$1/copyright
-        else
-            echo "No copyright file for package $1 found, sorry."
-            return 1
-        fi
-    }
-    _dcopyright() { _files -W /usr/share/doc -/ }
-    compdef _dcopyright dcopyright
-
-    #f3# View upstream's changelog of a given package
-    uchange() {
-        emulate -L zsh
-        if [[ -r /usr/share/doc/$1/changelog.gz ]] ; then
-            $PAGER /usr/share/doc/$1/changelog.gz
-        else
-            echo "No changelog for package $1 found, sorry."
-            return 1
-        fi
-    }
-    _uchange() { _files -W /usr/share/doc -/ }
-    compdef _uchange uchange
-fi
-
-# zsh profiling
-profile() {
-    ZSH_PROFILE_RC=1 $SHELL "$@"
-}
-
-#f1# Edit an alias via zle
-edalias() {
-    [[ -z "$1" ]] && { echo "Usage: edalias " ; return 1 } || vared aliases'[$1]' ;
-}
-compdef _aliases edalias
-
-#f1# Edit a function via zle
-edfunc() {
-    [[ -z "$1" ]] && { echo "Usage: edfunc " ; return 1 } || zed -f "$1" ;
-}
-compdef _functions edfunc
-
-# use it e.g. via 'Restart apache2'
-#m# f6 Start() \kbd{/etc/init.d/\em{process}}\quad\kbd{start}
-#m# f6 Restart() \kbd{/etc/init.d/\em{process}}\quad\kbd{restart}
-#m# f6 Stop() \kbd{/etc/init.d/\em{process}}\quad\kbd{stop}
-#m# f6 Reload() \kbd{/etc/init.d/\em{process}}\quad\kbd{reload}
-#m# f6 Force-Reload() \kbd{/etc/init.d/\em{process}}\quad\kbd{force-reload}
-#m# f6 Status() \kbd{/etc/init.d/\em{process}}\quad\kbd{status}
-if [[ -d /etc/init.d || -d /etc/service ]] ; then
-    __start_stop() {
-        local action_="${1:l}"  # e.g Start/Stop/Restart
-        local service_="$2"
-        local param_="$3"
-
-        local service_target_="$(readlink /etc/init.d/$service_)"
-        if [[ $service_target_ == "/usr/bin/sv" ]]; then
-            # runit
-            case "${action_}" in
-                start) if [[ ! -e /etc/service/$service_ ]]; then
-                           $SUDO ln -s "/etc/sv/$service_" "/etc/service/"
-                       else
-                           $SUDO "/etc/init.d/$service_" "${action_}" "$param_"
-                       fi ;;
-                # there is no reload in runits sysv emulation
-                reload) $SUDO "/etc/init.d/$service_" "force-reload" "$param_" ;;
-                *) $SUDO "/etc/init.d/$service_" "${action_}" "$param_" ;;
-            esac
-        else
-            # sysvinit
-            $SUDO "/etc/init.d/$service_" "${action_}" "$param_"
-        fi
-    }
-
-    _grmlinitd() {
-        local -a scripts
-        scripts=( /etc/init.d/*(x:t) )
-        _describe "service startup script" scripts
-    }
-
-    for i in Start Restart Stop Force-Reload Reload Status ; do
-        eval "$i() { __start_stop $i \"\$1\" \"\$2\" ; }"
-        compdef _grmlinitd $i
-    done
-fi
-
-#f1# Provides useful information on globbing
-H-Glob() {
-    echo -e "
-    /      directories
-    .      plain files
-    @      symbolic links
-    =      sockets
-    p      named pipes (FIFOs)
-    *      executable plain files (0100)
-    %      device files (character or block special)
-    %b     block special files
-    %c     character special files
-    r      owner-readable files (0400)
-    w      owner-writable files (0200)
-    x      owner-executable files (0100)
-    A      group-readable files (0040)
-    I      group-writable files (0020)
-    E      group-executable files (0010)
-    R      world-readable files (0004)
-    W      world-writable files (0002)
-    X      world-executable files (0001)
-    s      setuid files (04000)
-    S      setgid files (02000)
-    t      files with the sticky bit (01000)
-
-  print *(m-1)          # Files modified up to a day ago
-  print *(a1)           # Files accessed a day ago
-  print *(@)            # Just symlinks
-  print *(Lk+50)        # Files bigger than 50 kilobytes
-  print *(Lk-50)        # Files smaller than 50 kilobytes
-  print **/*.c          # All *.c files recursively starting in \$PWD
-  print **/*.c~file.c   # Same as above, but excluding 'file.c'
-  print (foo|bar).*     # Files starting with 'foo' or 'bar'
-  print *~*.*           # All Files that do not contain a dot
-  chmod 644 *(.^x)      # make all plain non-executable files publically readable
-  print -l *(.c|.h)     # Lists *.c and *.h
-  print **/*(g:users:)  # Recursively match all files that are owned by group 'users'
-  echo /proc/*/cwd(:h:t:s/self//) # Analogous to >ps ax | awk '{print $1}'<"
-}
-alias help-zshglob=H-Glob
-
-# grep for running process, like: 'any vim'
-any() {
-    emulate -L zsh
-    unsetopt KSH_ARRAYS
-    if [[ -z "$1" ]] ; then
-        echo "any - grep for process(es) by keyword" >&2
-        echo "Usage: any " >&2 ; return 1
-    else
-        ps xauwww | grep -i "${grep_options[@]}" "[${1[1]}]${1[2,-1]}"
-    fi
-}
-
-
-# After resuming from suspend, system is paging heavily, leading to very bad interactivity.
-# taken from $LINUX-KERNELSOURCE/Documentation/power/swsusp.txt
-[[ -r /proc/1/maps ]] && \
-deswap() {
-    print 'Reading /proc/[0-9]*/maps and sending output to /dev/null, this might take a while.'
-    cat $(sed -ne 's:.* /:/:p' /proc/[0-9]*/maps | sort -u | grep -v '^/dev/')  > /dev/null
-    print 'Finished, running "swapoff -a; swapon -a" may also be useful.'
-}
-
-# a wrapper for vim, that deals with title setting
-#   VIM_OPTIONS
-#       set this array to a set of options to vim you always want
-#       to have set when calling vim (in .zshrc.local), like:
-#           VIM_OPTIONS=( -p )
-#       This will cause vim to send every file given on the
-#       commandline to be send to it's own tab (needs vim7).
-if check_com vim; then
-    vim() {
-        VIM_PLEASE_SET_TITLE='yes' command vim ${VIM_OPTIONS} "$@"
-    }
-fi
-
-# make a backup of a file
-bk() {
-    cp -a "$1" "${1}_$(date --iso-8601=seconds)"
-}
-
-ssl_hashes=( sha512 sha256 sha1 md5 )
-
-for sh in ${ssl_hashes}; do
-    eval 'ssl-cert-'${sh}'() {
-        emulate -L zsh
-        if [[ -z $1 ]] ; then
-            printf '\''usage: %s \n'\'' "ssh-cert-'${sh}'"
-            return 1
-        fi
-        openssl x509 -noout -fingerprint -'${sh}' -in $1
-    }'
-done; unset sh
-
-ssl-cert-fingerprints() {
-    emulate -L zsh
-    local i
-    if [[ -z $1 ]] ; then
-        printf 'usage: ssl-cert-fingerprints \n'
-        return 1
-    fi
-    for i in ${ssl_hashes}
-        do ssl-cert-$i $1;
-    done
-}
-
-ssl-cert-info() {
-    emulate -L zsh
-    if [[ -z $1 ]] ; then
-        printf 'usage: ssl-cert-info \n'
-        return 1
-    fi
-    openssl x509 -noout -text -in $1
-    ssl-cert-fingerprints $1
-}
-
-# make sure our environment is clean regarding colors
-for color in BLUE RED GREEN CYAN YELLOW MAGENTA WHITE ; unset $color
-
-# "persistent history"
-# just write important commands you always need to ~/.important_commands
-if [[ -r ~/.important_commands ]] ; then
-    fc -R ~/.important_commands
-fi
-
-# load the lookup subsystem if it's available on the system
-zrcautoload lookupinit && lookupinit
-
-# variables
-
-# set terminal property (used e.g. by msgid-chooser)
-export COLORTERM="yes"
-
-# aliases
-
-# general
-#a2# Execute \kbd{du -sch}
-alias da='du -sch'
-#a2# Execute \kbd{jobs -l}
-alias j='jobs -l'
-
-# listing stuff
-#a2# Execute \kbd{ls -lSrah}
-alias dir="ls -lSrah"
-#a2# Only show dot-directories
-alias lad='ls -d .*(/)'
-#a2# Only show dot-files
-alias lsa='ls -a .*(.)'
-#a2# Only files with setgid/setuid/sticky flag
-alias lss='ls -l *(s,S,t)'
-#a2# Only show symlinks
-alias lsl='ls -l *(@)'
-#a2# Display only executables
-alias lsx='ls -l *(*)'
-#a2# Display world-{readable,writable,executable} files
-alias lsw='ls -ld *(R,W,X.^ND/)'
-#a2# Display the ten biggest files
-alias lsbig="ls -flh *(.OL[1,10])"
-#a2# Only show directories
-alias lsd='ls -d *(/)'
-#a2# Only show empty directories
-alias lse='ls -d *(/^F)'
-#a2# Display the ten newest files
-alias lsnew="ls -rtlh *(D.om[1,10])"
-#a2# Display the ten oldest files
-alias lsold="ls -rtlh *(D.Om[1,10])"
-#a2# Display the ten smallest files
-alias lssmall="ls -Srl *(.oL[1,10])"
-#a2# Display the ten newest directories and ten newest .directories
-alias lsnewdir="ls -rthdl *(/om[1,10]) .*(D/om[1,10])"
-#a2# Display the ten oldest directories and ten oldest .directories
-alias lsolddir="ls -rthdl *(/Om[1,10]) .*(D/Om[1,10])"
-
-# some useful aliases
-#a2# Remove current empty directory. Execute \kbd{cd ..; rmdir \$OLDCWD}
-alias rmcdir='cd ..; rmdir $OLDPWD || cd $OLDPWD'
-
-#a2# ssh with StrictHostKeyChecking=no \\&\quad and UserKnownHostsFile unset
-alias insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
-#a2# scp with StrictHostKeyChecking=no \\&\quad and UserKnownHostsFile unset
-alias insecscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
-
-# work around non utf8 capable software in utf environment via $LANG and luit
-if check_com isutfenv && check_com luit ; then
-    if check_com -c mrxvt ; then
-        isutfenv && [[ -n "$LANG" ]] && \
-            alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit mrxvt"
-    fi
-
-    if check_com -c aterm ; then
-        isutfenv && [[ -n "$LANG" ]] && \
-            alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit aterm"
-    fi
-
-    if check_com -c centericq ; then
-        isutfenv && [[ -n "$LANG" ]] && \
-            alias centericq="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit centericq"
-    fi
-fi
-
-# useful functions
-
-#f5# Backup \kbd{file {\rm to} file\_timestamp}
-bk() {
-    emulate -L zsh
-    cp -b $1 $1_`date --iso-8601=m`
-}
-
-#f5# cd to directoy and list files
-cl() {
-    emulate -L zsh
-    cd $1 && ls -a
-}
-
-# smart cd function, allows switching to /etc when running 'cd /etc/fstab'
-cd() {
-    if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then
-        [[ ! -e ${1:h} ]] && return 1
-        print "Correcting ${1} to ${1:h}"
-        builtin cd ${1:h}
-    else
-        builtin cd "$@"
-    fi
-}
-
-#f5# Create Directoy and \kbd{cd} to it
-mkcd() {
-    if (( ARGC != 1 )); then
-        printf 'usage: mkcd \n'
-        return 1;
-    fi
-    if [[ ! -d "$1" ]]; then
-        command mkdir -p "$1"
-    else
-        printf '`%s'\'' already exists: cd-ing.\n' "$1"
-    fi
-    builtin cd "$1"
-}
-
-#f5# Create temporary directory and \kbd{cd} to it
-cdt() {
-    local t
-    t=$(mktemp -d)
-    echo "$t"
-    builtin cd "$t"
-}
-
-#f5# List files which have been accessed within the last {\it n} days, {\it n} defaults to 1
-accessed() {
-    emulate -L zsh
-    print -l -- *(a-${1:-1})
-}
-
-#f5# List files which have been changed within the last {\it n} days, {\it n} defaults to 1
-changed() {
-    emulate -L zsh
-    print -l -- *(c-${1:-1})
-}
-
-#f5# List files which have been modified within the last {\it n} days, {\it n} defaults to 1
-modified() {
-    emulate -L zsh
-    print -l -- *(m-${1:-1})
-}
-# modified() was named new() in earlier versions, add an alias for backwards compatibility
-check_com new || alias new=modified
-
-# use colors when GNU grep with color-support
-#a2# Execute \kbd{grep -{}-color=auto}
-(( $#grep_options > 0 )) && alias grep='grep '${grep_options:+"${grep_options[*]}"}
-
-# Translate DE<=>EN
-# 'translate' looks up fot a word in a file with language-to-language
-# translations (field separator should be " : "). A typical wordlist looks
-# like at follows:
-#  | english-word : german-transmission
-# It's also only possible to translate english to german but not reciprocal.
-# Use the following oneliner to turn back the sort order:
-#  $ awk -F ':' '{ print $2" : "$1" "$3 }' \
-#    /usr/local/lib/words/en-de.ISO-8859-1.vok > ~/.translate/de-en.ISO-8859-1.vok
-#f5# Translates a word
-trans() {
-    emulate -L zsh
-    case "$1" in
-        -[dD]*)
-            translate -l de-en $2
-            ;;
-        -[eE]*)
-            translate -l en-de $2
-            ;;
-        *)
-            echo "Usage: $0 { -D | -E }"
-            echo "         -D == German to English"
-            echo "         -E == English to German"
-    esac
-}
-
-# Usage: simple-extract 
-# Using option -d deletes the original archive file.
-#f5# Smart archive extractor
-simple-extract() {
-    emulate -L zsh
-    setopt extended_glob noclobber
-    local DELETE_ORIGINAL DECOMP_CMD USES_STDIN USES_STDOUT GZTARGET WGET_CMD
-    local RC=0
-    zparseopts -D -E "d=DELETE_ORIGINAL"
-    for ARCHIVE in "${@}"; do
-        case $ARCHIVE in
-            *(tar.bz2|tbz2|tbz))
-                DECOMP_CMD="tar -xvjf -"
-                USES_STDIN=true
-                USES_STDOUT=false
-                ;;
-            *(tar.gz|tgz))
-                DECOMP_CMD="tar -xvzf -"
-                USES_STDIN=true
-                USES_STDOUT=false
-                ;;
-            *(tar.xz|txz|tar.lzma))
-                DECOMP_CMD="tar -xvJf -"
-                USES_STDIN=true
-                USES_STDOUT=false
-                ;;
-            *tar)
-                DECOMP_CMD="tar -xvf -"
-                USES_STDIN=true
-                USES_STDOUT=false
-                ;;
-            *rar)
-                DECOMP_CMD="unrar x"
-                USES_STDIN=false
-                USES_STDOUT=false
-                ;;
-            *lzh)
-                DECOMP_CMD="lha x"
-                USES_STDIN=false
-                USES_STDOUT=false
-                ;;
-            *7z)
-                DECOMP_CMD="7z x"
-                USES_STDIN=false
-                USES_STDOUT=false
-                ;;
-            *(zip|jar))
-                DECOMP_CMD="unzip"
-                USES_STDIN=false
-                USES_STDOUT=false
-                ;;
-            *deb)
-                DECOMP_CMD="ar -x"
-                USES_STDIN=false
-                USES_STDOUT=false
-                ;;
-            *bz2)
-                DECOMP_CMD="bzip2 -d -c -"
-                USES_STDIN=true
-                USES_STDOUT=true
-                ;;
-            *(gz|Z))
-                DECOMP_CMD="gzip -d -c -"
-                USES_STDIN=true
-                USES_STDOUT=true
-                ;;
-            *(xz|lzma))
-                DECOMP_CMD="xz -d -c -"
-                USES_STDIN=true
-                USES_STDOUT=true
-                ;;
-            *)
-                print "ERROR: '$ARCHIVE' has unrecognized archive type." >&2
-                RC=$((RC+1))
-                continue
-                ;;
-        esac
-
-        if ! check_com ${DECOMP_CMD[(w)1]}; then
-            echo "ERROR: ${DECOMP_CMD[(w)1]} not installed." >&2
-            RC=$((RC+2))
-            continue
-        fi
-
-        GZTARGET="${ARCHIVE:t:r}"
-        if [[ -f $ARCHIVE ]] ; then
-
-            print "Extracting '$ARCHIVE' ..."
-            if $USES_STDIN; then
-                if $USES_STDOUT; then
-                    ${=DECOMP_CMD} < "$ARCHIVE" > $GZTARGET
-                else
-                    ${=DECOMP_CMD} < "$ARCHIVE"
-                fi
-            else
-                if $USES_STDOUT; then
-                    ${=DECOMP_CMD} "$ARCHIVE" > $GZTARGET
-                else
-                    ${=DECOMP_CMD} "$ARCHIVE"
-                fi
-            fi
-            [[ $? -eq 0 && -n "$DELETE_ORIGINAL" ]] && rm -f "$ARCHIVE"
-
-        elif [[ "$ARCHIVE" == (#s)(https|http|ftp)://* ]] ; then
-            if check_com curl; then
-                WGET_CMD="curl -L -k -s -o -"
-            elif check_com wget; then
-                WGET_CMD="wget -q -O - --no-check-certificate"
-            else
-                print "ERROR: neither wget nor curl is installed" >&2
-                RC=$((RC+4))
-                continue
-            fi
-            print "Downloading and Extracting '$ARCHIVE' ..."
-            if $USES_STDIN; then
-                if $USES_STDOUT; then
-                    ${=WGET_CMD} "$ARCHIVE" | ${=DECOMP_CMD} > $GZTARGET
-                    RC=$((RC+$?))
-                else
-                    ${=WGET_CMD} "$ARCHIVE" | ${=DECOMP_CMD}
-                    RC=$((RC+$?))
-                fi
-            else
-                if $USES_STDOUT; then
-                    ${=DECOMP_CMD} =(${=WGET_CMD} "$ARCHIVE") > $GZTARGET
-                else
-                    ${=DECOMP_CMD} =(${=WGET_CMD} "$ARCHIVE")
-                fi
-            fi
-
-        else
-            print "ERROR: '$ARCHIVE' is neither a valid file nor a supported URI." >&2
-            RC=$((RC+8))
-        fi
-    done
-    return $RC
-}
-
-__archive_or_uri()
-{
-    _alternative \
-        'files:Archives:_files -g "*.(#l)(tar.bz2|tbz2|tbz|tar.gz|tgz|tar.xz|txz|tar.lzma|tar|rar|lzh|7z|zip|jar|deb|bz2|gz|Z|xz|lzma)"' \
-        '_urls:Remote Archives:_urls'
-}
-
-_simple_extract()
-{
-    _arguments \
-        '-d[delete original archivefile after extraction]' \
-        '*:Archive Or Uri:__archive_or_uri'
-}
-compdef _simple_extract simple-extract
-alias se=simple-extract
-
-#f5# Set all ulimit parameters to \kbd{unlimited}
-allulimit() {
-    ulimit -c unlimited
-    ulimit -d unlimited
-    ulimit -f unlimited
-    ulimit -l unlimited
-    ulimit -n unlimited
-    ulimit -s unlimited
-    ulimit -t unlimited
-}
-
-#f5# Change the xterm title from within GNU-screen
-xtrename() {
-    emulate -L zsh
-    if [[ $1 != "-f" ]] ; then
-        if [[ -z ${DISPLAY} ]] ; then
-            printf 'xtrename only makes sense in X11.\n'
-            return 1
-        fi
-    else
-        shift
-    fi
-    if [[ -z $1 ]] ; then
-        printf 'usage: xtrename [-f] "title for xterm"\n'
-        printf '  renames the title of xterm from _within_ screen.\n'
-        printf '  also works without screen.\n'
-        printf '  will not work if DISPLAY is unset, use -f to override.\n'
-        return 0
-    fi
-    print -n "\eP\e]0;${1}\C-G\e\\"
-    return 0
-}
-
-# Create small urls via http://goo.gl using curl(1).
-# API reference: https://code.google.com/apis/urlshortener/
-function zurl() {
-    emulate -L zsh
-    setopt extended_glob
-
-    if [[ -z $1 ]]; then
-        print "USAGE: zurl "
-        return 1
-    fi
-
-    local PN url prog api json contenttype item
-    local -a data
-    PN=$0
-    url=$1
-
-    # Prepend 'http://' to given URL where necessary for later output.
-    if [[ ${url} != http(s|)://* ]]; then
-        url='http://'${url}
-    fi
-
-    if check_com -c curl; then
-        prog=curl
-    else
-        print "curl is not available, but mandatory for ${PN}. Aborting."
-        return 1
-    fi
-    api='https://www.googleapis.com/urlshortener/v1/url'
-    contenttype="Content-Type: application/json"
-    json="{\"longUrl\": \"${url}\"}"
-    data=(${(f)"$($prog --silent -H ${contenttype} -d ${json} $api)"})
-    # Parse the response
-    for item in "${data[@]}"; do
-        case "$item" in
-            ' '#'"id":'*)
-                item=${item#*: \"}
-                item=${item%\",*}
-                printf '%s\n' "$item"
-                return 0
-                ;;
-        esac
-    done
-    return 1
-}
-
-#f2# Find history events by search pattern and list them by date.
-whatwhen()  {
-    emulate -L zsh
-    local usage help ident format_l format_s first_char remain first last
-    usage='USAGE: whatwhen [options]  '
-    help='Use `whatwhen -h'\'' for further explanations.'
-    ident=${(l,${#${:-Usage: }},, ,)}
-    format_l="${ident}%s\t\t\t%s\n"
-    format_s="${format_l//(\\t)##/\\t}"
-    # Make the first char of the word to search for case
-    # insensitive; e.g. [aA]
-    first_char=[${(L)1[1]}${(U)1[1]}]
-    remain=${1[2,-1]}
-    # Default search range is `-100'.
-    first=${2:-\-100}
-    # Optional, just used for ` ' given.
-    last=$3
-    case $1 in
-        ("")
-            printf '%s\n\n' 'ERROR: No search string specified. Aborting.'
-            printf '%s\n%s\n\n' ${usage} ${help} && return 1
-        ;;
-        (-h)
-            printf '%s\n\n' ${usage}
-            print 'OPTIONS:'
-            printf $format_l '-h' 'show help text'
-            print '\f'
-            print 'SEARCH RANGE:'
-            printf $format_l "'0'" 'the whole history,'
-            printf $format_l '-' 'offset to the current history number; (default: -100)'
-            printf $format_s '<[-]first> []' 'just searching within a give range'
-            printf '\n%s\n' 'EXAMPLES:'
-            printf ${format_l/(\\t)/} 'whatwhen grml' '# Range is set to -100 by default.'
-            printf $format_l 'whatwhen zsh -250'
-            printf $format_l 'whatwhen foo 1 99'
-        ;;
-        (\?)
-            printf '%s\n%s\n\n' ${usage} ${help} && return 1
-        ;;
-        (*)
-            # -l list results on stout rather than invoking $EDITOR.
-            # -i Print dates as in YYYY-MM-DD.
-            # -m Search for a - quoted - pattern within the history.
-            fc -li -m "*${first_char}${remain}*" $first $last
-        ;;
-    esac
-}
-
-# mercurial related stuff
-if check_com -c hg ; then
-    # gnu like diff for mercurial
-    # http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks
-    #f5# GNU like diff for mercurial
-    hgdi() {
-        emulate -L zsh
-        for i in $(hg status -marn "$@") ; diff -ubwd <(hg cat "$i") "$i"
-    }
-
-    # build debian package
-    #a2# Alias for \kbd{hg-buildpackage}
-    alias hbp='hg-buildpackage'
-
-    # execute commands on the versioned patch-queue from the current repos
-    alias mq='hg -R $(readlink -f $(hg root)/.hg/patches)'
-
-    # diffstat for specific version of a mercurial repository
-    #   hgstat      => display diffstat between last revision and tip
-    #   hgstat 1234 => display diffstat between revision 1234 and tip
-    #f5# Diffstat for specific version of a mercurial repos
-    hgstat() {
-        emulate -L zsh
-        [[ -n "$1" ]] && hg diff -r $1 -r tip | diffstat || hg export tip | diffstat
-    }
-
-fi # end of check whether we have the 'hg'-executable
-
-# grml-small cleanups
-
-# The following is used to remove zsh-config-items that do not work
-# in grml-small by default.
-# If you do not want these adjustments (for whatever reason), set
-# $GRMLSMALL_SPECIFIC to 0 in your .zshrc.pre file (which this configuration
-# sources if it is there).
-
-if (( GRMLSMALL_SPECIFIC > 0 )) && isgrmlsmall ; then
-
-    unset abk[V]
-    unalias    'V'      &> /dev/null
-    unfunction vman     &> /dev/null
-    unfunction viless   &> /dev/null
-    unfunction 2html    &> /dev/null
-
-    # manpages are not in grmlsmall
-    unfunction manzsh   &> /dev/null
-    unfunction man2     &> /dev/null
-
-fi
-
-zrclocal
-
-## genrefcard.pl settings
-
-### doc strings for external functions from files
-#m# f5 grml-wallpaper() Sets a wallpaper (try completion for possible values)
-
-### example: split functions-search 8,16,24,32
-#@# split functions-search 8
-
-## END OF FILE #################################################################
-# vim:filetype=zsh foldmethod=marker autoindent expandtab shiftwidth=4
-# Local variables:
-# mode: sh
-# End:
-
-if [ -f ~/.zsh_aliases ]; then
-        . ~/.zsh_aliases
-fi
diff --git a/.zshrc_orig b/.zshrc_orig
deleted file mode 100644
index 55be3ab..0000000
--- a/.zshrc_orig
+++ /dev/null
@@ -1,37 +0,0 @@
-# Set up the prompt
-
-autoload -Uz promptinit
-promptinit
-prompt adam1
-
-setopt histignorealldups sharehistory
-
-# Use emacs keybindings even if our EDITOR is set to vi
-bindkey -e
-
-# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
-HISTSIZE=1000
-SAVEHIST=1000
-HISTFILE=~/.zsh_history
-
-# Use modern completion system
-autoload -Uz compinit
-compinit
-
-zstyle ':completion:*' auto-description 'specify: %d'
-zstyle ':completion:*' completer _expand _complete _correct _approximate
-zstyle ':completion:*' format 'Completing %d'
-zstyle ':completion:*' group-name ''
-zstyle ':completion:*' menu select=2
-eval "$(dircolors -b)"
-zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
-zstyle ':completion:*' list-colors ''
-zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
-zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
-zstyle ':completion:*' menu select=long
-zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
-zstyle ':completion:*' use-compctl false
-zstyle ':completion:*' verbose true
-
-zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
-zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
diff --git a/bin/dirhistory.sh b/bin/dirhistory.sh
new file mode 100644
index 0000000..cc652d2
--- /dev/null
+++ b/bin/dirhistory.sh
@@ -0,0 +1,2 @@
+#!/bin/zsh
+for ((i=1; i<=$DIRSTACKSIZE; i++)) echo "$i $dirstack[$i]"
diff --git a/bin/play b/bin/play
new file mode 100755
index 0000000..a42a67f
--- /dev/null
+++ b/bin/play
@@ -0,0 +1,122 @@
+#!/bin/bash
+
+# bash script to play files from a slow network ressource, FTP folder, samba share or network drive etc.
+# caches the file in /tmp and moves to $ARCHIV
+# -y to skip verification
+# export global variable $ARCHIV
+# set the exit code right for quitting
+# echo "q quit 255" >> ~/.mpv/input.conf
+
+
+if [ "$1" = "-y" ] || [ "$1" = "y" ] || [ "$1" = "Y" ] || [ "$1" = "-Y" ]; then
+	verify="yes"
+	shift
+else
+	verify=0
+fi
+
+player[0]=$(command -v mpv) 		#media player of choice
+player[1]=$(command -v mplayer)
+player[2]=$(command -v vlc)		#you shouldn't use vlc
+
+for i in "${player[@]}"; do
+	if [ ! $i = "" ]; then
+		player=$i
+		break
+	fi
+done
+
+if [ ! $player ]; then
+	echo "No media player found. Please edit this script manually. I recommend the mpv. http://mpv.io"
+	exit 1
+fi
+
+if [ ! -d $ARCHIV ]; then
+	echo "Note: Variable \$ARCHIV couldn't be found. It will play the file fine, but you should consider to organize your collection."
+	read -p "You can export it temporarily. If you do, just type the path to the folder , if you don't, leave it empty. " path
+	if [ $path ] && [ -d $path ] && [ -w $path ]; then
+		export ARCHIV=$path
+		echo "Roger that!"
+	fi
+fi
+
+pwd=$(pwd)
+
+if [ -d /tmp ] && [ -w /tmp ]; then
+	tmp="/tmp"
+else
+	read -p "Please name the directory to cache the file: " tmp
+	if [ ! -d $tmp ] || [ ! -w $tmp ]; then
+		echo "Directory doesn't exist or you don't have write permission."
+		exit 1
+	fi
+fi
+
+if [[ "$@" =~ ^https?://.* ]]; then
+	read -p "Detected hyperlink. Should we try to download (caching)? Type something random to play direct with the mpv. [y/N] " download
+	if [ $download = "ja" ] || [ $download = "yes" ] || [ $download = "j" ] || [ $download = "y" ] || [ $download = "Y" ]; then
+		cd "$tmp"
+		wget  "$@" &
+	elif [ $player =~ .*/mpv$ ] && [ $download ] && ( [ ! $download = "n" ] || [ ! $download = "N" ] || [ ! $download = "no" ] || [ ! $download = "nein" ] || [ ! $download = "NO" ]); then
+		echo "Playing directly using mpv."
+		mpv "$@"
+		exit 0
+	else
+		echo "This script is designed to cache media files from a FTP share or network drive. Exiting. "
+		exit 1
+	fi
+else
+	cp "$@" $tmp &
+fi
+
+echo -n "Preparing the awesome! Starting playback in.."
+echo -n " 2,"
+sleep 1
+echo -n " 1"
+sleep 1
+echo " Start!"
+
+cd $tmp
+$player "$@"
+if [ $? -eq 0 ]; then
+	if [ -d $ARCHIV ] && [ -w $ARCHIV ]; then
+		echo "Finished $@ succesfull."
+		if [ $verify -eq 0 ]; then
+			read -p "Should we move everything to the Archiv? ($ARCHIV) [Y/n/rm/other] " verify
+		fi
+		if [ ! $verify ] || [ $verify = "ja" ] || [ $verify = "yes" ] || [ $verify = "j" ] || [ $verify = "y" ] || [ $verify = "Y" ]; then
+			echo "Moving the stuff to $ARCHIV."
+			mv -v "$@" "$ARCHIV"
+			if [ $? -eq 0 ]; then
+				cd $pwd
+				rm -v "$@"
+			fi
+		elif [ $verify = "other" ] || [ $verify = "o" ] || [ $verify = "O" ] || [ $verify = "OTHER" ]; then
+			read -p "Please tell us the absolute path: " path
+			if [ -d $path ] && [ -w $path ]; then
+				echo "Moving to $path."
+				mv -v "$@" "$path"
+				if [ $? -eq 0 ]; then
+					cd $pwd
+                                       	rm -v "$@"
+                               	fi
+			else
+				echo "Sorry, \"$path\" doesn't exist."
+				exit 1
+			fi
+		elif [ $verify = "r" ] || [ $verify = "rm" ] || [ $verify = "remove" ] || [ $verify = "RM" ] || [ $verify = "R" ]; then
+			echo "Cleaning the mess up. Only removing files from $tmp."
+			rm -v "$@"
+		else
+			echo "Okay, don't touching the files."		
+		fi
+	else
+		echo "Can't move to \"$ARCHIV\". Directory doesn't exist or you don't have write permission."
+		exit 1
+	fi
+else
+	echo "Something is broken with the media player!"
+	exit 1
+fi
+
+echo "Have a nice day!"
diff --git a/bin/playf b/bin/playf
new file mode 100755
index 0000000..12dd5cb
--- /dev/null
+++ b/bin/playf
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+mpv --playlist="$1"
diff --git a/bin/screenfetch b/bin/screenfetch
new file mode 100755
index 0000000..67a0275
--- /dev/null
+++ b/bin/screenfetch
@@ -0,0 +1,3199 @@
+#!/usr/bin/env bash
+
+# screenFetch
+
+# Script to fetch system and theme settings for screenshots in most mainstream
+# Linux distributions.
+
+# Copyright (c) 2010-2012 Brett Bohnenkamper < kittykatt AT archlinux DOT us >
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+# and associated documentation files (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# Yes, I do realize some of this is horribly ugly coding. Any ideas/suggestions would be
+# appreciated by emailing me or by stopping by http://github.com/KittyKatt/screenFetch . You
+# could also drop in on my IRC network, SilverIRC, at irc://kittykatt.silverirc.com:6667/screenFetch
+# to put forth suggestions/ideas. Thank you.
+#
+
+LANG=C
+LANGUAGE=C
+LC_ALL=C
+
+scriptVersion="3.2.0"
+
+######################
+# Settings for fetcher
+######################
+
+# This setting controls what ASCII logo is displayed. Available: Arch Linux (Old and Current Logos), Linux Mint, Ubuntu, Crunchbang, Debian, Gentoo, Mandrake/Mandriva, Slackware, SUSE, Fedora, BSD, OS X and None
+# distro="Linux"
+
+# This sets the information to be displayed. Available: distro, Kernel, DE, WM, Win_theme, Theme, Icons, Font, Background, ASCII. To get just the information, and not a text-art logo, you would take "ASCII" out of the below variable.
+#display="distro host kernel uptime pkgs shell res de wm wmtheme gtk disk cpu gpu mem"
+display=( distro host kernel uptime pkgs shell res de wm wmtheme gtk cpu gpu mem )
+# Display Type: ASCII or Text
+display_type="ASCII"
+
+# Colors to use for the information found. These are set below according to distribution. If you would like to set your OWN color scheme for these, uncomment the lines below and edit them to your heart's content.
+# textcolor="\e[0m"
+# labelcolor="\e[1;34m"
+
+# WM & DE process names
+# Removed WM's: compiz
+wmnames=( fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm fvwm dwm awesome wmaker stumpwm musca xmonad i3 ratpoison scrotwm spectrwm wmfs wmii beryl subtle e16 enlightenment sawfish emerald monsterwm dminiwm compiz Finder herbstluftwm notion bspwm )
+denames=( gnome-session xfce-mcs-manage xfce4-session xfconfd ksmserver lxsession gnome-settings-daemon mate-session mate-settings-daemon Finder )
+
+# Screenshot Settings
+# This setting lets the script know if you want to take a screenshot or not. 1=Yes 0=No
+screenshot=
+# You can specify a custom screenshot command here. Just uncomment and edit. Otherwise, we'll be using the default command: scrot -cd3.
+# screenCommand="scrot -cd5"
+hostshot=
+baseurl="http://www.example.com"
+serveraddr="www.example.com"
+scptimeout="20"
+serverdir="/path/to/directory"
+shotfile=$(printf "screenFetch-`date +'%Y-%m-%d_%H-%M-%S'`.png")
+
+# Verbose Setting - Set to 1 for verbose output.
+verbosity=
+
+#############################################
+#### CODE No need to edit past here CODE ####
+#############################################
+
+#########################################
+# Static Variables and Common Functions #
+#########################################
+c0="\033[0m" # Reset Text
+bold="\033[1m" # Bold Text
+underline="\033[4m" # Underline Text
+display_index=0
+
+# Static Color Definitions
+getColor() {
+	if [[ -n "$1" ]]; then
+		if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+			if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
+				tmp_color=${1,,}
+			else
+				tmp_color="$(tr '[:upper:]' '[:lower:]' <<< ${1})"
+			fi
+		else
+			tmp_color="$(tr '[:upper:]' '[:lower:]' <<< ${1})"
+		fi
+		case "${tmp_color}" in
+			'black') color_ret='\033[30m';;
+			'red') color_ret='\033[31m';;
+			'green') color_ret='\033[32m';;
+			'brown') color_ret='\033[33m';;
+			'blue') color_ret='\033[34m';;
+			'purple') color_ret='\033[35m';;
+			'cyan') color_ret='\033[36m';;
+			'light grey') color_ret='\033[37m';;
+			'dark grey') color_ret='\033[1;30m';;
+			'light red') color_ret='\033[1;31m';;
+			'light green') color_ret='\033[1;32m';;
+			'yellow') color_ret='\033[1;33m';;
+			'light blue') color_ret='\033[1;34m';;
+			'light purple') color_ret='\033[1;35m';;
+			'light cyan') color_ret='\033[1;36m';;
+			'white') color_ret='\033[1;37m';;
+		esac
+		[[ -n "${color_ret}" ]] && echo "${color_ret}"
+	else
+		:
+	fi
+}
+
+function verboseOut {
+	printf "\033[1;31m:: \033[0m$1\n"
+}
+
+function errorOut {
+	printf "\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m$1\n"
+}
+
+
+####################
+#  Color Defines
+####################
+
+detectColors() {
+	my_colors=$(printf "$OPTARG" | sed 's/^,/na,/;s/,$/,na/;s/,/ /')
+	my_lcolor=$(printf "$my_colors" | awk -F' ' '{print $1}')
+	if [[ "$my_lcolor" != "na" ]]; then
+		if [[ $(tput colors) -eq "256" ]]; then my_lcolor="\033[38;5;${my_lcolor}m"
+		else
+			case $my_lcolor in
+				0|00)  export my_lcolor=$(getColor 'black');;
+				1|01)  export my_lcolor=$(getColor 'red');;
+				2|02)  export my_lcolor=$(getColor 'green');;
+				3|03)  export my_lcolor=$(getColor 'brown');;
+				4|04)  export my_lcolor=$(getColor 'blue');;
+				5|05)  export my_lcolor=$(getColor 'purple');;
+				6|06)  export my_lcolor=$(getColor 'cyan');;
+				7|07)  export my_lcolor=$(getColor 'light grey');;
+				8|08)  export my_lcolor=$(getColor 'dark grey');;
+				9|09)  export my_lcolor=$(getColor 'light red');;
+				10) export my_lcolor=$(getColor 'light green');;
+				11) export my_lcolor=$(getColor 'yellow');;
+				12) export my_lcolor=$(getColor 'light blue');;
+				13) export my_lcolor=$(getColor 'light purple');;
+				14) export my_lcolor=$(getColor 'light cyan');;
+				15) export my_lcolor=$(getColor 'white');;
+				*) unset my_lcolor; continue ;;
+			esac
+		fi
+	else
+		unset my_lcolor
+	fi
+	my_hcolor=$(printf "$my_colors" | awk -F' ' '{print $2}')
+	if [[ "$my_hcolor" != "na" ]]; then
+		if [[ $(tput colors) -eq "256" ]]; then my_hcolor="\033[38;5;${my_hcolor}m"
+		else
+			case $my_hcolor in
+				0|00)  export my_hcolor=$(getColor 'black');;
+				1|01)  export my_hcolor=$(getColor 'red');;
+				2|02)  export my_hcolor=$(getColor 'green');;
+				3|03)  export my_hcolor=$(getColor 'brown');;
+				4|04)  export my_hcolor=$(getColor 'blue');;
+				5|05)  export my_hcolor=$(getColor 'purple');;
+				6|06)  export my_hcolor=$(getColor 'cyan');;
+				7|07)  export my_hcolor=$(getColor 'light grey');;
+				8|08)  export my_hcolor=$(getColor 'dark grey');;
+				9|09)  export my_hcolor=$(getColor 'light red');;
+				10) export my_hcolor=$(getColor 'light green');;
+				11) export my_hcolor=$(getColor 'yellow');;
+				12) export my_hcolor=$(getColor 'light blue');;
+				13) export my_hcolor=$(getColor 'light purple');;
+				14) export my_hcolor=$(getColor 'light cyan');;
+				15) export my_hcolor=$(getColor 'white');;
+				*) unset my_hcolor; continue ;;
+			esac
+		fi
+	else
+		unset my_hcolor
+	fi
+}
+
+
+displayHelp() {
+	printf "${underline}Usage${c0}:\n"
+	printf "  screenFetch [OPTIONAL FLAGS]\n\n"
+	printf "screenFetch - a CLI Bash script to show system/theme info in screenshots.\n\n"
+	printf "${underline}Supported Distributions${c0}:      Arch Linux (Old and Current Logos), Linux Mint,\n"
+	printf "			      LMDE, Ubuntu, Crunchbang, Debian, Gentoo, Fedora, SolusOS,\n"
+	printf "			      Mandrake/Mandriva, Slackware, Frugalware, openSUSE, Mageia,\n"
+	printf "			      Peppermint, ParabolaGNU, Viperr, LinuxDeepin, Chakra, and FreeBSD, OpenBSD\n"
+	printf "${underline}Supported Desktop Managers${c0}:   KDE, GNOME, XFCE, and LXDE, and Not Present\n"
+	printf "${underline}Supported Window Managers${c0}:    PekWM, OpenBox, FluxBox, BlackBox, Xfwm4,\n"
+	printf "			      Metacity, StumpWM, KWin, IceWM, FVWM,\n"
+	printf "			      DWM, Awesome, XMonad, Musca, i3, WindowMaker,\n"
+	printf "			      Ratpoison, wmii, WMFS, ScrotWM, SpectrWM,\n"
+	printf "			      subtle, Emerald, E17 and Beryl.\n\n"
+	printf "${underline}Options${c0}:\n"
+	printf "   ${bold}-v${c0}                 Verbose output.\n"
+	printf "   ${bold}-o 'OPTIONS'${c0}       Allows for setting script variables on the\n"
+	printf "		      command line. Must be in the following format...\n"
+	printf "		      'OPTION1=\"OPTIONARG1\";OPTION2=\"OPTIONARG2\"'\n"
+	#echo -e "   ${bold}-d 'ARGUMENTS'${c0}     Allows for setting what information is displayed"
+	#echo -e "		      on the command line. Format must be as follows:"
+	#echo -e "		      OPTION,OPTION,OPTION,OPTION. Valid options are"
+	#echo -e "		      host, distro, kernel, uptime, pkgs, shell, res, de, wm,"
+	#echo -e "		      wmtheme, gtk, cpu, gpu, mem."
+	printf "   ${bold}-n${c0}                 Do not display ASCII distribution logo.\n"
+	printf "   ${bold}-N${c0}                 Strip all color from output.\n"
+	printf "   ${bold}-t${c0}                 Truncate output based on terminal width (Experimental!).\n"
+	printf "   ${bold}-s(m)${c0}              Using this flag tells the script that you want it\n"
+	printf "		      to take a screenshot. Use the -m flag if you would like\n"
+	printf "		      to move it to a new location afterwards.\n"
+	printf "   ${bold}-c string${c0}          You may change the outputted colors with -c. The format is\n"
+	printf "                      as follows: [0-9][0-9],[0-9][0-9]. The first argument controls the\n"
+	printf "                      ASCII logo colors and the label colors. The second argument\n"
+	printf "                      controls the colors of the information found. One argument may be\n"
+	printf "                      used without the other.\n"
+	printf "   ${bold}-S 'COMMAND'${c0}       Here you can specify a custom screenshot command for\n"
+	printf "		      the script to execute. Surrounding quotes are required.\n"
+	printf "   ${bold}-D 'DISTRO'${c0}        Here you can specify your distribution for the script\n"
+	printf "		      to use. Surrounding quotes are required.\n"
+	printf "   ${bold}-A 'DISTRO'${c0}        Here you can specify the distribution art that you want\n"
+	printf "		      displayed. This is for when you want your distro\n"
+	printf "                      detected but want to display a different logo.\n"
+	printf "   ${bold}-E${c0}                 Suppress output of errors.\n"
+	printf "   ${bold}-V${c0}                 Display current script version.\n"
+	printf "   ${bold}-h${c0}                 Display this help.\n"
+}
+
+#####################
+# Begin Flags Phase
+#####################
+
+case $1 in
+	--help) displayHelp; exit 0;;
+esac
+		
+
+while getopts ":hsmevVEnNtlS:A:D:o:Bc:d:" flags; do
+	case $flags in
+		h) displayHelp; exit 0;;
+		s) screenshot=1; continue;;
+		S) screenCommand=$OPTARG; continue;;
+		m) hostshot=1; continue;;
+		v) verbosity=1; continue;;
+		V)
+			printf $underline"screenFetch"$c0" - Version $scriptVersion\n"
+			printf "Created by and licensed to Brett Bohnenkamper (kittykatt@kittykatt.us)\n"
+			printf "OS X porting done almost solely by shrx (http://shrx.github.com/) and Hu6.\n\n"
+			printf "This is free software; see the source for copying conditions.  There is NO warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+			exit 0
+		;;
+		E) errorSuppress="1";;
+		D) distro=$OPTARG; continue;;
+		A) asc_distro=$OPTARG; continue;;
+		t) truncateSet="Yes";;
+		n) display_type="Text";;
+		o) overrideOpts=$OPTARG; continue;;
+		c) detectColors "$OPTARGS"; continue;;
+		# d) overrideDisplay=$OPTARG; continue;;
+		d) overrideDisplay=$OPTARG; continue;;
+		N) no_color='1';;
+		:) errorOut "Error: You're missing an argument somewhere. Exiting."; exit 1;;
+		?) errorOut "Error: Invalid flag somewhere. Exiting."; exit 1;;
+		*) errorOut "Error"; exit 1;;
+	esac
+done
+
+###################
+# End Flags Phase
+###################
+
+
+####################
+# Override Options
+####################
+
+if [[ "$overrideOpts" ]]; then
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Found 'o' flag in syntax. Overriding some script variables..."
+	OLD_IFS="$IFS"
+	IFS=";"
+	for overopt in "$overrideOpts"; do
+		eval "$overrideOpts"
+	done
+	IFS="$OLD_IFS"
+fi
+
+
+#########################
+# Begin Detection Phase
+#########################
+
+# Distro Detection - Begin
+detectdistro () {
+	if [[ -z $distro ]]; then
+		distro="Unknown"
+
+		# LSB Release Check
+		if type -p lsb_release >/dev/null 2>&1; then
+			# read distro_detect distro_release distro_codename <<< $(lsb_release -sirc)
+			distro_detect=( $(lsb_release -sirc) )
+			if [[ ${#distro_detect[@]} -eq 3 ]]; then
+				distro_codename=${distro_detect[2]}
+				distro_release=${distro_detect[1]}
+				distro_detect=${distro_detect[0]}
+			else
+				for ((i=0; i<${#distro_detect[@]}; i++)); do
+					if [[ ${distro_detect[$i]} =~ ^[[:digit:]]+((.[[:digit:]]+|[[:digit:]]+|)+)$ ]]; then
+						distro_release=${distro_detect[$i]}
+						distro_codename=${distro_detect[@]:$(($i+1)):${#distro_detect[@]}+1}
+						distro_detect=${distro_detect[@]:0:${i}}
+						break 1
+					elif [[ ${distro_detect[$i]} =~ [Nn]/[Aa] || ${distro_detect[$i]} == "rolling" ]]; then
+						distro_release=${distro_detect[$i]}
+						distro_codename=${distro_detect[@]:$(($i+1)):${#distro_detect[@]}+1}
+						distro_detect=${distro_detect[@]:0:${i}}
+						break 1
+					fi
+				done
+			fi
+
+			if [[ "${distro_detect}" == "archlinux" || "${distro_detect}" == "Arch Linux" || "${distro_detect}" == "arch" || "${distro_detect}" == "archarm" ]]; then
+				distro="Arch Linux"
+				distro_release="n/a"
+			elif [[ "${distro_detect}" == "Chakra" ]]; then
+				distro="Chakra"
+				distro_release=null
+			elif [[ "${distro_detect}" == "CentOS" ]]; then
+				distro="CentOS"
+			elif [[ "${distro_detect}" == "Debian" ]]; then
+				if [[ -f /etc/crunchbang-lsb-release || -f /etc/lsb-release-crunchbang ]]; then
+					distro="CrunchBang"
+					distro_release=$(awk -F'=' '/^DISTRIB_RELEASE=/ {print $2}' /etc/lsb-release-crunchbang)
+					distro_codename=$(awk -F'=' '/^DISTRIB_DESCRIPTION=/ {print $2}' /etc/lsb-release-crunchbang)
+				else
+					distro="Debian"
+				fi
+			elif [[ "${distro_detect}" == "elementary" || "${distro_detect}" == "elementary OS" ]]; then
+				distro="elementary OS"
+			elif [[ "${distro_detect}" == "Fedora" ]]; then
+				distro="Fedora"
+			elif [[ "${distro_detect}" == "frugalware" ]]; then
+				distro="Frugalware"
+				distro_codename=null
+				distro_release=null
+			elif [[ "${distro_detect}" == "Fuduntu" ]]; then
+				distro="Fuduntu"
+				distro_codename=null
+			elif [[ "${distro_detect}" == "Gentoo" ]]; then
+				if [[ "$(lsb_release -sd)" =~ "Funtoo" ]]; then
+					distro="Funtoo"
+				else
+					distro="Gentoo"
+				fi
+			elif [[ "${distro_detect}" == "Jiyuu Linux" ]]; then
+				 distro="Jiyuu Linux"
+			elif [[ "${distro_detect}" == "LinuxDeepin" ]]; then
+				distro="LinuxDeepin"
+				distro_codename=null
+			elif [[ "${distro_detect}" == "Debian Kali Linux" ]]; then
+				 distro="Kali Linux"
+			elif [[ "${distro_detect}" == "Mageia" ]]; then
+				distro="Mageia"
+			elif [[ "$distro_detect" == "MandrivaLinux" ]]; then
+				distro="Mandriva"
+				if [[ "${distro_codename}" == "turtle" ]]; then
+					distro="Mandriva-${distro_release}"
+					distro_codename=null
+				elif [[ "${distro_codename}" == "Henry_Farman" ]]; then
+					distro="Mandriva-${distro_release}"
+					distro_codename=null
+				elif [[ "${distro_codename}" == "Farman" ]]; then
+					distro="Mandriva-${distro_release}"
+					distro_codename=null
+				elif [[ "${distro_codename}" == "Adelie" ]]; then
+					distro="Mandriva-${distro_release}"
+					distro_codename=null
+				elif [[ "${distro_codename}" == "pauillac" ]]; then
+					distro="Mandriva-${distro_release}"
+					distro_codename=null
+				fi
+			elif [[ "${distro_detect}" == "ManjaroLinux" ]]; then
+				distro="Manjaro"
+			elif [[ "${distro_detect}" == "LinuxMint" ]]; then
+				distro="Mint"
+				if [[ "${distro_codename}" == "debian" ]]; then
+					distro="LMDE"
+					distro_codename=null
+					distro_release=null
+				fi
+			elif [[ "${distro_detect}" == "SUSE LINUX" || "${distro_detect}" == "openSUSE project" ]]; then
+				distro="openSUSE"
+			elif [[ "${distro_detect}" == "ParabolaGNU/Linux-libre" ]]; then
+				distro="ParabolaGNU/Linux-libre"
+			elif [[ "${distro_detect}" == "Peppermint" ]]; then
+				distro="Peppermint"
+				distro_codename=null
+			elif [[ "${distro_detect}" == "CentOS" || "${distro_detect}" =~ "RedHatEnterprise" ]]; then
+				distro="Red Hat Linux"
+			elif [[ "${distro_detect}" == "Sabayon" ]]; then
+				distro="Sabayon"
+			elif [[ "${distro_detect}" == "SolusOS" ]]; then
+				distro="SolusOS"
+			elif [[ "${distro_detect}" == "Trisquel" ]]; then
+				distro="Trisquel"
+			elif [[ "${distro_detect}" == "Ubuntu" ]]; then
+				distro="Ubuntu"
+			elif [[ "${distro_detect}" == "Viperr" ]]; then
+				distro="Viperr"
+				distro_codename=null
+			fi
+			if [[ -n ${distro_release} && ${distro_release} != "n/a" ]]; then distro_more="$distro_release"; fi
+			if [[ -n ${distro_codename} && ${distro_codename} != "n/a" ]]; then distro_more="$distro_more $distro_codename"; fi
+			if [[ -n ${distro_more} ]]; then
+				distro_more="${distro} ${distro_more}"
+			fi
+		fi
+
+		# Existing File Check
+		if [ "$distro" == "Unknown" ]; then
+			if [ $(uname -o 2>/dev/null) ]; then
+				if [ `uname -o` == "Cygwin" ]; then distro="Cygwin"; fake_distro="${distro}"; fi
+			fi
+			if [ -f /etc/os-release ]; then
+				distrib_id=$(/dev/null; then
+						distro="Mac OS X"
+					elif [[ -f /var/run/dmesg.boot ]]; then
+						distro=$(awk 'BEGIN {
+							distro = "Unknown"
+						}
+						{
+							if ($0 ~ /DragonFly/) {
+								distro = "DragonFlyBSD"
+								exit
+							}
+							else if ($0 ~ /FreeBSD/) {
+								distro = "FreeBSD"
+								exit
+							}
+							else if ($0 ~ /NetBSD/) {
+								distro = "NetBSD"
+								exit
+							}
+							else if ($0 ~ /OpenBSD/) {
+								distro = "OpenBSD"
+								exit
+							}
+						} END {
+							print distro
+						}' /var/run/dmesg.boot)
+					fi
+				fi
+			fi
+			if [[ "${distro}" == "Unknown" ]] && [[ "${OSTYPE}" == "linux-gnu" || "${OSTYPE}" == "linux" ]]; then
+				if [[ -f /etc/issue ]]; then
+					distro=$(awk 'BEGIN {
+						distro = "Unknown"
+					}
+					{
+						if ($0 ~ /"LinuxDeepin"/) {
+							distro = "LinuxDeepin"
+							exit
+						}
+						else if ($0 ~ /"Parabola GNU\/Linux-libre"/) {
+							distro = "ParabolaGNU/Linux-libre"
+							exit
+						}
+						else if ($0 ~ /"SolusOS"/) {
+							distro = "SolusOS"
+							exit
+						}
+					} END {
+						print distro
+					}' /etc/issue)
+				fi
+			fi
+			if [[ "${distro}" == "Unknown" ]] && [[ "${OSTYPE}" == "linux-gnu" || "${OSTYPE}" == "linux" ]]; then
+				if [[ -f /etc/system-release ]]; then
+					distro=$(awk 'BEGIN {
+						distro = "Unknown"
+					}
+					{
+						if ($0 ~ /"Scientific\ Linux"/) {
+							distro = "Scientific Linux"
+							exit
+						}
+					} END {
+						print distro
+					}' /etc/system-release)
+				fi
+			fi
+
+
+
+		fi
+	fi
+	if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+		if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
+			distro=${distro,,}
+		else
+			distro="$(tr '[:upper:]' '[:lower:]' <<< ${distro})"
+		fi
+	else
+		distro="$(tr '[:upper:]' '[:lower:]' <<< ${distro})"
+	fi
+	case $distro in
+		arch*linux*old) distro="Arch Linux - Old" ;;
+		arch*linux) distro="Arch Linux" ;;
+		arch) distro="Arch Linux";;
+		'elementary'|'elementary os') distro="elementary OS";;
+		fedora) distro="Fedora" ;;
+		mageia) distro="Mageia" ;;
+		mandriva) distro="Mandriva" ;;
+		mandrake) distro="Mandrake" ;;
+		mint) distro="Mint" ;;
+		kali*linux) distro="Kali Linux" ;;
+		lmde) distro="LMDE" ;;
+		opensuse) distro="openSUSE" ;;
+		ubuntu) distro="Ubuntu" ;;
+		debian) distro="Debian" ;;
+		freebsd) distro="FreeBSD" ;;
+		openbsd) distro="OpenBSD" ;;
+		dragonflybsd) distro="DragonFlyBSD" ;;
+		netbsd) distro="NetBSD" ;;
+		red*hat*) distro="Red Hat Linux" ;;
+		crunchbang) distro="CrunchBang" ;;
+		gentoo) distro="Gentoo" ;;
+		funtoo) distro="Funtoo" ;;
+		slackware) distro="Slackware" ;;
+		frugalware) distro="Frugalware" ;;
+		peppermint) distro="Peppermint" ;;
+		solusos) distro="SolusOS" ;;
+		parabolagnu|parabolagnu/linux-libre) distro="ParabolaGNU/Linux-libre" ;;
+		viperr) distro="Viperr" ;;
+		linuxdeepin) distro="LinuxDeepin" ;;
+		chakra) distro="Chakra" ;;
+		centos) distro="CentOS";;
+		mac*os*x) distro="Mac OS X" ;;
+		fuduntu) distro="Fuduntu" ;;
+		manjaro) distro="Manjaro" ;;
+		cygwin) distro="Cygwin" ;;
+	esac
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding distro...found as '$distro $distro_release'"
+}
+# Distro Detection - End
+
+# Host and User detection - Begin
+detecthost () {
+	myUser=${USER}
+	myHost=${HOSTNAME}
+	if [[ "${distro}" == "Mac OS X" ]]; then myHost=${myHost/.local/}; fi
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding hostname and user...found as '$myUser@$myHost'"
+}
+
+# Find Number of Running Processes
+# processnum="$(( $( ps aux | wc -l ) - 1 ))"
+
+# Kernel Version Detection - Begin
+detectkernel () {
+	kernel=( $(uname -srm) )
+	kernel="${kernel[${#kernel[@]}-1]} ${kernel[@]:0:${#kernel[@]}-1}"
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding kernel version...found as '$kernel'"
+}
+# Kernel Version Detection - End
+
+
+# Uptime Detection - Begin
+detectuptime () {
+	unset uptime
+	if [ "$distro" == "Mac OS X" ]; then
+		boot=`sysctl -n kern.boottime | cut -d "=" -f 2 | cut -d "," -f 1`
+		now=`date +%s`
+		uptime=$(($now-$boot))
+	elif [[ "${distro}" == "FreeBSD" || "${distro}" == "OpenBSD" ]]; then
+		if [[ "${distro}" == "FreeBSD" ]]; then boot=`sysctl -n kern.boottime | cut -d "=" -f 2 | cut -d "," -f 1`
+		else boot=$(sysctl -n kern.boottime); fi
+		now=$(date +%s)
+		uptime=$((${now} - ${boot}))
+	else
+		if [[ -f /proc/uptime ]]; then
+			uptime=$(/dev/null 2>&1; then
+				port_pkgs=$(port installed 2>/dev/null | wc -l)
+				pkgs=$((${pkgs} + (${port_pkgs} -1)))
+			fi
+
+			if type -p port >/dev/null 2>&1; then
+				brew_pkgs=$(brew list -1 2>/dev/null | wc -l)
+				pkgs=$((${pkgs} + ${brew_pkgs}))
+			fi
+		;;
+		'OpenBSD') 
+			pkgs=$(pkg_info | wc -l | awk '{sub(" ", "");print $1}')
+			if type -p portmaster >/dev/null 2>&1; then
+				ports=$(portmaster -l | grep -Eo '[0-9]+ total installed' | sed 's/ total installed//')
+				pkgs=$((${pkgs} + ${ports}))
+			fi
+		;;
+		'FreeBSD')
+			pkgs=$(if TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 PACKAGESITE=file:///nonexistent pkg info pkg >/dev/null 2>&1; then 
+				pkg info | wc -l | awk '{print $1}'; else pkg_info | wc -l | awk '{sub(" ", "");print $1}'; fi)
+		;;
+		'Cygwin') cygfix=2; pkgs=$(($(cygcheck -cd | wc -l)-$cygfix)) ;;
+	esac
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current package count...found as '$pkgs'"
+}
+
+
+
+
+# CPU Detection - Begin
+detectcpu () {
+	REGEXP="-r"
+	if [ "$distro" == "Mac OS X" ]; then 
+		cpu=$(echo $(sysctl -n machdep.cpu.brand_string))
+		REGEXP="-E"
+	elif [ "$distro" == "FreeBSD" ]; then cpu=$(sysctl -n hw.model)
+	elif [ "$distro" == "DragonflyBSD" ]; then cpu=$(sysctl -n hw.model)
+	elif [ "$distro" == "OpenBSD" ]; then cpu=$(sysctl -n hw.model | sed 's/@.*//')
+	else
+		cpu=$(awk 'BEGIN{FS=":"} /model name/ { print $2; exit }' /proc/cpuinfo | sed 's/ @/\n/' | head -1)
+		if [ -z "$cpu" ]; then 
+			cpu=$(awk 'BEGIN{FS=":"} /^cpu/ { gsub(/  +/," ",$2); print $2; exit}' /proc/cpuinfo | sed 's/, altivec supported//;s/^ //')
+			if [[ $cpu =~ ^(PPC)*9.+ ]]; then
+				model="IBM PowerPC G5 "
+			elif [[ $cpu =~ ^74.+ ]]; then
+				model="Motorola PowerPC G4 "
+			else
+				model="IBM PowerPC G3 "
+			fi
+			cpu="${model}${cpu}"
+		fi
+		loc="/sys/devices/system/cpu/cpu0/cpufreq"
+		if [ -f $loc/bios_limit ];then
+			cpu_mhz=$(cat $loc/bios_limit | awk '{print $1/1000}')
+		elif [ -f $loc/scaling_max_freq ];then
+			cpu_mhz=$(cat $loc/scaling_max_freq | awk '{print $1/1000}')
+		else
+			cpu_mhz=$(awk -F':' '/cpu MHz/{ print int($2+.5) }' /proc/cpuinfo | head -n 1)
+		fi
+		if [ -n "$cpu_mhz" ];then
+			if [ $cpu_mhz -gt 999 ];then
+				cpu_ghz=$(echo $cpu_mhz | awk '{print $1/1000}')
+				cpu="$cpu @ ${cpu_ghz}GHz"
+			else
+				cpu="$cpu @ ${cpu_mhz}MHz"
+			fi
+		fi
+	fi
+	cpu=$(echo "${cpu}" | sed $REGEXP 's/\([tT][mM]\)|\([Rr]\)|[pP]rocessor//g' | xargs)
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current CPU...found as '$cpu'"
+}
+# CPU Detection - End
+
+
+# GPU Detection - Begin (EXPERIMENTAL!)
+detectgpu () {
+	if [[ "${distro}" == "FreeBSD" ]]; then
+		gpu_info=$(pciconf -lv | grep -B 4 VGA)
+		gpu_info=$(echo "${gpu_info}" | grep -E 'device.*=.*')
+		gpu=$(echo "${gpu_info}" | sed 's/.*device.*= //' | sed "s/'//g")
+	else
+		if [ -n "$(type -p lspci)" ]; then
+			gpu_info=$(lspci | grep VGA)
+			gpu=$(echo "$gpu_info" | grep -oE '\[.*\]' | sed 's/\[//;s/\]//')
+			gpu=$(echo "${gpu}" | sed -n '1h;2,$H;${g;s/\n/, /g;p}')
+		elif [[ -n "$(type -p glxinfo)" && -z "$gpu" ]]; then
+			gpu_info=$(glxinfo 2>/dev/null)
+			gpu=$(echo "$gpu_info" | grep "OpenGL renderer string")
+			gpu=$(echo "$gpu" | cut -d ':' -f2)
+			gpu="${gpu:1}"
+			gpu_info=$(echo "$gpu_info" | grep "OpenGL vendor string")
+		elif [[ "${distro}" == "Mac OS X" ]]; then
+			gpu=$(system_profiler SPDisplaysDataType | awk -F': ' '/^\ *Chipset Model:/ {print $2}')
+		elif [[ "${distro}" == "Cygwin" ]]; then
+			gpu=$(wmic path Win32_VideoController get caption)
+			gpu=$(tail -1 <<< ${gpu})
+		fi
+	fi
+
+	if [ -n "$gpu" ];then
+		if [ $(echo "$gpu_info" | grep -i nvidia | wc -l) -gt 0 ];then
+			gpu_info="NVidia "
+		elif [ $(echo "$gpu_info" | grep -i intel | wc -l) -gt 0 ];then
+			gpu_info="Intel "
+		elif [ $(echo "$gpu_info" | grep -i amd | wc -l) -gt 0 ];then
+			gpu_info="AMD "
+		elif [[ $(echo "$gpu_info" | grep -i ati | wc -l) -gt 0  || $(echo "$gpu_info" | grep -i radeon | wc -l) -gt 0 ]]; then
+			gpu_info="ATI "
+		else
+			gpu_info=$(echo "$gpu_info" | cut -d ':' -f2)
+			gpu_info="${gpu_info:1} "
+		fi
+		gpu="${gpu_info}${gpu}"
+	else
+		gpu="Not Found"
+	fi
+
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current GPU...found as '$gpu'"
+}
+# GPU Detection - End
+
+
+# Disk Usage Detection - Begin
+detectdisk () {
+	diskusage="Unknown"
+	if type -p df >/dev/null 2>&1; then
+		if [[ "${distro}" =~ (Free|Net|Open|DragonFly)BSD ]]; then
+			totaldisk=$(df -h -c 2>/dev/null | tail -1)
+		elif [[ "${distro}" == "Mac OS X" ]]; then
+			totaldisk=$(df -H / 2>/dev/null | tail -1)
+		else
+			totaldisk=$(df -h --total 2>/dev/null | tail -1)
+		fi
+		disktotal=$(awk '{print $2}' <<< "${totaldisk}")
+		diskused=$(awk '{print $3}' <<< "${totaldisk}")
+		diskusedper=$(awk '{print $5}' <<< "${totaldisk}")
+		diskusage="${diskused} / ${disktotal} (${diskusedper})"
+		diskusage_verbose=$(sed 's/%/%%/' <<< $diskusage)
+	fi
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current disk usage...found as '$diskusage_verbose'"
+}	
+# Disk Usage Detection - End
+
+
+# Memory Detection - Begin
+detectmem () {
+	hw_mem=0
+	free_mem=0
+	human=1024
+	if [ "$distro" == "Mac OS X" ]; then
+		totalmem=$(echo "$(sysctl -n hw.memsize)"/${human}^2|bc)
+ 		usedmem=$(top -l 1 | awk '{
+ 			if ($0 ~ /PhysMem/) {
+ 				for (x=1; x<=NF; x++) {
+ 					if ($x ~ /wired/) {
+ 						wired = $(x-1)
+ 						gsub(/[^0-9]/,"",wired)
+ 					}
+
+ 					if ($x ~ /^active/) {
+ 						active = $(x-1)
+ 						gsub(/[^0-9]/,"",active)
+ 					}
+
+ 					if ($x ~ /inactive/) {
+ 						inactive = $(x-1)
+ 						gsub(/[^0-9]/,"",inactive)
+ 					}
+ 				}
+ 				usedmem = wired + active + inactive
+ 				print usedmem
+ 				exit
+ 			}
+ 		}')
+	elif [ "$distro" == "Cygwin" ]; then
+		total_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
+		totalmem=$((${total_mem}/1024))
+		free_mem=$(awk '/MemFree/ { print $2 }' /proc/meminfo)
+		used_mem=$((${total_mem} - ${free_mem}))
+		usedmem=$((${used_mem}/1024))
+	elif [ "$distro" == "FreeBSD" ]; then
+		phys_mem=$(sysctl -n hw.physmem)
+		size_mem=$phys_mem
+		size_chip=1
+		guess_chip=`echo "$size_mem / 8 - 1" | bc`
+		while [ $guess_chip != 0 ]; do
+			guess_chip=`echo "$guess_chip / 2" | bc`
+			size_chip=`echo "$size_chip * 2" | bc`
+		done
+		round_mem=`echo "( $size_mem / $size_chip + 1 ) * $size_chip " | bc`
+		totalmem=$(($round_mem / ($human * $human) ))
+		pagesize=$(sysctl -n hw.pagesize)
+		inactive_count=$(sysctl -n vm.stats.vm.v_inactive_count)
+		inactive_mem=$(($inactive_count * $pagesize))
+		cache_count=$(sysctl -n vm.stats.vm.v_cache_count)
+		cache_mem=$(($cache_count * $pagesize))
+		free_count=$(sysctl -n vm.stats.vm.v_free_count)
+		free_mem=$(($free_count * $pagesize))
+		avail_mem=$(($inactive_mem + $cache_mem + $free_mem))
+		used_mem=$(($round_mem - $avail_mem))
+		usedmem=$(($used_mem / ($human * $human) ))
+	elif [ "$distro" == "OpenBSD" ]; then
+		totalmem=$(top -1 1 | awk '/Real:/ {k=split($3,a,"/");print a[k] }' | tr -d 'M')
+		usedmem=$(top -1 1 | awk '/Real:/ {print $3}' | sed 's/M.*//')
+	elif [ "$distro" == "NetBSD" ]; then
+		phys_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
+		totalmem=$((${phys_mem} / $human))
+		if grep -q 'Cached' /proc/meminfo; then
+			cache=$(awk '/Cached/ {print $2}' /proc/meminfo)
+			usedmem=$((${cache} / $human))
+		else
+			free_mem=$(awk '/MemFree/ { print $2 }' /proc/meminfo)
+			used_mem=$((${phys_mem} - ${free_mem}))
+			usedmem=$((${used_mem} / $human))
+		fi
+	else
+		mem_info=$(1 {print $1}')
+			shell_type=${shell_type/-}
+			shell_type=${shell_type//*\/}
+		fi
+	fi
+
+	case $shell_type in
+		bash)
+			shell_version_data=$( detectshell_ver "$shell_type" "^GNU.bash,.version" "4" )
+			;;
+		csh)
+			shell_version_data=$( detectshell_ver "$shell_type" "$shell_type" "3" )
+			;;
+		dash)
+			shell_version_data=$( detectshell_ver "$shell_type" "$shell_type" "3" )
+			;;
+		ksh)
+			shell_version_data=$( detectshell_ver "$shell_type" "version" "5" )
+			;;
+		tcsh)
+			shell_version_data=$( detectshell_ver "$shell_type" "^tcsh" "2" )
+			;;
+		zsh)
+			shell_version_data=$( detectshell_ver "$shell_type" "^zsh" "2" )
+			;;
+	esac
+
+	if [[ -n $shell_version_data ]];then
+		shell_type="$shell_type $shell_version_data"
+	fi
+
+	myShell=${shell_type}
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current shell...found as '$myShell'"
+}
+# Shell Detection - End
+
+
+# Resolution Detection - Begin
+detectres () {
+	if [[ -n ${DISPLAY} && ${distro} != "Mac OS X" && ${distro} != "Cygwin" ]]; then
+		if [[ "$distro" =~ "BSD" ]]; then
+			xResolution=$(xdpyinfo | sed -n 's/.*dim.* \([0-9]*x[0-9]*\) .*/\1/pg' | tr '\n' ' ')
+		else
+			xResolution=$(xdpyinfo | sed -n 's/.*dim.* \([0-9]*x[0-9]*\) .*/\1/pg' | sed ':a;N;$!ba;s/\n/ /g')
+		fi
+	elif [[ ${distro} == "Mac OS X" ]]; then
+		xResolution=$(system_profiler SPDisplaysDataType | awk '/Resolution:/ {print $2"x"$4" "}')
+	elif [[ "${distro}" == "Cygwin" ]]; then
+		width=$(wmic desktopmonitor get screenwidth | grep -vE '[a-z]+' | tr -d '\r\n ')
+		height=$(wmic desktopmonitor get screenheight | grep -vE '[a-z]+' | tr -d '\r\n ')
+		xResolution="${width}x${height}"
+	else
+		xResolution="No X Server"
+	fi
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current resolution(s)...found as '$xResolution'"
+}
+# Resolution Detection - End
+
+
+# DE Detection - Begin
+detectde () {
+	DE="Not Present"
+	if [[ -n ${DISPLAY} && ${distro} != "Mac OS X" && ${distro} != "Cygwin" ]]; then
+		if type -p xprop >/dev/null 2>&1;then
+			xprop_root="$(xprop -root 2>/dev/null)"
+			if [[ -n ${xprop_root} ]]; then
+				DE=$(echo "${xprop_root}" | awk 'BEGIN {
+					de = "Not Present"
+				}
+				{
+					if ($1 ~ /^_DT_SAVE_MODE/) {
+						de = $NF
+						gsub(/\"/,"",de)
+						de = toupper(de)
+						exit
+					}
+					else if ($1 ~/^KDE_SESSION_VERSION/) {
+						de = "KDE"$NF
+						exit
+					}
+					else if ($1 ~ /^_MARCO/) {
+						de = "MATE"
+						exit
+					}
+					else if ($1 ~ /^_MUFFIN/) {
+						de = "Cinnamon"
+						exit
+					}
+					else if ($0 ~ /"xfce4"/) {
+						de = "XFCE4"
+						exit
+					}
+					else if ($0 ~ /"xfce5"/) {
+						de = "XFCE5"
+						exit
+					}
+				} END {
+					print de
+				}')
+			fi
+		fi
+
+		if [[ ${DE} == "Not Present" ]]; then
+			if [[ -n ${GNOME_DESKTOP_SESSION_ID} ]]; then
+				DE="Gnome"
+				if type -p xprop >/dev/null 2>&1; then
+					if xprop -name "unity-launcher" >/dev/null 2>&1; then
+						DE="Unity"
+					elif xprop -name "launcher" >/dev/null 2>&1 &&
+						xprop -name "panel" >/dev/null 2>&1; then
+
+						DE="Unity"
+					fi
+				fi
+			elif [[ -n ${MATE_DESKTOP_SESSION_ID} ]]; then
+				DE="MATE"
+			elif [[ -n ${KDE_SESSION_VERSION} ]]; then
+				if [[ ${KDE_SESSION_VERSION} == '5' ]]; then
+					DE="KDE5"
+				elif [[ ${KDE_SESSION_VERSION} == '4' ]]; then
+					DE="KDE4"
+				fi
+			elif [[ -n ${KDE_FULL_SESSION} ]]; then
+				if [[ ${KDE_FULL_SESSION} == 'true' ]]; then
+					DE="KDE"
+					DEver_data=$( kded --version 2>/dev/null )
+					DEver=$( grep -si '^KDE:' <<< "$DEver_data" | awk '{print $2}' )
+				fi
+			fi
+		fi
+
+		if [[ ${DE} != "Not Present" ]]; then
+			if [[ ${DE} == "Cinnamon" ]]; then
+				if type -p >/dev/null 2>&1; then
+					DEver=$(cinnamon --version)
+					DE="${DE} ${DEver//* }"
+				fi
+			elif [[ ${DE} == "Gnome" || ${DE} == "GNOME" ]]; then
+				if type -p gnome-session-properties >/dev/null 2>&1; then
+					DEver=$(gnome-session-properties --version)
+					DE="${DE} ${DEver//* }"
+				elif type -p gnome-session >/dev/null 2>&1; then
+					DEver=$(gnome-session --version)
+					DE="${DE} ${DEver//* }"
+				fi
+			elif [[ ${DE} == "KDE4" || ${DE} == "KDE5" ]]; then
+				if type -p kded${DE#KDE} >/dev/null 2>&1; then
+					DEver=$(kded${DE#KDE} --version)
+					for l in $(echo "${DEver// /_}"); do
+						if [[ ${l//:*} == "KDE_Development_Platform" ]]; then
+							DEver=${l//*:_}
+							DE="KDE ${DEver//_*}"
+						fi;
+					done
+				fi
+			elif [[ ${DE} == "MATE" ]]; then
+				if type -p mate-session >/dev/null 2>&1; then
+					DEver=$(mate-session --version)
+					DE="${DE} ${DEver//* }"
+				fi
+
+			elif [[ ${DE} == "Unity" ]]; then
+				if type -p unity >/dev/null 2>&1; then
+					DEver=$(unity --version)
+					DE="${DE} ${DEver//* }"
+				fi
+			fi
+		fi
+
+		if [[ "${DE}" == "Not Present" ]]; then
+			if pgrep -U ${UID} lxsession >/dev/null 2>&1; then
+				DE="LXDE"
+				if type -p lxpanel >/dev/null 2>&1; then
+					DEver=$(lxpanel -v)
+					DE="${DE} $DEver"
+				fi
+			elif pgrep -U ${UID} razor-session >/dev/null 2>&1; then
+				DE="RazorQt"
+			fi
+		fi
+	elif [[ "${distro}" == "Mac OS X" ]]; then
+		if ps -U ${USER} | grep [F]inder >/dev/null 2>&1; then
+			DE="Aqua"
+		fi
+	elif [[ "${distro}" == "Cygwin" ]]; then
+		winver=`wmic os get version | grep -o '^[0-9]'`
+		if [ "$winver" == "7" ]; then DE='Aero'
+		elif [ "$winver" == "6" ]; then DE='Aero'
+		else DE='Luna'; fi
+	fi
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding desktop environment...found as '$DE'"
+}
+### DE Detection - End
+
+
+# WM Detection - Begin
+detectwm () {
+	WM="Not Found"
+	if [[ -n ${DISPLAY} && ${distro} != "Cygwin" ]]; then
+
+		for each in "${wmnames[@]}"; do
+			PID="$(pgrep -U ${UID} $each)"
+			if [ "$PID" ]; then
+				case $each in
+					'awesome') WM="Awesome";;
+					'beryl') WM="Beryl";;
+					'bspwm') WM="bspwm";;
+					'blackbox') WM="Blackbox";;
+					'cinnamon') WM="Cinnamon";;
+					'compiz') WM="Compiz";;
+					'dminiwm') WM="dminiwm";;
+					'dwm') WM="dwm";;
+					'e16') WM="E16";;
+					'emerald') WM="Emerald";;
+					'enlightenment') WM="E17";;
+					'fluxbox') WM="FluxBox";;
+					'fvwm') WM="FVWM";;
+					'herbstluftwm') WM="herbstluftwm";;
+					'icewm') WM="IceWM";;
+					'kwin') WM="KWin";;
+					'metacity') WM="Metacity";;
+					'monsterwm') WM="monsterwm";;
+					'musca') WM="Musca";;
+					'notion') WM="Notion";;
+					'openbox') WM="OpenBox";;
+					'pekwm') WM="PekWM";;
+					'ratpoison') WM="Ratpoison";;
+					'sawfish') WM="Sawfish";;
+					'scrotwm') WM="ScrotWM";;
+					'spectrwm') WM="SpectrWM";;
+					'stumpwm') WM="StumpWM";;
+					'subtle') WM="subtle";;
+					'wmaker') WM="WindowMaker";;
+					'wmfs') WM="WMFS";;
+					'wmii') WM="wmii";;
+					'xfwm4') WM="Xfwm4";;
+					'i3') WM="i3";;
+					'xmonad') WM="XMonad";;
+				esac
+			fi
+
+			if [[ ${WM} != "Not Found" ]]; then
+				break 1
+			fi
+		done
+
+		if [[ ${WM} == "Not Found" ]]; then
+			if type -p xprop >/dev/null 2>&1; then
+				WM=$(xprop -root _NET_SUPPORTING_WM_CHECK)
+				if [[ "$WM" =~ 'not found' ]]; then
+					WM="Not Found"
+				elif [[ "$WM" =~ 'Not found' ]]; then
+					WM="Not Found"
+				elif [[ "$WM" =~ '[Ii]nvalid window id format' ]]; then
+					WM="Not Found"
+				elif [[ "$WM" =~ "no such" ]]; then
+					WM="Not Found"
+				else
+					WM=${WM//* }
+					WM=$(xprop -id ${WM} 8s _NET_WM_NAME)
+					WM=$(echo $(WM=${WM//*= }; echo ${WM//\"}))
+				fi
+			fi
+		else
+			if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+				if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
+					WM=${WM,,}
+				else
+					WM="$(tr '[:upper:]' '[:lower:]' <<< ${WM})"
+				fi
+			else
+				WM="$(tr '[:upper:]' '[:lower:]' <<< ${WM})"
+			fi
+			case ${WM} in
+				'awesome') WM="Awesome";;
+				'beryl') WM="Beryl";;
+				'blackbox') WM="Blackbox";;
+				'cinnamon') WM="Cinnamon";;
+				'compiz') WM="Compiz";;
+				'dminiwm') WM="dminiwm";;
+				'dwm') WM="dwm";;
+				'e16') WM="E16";;
+				'emerald') WM="Emerald";;
+				'enlightenment') WM="E17";;
+				'fluxbox') WM="FluxBox";;
+				'fvwm') WM="FVWM";;
+				'herbstluftwm') WM="herbstluftwm";;
+				'icewm') WM="IceWM";;
+				'kwin') WM="KWin";;
+				'metacity') WM="Metacity";;
+				'monsterwm') WM="monsterwm";;
+				'musca') WM="Musca";;
+				*'gala'*) WM="Gala";;
+				'mutter'*) WM="Mutter";;
+				'gnome shell'*) WM="Mutter";;
+				'notion') WM="Notion";;
+				'openbox') WM="OpenBox";;
+				'pekwm') WM="PekWM";;
+				'ratpoison') WM="Ratpoison";;
+				'sawfish') WM="Sawfish";;
+				'scrotwm') WM="ScrotWM";;
+				'spectrwm') WM="SpectrWM";;
+				'stumpwm') WM="StumpWM";;
+				'subtle') WM="subtle";;
+				'wmaker') WM="WindowMaker";;
+				'wmfs') WM="WMFS";;
+				'wmii') WM="wmii";;
+				'xfwm4') WM="Xfwm4";;
+				'xmonad') WM="XMonad";;
+				'i3') WM="i3";;
+			esac
+		fi
+	elif [[ ${distro} == "Mac OS X" && "${WM}" == "Not Found" ]]; then
+		if ps -U ${USER} | grep [F]inder >/dev/null 2>&1; then
+			WM="Quartz Compositor"
+		fi
+	elif [[ "${distro}" == "Cygwin" ]]; then
+		bugn=$(tasklist | grep -o 'bugn' | tr -d '\r \n')
+		wind=$(tasklist | grep -o 'Windawesome' | tr -d '\r \n')
+		if [ "$bugn" = "bugn" ]; then WM="bug.n"
+		elif [ "$wind" = "Windawesome" ]; then WM="Windawesome"
+		else WM="DWM"; fi
+	fi
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding window manager...found as '$WM'"
+}
+# WM Detection - End
+
+
+# WM Theme Detection - BEGIN
+detectwmtheme () {
+	Win_theme="Not Found"
+	case $WM in
+		'Awesome') if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/awesome/rc.lua ]; then Win_theme="$(grep -e '^[^-].*\(theme\|beautiful\).*lua' ${XDG_CONFIG_HOME:-${HOME}/.config}/awesome/rc.lua | grep '[a-zA-Z0-9]\+/[a-zA-Z0-9]\+.lua' -o | cut -d'/' -f1 | head -n1)"; fi;;
+		'BlackBox') if [ -f $HOME/.blackboxrc ]; then Win_theme="$(awk -F"/" '/styleFile/ {print $NF}' $HOME/.blackboxrc)"; fi;;
+		'Beryl') Win_theme="Not Present";;
+		'bspwm') Win_theme="Not Present";;
+		'Cinnamon') Win_theme="$(gsettings get org.cinnamon.theme name)";;
+		'Compiz'|'Mutter'*|'GNOME Shell'|'Gala')
+			if type -p gsettings >/dev/null 2>&1; then
+				Win_theme="$(gsettings get org.gnome.desktop.wm.preferences theme)"
+				Win_theme=${Win_theme//"'"}
+			elif type -p gconftool-2 >/dev/null 2>&1; then
+				Win_theme=$(gconftool-2 -g /apps/metacity/general/theme)
+			fi
+		;;
+		'dminiwm') Win_theme="Not Present";;
+		'dwm') Win_theme="Not Present";;
+		'E16') Win_theme="$(awk -F"= " '/theme.name/ {print $2}' $HOME/.e16/e_config--0.0.cfg)";;
+		'E17'|'Enlightenment') 
+			if [ "$(which eet 2>/dev/null)" ]; then
+				econfig="$(eet -d $HOME/.e/e/config/standard/e.cfg config | awk '/value \"file\" string.*.edj/{ print $4 }')"
+				econfigend="${econfig##*/}"
+				Win_theme=${econfigend%.*}
+			fi
+		;;
+		#E17 doesn't store cfg files in text format so for now get the profile as opposed to theme. atyoung
+		#TODO: Find a way to extract and read E17 .cfg files ( google seems to have nothing ). atyoung
+		'E17') Win_theme=${E_CONF_PROFILE};;
+		'Emerald') if [ -f $HOME/.emerald/theme/theme.ini ]; then Win_theme="$(for a in /usr/share/emerald/themes/* $HOME/.emerald/themes/*; do cmp "$HOME/.emerald/theme/theme.ini" "$a/theme.ini" &>/dev/null && basename "$a"; done)"; fi;;
+		'Finder') Win_theme="Not Present";;
+		'FluxBox'|'Fluxbox') if [ -f $HOME/.fluxbox/init ]; then Win_theme="$(awk -F"/" '/styleFile/ {print $NF}' $HOME/.fluxbox/init)"; fi;;
+		'FVWM') Win_theme="Not Present";;
+		'i3') Win_theme="Not Present";;
+		'IceWM') if [ -f $HOME/.icewm/theme ]; then Win_theme="$(awk -F"[\",/]" '!/#/ {print $2}' $HOME/.icewm/theme)"; fi;;
+		'KWin'*)
+			if [[ -z $KDE_CONFIG_DIR ]]; then
+				if type -p kde5-config >/dev/null 2>&1; then
+					KDE_CONFIG_DIR=$(kde5-config --localprefix)
+				elif type -p kde4-config >/dev/null 2>&1; then
+					KDE_CONFIG_DIR=$(kde4-config --localprefix)
+				elif type -p kde-config >/dev/null 2>&1; then
+					KDE_CONFIG_DIR=$(kde-config --localprefix)
+				fi
+			fi
+
+			if [[ -n $KDE_CONFIG_DIR ]]; then
+				Win_theme=$(awk '/PluginLib=kwin3_/{gsub(/PluginLib=kwin3_/,"",$0); print $0; exit}' $KDE_CONFIG_DIR/share/config/kwinrc)
+				if [[ -z $Win_theme ]]; then
+					if [[ -f $KDE_CONFIG_DIR/share/config/kdebugrc ]]; then
+						Win_theme=$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' $KDE_CONFIG_DIR/share/config/kdebugrc)
+						if [[ -z $Win_theme ]]; then
+							Win_theme="Not Found"
+						fi
+					else
+						Win_theme="Not Found"
+					fi
+				fi
+
+				if [[ $Win_theme != 'Not Found' ]]; then
+					if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
+						if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
+							Win_theme=${Win_theme^}
+						else
+							Win_theme="$(tr '[:lower:]' '[:upper:]' <<< ${Win_theme:0:1})${Win_theme:1}"
+						fi
+					else
+						Win_theme="$(tr '[:lower:]' '[:upper:]' <<< ${Win_theme:0:1})${Win_theme:1}"
+					fi
+				fi
+			fi
+		;;
+		'Marco')
+			Win_theme="$(gsettings get org.mate.Marco.general theme)"
+			Win_theme=${Win_theme//"'"}
+		;;
+		'Metacity') if [ "`gconftool-2 -g /apps/metacity/general/theme`" ]; then Win_theme="$(gconftool-2 -g /apps/metacity/general/theme)"; fi ;;
+		'monsterwm') Win_theme="Not Present";;
+		'Musca') Win_theme="Not Present";;\
+		'Notion') Win_theme="Not Present";;
+		'OpenBox'|'Openbox')
+			if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/openbox/rc.xml ]; then
+				Win_theme="$(awk -F"[<,>]" '/]" '//dev/null 2>&1; then
+				KDE_CONFIG_DIR=$(kde4-config --localprefix)
+				if [[ -d ${KDE_CONFIG_DIR} ]]; then
+					if [[ -f "${KDE_CONFIG_DIR}/share/config/kdeglobals" ]]; then
+						KDE_CONFIG_FILE="${KDE_CONFIG_DIR}/share/config/kdeglobals"
+					fi
+				fi
+			elif type -p kde5-config >/dev/null 2>&1; then
+				KDE_CONFIG_DIR=$(kde5-config --localprefix)
+				if [[ -d ${KDE_CONFIG_DIR} ]]; then
+					if [[ -f "${KDE_CONFIG_DIR}/share/config/kdeglobals" ]]; then
+						KDE_CONFIG_FILE="${KDE_CONFIG_DIR}/share/config/kdeglobals"
+					fi
+				fi
+			elif type -p kde-config >/dev/null 2>&1; then
+				KDE_CONFIG_DIR=$(kde-config --localprefix)
+				if [[ -d ${KDE_CONFIG_DIR} ]]; then
+					if [[ -f "${KDE_CONFIG_DIR}/share/config/kdeglobals" ]]; then
+						KDE_CONFIG_FILE="${KDE_CONFIG_DIR}/share/config/kdeglobals"
+					fi
+				fi
+			fi
+
+			if [[ -n ${KDE_CONFIG_FILE} ]]; then
+				if grep -q "widgetStyle=" "${KDE_CONFIG_FILE}"; then
+					gtk2Theme=$(awk -F"=" '/widgetStyle=/ {print $2}' "${KDE_CONFIG_FILE}")
+				elif grep -q "colorScheme=" "${KDE_CONFIG_FILE}"; then
+					gtk2Theme=$(awk -F"=" '/colorScheme=/ {print $2}' "${KDE_CONFIG_FILE}")
+				fi
+
+				if grep -q "Theme=" "${KDE_CONFIG_FILE}"; then
+					gtkIcons=$(awk -F"=" '/Theme=/ {print $2}' "${KDE_CONFIG_FILE}")
+				fi
+
+				if grep -q "Font=" "${KDE_CONFIG_FILE}"; then
+					gtkFont=$(awk -F"=" '/font=/ {print $2}' "${KDE_CONFIG_FILE}")
+				fi
+			fi
+
+			if [[ -f $HOME/.gtkrc-2.0 ]]; then
+				gtk2Theme=$(grep '^gtk-theme-name' $HOME/.gtkrc-2.0 | awk -F'=' '{print $2}')
+				gtk2Theme=${gtk2Theme//\"/}
+				gtkIcons=$(grep '^gtk-icon-theme-name' $HOME/.gtkrc-2.0 | awk -F'=' '{print $2}')
+				gtkIcons=${gtkIcons//\"/}
+				gtkFont=$(grep 'font_name' $HOME/.gtkrc-2.0 | awk -F'=' '{print $2}')
+				gtkFont=${gtkFont//\"/}
+			fi
+
+			if [[ -f $HOME/.config/gtk-3.0/settings.ini ]]; then
+				gtk3Theme=$(grep '^gtk-theme-name=' $HOME/.config/gtk-3.0/settings.ini | awk -F'=' '{print $2}')
+			fi
+		;;
+		'Cinnamon'*) # Desktop Environment found as "Cinnamon"
+			if type -p gsettings >/dev/null 2>&1; then
+				gtk3Theme=$(gsettings get org.gnome.desktop.interface gtk-theme)
+				gtk3Theme=${gtk3Theme//"'"}
+				gtk2Theme=${gtk3Theme}
+
+				gtkIcons=$(gsettings get org.gnome.desktop.interface icon-theme)
+				gtkIcons=${gtkIcons//"'"}
+				gtkFont=$(gsettings get org.gnome.desktop.interface font-name)
+				gtkFont=${gtkFont//"'"}
+				if [ "$background_detect" == "1" ]; then gtkBackground=$(gsettings get org.gnome.desktop.background picture-uri); fi
+			fi
+		;;
+		'GNOME'*|'Gnome'*|'Unity'*) # Desktop Environment found as "GNOME"
+			if type -p gsettings >/dev/null 2>&1; then
+				gtk3Theme=$(gsettings get org.gnome.desktop.interface gtk-theme)
+				gtk3Theme=${gtk3Theme//"'"}
+				gtk2Theme=${gtk3Theme}
+				gtkIcons=$(gsettings get org.gnome.desktop.interface icon-theme)
+				gtkIcons=${gtkIcons//"'"}
+				gtkFont=$(gsettings get org.gnome.desktop.interface font-name)
+				gtkFont=${gtkFont//"'"}
+				if [ "$background_detect" == "1" ]; then gtkBackground=$(gsettings get org.gnome.desktop.background picture-uri); fi
+			elif type -p gconftool-2 >/dev/null 2>&1; then
+				gtk2Theme=$(gconftool-2 -g /desktop/gnome/interface/gtk_theme)
+				gtkIcons=$(gconftool-2 -g /desktop/gnome/interface/icon_theme)
+				gtkFont=$(gconftool-2 -g /desktop/gnome/interface/font_name)
+				if [ "$background_detect" == "1" ]; then
+					gtkBackgroundFull=$(gconftool-2 -g /desktop/gnome/background/picture_filename)
+					gtkBackground=$(echo "$gtkBackgroundFull" | awk -F"/" '{print $NF}')
+				fi
+			fi
+		;;
+		'MATE'*) # MATE desktop environment
+			#if type -p gsettings >/dev/null 2&>1; then
+			gtk3Theme=$(gsettings get org.mate.interface gtk-theme)
+			# gtk3Theme=${gtk3Theme//"'"}
+			gtk2Theme=${gtk3Theme}
+			gtkIcons=$(gsettings get org.mate.interface icon-theme)
+			gtkIcons=${gtkIcons//"'"}
+			gtkFont=$(gsettings get org.mate.interface font-name)
+			gtkFont=${gtkFont//"'"}
+			#fi
+		;;
+		'XFCE'*) # Desktop Environment found as "XFCE"
+			if type -p xfconf-query >/dev/null 2>&1; then
+				gtk2Theme=$(xfconf-query -c xsettings -p /Net/ThemeName)
+			fi
+
+			if type -p xfconf-query >/dev/null 2>&1; then
+				gtkIcons=$(xfconf-query -c xsettings -p /Net/IconThemeName)
+			fi
+
+			if type -p xfconf-query >/dev/null 2>&1; then
+				gtkFont=$(xfconf-query -c xsettings -p /Gtk/FontName)
+			fi
+		;;
+		'LXDE'*)
+			if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/lxde/config ]; then
+				lxdeconf="/lxde/config"
+			elif [ "$distro" == "Trisquel" ]; then
+				lxdeconf=""
+			elif [ "$distro" == "FreeBSD" ]; then
+				lxdeconf=""
+			else
+				lxdeconf="/lxsession/LXDE/desktop.conf"
+			fi
+			# TODO: Clean me.
+			if grep -q "sNet\/ThemeName" ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf 2>/dev/null; then
+				gtk2Theme=$(awk -F'=' '/sNet\/ThemeName/ {print $2}' ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf)
+			fi
+
+			if grep -q IconThemeName ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf 2>/dev/null; then
+				gtkIcons=$(awk -F'=' '/sNet\/IconThemeName/ {print $2}' ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf)
+			fi
+
+			if grep -q FontName ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf 2>/dev/null; then
+				gtkFont=$(awk -F'=' '/sGtk\/FontName/ {print $2}' ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf)
+			fi
+		;;
+
+		# /home/me/.config/rox.sourceforge.net/ROX-Session/Settings.xml
+
+		*)	# Lightweight or No DE Found
+			if [ -f $HOME/.gtkrc-2.0 ]; then
+				if grep -q gtk-theme $HOME/.gtkrc-2.0; then
+					gtk2Theme=$(awk -F'"' '/^gtk-theme/ {print $2}' $HOME/.gtkrc-2.0)
+				fi
+
+				if grep -q icon-theme $HOME/.gtkrc-2.0; then
+					gtkIcons=$(awk -F'"' '/^gtk-icon-theme/ {print $2}' $HOME/.gtkrc-2.0)
+				fi
+
+				if grep -q font $HOME/.gtkrc-2.0; then
+					gtkFont=$(awk -F'"' '/^gtk-font-name/ {print $2}' $HOME/.gtkrc-2.0)
+				fi
+			fi
+			# $HOME/.gtkrc.mine theme detect only
+			if [ -f $HOME/.gtkrc.mine ]; then
+				if grep -q "^include" $HOME/.gtkrc.mine; then
+					gtk2Theme=$(grep '^include.*gtkrc' $HOME/.gtkrc.mine | awk -F "/" '{ print $5 }')
+				fi
+				if grep -q "^gtk-icon-theme-name" $HOME/.gtkrc.mine; then
+					gtkIcons=$(grep '^gtk-icon-theme-name' $HOME/.gtkrc.mine | awk -F '"' '{print $2}')
+				fi
+			fi
+			# /etc/gtk-2.0/gtkrc compatability
+			if [[ -f /etc/gtk-2.0/gtkrc && ! -f $HOME/.gtkrc-2.0 && ! -f $HOME/.gtkrc.mine ]]; then
+				if grep -q gtk-theme-name /etc/gtk-2.0/gtkrc; then
+					gtk2Theme=$(awk -F'"' '/^gtk-theme-name/ {print $2}' /etc/gtk-2.0/gtkrc)
+				fi
+				if grep -q gtk-fallback-theme-name /etc/gtk-2.0/gtkrc  && ! [ "x$gtk2Theme" = "x" ]; then
+					gtk2Theme=$(awk -F'"' '/^gtk-fallback-theme-name/ {print $2}' /etc/gtk-2.0/gtkrc)
+				fi
+
+				if grep -q icon-theme /etc/gtk-2.0/gtkrc; then
+					gtkIcons=$(awk -F'"' '/^icon-theme/ {print $2}' /etc/gtk-2.0/gtkrc)
+				fi
+				if  grep -q gtk-fallback-icon-theme /etc/gtk-2.0/gtkrc  && ! [ "x$gtkIcons" = "x" ]; then
+					gtkIcons=$(awk -F'"' '/^gtk-fallback-icon-theme/ {print $2}' /etc/gtk-2.0/gtkrc)
+				fi
+
+				if grep -q font /etc/gtk-2.0/gtkrc; then
+					gtkFont=$(awk -F'"' '/^gtk-font-name/ {print $2}' /etc/gtk-2.0/gtkrc)
+				fi
+			fi
+
+			# EXPERIMENTAL gtk3 Theme detection
+			if [ -f $HOME/.config/gtk-3.0/settings.ini ]; then
+				if grep -q gtk-theme-name $HOME/.config/gtk-3.0/settings.ini; then
+					gtk3Theme=$(awk -F'=' '/^gtk-theme-name/ {print $2}' $HOME/.config/gtk-3.0/settings.ini)
+				fi
+			fi
+
+			# Proper gtk3 Theme detection
+			#if [ $(which gsettings) ] && [ "$distro" != "Mac OS X" ]; then
+			#	gtk3Theme="$(gsettings get org.gnome.desktop.interface gtk-theme | tr -d \"\'\")"
+			#fi
+			if type -p gsettings >/dev/null 2>&1; then
+				gtk3Theme=$(gsettings get org.gnome.desktop.interface gtk-theme 2>/dev/null)
+				gtk3Theme=${gtk3Theme//"'"}
+			fi
+
+			# ROX-Filer icon detect only
+			if [ -a ${XDG_CONFIG_HOME:-${HOME}/.config}/rox.sourceforge.net/ROX-Filer/Options ]; then
+				gtkIcons=$(awk -F'[>,<]' '/^icon_theme/ {print $3}' ${XDG_CONFIG_HOME:-${HOME}/.config}/rox.sourceforge.net/ROX-Filer/Options)
+			fi
+
+			# E17 detection
+			if [ $E_ICON_THEME ]; then
+				gtkIcons=${E_ICON_THEME}
+				gtk2Theme="Not available."
+				gtkFont="Not available."
+			fi
+
+			# Background Detection (feh, nitrogen)
+			if [ "$background_detect" == "1" ]; then
+				if [ -a $HOME/.fehbg ]; then
+					gtkBackgroundFull=$(awk -F"'" '/feh --bg/{print $2}' $HOME/.fehbg 2>/dev/null)
+					gtkBackground=$(echo "$gtkBackgroundFull" | awk -F"/" '{print $NF}')
+				elif [ -a ${XDG_CONFIG_HOME:-${HOME}/.config}/nitrogen/bg-saved.cfg ]; then
+					gtkBackground=$(awk -F"/" '/file=/ {print $NF}' ${XDG_CONFIG_HOME:-${HOME}/.config}/nitrogen/bg-saved.cfg)
+				fi
+			fi
+
+			# Font detection (OS X)
+			if [[ ${distro} == "Mac OS X" ]]; then
+				if ps -U ${USER} | grep [F]inder >/dev/null 2>&1; then
+					gtkFont="Not Found"
+					if [ -f ~/Library/Preferences/com.googlecode.iterm2.plist ]; then
+						gtkFont=$(str1=$(defaults read com.googlecode.iTerm2|grep -m 1 "Normal Font");echo ${str1:29:${#str1}-29-2})
+					fi
+				fi
+			fi
+
+			if [ "$distro" == "Cygwin" -a "$gtkFont" == "Not Found" ]; then
+				if [ -f $HOME/.minttyrc ]; then
+					gtkFont="$(cat $HOME/.minttyrc | grep '^Font=.*' | grep -o '[0-9A-z ]*$')"
+				fi
+			fi
+		;;
+	esac
+	if [[ "$verbosity" -eq "1" ]]; then
+		verboseOut "Finding GTK2 theme...found as '$gtk2Theme'"
+		verboseOut "Finding GTK3 theme...found as '$gtk3Theme'"
+		verboseOut "Finding icon theme...found as '$gtkIcons'"
+		verboseOut "Finding user font...found as '$gtkFont'"
+		[[ $gtkBackground ]] && verboseOut "Finding background...found as '$gtkBackground'"
+	fi
+}
+# GTK Theme\Icon\Font Detection - END
+
+# Android-specific detections
+detectdroid () {
+	distro_ver=$(getprop ro.build.version.release)
+
+	hostname=$(getprop net.hostname)
+
+	_device=$(getprop ro.product.device)
+	_model=$(getprop ro.product.model)
+	device="${_model} (${_device})"
+
+	if [[ $(getprop ro.build.host) == "cyanogenmod" ]]; then
+		rom=$(getprop ro.cm.version)
+	else
+		rom=$(getprop ro.build.display.id)
+	fi
+
+	baseband=$(getprop ro.baseband)
+
+	cpu=$(grep '^Processor' /proc/cpuinfo)
+	cpu=$(echo "$cpu" | sed 's/Processor.*: //')
+}
+
+
+#######################
+# End Detection Phase
+#######################
+
+takeShot () {
+	if [[ -z $screenCommand ]]; then
+		if [[ "$hostshot" == "1" ]]; then
+			if [ "$distro" == "Mac OS X" ]; then printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x "${shotfile}" &> /dev/null
+			else scrot -cd3 "${shotfile}"; fi
+			if [ -f "${shotfile}" ]; then
+				[[ "$verbosity" -eq "1" ]] && verboseOut "Screenshot saved at '${shotfile}'"
+				scp -qo ConnectTimeout="${scptimeout}" "${shotfile}" "${serveraddr}:${serverdir}"
+				echo -e "${bold}==>${c0} Your screenshot can be viewed at ${baseurl}/$shotfile"
+			else
+				verboseOut "ERROR: Problem saving screenshot to ${shotfile}"
+			fi
+		else
+			if [ "$distro" == "Mac OS X" ]; then printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x "${shotfile}" &> /dev/null
+			else scrot -cd3 "${shotfile}"; fi
+			if [ -f "${shotfile}" ]; then
+				[[ "$verbosity" -eq "1" ]] && verboseOut "Screenshot saved at '${shotfile}'"
+			else
+				verboseOut "ERROR: Problem saving screenshot to ${shotfile}"
+			fi
+		fi
+	else
+		$screenCommand
+	fi
+}
+
+
+
+asciiText () {
+# Distro logos and ASCII outputs
+	if [[ "$fake_distro" ]]; then distro="${fake_distro}"; fi
+	if [[ "$asc_distro" ]]; then myascii="${asc_distro}"
+	else myascii="${distro}"; fi
+	case ${myascii} in
+		"Arch Linux - Old")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light blue') # Light Blue
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("$c1              __                      %s"
+"$c1          _=(SDGJT=_                 %s"
+"$c1        _GTDJHGGFCVS)                %s"
+"$c1       ,GTDJGGDTDFBGX0               %s"
+"$c1      JDJDIJHRORVFSBSVL$c2-=+=,_        %s"
+"$c1     IJFDUFHJNXIXCDXDSV,$c2  \"DEBL      %s"
+"$c1    [LKDSDJTDU=OUSCSBFLD.$c2   '?ZWX,   %s"
+"$c1   ,LMDSDSWH'     \`DCBOSI$c2     DRDS], %s"
+"$c1   SDDFDFH'         !YEWD,$c2   )HDROD  %s"
+"$c1  !KMDOCG            &GSU|$c2\_GFHRGO\'  %s"
+"$c1  HKLSGP'$c2           __$c1\TKM0$c2\GHRBV)'  %s"
+"$c1 JSNRVW'$c2       __+MNAEC$c1\IOI,$c2\BN'     %s"
+"$c1 HELK['$c2    __,=OFFXCBGHC$c1\FD)         %s"
+"$c1 ?KGHE $c2\_-#DASDFLSV='$c1    'EF         %s"
+"$c1 'EHTI                    !H         %s"
+"$c1  \`0F'                    '!         %s"
+"                                     %s"
+"                                     %s")
+		;;
+
+		"Arch Linux")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light cyan') # Light
+				c2=$(getColor 'cyan') # Dark
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="1"
+			fulloutput=("${c1}                   -\`"
+"${c1}                  .o+\`                 %s"
+"${c1}                 \`ooo/                %s"
+"${c1}                \`+oooo:               %s"
+"${c1}               \`+oooooo:              %s"
+"${c1}               -+oooooo+:             %s"
+"${c1}             \`/:-:++oooo+:            %s"
+"${c1}            \`/++++/+++++++:           %s"
+"${c1}           \`/++++++++++++++:          %s"
+"${c1}          \`/+++o"${c2}"oooooooo"${c1}"oooo/\`        %s"
+"${c2}         "${c1}"./"${c2}"ooosssso++osssssso"${c1}"+\`       %s"
+"${c2}        .oossssso-\`\`\`\`/ossssss+\`      %s"
+"${c2}       -osssssso.      :ssssssso.     %s"
+"${c2}      :osssssss/        osssso+++.    %s"
+"${c2}     /ossssssss/        +ssssooo/-    %s"
+"${c2}   \`/ossssso+/:-        -:/+osssso+-  %s"
+"${c2}  \`+sso+:-\`                 \`.-/+oso: %s"
+"${c2} \`++:.                           \`-/+/%s"
+"${c2} .\`                                 \`/%s")
+		;;
+
+		"Mint")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light green') # Bold Green
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("                                       %s"
+"$c2 MMMMMMMMMMMMMMMMMMMMMMMMMmds+.       %s"
+"$c2 MMm----::-://////////////oymNMd+\`    %s"
+"$c2 MMd      "$c1"/++                "$c2"-sNMd:   %s"
+"$c2 MMNso/\`  "$c1"dMM    \`.::-. .-::.\` "$c2".hMN:  %s"
+"$c2 ddddMMh  "$c1"dMM   :hNMNMNhNMNMNh: "$c2"\`NMm  %s"
+"$c2     NMm  "$c1"dMM  .NMN/-+MMM+-/NMN\` "$c2"dMM  %s"
+"$c2     NMm  "$c1"dMM  -MMm  \`MMM   dMM. "$c2"dMM  %s"
+"$c2     NMm  "$c1"dMM  -MMm  \`MMM   dMM. "$c2"dMM  %s"
+"$c2     NMm  "$c1"dMM  .mmd  \`mmm   yMM. "$c2"dMM  %s"
+"$c2     NMm  "$c1"dMM\`  ..\`   ...   ydm. "$c2"dMM  %s"
+"$c2     hMM- "$c1"+MMd/-------...-:sdds  "$c2"dMM  %s"
+"$c2     -NMm- "$c1":hNMNNNmdddddddddy/\`  "$c2"dMM  %s"
+"$c2      -dMNs-"$c1"\`\`-::::-------.\`\`    "$c2"dMM  %s"
+"$c2       \`/dMNmy+/:-------------:/yMMM  %s"
+"$c2          ./ydNMMMMMMMMMMMMMMMMMMMMM  %s"
+"$c2             \.MMMMMMMMMMMMMMMMMMM    %s"
+"                                      %s")
+		;;
+
+
+		"LMDE")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light green') # Bold Green
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("          "${c1}"\`.-::---..            %s"
+"${c2}       .:++++ooooosssoo:.      %s"
+"${c2}     .+o++::.      \`.:oos+.    %s"
+"${c2}    :oo:.\`             -+oo"${c1}":   %s"
+"${c2}  "${c1}"\`"${c2}"+o/\`    ."${c1}"::::::"${c2}"-.    .++-"${c1}"\`  %s"
+"${c2} "${c1}"\`"${c2}"/s/    .yyyyyyyyyyo:   +o-"${c1}"\`  %s"
+"${c2} "${c1}"\`"${c2}"so     .ss       ohyo\` :s-"${c1}":  %s"
+"${c2} "${c1}"\`"${c2}"s/     .ss  h  m  myy/ /s\`"${c1}"\`  %s"
+"${c2} \`s:     \`oo  s  m  Myy+-o:\`   %s"
+"${c2} \`oo      :+sdoohyoydyso/.     %s"
+"${c2}  :o.      .:////////++:       %s"
+"${c2}  \`/++        "${c1}"-:::::-          %s"
+"${c2}   "${c1}"\`"${c2}"++-                        %s"
+"${c2}    "${c1}"\`"${c2}"/+-                       %s"
+"${c2}      "${c1}"."${c2}"+/.                     %s"
+"${c2}        "${c1}"."${c2}":+-.                  %s"
+"${c2}           \`--.\`\`              %s"
+"                               %s")
+		;;
+
+		"Ubuntu")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light red') # Light Red
+				c3=$(getColor 'yellow') # Bold Yellow
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("$c2                          ./+o+-       %s"
+"$c1                  yyyyy- $c2-yyyyyy+     %s"
+"$c1               $c1://+//////$c2-yyyyyyo     %s"
+"$c3           .++ $c1.:/++++++/-$c2.+sss/\`     %s"
+"$c3         .:++o:  $c1/++++++++/:--:/-     %s"
+"$c3        o:+o+:++.$c1\`..\`\`\`.-/oo+++++/    %s"
+"$c3       .:+o:+o/.$c1          \`+sssoo+/   %s"
+"$c1  .++/+:$c3+oo+o:\`$c1             /sssooo.  %s"
+"$c1 /+++//+:$c3\`oo+o$c1               /::--:.  %s"
+"$c1 \+/+o+++$c3\`o++o$c2               ++////.  %s"
+"$c1  .++.o+$c3++oo+:\`$c2             /dddhhh.  %s"
+"$c3       .+.o+oo:.$c2          \`oddhhhh+   %s"
+"$c3        \+.++o+o\`\`-\`\`$c2\`\`.:ohdhhhhh+    %s"
+"$c3         \`:o+++ $c2\`ohhhhhhhhyo++os:     %s"
+"$c3           .o:$c2\`.syhhhhhhh/$c3.oo++o\`     %s"
+"$c2               /osyyyyyyo$c3++ooo+++/    %s"
+"$c2                   \`\`\`\`\` $c3+oo+++o\:    %s"
+"$c3                          \`oo++.      %s")
+		;;
+
+		"Debian")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light red') # Light Red
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+                        fulloutput=("  $c1       _,met\$\$\$\$\$gg.           %s"
+"  $c1    ,g\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$P.       %s"
+"  $c1  ,g\$\$P\"\"       \"\"\"Y\$\$.\".     %s"
+"  $c1 ,\$\$P'              \`\$\$\$.     %s"
+"  $c1',\$\$P       ,ggs.     \`\$\$b:   %s"
+"  $c1\`d\$\$'     ,\$P\"\'   $c2.$c1    \$\$\$    %s"
+"  $c1 \$\$P      d\$\'     $c2,$c1    \$\$P    %s"
+"  $c1 \$\$:      \$\$.   $c2-$c1    ,d\$\$'    %s"
+"  $c1 \$\$\;      Y\$b._   _,d\$P'     %s"
+"  $c1 Y\$\$.    $c2\`.$c1\`\"Y\$\$\$\$P\"'         %s"
+"  $c1 \`\$\$b      $c2\"-.__              %s"
+"  $c1  \`Y\$\$                        %s"
+"  $c1   \`Y\$\$.                      %s"
+"  $c1     \`\$\$b.                    %s"
+"  $c1       \`Y\$\$b.                 %s"
+"  $c1          \`\"Y\$b._             %s"
+"  $c1              \`\"\"\"\"           %s"
+"                                %s")
+		;;
+
+
+		"CrunchBang")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+            fulloutput=("                                       %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
+"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
+"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"               %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"               %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
+"$c2                                      %s")
+		;;
+
+		"Gentoo")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light purple') # Light Purple
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("$c2         -/oyddmdhs+:.                %s"
+"$c2     -o"$c1"dNMMMMMMMMNNmhy+"$c2"-\`            %s"
+"$c2   -y"$c1"NMMMMMMMMMMMNNNmmdhy"$c2"+-          %s"
+"$c2 \`o"$c1"mMMMMMMMMMMMMNmdmmmmddhhy"$c2"/\`       %s"
+"$c2 om"$c1"MMMMMMMMMMMN"$c2"hhyyyo"$c1"hmdddhhhd"$c2"o\`     %s"
+"$c2.y"$c1"dMMMMMMMMMMd"$c2"hs++so/s"$c1"mdddhhhhdm"$c2"+\`   %s"
+"$c2 oy"$c1"hdmNMMMMMMMN"$c2"dyooy"$c1"dmddddhhhhyhN"$c2"d.  %s"
+"$c2  :o"$c1"yhhdNNMMMMMMMNNNmmdddhhhhhyym"$c2"Mh  %s"
+"$c2    .:"$c1"+sydNMMMMMNNNmmmdddhhhhhhmM"$c2"my  %s"
+"$c2       /m"$c1"MMMMMMNNNmmmdddhhhhhmMNh"$c2"s:  %s"
+"$c2    \`o"$c1"NMMMMMMMNNNmmmddddhhdmMNhs"$c2"+\`   %s"
+"$c2  \`s"$c1"NMMMMMMMMNNNmmmdddddmNMmhs"$c2"/.     %s"
+"$c2 /N"$c1"MMMMMMMMNNNNmmmdddmNMNdso"$c2":\`       %s"
+"$c2+M"$c1"MMMMMMNNNNNmmmmdmNMNdso"$c2"/-          %s"
+"$c2yM"$c1"MNNNNNNNmmmmmNNMmhs+/"$c2"-\`              %s"
+"$c2/h"$c1"MMNNNNNNNNMNdhs++/"$c2"-\`               %s"
+"$c2\`/"$c1"ohdmmddhys+++/:"$c2".\`                  %s"
+"$c2  \`-//////:--.                       %s")
+		;;
+
+
+		"Funtoo")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light purple') # Light Purple
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("                                                     %s"
+"                                                    %s"
+"                                                    %s"
+"                                                    %s"
+"${c1}     _______               ____                     %s"
+"${c1}    /MMMMMMM/             /MMMM| _____  _____       %s"
+"${c1} __/M${c2}.MMM.${c1}M/_____________|M${c2}.M${c1}MM|/MMMMM\/MMMMM\      %s"
+"${c1}|MMMM${c2}MM'${c1}MMMMMMMMMMMMMMMMMMM${c2}MM${c1}MMMM${c2}.MMMM..MMMM.${c1}MM\    %s"
+"${c1}|MM${c2}MMMMMMM${c1}/m${c2}MMMMMMMMMMMMMMMMMMMMMM${c1}MMMM${c2}MM${c1}MMMM${c2}MM${c1}MM|   %s"
+"${c1}|MMMM${c2}MM${c1}MMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MMMMM${c2}\MMM${c1}MMM${c2}MM${c1}MMMM${c2}MM${c1}MMMM${c2}MM${c1}MM|   %s"
+"${c1}  |MM${c2}MM${c1}MMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MMM${c1}MMMM${c2}'MMMM''MMMM'${c1}MM/    %s"
+"${c1}  |MM${c2}MM${c1}MMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MMM${c1}MMM\MMMMM/\MMMMM/      %s"
+"${c1}  |MM${c2}MM${c1}MMM${c2}MM${c1}MMMMMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MMMMM'${c1}M|                  %s"
+"${c1}  |MM${c2}MM${c1}MMM${c2}MMMMMMMMMMMMMMMMM MM'${c1}M/                   %s"
+"${c1}  |MMMMMMMMMMMMMMMMMMMMMMMMMMMM/                    %s"
+"                                                    %s"
+"                                                    %s"
+"                                                    %s")
+		;;
+
+		"Fedora")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light blue') # Light Blue
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("$c2           /:-------------:\          %s"
+"$c2        :-------------------::       %s"
+"$c2      :-----------"$c1"/shhOHbmp"$c2"---:\\     %s"
+"$c2    /-----------"$c1"omMMMNNNMMD  "$c2"---:    %s"
+"$c2   :-----------"$c1"sMMMMNMNMP"$c2"     ---:   %s"
+"$c2  :-----------"$c1":MMMdP"$c2"-----      ---   %s"
+"$c2 ,------------"$c1":MMMd"$c2"------      ---:  %s"
+"$c2 :------------"$c1":MMMd"$c2"-----      .---:  %s"
+"$c2 :----    "$c1"oNMMMMMMMMMNho"$c2"     .----:  %s"
+"$c2 :--      "$c1"+shhhMMMmhhy++"$c2"   .------   %s"
+"$c2 :-      -----"$c1":MMMd"$c2"--------------:   %s"
+"$c2 :-     ------"$c1"/MMMd"$c2"-------------;    %s"
+"$c2 :-    ${c1}..${c2}----"$c1"/hMMMy"$c2"------------:     %s"
+"$c2 :--"$c1" :dMNdhhdNMMNo"$c2"------------;      %s"
+"$c2 :---"$c1":sdNMMMMNds:"$c2"------------:       %s"
+"$c2 :------"$c1":://:"$c2"-------------::         %s"
+"$c2 :---------------------://           %s"
+"                                     %s")
+		;;
+
+		"FreeBSD")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # white
+				c2=$(getColor 'light red') # Light Red
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("                                      %s"   # user@host
+"   "$c1"\`\`\`                        "$c2"\`      %s"      # OS
+"  "$c1"\` \`.....---..."$c2"....--.\`\`\`   -/      %s"     # Kernel
+"  "$c1"+o   .--\`         "$c2"/y:\`      +.     %s"        # Uptime
+"  "$c1" yo\`:.            "$c2":o      \`+-      %s"        # Packages
+"    "$c1"y/               "$c2"-/\`   -o/       %s"         # Shell
+"   "$c1".-                  "$c2"::/sy+:.      %s"          # Resolution
+"   "$c1"/                     "$c2"\`--  /      %s"         # DE
+"  "$c1"\`:                          "$c2":\`     %s"        # WM 
+"  "$c1"\`:                          "$c2":\`     %s"        # WM Theme
+"   "$c1"/                          "$c2"/      %s"          # GTK2 Theme
+"   "$c1".-                        "$c2"-.      %s"          # GTK3 Theme
+"    "$c1"--                      "$c2"-.       %s"          # Icon Theme
+"     "$c1"\`:\`                  "$c2"\`:\`        %s"      # Font
+"       "$c2".--             \`--.          %s"              # Disk
+"         "$c2" .---.....----.             %s"               # CPU
+"                                     %s"                    # GPU
+"                                     %s"                    # RAM
+)
+                ;;
+
+
+		"OpenBSD")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'yellow') # Light Yellow
+				c2=$(getColor 'brown') # Bold Yellow
+				c3=$(getColor 'light cyan') # Light Cyan
+				c4=$(getColor 'light red') # Light Red
+				c5=$(getColor 'dark grey')
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="$my_lcolor"; c2="${my_color}"; fi
+			startline="3"
+			fulloutput=(
+"                                       "$c3" _      "
+"                                       "$c3"(_)      "
+""$c1"              |    .                            "
+""$c1"          .   |L  /|   .         "$c3" _      %s"
+""$c1"      _ . |\ _| \--+._/| .       "$c3"(_)    %s"
+""$c1"     / ||\| Y J  )   / |/| ./           %s"
+""$c1"    J  |)'( |        \` F\`.'/       "$c3" _   %s"
+""$c1"  -<|  F         __     .-<        "$c3"(_)  %s"
+""$c1"    | /       .-'"$c3". "$c1"\`.  /"$c3"-. "$c1"L___         %s"
+""$c1"    J \      <    "$c3"\ "$c1" | | "$c5"O"$c3"\\\\"$c1"|.-' "$c3" _      %s"
+""$c1"  _J \  .-    \\\\"$c3"/ "$c5"O "$c3"| "$c1"| \  |"$c1"F    "$c3"(_)     %s"
+""$c1" '-F  -<_.     \   .-'  \`-' L__         %s"
+""$c1"__J  _   _.     >-'  "$c2")"$c4"._.   "$c1"|-'         %s         "
+""$c1" \`-|.'   /_.          "$c4"\_|  "$c1" F           %s     "
+""$c1"  /.-   .                _.<            %s"
+""$c1" /'    /.'             .'  \`\           %s"
+""$c1"  /L  /'   |/      _.-'-\               %s "
+""$c1" /'J       ___.---'\|                   %s"
+""$c1"   |\  .--' V  | \`. \`                   %s "
+""$c1"   |/\`. \`-.     \`._)                    %s"
+""$c1"      / .-.\                            %s"
+""$c1"      \ (  \`\                           "
+""$c1"       \`.\                                  "
+)
+		;;
+
+		"DragonFlyBSD")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light red') # Red
+				c2=$(getColor 'white') # White
+				c3=$(getColor 'yellow') #
+				c4=$(getColor 'light red')
+			fi
+			startline="0"
+			fulloutput=("                     "$c1" |                     %s"
+"                    "$c1" .-.                   %s"
+"                   "$c3" ()"$c1"I"$c3"()                  %s"
+"              "$c1" \"==.__:-:__.==\"             %s"
+"              "$c1"\"==.__/~|~\__.==\"            %s"
+"              "$c1"\"==._(  Y  )_.==\"            %s"
+"   "$c2".-'~~\"\"~=--...,__"$c1"\/|\/"$c2"__,...--=~\"\"~~'-. %s"
+"  "$c2"(               ..="$c1"\\\\="$c1"/"$c2"=..               )%s"
+"   "$c2"\`'-.        ,.-\"\`;"$c1"/=\\\\"$c2" ;\"-.,_        .-'\`%s"
+"      "$c2" \`~\"-=-~\` .-~\` "$c1"|=|"$c2" \`~-. \`~-=-\"~\`     %s"
+"       "$c2"     .-~\`    /"$c1"|=|"$c2"\    \`~-.          %s"
+"       "$c2"  .~\`       / "$c1"|=|"$c2" \       \`~.       %s"
+" "$c2"    .-~\`        .'  "$c1"|=|"$c2"  \\\\\`.        \`~-.  %s"
+" "$c2"  (\`     _,.-=\"\`  "$c1"  |=|"$c2"    \`\"=-.,_     \`) %s"
+" "$c2"   \`~\"~\"\`        "$c1"   |=|"$c2"           \`\"~\"~\`  %s"
+"                   "$c1"  /=\                   %s"
+"                   "$c1"  \=/                   %s"
+"                   "$c1"   ^                    %s"
+)
+		;;
+
+		"NetBSD")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light red') # Light Red
+				c2=$(getColor 'white') # White
+			fi
+			startline="0"
+			fulloutput=(
+"                                  "$c1"__,gnnnOCCCCCOObaau,_      %s"
+"   "$c2"_._                    "$c1"__,gnnCCCCCCCCOPF\"''              %s"
+"  "$c2"(N\\\\\\\\"$c1"XCbngg,._____.,gnnndCCCCCCCCCCCCF\"___,,,,___          %s"
+"   "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOPYvv.     %s"
+"    "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCPF\"''               %s"
+"     "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCCCCCCOF\"'                     %s"
+"      "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCOF\"'                         %s"
+"       "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCPF\"'                             %s"
+"        "$c2"\\\\N\\\\\\\\"$c1"\"PCOCCCOCCFP\"\"                                  %s"
+"         "$c2"\\\\N\                                                %s"
+"          "$c2"\\\\N\                                               %s"
+"           "$c2"\\\\N\                                              %s"
+"            "$c2"\\\\NN\                                            %s"
+"             "$c2"\\\\NN\                                           %s"
+"              "$c2"\\\\NNA.                                         %s"
+"               "$c2"\\\\NNA,                                        %s"
+"                "$c2"\\\\NNN,                                       %s"
+"                 "$c2"\\\\NNN\                                      %s"
+"                  "$c2"\\\\NNN\ "
+"                   "$c2"\\\\NNNA")
+		;;
+
+		"Mandriva"|"Mandrake")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light blue') # Light Blue
+				c2=$(getColor 'yellow') # Bold Yellow
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("                                          %s"
+"$c2                         \`\`              %s"
+"$c2                        \`-.              %s"
+"$c1       \`               $c2.---              %s"
+"$c1     -/               $c2-::--\`             %s"
+"$c1   \`++    $c2\`----...\`\`\`-:::::.             %s"
+"$c1  \`os.      $c2.::::::::::::::-\`\`\`     \`  \` %s"
+"$c1  +s+         $c2.::::::::::::::::---...--\` %s"
+"$c1 -ss:          $c2\`-::::::::::::::::-.\`\`.\`\` %s"
+"$c1 /ss-           $c2.::::::::::::-.\`\`   \`    %s"
+"$c1 +ss:          $c2.::::::::::::-            %s"
+"$c1 /sso         $c2.::::::-::::::-            %s"
+"$c1 .sss/       $c2-:::-.\`   .:::::            %s"
+"$c1  /sss+.    $c2..\`$c1  \`--\`    $c2.:::            %s"
+"$c1   -ossso+/:://+/-\`        $c2.:\`           %s"
+"$c1     -/+ooo+/-.              $c2\`           %s"
+"                                         %s"
+"                                         %s")
+		;;
+
+		"openSUSE")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light green') # Bold Green
+				c2=$(getColor 'white') # Bold White
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("$c2             .;ldkO0000Okdl;.                %s"
+"$c2         .;d00xl:,'....';:ok00d;.           %s"
+"$c2       .d00l'                ,o00d.         %s"
+"$c2     .d0Kd."$c1" :Okxol:;'.          "$c2":O0d.       %s"
+"$c2    'OK"$c1"KKK0kOKKKKKKKKKKOxo:'      "$c2"lKO'      %s"
+"$c2   ,0K"$c1"KKKKKKKKKKKKKKK0d:"$c2",,,"$c1":dx:"$c2"    ;00,     %s"
+"$c2  .OK"$c1"KKKKKKKKKKKKKKKk."$c2".oOkdl."$c1"'0k."$c2"   cKO.    %s"
+"$c2  :KK"$c1"KKKKKKKKKKKKKKK: "$c2"kKx..od "$c1"lKd"$c2"   .OK:    %s"
+"$c2  dKK"$c1"KKKKKKKKKOx0KKKd "$c2";0KKKO, "$c1"kKKc"$c2"   dKd    %s"
+"$c2  dKK"$c1"KKKKKKKKKK;.;oOKx,.."$c2"'"$c1"..;kKKK0."$c2"  dKd    %s"
+"$c2  :KK"$c1"KKKKKKKKKK0o;...;cdxxOK0Oxc,.  "$c2".0K:    %s"
+"$c2   kKK"$c1"KKKKKKKKKKKKK0xl;'......,cdo  "$c2"lKk     %s"
+"$c2   '0K"$c1"KKKKKKKKKKKKKKKKKKKK00KKOo;  "$c2"c00'     %s"
+"$c2    .kK"$c1"KKOxddxkOO00000Okxoc;'.   "$c2".dKk.      %s"
+"$c2      l0Ko.                    .c00l.       %s"
+"$c2       .l0Kk:.              .;xK0l.         %s"
+"$c2          ,lkK0xl:;,,,,;:ldO0kl,            %s"
+"$c2              .':ldxkkkkxdl:'.              %s")
+		;;
+
+		"Slackware")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light blue') # Light Blue
+				c2=$(getColor 'white') # Bold White
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="1"
+			fulloutput=("$c1                   :::::::"
+"$c1             :::::::::::::::::::               %s"
+"$c1          :::::::::::::::::::::::::           %s"
+"$c1        ::::::::"${c2}"cllcccccllllllll"${c1}"::::::        %s"
+"$c1     :::::::::"${c2}"lc               dc"${c1}":::::::      %s"
+"$c1    ::::::::"${c2}"cl   clllccllll    oc"${c1}":::::::::    %s"
+"$c1   :::::::::"${c2}"o   lc"${c1}"::::::::"${c2}"co   oc"${c1}"::::::::::   %s"
+"$c1  ::::::::::"${c2}"o    cccclc"${c1}":::::"${c2}"clcc"${c1}"::::::::::::  %s"
+"$c1  :::::::::::"${c2}"lc        cclccclc"${c1}":::::::::::::  %s"
+"$c1 ::::::::::::::"${c2}"lcclcc          lc"${c1}":::::::::::: %s"
+"$c1 ::::::::::"${c2}"cclcc"${c1}":::::"${c2}"lccclc     oc"${c1}"::::::::::: %s"
+"$c1 ::::::::::"${c2}"o    l"${c1}"::::::::::"${c2}"l    lc"${c1}"::::::::::: %s"
+"$c1  :::::"${c2}"cll"${c1}":"${c2}"o     clcllcccll     o"${c1}":::::::::::  %s"
+"$c1  :::::"${c2}"occ"${c1}":"${c2}"o                  clc"${c1}":::::::::::  %s"
+"$c1   ::::"${c2}"ocl"${c1}":"${c2}"ccslclccclclccclclc"${c1}":::::::::::::   %s"
+"$c1    :::"${c2}"oclcccccccccccccllllllllllllll"${c1}":::::    %s"
+"$c1     ::"${c2}"lcc1lcccccccccccccccccccccccco"${c1}"::::     %s"
+"$c1       ::::::::::::::::::::::::::::::::       %s"
+"$c1         ::::::::::::::::::::::::::::         %s"
+"$c1            ::::::::::::::::::::::"
+"$c1                 ::::::::::::")
+		;;
+
+		"Red Hat Linux")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light red') # Light Red
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("                                           %s"
+"$c2              \`.-..........\`              %s"
+"$c2             \`////////::.\`-/.             %s"
+"$c2             -: ....-////////.            %s"
+"$c2             //:-::///////////\`           %s"
+"$c2      \`--::: \`-://////////////:           %s"
+"$c2      //////-    \`\`.-:///////// .\`        %s"
+"$c2      \`://////:-.\`    :///////::///:\`     %s"
+"$c2        .-/////////:---/////////////:     %s"
+"$c2           .-://////////////////////.     %s"
+"$c1          yMN+\`.-$c2::///////////////-\`      %s"
+"$c1       .-\`:NMMNMs\`  \`..-------..\`         %s"
+"$c1        MN+/mMMMMMhoooyysshsss            %s"
+"$c1 MMM    MMMMMMMMMMMMMMyyddMMM+            %s"
+"$c1  MMMM   MMMMMMMMMMMMMNdyNMMh\`     hyhMMM %s"
+"$c1   MMMMMMMMMMMMMMMMyoNNNMMM+.   MMMMMMMM  %s"
+"$c1    MMNMMMNNMMMMMNM+ mhsMNyyyyMNMMMMsMM   %s"
+"                                          %s")
+		;;
+
+		"Frugalware")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light blue') # Light Blue
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="3"
+			fulloutput=("${c2}          \`++/::-.\`"
+"${c2}         /o+++++++++/::-.\`"
+"${c2}        \`o+++++++++++++++o++/::-.\`"
+"${c2}        /+++++++++++++++++++++++oo++/:-.\`\`         %s"
+"${c2}       .o+ooooooooooooooooooosssssssso++oo++/:-\`  %s"
+"${c2}       ++osoooooooooooosssssssssssssyyo+++++++o:  %s"
+"${c2}      -o+ssoooooooooooosssssssssssssyyo+++++++s\`  %s"
+"${c2}      o++ssoooooo++++++++++++++sssyyyyo++++++o:   %s"
+"${c2}     :o++ssoooooo"${c1}"/-------------"${c2}"+syyyyyo+++++oo    %s"
+"${c2}    \`o+++ssoooooo"${c1}"/-----"${c2}"+++++ooosyyyyyyo++++os:    %s"
+"${c2}    /o+++ssoooooo"${c1}"/-----"${c2}"ooooooosyyyyyyyo+oooss     %s"
+"${c2}   .o++++ssooooos"${c1}"/------------"${c2}"syyyyyyhsosssy-     %s"
+"${c2}   ++++++ssooooss"${c1}"/-----"${c2}"+++++ooyyhhhhhdssssso      %s"
+"${c2}  -s+++++syssssss"${c1}"/-----"${c2}"yyhhhhhhhhhhhddssssy.      %s"
+"${c2}  sooooooyhyyyyyh"${c1}"/-----"${c2}"hhhhhhhhhhhddddyssy+       %s"
+"${c2} :yooooooyhyyyhhhyyyyyyhhhhhhhhhhdddddyssy\`       %s"
+"${c2} yoooooooyhyyhhhhhhhhhhhhhhhhhhhddddddysy/        %s"
+"${c2}-ysooooooydhhhhhhhhhhhddddddddddddddddssy         %s"
+"${c2} .-:/+osssyyyysyyyyyyyyyyyyyyyyyyyyyyssy:         %s"
+"${c2}       \`\`.-/+oosysssssssssssssssssssssss          %s"
+"${c2}               \`\`.:/+osyysssssssssssssh.          %s"
+"${c2}                        \`-:/+osyyssssyo"
+"${c2}                                .-:+++\`")
+		;;
+
+
+		"Peppermint")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light red') # Light Red
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("${c2}             8ZZZZZZ"${c1}"MMMMM               %s"
+"${c2}          .ZZZZZZZZZ"${c1}"MMMMMMM.           %s"
+"${c1}        MM"${c2}"ZZZZZZZZZ"${c1}"MMMMMMM"${c2}"ZZZZ         %s"
+"${c1}      MMMMM"${c2}"ZZZZZZZZ"${c1}"MMMMM"${c2}"ZZZZZZZM       %s"
+"${c1}     MMMMMMM"${c2}"ZZZZZZZ"${c1}"MMMM"${c2}"ZZZZZZZZZ.      %s"
+"${c1}    MMMMMMMMM"${c2}"ZZZZZZ"${c1}"MMM"${c2}"ZZZZZZZZZZZI     %s"
+"${c1}   MMMMMMMMMMM"${c2}"ZZZZZZ"${c1}"MM"${c2}"ZZZZZZZZZZ"${c1}"MMM    %s"
+"${c2}   .ZZZ"${c1}"MMMMMMMMMM"${c2}"IZZ"${c1}"MM"${c2}"ZZZZZ"${c1}"MMMMMMMMM   %s"
+"${c2}   ZZZZZZZ"${c1}"MMMMMMMM"${c2}"ZZ"${c1}"M"${c2}"ZZZZ"${c1}"MMMMMMMMMMM   %s"
+"${c2}   ZZZZZZZZZZZZZZZZ"${c1}"M"${c2}"Z"${c1}"MMMMMMMMMMMMMMM   %s"
+"${c2}   .ZZZZZZZZZZZZZ"${c1}"MMM"${c2}"Z"${c1}"M"${c2}"ZZZZZZZZZZ"${c1}"MMMM   %s"
+"${c2}   .ZZZZZZZZZZZ"${c1}"MMM"${c2}"7ZZ"${c1}"MM"${c2}"ZZZZZZZZZZ7"${c1}"M    %s"
+"${c2}    ZZZZZZZZZ"${c1}"MMMM"${c2}"ZZZZ"${c1}"MMMM"${c2}"ZZZZZZZ77     %s"
+"${c1}     MMMMMMMMMMMM"${c2}"ZZZZZ"${c1}"MMMM"${c2}"ZZZZZ77      %s"
+"${c1}      MMMMMMMMMM"${c2}"7ZZZZZZ"${c1}"MMMMM"${c2}"ZZ77       %s"
+"${c1}       .MMMMMMM"${c2}"ZZZZZZZZ"${c1}"MMMMM"${c2}"Z7Z        %s"
+"${c1}         MMMMM"${c2}"ZZZZZZZZZ"${c1}"MMMMMMM         %s"
+"${c2}           NZZZZZZZZZZZ"${c1}"MMMMM           %s"
+"${c2}              ZZZZZZZZZ"${c1}"MM")
+		;;
+
+		"SolusOS")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'dark grey') # Light Gray
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("${c1}               e         e      %s"
+"${c1}             eee       ee      %s"
+"${c1}            eeee     eee       %s"
+"${c2}        wwwwwwwww"${c1}"eeeeee        %s"
+"${c2}     wwwwwwwwwwwwwww"${c1}"eee        %s"
+"${c2}   wwwwwwwwwwwwwwwwwww"${c1}"eeeeeeee %s"
+"${c2}  wwwww     "${c1}"eeeee"${c2}"wwwwww"${c1}"eeee    %s"
+"${c2} www          "${c1}"eeee"${c2}"wwwwww"${c1}"e      %s"
+"${c2} ww             "${c1}"ee"${c2}"wwwwww       %s"
+"${c2} w                 wwwww       %s"
+"${c2}                   wwwww       %s"
+"${c2}                  wwwww        %s"
+"${c2}                 wwwww         %s"
+"${c2}                wwww           %s"
+"${c2}               wwww            %s"
+"${c2}             wwww              %s"
+"${c2}           www                 %s"
+"${c2}         ww                    %s")
+		;;
+
+		"Mageia")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+			 	c2=$(getColor 'light cyan') # Light Cyan
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("$c2               .°°.               %s"
+"$c2                °°   .°°.        %s"
+"$c2                .°°°. °°         %s"
+"$c2                .   .            %s"
+"$c2                 °°° .°°°.       %s"
+"$c2             .°°°.   '___'       %s"
+"$c1            .${c2}'___'     $c1   .      %s"
+"$c1          :dkxc;'.  ..,cxkd;     %s"
+"$c1        .dkk. kkkkkkkkkk .kkd.   %s"
+"$c1       .dkk.  ';cloolc;.  .kkd   %s"
+"$c1       ckk.                .kk;  %s"
+"$c1       xO:                  cOd  %s"
+"$c1       xO:                  lOd  %s"
+"$c1       lOO.                .OO:  %s"
+"$c1       .k00.              .00x   %s"
+"$c1        .k00;            ;00O.   %s"
+"$c1         .lO0Kc;,,,,,,;c0KOc.    %s"
+"$c1            ;d00KKKKKK00d;       %s"
+"$c1               .,KKKK,.            ")
+		;;
+
+
+		"ParabolaGNU/Linux-libre")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light purple') # Light Purple
+				c2=$(getColor 'white') # White
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("                                  %s"
+"${c1}              eeeeeeeee          %s"
+"${c1}          eeeeeeeeeeeeeee        %s"
+"${c1}       eeeeee"${c2}"//////////"${c1}"eeeee     %s"
+"${c1}     eeeee"${c2}"///////////////"${c1}"eeeee   %s"
+"${c1}   eeeee"${c2}"///           ////"${c1}"eeee   %s"
+"${c1}  eeee"${c2}"//              ///"${c1}"eeeee   %s"
+"${c1} eee                 "${c2}"///"${c1}"eeeee    %s"
+"${c1}ee                  "${c2}"//"${c1}"eeeeee     %s"
+"${c1}e                  "${c2}"/"${c1}"eeeeeee      %s"
+"${c1}                  eeeeeee        %s"
+"${c1}                 eeeeee          %s"
+"${c1}                eeeeee           %s"
+"${c1}               eeeee             %s"
+"${c1}              eeee               %s"
+"${c1}            eee                  %s"
+"${c1}           ee                    %s"
+"${c1}          e                      %s")
+		;;
+
+
+		"Viperr")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'dark grey') # Dark Gray
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("${c1}    wwzapd         dlzazw       %s"
+"${c1}   an"${c2}"#"${c1}"zncmqzepweeirzpas"${c2}"#"${c1}"xz     %s"
+"${c1} apez"${c2}"##"${c1}"qzdkawweemvmzdm"${c2}"##"${c1}"dcmv   %s"
+"${c1}zwepd"${c2}"####"${c1}"qzdweewksza"${c2}"####"${c1}"ezqpa  %s"
+"${c1}ezqpdkapeifjeeazezqpdkazdkwqz  %s"
+"${c1} ezqpdksz"${c2}"##"${c1}"wepuizp"${c2}"##"${c1}"wzeiapdk   %s"
+"${c1}  zqpakdpa"${c2}"#"${c1}"azwewep"${c2}"#"${c1}"zqpdkqze    %s"
+"${c1}    apqxalqpewenwazqmzazq      %s"
+"${c1}     mn"${c2}"##"${c1}"=="${c2}"#######"${c1}"=="${c2}"##"${c1}"qp       %s"
+"${c1}      qw"${c2}"##"${c1}"="${c2}"#######"${c1}"="${c2}"##"${c1}"zl        %s"
+"${c1}      z0"${c2}"######"${c1}"="${c2}"######"${c1}"0a        %s"
+"${c1}       qp"${c2}"#####"${c1}"="${c2}"#####"${c1}"mq         %s"
+"${c1}       az"${c2}"####"${c1}"==="${c2}"####"${c1}"mn         %s"
+"${c1}        ap"${c2}"#########"${c1}"qz          %s"
+"${c1}         9qlzskwdewz           %s"
+"${c1}          zqwpakaiw            %s"
+"${c1}            qoqpe              %s"
+"                               %s")
+		;;
+
+
+		"LinuxDeepin")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light green') # Bold Green
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("${c1}  eeeeeeeeeeeeeeeeeeeeeeeeeeee    %s"
+"${c1} eee  eeeeeee          eeeeeeee  %s"
+"${c1}ee   eeeeeeeee      eeeeeeeee ee %s"
+"${c1}e   eeeeeeeee     eeeeeeeee    e %s"
+"${c1}e   eeeeeee    eeeeeeeeee      e %s"
+"${c1}e   eeeeee    eeeee            e %s"
+"${c1}e    eeeee    eee  eee         e %s"
+"${c1}e     eeeee   ee eeeeee        e %s"
+"${c1}e      eeeee   eee   eee       e %s"
+"${c1}e       eeeeeeeeee  eeee       e %s"
+"${c1}e         eeeee    eeee        e %s"
+"${c1}e               eeeeee         e %s"
+"${c1}e            eeeeeee           e %s"
+"${c1}e eee     eeeeeeee             e %s"
+"${c1}eeeeeeeeeeeeeeee               e %s"
+"${c1}eeeeeeeeeeeee                 ee %s"
+"${c1} eeeeeeeeeee                eee  %s"
+"${c1}  eeeeeeeeeeeeeeeeeeeeeeeeeeee   %s"
+"                                 %s")
+		;;
+
+
+		"Chakra")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light blue') # Light Blue
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("${c1}      _ _ _        \"kkkkkkkk.          %s"
+"${c1}    ,kkkkkkkk.,    \'kkkkkkkkk,        %s"
+"${c1}    ,kkkkkkkkkkkk., \'kkkkkkkkk.       %s"
+"${c1}   ,kkkkkkkkkkkkkkkk,\'kkkkkkkk,       %s"
+"${c1}  ,kkkkkkkkkkkkkkkkkkk\'kkkkkkk.       %s"
+"${c1}   \"\'\'\"\'\'\',;::,,\"\'\'kkk\'\'kkkkk;   __   %s"
+"${c1}       ,kkkkkkkkkk, \"k\'\'kkkkk\' ,kkkk  %s"
+"${c1}     ,kkkkkkk\' ., \' .: \'kkkk\',kkkkkk  %s"
+"${c1}   ,kkkkkkkk\'.k\'   ,  ,kkkk;kkkkkkkkk %s"
+"${c1}  ,kkkkkkkk\';kk \'k  \"\'k\',kkkkkkkkkkkk %s"
+"${c1} .kkkkkkkkk.kkkk.\'kkkkkkkkkkkkkkkkkk\' %s"
+"${c1} ;kkkkkkkk\'\'kkkkkk;\'kkkkkkkkkkkkk\'\'   %s"
+"${c1} \'kkkkkkk; \'kkkkkkkk.,\"\"\'\'\"\'\'\"\"       %s"
+"${c1}   \'\'kkkk;  \'kkkkkkkkkk.,             %s"
+"${c1}      \';\'    \'kkkkkkkkkkkk.,          %s"
+"${c1}              ';kkkkkkkkkk\'           %s"
+"${c1}                ';kkkkkk\'             %s"
+"${c1}                   \"\'\'\"               %s")
+		;;
+
+
+		"Fuduntu")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'dark grey') # Dark Gray
+				c2=$(getColor 'yellow') # Bold Yellow
+				c3=$(getColor 'light red') # Light Red
+				c4=$(getColor 'white') # White
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+			startline="1"
+			fulloutput=("${c1}       \`dwoapfjsod\`"${c2}"           \`dwoapfjsod\`"
+"${c1}    \`xdwdsfasdfjaapz\`"${c2}"       \`dwdsfasdfjaapzx\`     %s"
+"${c1}  \`wadladfladlafsozmm\`"${c2}"     \`wadladfladlafsozmm\`  %s"
+"${c1} \`aodowpwafjwodisosoaas\`"${c2}" \`odowpwafjwodisosoaaso\` %s"
+"${c1} \`adowofaowiefawodpmmxs\`"${c2}" \`dowofaowiefawodpmmxso\` %s"
+"${c1} \`asdjafoweiafdoafojffw\`"${c2}" \`sdjafoweiafdoafojffwq\` %s"
+"${c1}  \`dasdfjalsdfjasdlfjdd\`"${c2}" \`asdfjalsdfjasdlfjdda\`  %s"
+"${c1}   \`dddwdsfasdfjaapzxaw\`"${c2}" \`ddwdsfasdfjaapzxawo\`   %s"
+"${c1}     \`dddwoapfjsowzocmw\`"${c2}" \`ddwoapfjsowzocmwp\`     %s"
+"${c1}       \`ddasowjfowiejao\`"${c2}" \`dasowjfowiejaow\`       %s"
+"                                                 %s"
+"${c3}       \`ddasowjfowiejao\`"${c4}" \`dasowjfowiejaow\`       %s"
+"${c3}     \`dddwoapfjsowzocmw\`"${c4}" \`ddwoapfjsowzocmwp\`     %s"
+"${c3}   \`dddwdsfasdfjaapzxaw\`"${c4}" \`ddwdsfasdfjaapzxawo\`   %s"
+"${c3}  \`dasdfjalsdfjasdlfjdd\`"${c4}" \`asdfjalsdfjasdlfjdda\`  %s"
+"${c3} \`asdjafoweiafdoafojffw\`"${c4}" \`sdjafoweiafdoafojffwq\` %s"
+"${c3} \`adowofaowiefawodpmmxs\`"${c4}" \`dowofaowiefawodpmmxso\` %s"
+"${c3} \`aodowpwafjwodisosoaas\`"${c4}" \`odowpwafjwodisosoaaso\` %s"
+"${c3}   \`wadladfladlafsozmm\`"${c4}"     \`wadladfladlafsozmm\` %s"
+"${c3}     \`dwdsfasdfjaapzx\`"${c4}"       \`dwdsfasdfjaapzx\`"
+"${c3}        \`woapfjsod\`"${c4}"             \`woapfjsod\`")
+		;;
+
+		"Mac OS X")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'green') # Green
+				c2=$(getColor 'brown') # Yellow
+				c3=$(getColor 'light red') # Orange
+				c4=$(getColor 'red') # Red
+				c5=$(getColor 'purple') # Purple
+				c6=$(getColor 'blue') # Blue
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; c4="${my_lcolor}"; c5="${my_lcolor}"; c6="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("\n${c1}                 -/+:.          %s"
+"${c1}                :++++.         %s"
+"${c1}               /+++/.          %s"
+"${c1}       .:-::- .+/:-\`\`.::-      %s"
+"${c1}    .:/++++++/::::/++++++/:\`   %s"
+"${c2}  .:///////////////////////:\`  %s"
+"${c2}  ////////////////////////\`    %s"
+"${c3} -+++++++++++++++++++++++\`     %s"
+"${c3} /++++++++++++++++++++++/      %s"
+"${c4} /sssssssssssssssssssssss.     %s"
+"${c4} :ssssssssssssssssssssssss-    %s"
+"${c5}  osssssssssssssssssssssssso/\` %s"
+"${c5}  \`syyyyyyyyyyyyyyyyyyyyyyyy+\` %s"
+"${c6}   \`ossssssssssssssssssssss/   %s"
+"${c6}     :ooooooooooooooooooo+.    %s"
+"${c6}      \`:+oo+/:-..-:/+o+/-      %s\n")
+		;;
+
+		"Windows"|"Cygwin")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light red') # Red
+				c2=$(getColor 'light green') # Green
+				c3=$(getColor 'light blue') # Blue
+				c4=$(getColor 'yellow') # Yellow
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; c4="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("${c1}        ,.=:!!t3Z3z.,                 %s"
+"${c1}       :tt:::tt333EE3                %s"
+"${c1}       Et:::ztt33EEEL${c2} @Ee.,      .., %s"
+"${c1}      ;tt:::tt333EE7${c2} ;EEEEEEttttt33# %s"
+"${c1}     :Et:::zt333EEQ.${c2} \$EEEEEttttt33QL %s"
+"${c1}     it::::tt333EEF${c2} @EEEEEEttttt33F  %s"
+"${c1}    ;3=*^\`\`\`\"*4EEV${c2} :EEEEEEttttt33@.  %s"
+"${c3}    ,.=::::!t=., ${c1}\`${c2} @EEEEEEtttz33QF   %s"
+"${c3}   ;::::::::zt33)${c2}   \"4EEEtttji3P*    %s"
+"${c3}  :t::::::::tt33.${c4}:Z3z..${c2}  \`\`${c4} ,..g.    %s"
+"${c3}  i::::::::zt33F${c4} AEEEtttt::::ztF     %s"
+"${c3} ;:::::::::t33V${c4} ;EEEttttt::::t3      %s"
+"${c3} E::::::::zt33L${c4} @EEEtttt::::z3F      %s"
+"${c3}{3=*^\`\`\`\"*4E3)${c4} ;EEEtttt:::::tZ\`      %s"
+"${c3}             \`${c4} :EEEEtttt::::z7       %s"
+"${c4}                 \"VEzjt:;;z>*\`       %s")
+		;;
+
+		"Trisquel")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light blue') # Light Blue
+				c2=$(getColor 'light cyan') # Blue
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=(
+"${c1}                          â–„â–„â–„â–„â–„â–„       %s"
+"${c1}                       ▄█████████▄    %s"
+"${c1}       ▄▄▄▄▄▄         ████▀   ▀████   %s"
+"${c1}    ▄██████████▄     ████▀   ▄▄ ▀███  %s"
+"${c1}  ▄███▀▀   ▀▀████     ███▄   ▄█   ███ %s"
+"${c1} ▄███   ▄▄▄   ████▄    ▀██████   ▄███ %s"
+"${c1} ███   █▀▀██▄  █████▄     ▀▀   ▄████  %s"
+"${c1} ▀███      ███  ███████▄▄  ▄▄██████   %s"
+"${c1}  ▀███▄   ▄███  █████████████${c2}████▀    %s"
+"${c1}   ▀█████████    ███████${c2}███▀▀▀        %s"
+"${c1}     ▀▀███▀▀     ██${c2}████▀▀             %s"
+"${c2}                ██████▀   ▄▄▄▄        %s"
+"${c2}               █████▀   ████████      %s"
+"${c2}               █████   ███▀  ▀███     %s"
+"${c2}                ████▄   ██▄▄▄  ███    %s"
+"${c2}                 █████▄   ▀▀  ▄██     %s"
+"${c2}                   ██████▄▄▄████      %s"
+"${c2}                      ▀▀█████▀▀       %s")
+		;;
+
+		"Manjaro")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light green') # Green
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=(
+"${c1} ██████████████████  ████████     %s"
+"${c1} ██████████████████  ████████    %s"
+"${c1} ██████████████████  ████████    %s"
+"${c1} ██████████████████  ████████    %s"
+"${c1} ████████            ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1}           ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"${c1} ████████  ████████  ████████    %s"
+"                                 %s")
+		;;
+
+
+		"Manjaro-tree")
+			if [[ "$no_color" != "1" ]]; then
+				c1="\e[1;32m" # Green
+				c2="\e[1;33m" # Yellow
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=(
+"${c1}                         ###      %s"
+"${c1}     ###             ####        %s"
+"${c1}        ###       ####           %s"
+"${c1}         ##### #####             %s"
+"${c1}      #################          %s"
+"${c1}    ###     #####    ####        %s"
+"${c1}   ##        ${c2}OOO       ${c1}###       %s"
+"${c1}  #          ${c2}WW         ${c1}##       %s"
+"${c1}            ${c2}WW            ${c1}#      %s"
+"${c2}            WW                   %s"
+"${c2}            WW                   %s"
+"${c2}           WW                    %s"
+"${c2}           WW                    %s"
+"${c2}           WW                    %s"
+"${c2}          WW                     %s"
+"${c2}          WW                     %s"
+"${c2}          WW                     %s"
+"                                 %s")
+		;;
+
+
+
+		"elementary OS"|"elementary os")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=(
+"                                     %s"
+"${c1}         eeeeeeeeeeeeeeeee          %s"
+"${c1}      eeeeeeeeeeeeeeeeeeeeeee       %s"
+"${c1}    eeeee  eeeeeeeeeeee   eeeee     %s"
+"${c1}  eeee   eeeee       eee     eeee   %s"
+"${c1} eeee   eeee          eee     eeee  %s"
+"${c1}eee    eee            eee       eee %s"
+"${c1}eee   eee            eee        eee %s"
+"${c1}ee    eee           eeee       eeee %s"
+"${c1}ee    eee         eeeee      eeeeee %s"
+"${c1}ee    eee       eeeee      eeeee ee %s"
+"${c1}eee   eeee   eeeeee      eeeee  eee %s"
+"${c1}eee    eeeeeeeeee     eeeeee    eee %s"
+"${c1} eeeeeeeeeeeeeeeeeeeeeeee    eeeee  %s"
+"${c1}  eeeeeeee eeeeeeeeeeee      eeee   %s"
+"${c1}    eeeee                 eeeee     %s"
+"${c1}      eeeeeee         eeeeeee       %s"
+"${c1}         eeeeeeeeeeeeeeeee          %s")
+	;;
+
+
+		"Android")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light green') # Bold Green
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+			startline="2"
+	                fulloutput=(
+"${c2}       ╲ â–▂▂▂■╱"
+"${c2}       ▄███████▄ "
+"${c2}      ▄██${c1} ${c2}███${c1} ${c2}██▄        %s"
+"${c2}     ▄███████████▄      %s"
+"${c2}  ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄ █▄   %s"
+"${c2}  ██ █████████████ ██   %s"
+"${c2}  ██ █████████████ ██   %s"
+"${c2}  ██ █████████████ ██   %s"
+"${c2}  ██ █████████████ ██   %s"
+"${c2}     █████████████      %s"
+"${c2}      ███████████       %s"
+"${c2}       ██     ██"
+"${c2}       ██     ██")
+		;;
+
+		"Scientific Linux")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light blue')
+				c2=$(getColor 'light red')
+				c3=$(getColor 'white')
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="1"
+			fulloutput=("${c1}                  =/;;/-"
+"${c1}                 +:    //                    %s"
+"${c1}                /;      /;                  %s"
+"${c1}               -X        H.                 %s"
+"${c1} .//;;;:;;-,   X=        :+   .-;:=;:;#;.   %s"
+"${c1} M-       ,=;;;#:,      ,:#;;:=,       ,@   %s"
+"${c1} :#           :#.=/++++/=.$=           #=   %s"
+"${c1}  ,#;         #/:+/;,,/++:+/         ;+.    %s"
+"${c1}    ,+/.    ,;@+,        ,#H;,    ,/+,      %s"
+"${c1}       ;+;;/= @.  ${c2}.H${c3}#${c2}#X   ${c1}-X :///+;         %s"
+"${c1}       ;+=;;;.@,  ${c3}.X${c2}M${c3}@$.  ${c1}=X.//;=#/.        %s"
+"${c1}    ,;:      :@#=        =\$H:     .+#-      %s"
+"${c1}  ,#=         #;-///==///-//         =#,    %s"
+"${c1} ;+           :#-;;;:;;;;-X-           +:   %s"
+"${c1} @-      .-;;;;M-        =M/;;;-.      -X   %s"
+"${c1}  :;;::;;-.    #-        :+    ,-;;-;:==    %s"
+"${c1}               ,X        H.                 %s"
+"${c1}                ;/      #=                  %s"
+"${c1}                 //    +;                   %s"
+"${c1}                  '////'")
+		;;
+
+		"BackTrack Linux")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'light red') # Light Red
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="1"
+			fulloutput=("${c1}.............."
+"${c1}            ..,;:ccc,.                           %s"
+"${c1}          ......''';lxO.                        %s"
+"${c1}.....''''..........,:ld;                        %s"
+"${c1}           .';;;:::;,,.x,                       %s"
+"${c1}      ..'''.            0Xxoc:,.  ...           %s"
+"${c1}  ....                ,ONkc;,;cokOdc',.         %s"
+"${c1} .                   OMo           ':"${c2}"dd"${c1}"o.       %s"
+"${c1}                    dMc               :OO;      %s"
+"${c1}                    0M.                 .:o.    %s"
+"${c1}                    ;Wd                         %s"
+"${c1}                     ;XO,                       %s"
+"${c1}                       ,d0Odlc;,..              %s"
+"${c1}                           ..',;:cdOOd::,.      %s"
+"${c1}                                    .:d;.':;.   %s"
+"${c1}                                       'd,  .'  %s"
+"${c1}                                         ;l   ..%s"
+"${c1}                                          .o    %s"
+"${c1}                                            c   %s"
+"${c1}                                            .'"
+"${c1}                                             .")
+		;;
+		
+		"Kali Linux")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light blue') # White
+				c2=$(getColor 'black') # Light Red
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
+			startline="1"
+			fulloutput=("${c1}.............."
+"${c1}            ..,;:ccc,.                           %s"
+"${c1}          ......''';lxO.                        %s"
+"${c1}.....''''..........,:ld;                        %s"
+"${c1}           .';;;:::;,,.x,                       %s"
+"${c1}      ..'''.            0Xxoc:,.  ...           %s"
+"${c1}  ....                ,ONkc;,;cokOdc',.         %s"
+"${c1} .                   OMo           ':"${c2}"dd"${c1}"o.       %s"
+"${c1}                    dMc               :OO;      %s"
+"${c1}                    0M.                 .:o.    %s"
+"${c1}                    ;Wd                         %s"
+"${c1}                     ;XO,                       %s"
+"${c1}                       ,d0Odlc;,..              %s"
+"${c1}                           ..',;:cdOOd::,.      %s"
+"${c1}                                    .:d;.':;.   %s"
+"${c1}                                       'd,  .'  %s"
+"${c1}                                         ;l   ..%s"
+"${c1}                                          .o    %s"
+"${c1}                                            c   %s"
+"${c1}                                            .'"
+"${c1}                                             .")
+		;;
+
+                "Sabayon")
+                        if [[ "$no_color" != "1" ]]; then
+                                c1=$(getColor 'white') # White
+				c2=$(getColor 'light blue') # Blue
+                        fi
+                        if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+                        startline="0"
+                        fulloutput=("${c2}            ...........                %s"
+"${c2}         ..             ..            %s"
+"${c2}      ..                   ..         %s"
+"${c2}    ..           ${c1}o           ${c2}..       %s"
+"${c2}  ..            ${c1}:W'            ${c2}..     %s"
+"${c2} ..             ${c1}.d.             ${c2}..    %s"
+"${c2}:.             ${c1}.KNO              ${c2}.:   %s"
+"${c2}:.             ${c1}cNNN.             ${c2}.:   %s"
+"${c2}:              ${c1}dXXX,              ${c2}:   %s"
+"${c2}:   ${c1}.          dXXX,       .cd,   ${c2}:   %s"
+"${c2}:   ${c1}'kc ..     dKKK.    ,ll;:'    ${c2}:   %s"
+"${c2}:     ${c1}.xkkxc;..dkkkc',cxkkl       ${c2}:   %s"
+"${c2}:.     ${c1}.,cdddddddddddddo:.       ${c2}.:   %s"
+"${c2} ..         ${c1}:lllllll:           ${c2}..    %s"
+"${c2}   ..         ${c1}',,,,,          ${c2}..      %s"
+"${c2}     ..                     ..        %s"
+"${c2}        ..               ..           %s"
+"${c2}          ...............             %s")
+                ;;
+
+                "CentOS")
+                        if [[ "$no_color" != "1" ]]; then
+                                c1=$(getColor 'yellow') # White
+                                c2=$(getColor 'light green') # White
+                                c3=$(getColor 'light blue') # White
+                                c4=$(getColor 'light purple') # White
+                                c5=$(getColor 'white') # White
+                        fi
+                        if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+                        startline="0"
+                        fulloutput=("${c1}                   ..                    %s"
+"${c1}                 .PLTJ.                 %s"
+"${c1}                <><><><>                %s"
+"       ${c2}KKSSV' 4KKK ${c1}LJ${c4} KKKL.'VSSKK       %s"
+"       ${c2}KKV' 4KKKKK ${c1}LJ${c4} KKKKAL 'VKK       %s"
+"       ${c2}V' ' 'VKKKK ${c1}LJ${c4} KKKKV' ' 'V       %s"
+"       ${c2}.4MA.' 'VKK ${c1}LJ${c4} KKV' '.4Mb.       %s"
+"${c4}     . ${c2}KKKKKA.' 'V ${c1}LJ${c4} V' '.4KKKKK ${c3}.     %s"
+"${c4}   .4D ${c2}KKKKKKKA.'' ${c1}LJ${c4} ''.4KKKKKKK ${c3}FA.   %s"
+"${c4}    %s"
+"${c4}   'VD ${c3}KKKKKKKK'.. ${c2}LJ ${c1}..'KKKKKKKK ${c3}FV    %s"
+"${c4}     ' ${c3}VKKKKK'. .4 ${c2}LJ ${c1}K. .'KKKKKV ${c3}'     %s"
+"       ${c3} 'VK'. .4KK ${c2}LJ ${c1}KKA. .'KV'        %s"
+"       ${c3}A. . .4KKKK ${c2}LJ ${c1}KKKKA. . .4       %s"
+"       ${c3}KKA. 'KKKKK ${c2}LJ ${c1}KKKKK' .4KK       %s"
+"       ${c3}KKSSA. VKKK ${c2}LJ ${c1}KKKV .4SSKK       %s"
+"${c2}                <><><><>                 %s"
+"${c2}                 'MKKM'                  %s"
+"${c2}                   ''")
+		;;
+
+
+		"Jiyuu Linux")
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'light blue') # Light Blue
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("${c1}+++++++++++++++++++++++.        %s"
+"${c1}ss:-......-+so/:----.os-       %s"
+"${c1}ss        +s/        os-       %s"
+"${c1}ss       :s+         os-       %s"
+"${c1}ss       os.         os-       %s"
+"${c1}ss      .so          os-       %s"
+"${c1}ss      :s+          os-       %s"
+"${c1}ss      /s/          os-       %s"
+"${c1}ss      /s:          os-       %s"
+"${c1}ss      +s-          os-       %s"
+"${c1}ss-.....os:..........os-       %s"
+"${c1}++++++++os+++++++++oooo.       %s"
+"${c1}        os.     ./oo/.         %s"
+"${c1}        os.   ./oo:            %s"
+"${c1}        os. ./oo:              %s"
+"${c1}        os oo+-                %s"
+"${c1}        os+-                   %s"
+"${c1}        /.                     %s")
+		;;
+
+
+		*)
+			if [[ "$no_color" != "1" ]]; then
+				c1=$(getColor 'white') # White
+				c2=$(getColor 'dark grey') # Light Gray
+				c3=$(getColor 'yellow') # Light Yellow
+			fi
+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
+			startline="0"
+			fulloutput=("                             %s"
+"                            %s"
+"                            %s"
+"$c2         #####$c0              %s"
+"$c2        #######             %s"
+"$c2        ##"$c1"O$c2#"$c1"O$c2##             %s"
+"$c2        #$c3#####$c2#             %s"
+"$c2      ##$c1##$c3###$c1##$c2##           %s"
+"$c2     #$c1##########$c2##          %s"
+"$c2    #$c1############$c2##         %s"
+"$c2    #$c1############$c2###        %s"
+"$c3   ##$c2#$c1###########$c2##$c3#        %s"
+"$c3 ######$c2#$c1#######$c2#$c3######      %s"
+"$c3 #######$c2#$c1#####$c2#$c3#######      %s"
+"$c3   #####$c2#######$c3#####        %s"
+"                            %s"
+"                            %s"
+"                            %s")
+  		;;
+	esac
+
+
+	# Truncate lines based on terminal width.
+	if [ "$truncateSet" == "Yes" ]; then
+		for ((i=0; i<${#fulloutput[@]}; i++)); do
+			my_out=$(printf "${fulloutput[i]}$c0\n" "${out_array}")
+			my_out_full=$(echo "$my_out" | cat -v)
+			termWidth=$(tput cols)
+			SHOPT_EXTGLOB_STATE=$(shopt -p extglob)
+			read SHOPT_CMD SHOPT_STATE SHOPT_OPT <<< ${SHOPT_EXTGLOB_STATE}
+			if [[ ${SHOPT_STATE} == "-u" ]]; then
+				shopt -s extglob
+			fi
+
+			stringReal="${my_out_full//\^\[\[@([0-9]|[0-9];[0-9][0-9])m}"
+
+			if [[ ${SHOPT_STATE} == "-u" ]]; then
+				shopt -u extglob
+			fi
+
+			if [[ "${#stringReal}" -le "${termWidth}" ]]; then
+				echo -e "${my_out}"$c0
+			elif [[ "${#stringReal}" -gt "${termWidth}" ]]; then
+				((NORMAL_CHAR_COUNT=0))
+				for ((j=0; j<=${#my_out_full}; j++)); do
+					if [[ "${my_out_full:${j}:3}" == '^[[' ]]; then
+						if [[ "${my_out_full:${j}:5}" =~ ^\^\[\[[[:digit:]]m$ ]]; then
+							if [[ ${j} -eq 0 ]]; then
+								j=$((${j} + 5))
+							else
+								j=$((${j} + 4))
+							fi
+						elif [[ "${my_out_full:${j}:8}" =~ ^\^\[\[[[:digit:]]\;[[:digit:]][[:digit:]]m ]]; then
+							if [[ ${j} -eq 0 ]]; then
+								j=$((${j} + 8))
+							else
+								j=$((${j} + 7))
+							fi
+						fi
+					else
+						((NORMAL_CHAR_COUNT++))
+						if [[ ${NORMAL_CHAR_COUNT} -ge ${termWidth} ]]; then
+							echo -e "${my_out:0:$((${j} - 5))}"$c0
+							break 1
+						fi
+					fi
+				done
+			fi
+
+			if [[ "$i" -ge "$startline" ]]; then
+				unset out_array[0]
+				out_array=( "${out_array[@]}" )
+			fi
+		done
+	else
+		#n=${#fulloutput[*]}
+		for ((i=0; i<${#fulloutput[*]}; i++)); do
+			# echo "${out_array[@]}"
+			printf "${fulloutput[i]}$c0\n" "${out_array}"
+			if [[ "$i" -ge "$startline" ]]; then
+				unset out_array[0]
+				out_array=( "${out_array[@]}" )
+			fi
+		done
+	fi
+	# Done with ASCII output
+}
+
+infoDisplay () {
+	textcolor="\033[0m"
+	[[ "$my_hcolor" ]] && textcolor="${my_hcolor}"
+	#TODO: Centralize colors and use them across the board so we only change them one place.
+	myascii="${distro}"
+	[[ "${asc_distro}" ]] && myascii="${asc_distro}"
+	case ${myascii} in
+		"Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake"|"Chakra"|"Sabayon"|"Slackware"|"Mac OS X"|"Trisquel"|"Kali Linux"|"Jiyuu Linux") labelcolor=$(getColor 'light blue');;
+		"Arch Linux"|"Frugalware"|"Mageia") labelcolor=$(getColor 'light cyan');;
+		"Mint"|"LMDE"|"openSUSE"|"LinuxDeepin"|"DragonflyBSD"|"Manjaro"|"Manjaro-tree"|"Android") labelcolor=$(getColor 'light green');;
+		"Ubuntu"|"FreeBSD"|"Debian"|"BSD"|"Red Hat Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');;
+		"CrunchBang"|"SolusOS"|"Viperr"|"elementary"*) labelcolor=$(getColor 'dark grey');;
+		"Gentoo"|"ParabolaGNU/Linux-libre"|"Funtoo"|"Funtoo-text") labelcolor=$(getColor 'light purple');;
+		"CentOS"|*) labelcolor=$(getColor 'yellow');;
+	esac
+	[[ "$my_lcolor" ]] && labelcolor="${my_lcolor}"
+	if [[ "$no_color" == "1" ]]; then labelcolor=""; bold=""; c0=""; textcolor=""; fi
+	# Some verbosity stuff
+	[[ "$verbosity" == "1" ]] && [[ "$screenshot" == "1" ]] && verboseOut "Screenshot will be taken after info is displayed."
+	[[ "$verbosity" == "1" ]] && [[ "$hostshot" == "1" ]] && verboseOut "Screenshot will be transferred/uploaded to specified location."
+	#########################
+	# Info Variable Setting #
+	#########################
+	if [[ "${distro}" == "Android" ]]; then
+		myhostname=$(echo -e "${labelcolor}${hostname}"); out_array=( "${out_array[@]}" "$myhostname" )
+		mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $distro_ver"); out_array=( "${out_array[@]}" "$mydistro" )
+		mydevice=$(echo -e "$labelcolor Device:$textcolor $device"); out_array=( "${out_array[@]}" "$mydevice" )
+		myrom=$(echo -e "$labelcolor ROM:$textcolor $rom"); out_array=( "${out_array[@]}" "$myrom" )
+		mybaseband=$(echo -e "$labelcolor Baseband:$textcolor $baseband"); out_array=( "${out_array[@]}" "$mybaseband" )
+		mykernel=$(echo -e "$labelcolor Kernel:$textcolor $kernel"); out_array=( "${out_array[@]}" "$mykernel" )
+		myuptime=$(echo -e "$labelcolor Uptime:$textcolor $uptime"); out_array=( "${out_array[@]}" "$myuptime" )
+		mycpu=$(echo -e "$labelcolor CPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mycpu" )
+		mygpu=$(echo -e "$labelcolor GPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mygpu" )
+		mymem=$(echo -e "$labelcolor RAM:$textcolor $mem"); out_array=( "${out_array[@]}" "$mymem" )
+	else
+		if [[ "${display[@]}" =~ "host" ]]; then myinfo=$(echo -e "${labelcolor}${myUser}$textcolor${bold}@${c0}${labelcolor}${myHost}"); out_array=( "${out_array[@]}" "$myinfo" ); ((display_index++)); fi
+		if [[ "${display[@]}" =~ "distro" ]]; then
+			if [ "$distro" == "Mac OS X" ]; then
+				sysArch=`str1=$(ioreg -l -p IODeviceTree | grep firmware-abi);echo ${str1: -4: 2}bit`
+				prodVers=`prodVers=$(sw_vers|grep ProductVersion);echo ${prodVers:15}`
+				buildVers=`buildVers=$(sw_vers|grep BuildVersion);echo ${buildVers:14}`
+				if [ -n "$distro_more" ]; then mydistro=$(echo -e "$labelcolor OS:$textcolor $distro_more $sysArch")
+				else mydistro=$(echo -e "$labelcolor OS:$textcolor $sysArch $distro $prodVers $buildVers"); fi
+			elif [[ "$distro" == "Cygwin" ]]; then
+				distro=$(wmic os get name | head -2 | tail -1)
+				distro=$(expr match "$distro" '\(Microsoft Windows [A-Za-z0-9]\+\)')
+				sysArch=$(wmic os get OSArchitecture | head -2 | tail -1 | tr -d '\r ')
+				mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $sysArch")
+			else
+				if [ -n "$distro_more" ]; then mydistro=$(echo -e "$labelcolor OS:$textcolor $distro_more")
+				else mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $sysArch"); fi
+			fi
+			out_array=( "${out_array[@]}" "$mydistro" )
+			((display_index++))
+		fi
+		if [[ "${display[@]}" =~ "kernel" ]]; then mykernel=$(echo -e "$labelcolor Kernel:$textcolor $kernel"); out_array=( "${out_array[@]}" "$mykernel" ); ((display_index++)); fi
+		if [[ "${display[@]}" =~ "uptime" ]]; then myuptime=$(echo -e "$labelcolor Uptime:$textcolor $uptime"); out_array=( "${out_array[@]}" "$myuptime" ); ((display_index++)); fi
+		if [[ "${display[@]}" =~ "pkgs" ]]; then mypkgs=$(echo -e "$labelcolor Packages:$textcolor $pkgs"); out_array=( "${out_array[@]}" "$mypkgs" ); ((display_index++)); fi
+		if [[ "${display[@]}" =~ "shell" ]]; then myshell=$(echo -e "$labelcolor Shell:$textcolor $myShell"); out_array=( "${out_array[@]}" "$myshell" ); ((display_index++)); fi
+		if [[ -n "$DISPLAY" ]]; then
+			if [[ "${display[@]}" =~ "res" ]]; then myres=$(echo -e "$labelcolor Resolution:${textcolor} $xResolution"); out_array=( "${out_array[@]}" "$myres" ); ((display_index++)); fi
+			if [[ "${display[@]}" =~ "de" ]]; then
+				if [[ "${DE}" != "Not Present" ]]; then
+					myde=$(echo -e "$labelcolor DE:$textcolor $DE"); out_array=( "${out_array[@]}" "$myde" ); ((display_index++))
+				fi
+			fi
+			if [[ "${display[@]}" =~ "wm" ]]; then mywm=$(echo -e "$labelcolor WM:$textcolor $WM"); out_array=( "${out_array[@]}" "$mywm" ); ((display_index++)); fi
+			if [[ "${display[@]}" =~ "wmtheme" ]]; then
+					if [[ "${Win_theme}" == "Not Present" ]]; then
+						:
+					else
+						mywmtheme=$(echo -e "$labelcolor WM Theme:$textcolor $Win_theme"); out_array=( "${out_array[@]}" "$mywmtheme" ); ((display_index++)); fi
+					fi
+			if [[ "${display[@]}" =~ "gtk" ]]; then
+				if [ "$distro" == "Mac OS X" ]; then
+					if [ "$gtkIcons" != "Not Found" ]; then
+						if [ -n "$gtkIcons" ]; then 
+							myicons=$(echo -e "$labelcolor Icon Theme:$textcolor $gtkIcons"); out_array=( "${out_array[@]}" "$myicons" ); ((display_index++))
+						fi
+					fi
+					if [ "$gtkFont" != "Not Found" ]; then
+						if [ -n "$gtkFont" ]; then 
+							myfont=$(echo -e "$labelcolor Font:$textcolor $gtkFont"); out_array=( "${out_array[@]}" "$myfont" ); ((display_index++))
+						fi
+					fi
+				else
+					if [ "$gtk2Theme" != "Not Found" ]; then
+						if [ -n "$gtk2Theme" ]; then 
+							mygtk2="${gtk2Theme} [GTK2]"
+						fi
+					fi
+					if [ "$gtk3Theme" != "Not Found" ]; then
+						if [ -n "$mygtk2" ]; then 
+							mygtk3=", ${gtk3Theme} [GTK3]"
+						else
+							mygtk3="${gtk3Theme} [GTK3]"
+						fi
+					fi
+					mygtk=$(echo -e "$labelcolor GTK Theme:$textcolor ${mygtk2}${mygtk3}"); out_array=( "${out_array[@]}" "$mygtk" ); ((display_index++))
+					if [ "$gtkIcons" != "Not Found" ]; then
+						if [ -n "$gtkIcons" ]; then 
+							myicons=$(echo -e "$labelcolor Icon Theme:$textcolor $gtkIcons"); out_array=( "${out_array[@]}" "$myicons" ); ((display_index++))
+						fi
+					fi
+					if [ "$gtkFont" != "Not Found" ]; then
+						if [ -n "$gtkFont" ]; then 
+							myfont=$(echo -e "$labelcolor Font:$textcolor $gtkFont"); out_array=( "${out_array[@]}" "$myfont" ); ((display_index++))
+						fi
+					fi
+					# [ "$gtkBackground" ] && mybg=$(echo -e "$labelcolor BG:$textcolor $gtkBackground"); out_array=( "${out_array[@]}" "$mybg" ); ((display_index++))
+				fi
+			fi
+		elif [[ "$fake_distro" == "Cygwin" ]]; then
+			if [[ "${display[@]}" =~ "res" ]]; then myres=$(echo -e "$labelcolor Resolution:${textcolor} $xResolution"); out_array=( "${out_array[@]}" "$myres" ); ((display_index++)); fi
+			if [[ "${display[@]}" =~ "de" ]]; then
+				if [[ "${DE}" != "Not Present" ]]; then
+					myde=$(echo -e "$labelcolor DE:$textcolor $DE"); out_array=( "${out_array[@]}" "$myde" ); ((display_index++))
+				fi
+			fi
+			if [[ "${display[@]}" =~ "wm" ]]; then mywm=$(echo -e "$labelcolor WM:$textcolor $WM"); out_array=( "${out_array[@]}" "$mywm" ); ((display_index++)); fi
+			if [[ "${display[@]}" =~ "wmtheme" ]]; then
+				if [[ "${Win_theme}" == "Not Present" ]]; then
+					:
+				else
+					mywmtheme=$(echo -e "$labelcolor WM Theme:$textcolor $Win_theme"); out_array=( "${out_array[@]}" "$mywmtheme" ); ((display_index++))
+				fi
+			fi
+		fi
+		[[ "${fake_distro}" != "Cygwin" ]] && if [[ "${display[@]}" =~ "disk" ]]; then mydisk=$(echo -e "$labelcolor Disk:$textcolor $diskusage"); out_array=( "${out_array[@]}" "$mydisk" ); ((display_index++)); fi
+		if [[ "${display[@]}" =~ "cpu" ]]; then mycpu=$(echo -e "$labelcolor CPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mycpu" ); ((display_index++)); fi
+		if [[ "${display[@]}" =~ "gpu" ]] && [[ "$gpu" != "Not Found" ]]; then mygpu=$(echo -e "$labelcolor GPU:$textcolor $gpu"); out_array=( "${out_array[@]}" "$mygpu" ); ((display_index++)); fi
+		if [[ "${display[@]}" =~ "mem" ]]; then mymem=$(echo -e "$labelcolor RAM:$textcolor $mem"); out_array=( "${out_array[@]}" "$mymem" ); ((display_index++)); fi
+	fi
+	if [[ "$display_type" == "ASCII" ]]; then
+		asciiText
+	else
+		if [[ "${display[@]}" =~ "host" ]]; then echo -e " $myinfo"; fi
+		if [[ "${display[@]}" =~ "distro" ]]; then echo -e "$mydistro"; fi
+		if [[ "${display[@]}" =~ "kernel" ]]; then echo -e "$mykernel"; fi
+		if [[ "${distro}" == "Android" ]]; then
+			echo -e "$mydevice"
+			echo -e "$myrom"
+			echo -e "$mybaseband"
+			echo -e "$mykernel"
+			echo -e "$myuptime"
+			echo -e "$mycpu"
+			echo -e "$mymem"
+		else
+			if [[ "${display[@]}" =~ "uptime" ]]; then echo -e "$myuptime"; fi
+			if [[ "${display[@]}" =~ "pkgs" ]]; then echo -e "$mypkgs"; fi
+			if [[ "${display[@]}" =~ "shell" ]]; then echo -e "$myshell"; fi
+			if [[ "${display[@]}" =~ "res" ]]; then echo -e "$myres"; fi
+			if [[ "${display[@]}" =~ "de" ]]; then
+				if [[ "${DE}" != "Not Present" ]]; then echo -e "$myde"; fi
+			fi
+			if [[ "${display[@]}" =~ "wm" ]]; then
+				echo -e "$mywm"
+				if [[ "${Win_theme}" != "Not Present" ]]; then
+					echo -e "$mywmtheme"
+				fi
+			fi
+			if [[ "${display[@]}" =~ "gtk" ]]; then
+				echo -e "$mygtk2"
+				echo -e "$mygtk3"
+				echo -e "$myicons"
+				echo -e "$myfont"
+			fi
+			if [[ "${display[@]}" =~ "disk" ]]; then echo -e "$mydisk"; fi
+			if [[ "${display[@]}" =~ "cpu" ]]; then echo -e "$mycpu"; fi
+			if [[ "${display[@]}" =~ "gpu" ]]; then echo -e "$mygpu"; fi
+			if [[ "${display[@]}" =~ "mem" ]]; then echo -e "$mymem"; fi
+		fi
+	fi
+}
+
+##################
+# Let's Do This!
+##################
+
+if [[ -f "$HOME/.screenfetchOR" ]]; then
+    source $HOME/.screenfetchOR
+fi
+
+
+if [[ "$overrideDisplay" ]]; then
+	[[ "$verbosity" -eq "1" ]] && verboseOut "Found 'd' flag in syntax. Overriding some display options..."
+	overrideDisplay=${overrideDisplay//,/ }
+	display=( $overrideDisplay )
+fi
+
+# Check for android
+if type -p getprop >/dev/null 2>&1; then
+	distro="Android"
+	detectmem
+	detectuptime
+	detectkernel
+	detectdroid
+	infoDisplay
+	exit 0
+fi
+
+for i in "${display[@]}"; do
+	if [[ $i =~ wm ]]; then
+		 ! [[ $WM  ]] && detectwm;
+		 ! [[ $Win_theme ]] && detectwmtheme;
+	else
+		if [[ "${display[*]}" =~ "$i" ]]; then 
+			if [[ "$errorSuppress" == "1" ]]; then detect${i} 2>/dev/null
+			else detect${i}; fi
+		fi
+	fi
+done
+
+infoDisplay
+[ "$screenshot" == "1" ] && takeShot
+[ "$exportTheme" == "1" ] && themeExport
+
+exit 0
diff --git a/bin/updatekernel.sh b/bin/updatekernel.sh
new file mode 100755
index 0000000..ac2b579
--- /dev/null
+++ b/bin/updatekernel.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+### run: sh updatekernel.sh
+
+#download amd64|i386
+DownInstall() { wget $(lynx -dump -listonly $link | egrep 'all|'$@ ) ; echo dpkg -i *.deb ; }
+
+link=$(lynx --dump http://kernel.ubuntu.com/~kernel-ppa/mainline/ | awk '/http/{print $2}'  | grep -v rc | tail -n 1)
+KVERSION=$(echo $link | cut -d "/" -f 6)
+
+LastKernelInstalled=$(ls /boot/ | grep img | cut -d "-" -f2 | tail -n 1)
+LastKernelAvaliable=$(echo $KVERSION | sed -e "s/v//g"  | cut -d "-" -f1 )
+LastKernelRC=$(lynx --dump http://kernel.ubuntu.com/~kernel-ppa/mainline/ | awk '/http/{print $2}'  | grep rc | tail -n 1 | cut -d "/" -f 6)
+
+echo "\n\n\t\t[UBUNTU KERNELS] \
+\n\n\tLast installed :\t $LastKernelInstalled \
+\n\tLast Stable online :\t $LastKernelAvaliable
+\n\tLast RC online :\t $LastKernelRC"
+
+
+if [ $LastKernelInstalled = $LastKernelAvaliable ]  
+   then echo  "\n\n\t already updated to version" $KVERSION  "\n\n" # non serve "echo -e"
+	exit
+   else echo "\n\n\t upgrading to version" $KVERSION  "\n\n"
+fi
+
+
+########################
+
+echo "$(tput setaf 3)---kernel $KVERSION will be installed in an `uname -i` system---$(tput sgr0)"
+sleep 2
+read -p "Press Enter to continue, or abort by pressing CTRL+C" nothing
+echo "/n/n"
+
+DownloadFolder=$HOME/.kernel_update/kernel_$KVERSION
+echo $DownloadFolder
+mkdir -p $DownloadFolder
+cd $DownloadFolder
+
+#System architecture
+arch=`uname -m`
+if  [ $arch = i686 ] || [ $arch = i386 ]; then
+	DownInstall i386
+  elif [ $arch = "x86_64" ]; then
+	DownInstall amd64
+  else
+        echo "Unsupported Architecture"
+fi
+dpkg -i *.deb
+apt-get install -f
+rm -Rf $DownloadFolder
diff --git a/config b/config
deleted file mode 100644
index 68bb941..0000000
--- a/config
+++ /dev/null
@@ -1,14 +0,0 @@
-# mpv config, stored in ~/.mpv
-# Write your default config options here!
-# Play German audio if available, fall back to Japanese or English otherwise.
-alang = de,jpn,en
-# Subtitles
-#slang = de,en
-
-# Keep the player window on top of all other windows.
-#ontop=yes
-
-screenshot-format=png
-screenshot-png-compression=9
-screenshot-template="/home/horus/.mpv/screenshot/%f - %p"
---audio-display=no
diff --git a/dirhistory.sh b/dirhistory.sh
deleted file mode 100644
index cc652d2..0000000
--- a/dirhistory.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/zsh
-for ((i=1; i<=$DIRSTACKSIZE; i++)) echo "$i $dirstack[$i]"
diff --git a/input.conf b/input.conf
deleted file mode 100644
index 199c9bd..0000000
--- a/input.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-q quit 255
-Q quit_watch_later
diff --git a/mpv/config b/mpv/config
new file mode 100644
index 0000000..68bb941
--- /dev/null
+++ b/mpv/config
@@ -0,0 +1,14 @@
+# mpv config, stored in ~/.mpv
+# Write your default config options here!
+# Play German audio if available, fall back to Japanese or English otherwise.
+alang = de,jpn,en
+# Subtitles
+#slang = de,en
+
+# Keep the player window on top of all other windows.
+#ontop=yes
+
+screenshot-format=png
+screenshot-png-compression=9
+screenshot-template="/home/horus/.mpv/screenshot/%f - %p"
+--audio-display=no
diff --git a/mpv/input.conf b/mpv/input.conf
new file mode 100644
index 0000000..199c9bd
--- /dev/null
+++ b/mpv/input.conf
@@ -0,0 +1,2 @@
+q quit 255
+Q quit_watch_later
diff --git a/play b/play
deleted file mode 100755
index a42a67f..0000000
--- a/play
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/bin/bash
-
-# bash script to play files from a slow network ressource, FTP folder, samba share or network drive etc.
-# caches the file in /tmp and moves to $ARCHIV
-# -y to skip verification
-# export global variable $ARCHIV
-# set the exit code right for quitting
-# echo "q quit 255" >> ~/.mpv/input.conf
-
-
-if [ "$1" = "-y" ] || [ "$1" = "y" ] || [ "$1" = "Y" ] || [ "$1" = "-Y" ]; then
-	verify="yes"
-	shift
-else
-	verify=0
-fi
-
-player[0]=$(command -v mpv) 		#media player of choice
-player[1]=$(command -v mplayer)
-player[2]=$(command -v vlc)		#you shouldn't use vlc
-
-for i in "${player[@]}"; do
-	if [ ! $i = "" ]; then
-		player=$i
-		break
-	fi
-done
-
-if [ ! $player ]; then
-	echo "No media player found. Please edit this script manually. I recommend the mpv. http://mpv.io"
-	exit 1
-fi
-
-if [ ! -d $ARCHIV ]; then
-	echo "Note: Variable \$ARCHIV couldn't be found. It will play the file fine, but you should consider to organize your collection."
-	read -p "You can export it temporarily. If you do, just type the path to the folder , if you don't, leave it empty. " path
-	if [ $path ] && [ -d $path ] && [ -w $path ]; then
-		export ARCHIV=$path
-		echo "Roger that!"
-	fi
-fi
-
-pwd=$(pwd)
-
-if [ -d /tmp ] && [ -w /tmp ]; then
-	tmp="/tmp"
-else
-	read -p "Please name the directory to cache the file: " tmp
-	if [ ! -d $tmp ] || [ ! -w $tmp ]; then
-		echo "Directory doesn't exist or you don't have write permission."
-		exit 1
-	fi
-fi
-
-if [[ "$@" =~ ^https?://.* ]]; then
-	read -p "Detected hyperlink. Should we try to download (caching)? Type something random to play direct with the mpv. [y/N] " download
-	if [ $download = "ja" ] || [ $download = "yes" ] || [ $download = "j" ] || [ $download = "y" ] || [ $download = "Y" ]; then
-		cd "$tmp"
-		wget  "$@" &
-	elif [ $player =~ .*/mpv$ ] && [ $download ] && ( [ ! $download = "n" ] || [ ! $download = "N" ] || [ ! $download = "no" ] || [ ! $download = "nein" ] || [ ! $download = "NO" ]); then
-		echo "Playing directly using mpv."
-		mpv "$@"
-		exit 0
-	else
-		echo "This script is designed to cache media files from a FTP share or network drive. Exiting. "
-		exit 1
-	fi
-else
-	cp "$@" $tmp &
-fi
-
-echo -n "Preparing the awesome! Starting playback in.."
-echo -n " 2,"
-sleep 1
-echo -n " 1"
-sleep 1
-echo " Start!"
-
-cd $tmp
-$player "$@"
-if [ $? -eq 0 ]; then
-	if [ -d $ARCHIV ] && [ -w $ARCHIV ]; then
-		echo "Finished $@ succesfull."
-		if [ $verify -eq 0 ]; then
-			read -p "Should we move everything to the Archiv? ($ARCHIV) [Y/n/rm/other] " verify
-		fi
-		if [ ! $verify ] || [ $verify = "ja" ] || [ $verify = "yes" ] || [ $verify = "j" ] || [ $verify = "y" ] || [ $verify = "Y" ]; then
-			echo "Moving the stuff to $ARCHIV."
-			mv -v "$@" "$ARCHIV"
-			if [ $? -eq 0 ]; then
-				cd $pwd
-				rm -v "$@"
-			fi
-		elif [ $verify = "other" ] || [ $verify = "o" ] || [ $verify = "O" ] || [ $verify = "OTHER" ]; then
-			read -p "Please tell us the absolute path: " path
-			if [ -d $path ] && [ -w $path ]; then
-				echo "Moving to $path."
-				mv -v "$@" "$path"
-				if [ $? -eq 0 ]; then
-					cd $pwd
-                                       	rm -v "$@"
-                               	fi
-			else
-				echo "Sorry, \"$path\" doesn't exist."
-				exit 1
-			fi
-		elif [ $verify = "r" ] || [ $verify = "rm" ] || [ $verify = "remove" ] || [ $verify = "RM" ] || [ $verify = "R" ]; then
-			echo "Cleaning the mess up. Only removing files from $tmp."
-			rm -v "$@"
-		else
-			echo "Okay, don't touching the files."		
-		fi
-	else
-		echo "Can't move to \"$ARCHIV\". Directory doesn't exist or you don't have write permission."
-		exit 1
-	fi
-else
-	echo "Something is broken with the media player!"
-	exit 1
-fi
-
-echo "Have a nice day!"
diff --git a/playf b/playf
deleted file mode 100755
index 12dd5cb..0000000
--- a/playf
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-mpv --playlist="$1"
diff --git a/rtorrent/.rtorrent.rc b/rtorrent/.rtorrent.rc
new file mode 100755
index 0000000..772ad75
--- /dev/null
+++ b/rtorrent/.rtorrent.rc
@@ -0,0 +1,121 @@
+# This is an example resource file for rTorrent. Copy to
+# ~/.rtorrent.rc and enable/modify the options as needed. Remember to
+# uncomment the options you wish to enable.
+
+# Maximum and minimum number of peers to connect to per torrent.
+#min_peers = 40
+max_peers = 100
+
+# Same as above but for seeding completed torrents (-1 = same as downloading)
+min_peers_seed = -1
+max_peers_seed = -1
+
+# Maximum number of simultanious uploads per torrent.
+max_uploads = 50
+
+# Global upload and download rate in KiB. "0" for unlimited.
+download_rate = 500
+upload_rate = 50
+
+# Default directory to save the downloaded torrents.
+#directory = /home/horus/Downloads
+
+# Default session directory. Make sure you don't run multiple instance
+# of rtorrent using the same session directory. Perhaps using a
+# relative path?
+session = /home/horus/.session
+
+# Watch a directory for new torrents, and stop those that have been
+# deleted.
+#schedule = watch_directory,5,5,load_start=/media/watashino/Downloads/*.torrent,d.set_directory=/media/watashino/Animebytes/"
+#schedule = untied_directory,5,5,stop_untied=
+### watch another directory with a different destination
+#schedule = watch_directory_2,5,5,"load_start=/media/watashino/Animebytes/*.torrent,d.set_directory=/media/watashino/Animebytes/"
+#schedule = watch_directory_3,5,5,"load_start=/media/watashino/Summer\ Season/*torrent
+
+### send mail when torrent is completed
+system.method.set_key = event.download.finished,notify_me,"execute=/home/horus/.scripte/rtorrent_mail.sh,$d.get_name="
+
+
+# Close torrents when diskspace is low.
+schedule = low_diskspace,5,60,close_low_diskspace=100M
+
+# Stop torrents when reaching upload ratio in percent,
+# when also reaching total upload in bytes, or when
+# reaching final upload ratio in percent.
+# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
+#schedule = ratio,60,60,stop_on_ratio=200,200M,2000
+
+# The ip address reported to the tracker.
+#ip = 127.0.0.1
+#ip = rakshasa.no
+
+# The ip address the listening socket and outgoing connections is
+# bound to.
+#bind = 127.0.0.1
+#bind = rakshasa.no
+
+# Port range to use for listening.
+port_range = 6890-6999
+
+# Start opening ports at a random position within the port range.
+#port_random = no
+
+# Check hash for finished torrents. Might be usefull until the bug is
+# fixed that causes lack of diskspace not to be properly reported.
+#check_hash = no
+
+# Set whetever the client should try to connect to UDP trackers.
+#use_udp_trackers = yes
+
+# Alternative calls to bind and ip that should handle dynamic ip's.
+#schedule = ip_tick,0,1800,ip=rakshasa
+#schedule = bind_tick,0,1800,bind=rakshasa
+
+# Encryption options, set to none (default) or any combination of the following:
+# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
+#
+# The example value allows incoming encrypted connections, starts unencrypted
+# outgoing connections but retries with encryption if they fail, preferring
+# plaintext to RC4 encryption after the encrypted handshake
+#
+ encryption = allow_incoming,enable_retry,prefer_plaintext
+
+ dht = disable
+
+#
+# Do not modify the following parameters unless you know what you're doing.
+#
+
+# Hash read-ahead controls how many MB to request the kernel to read
+# ahead. If the value is too low the disk may not be fully utilized,
+# while if too high the kernel might not be able to keep the read
+# pages in memory thus end up trashing.
+#hash_read_ahead = 10
+
+# Interval between attempts to check the hash, in milliseconds.
+#hash_interval = 100
+
+# Number of attempts to check the hash while using the mincore status,
+# before forcing. Overworked systems might need lower values to get a
+# decent hash checking rate.
+#hash_max_tries = 10
+
+# Max number of files to keep open simultaniously.
+#max_open_files = 128
+
+# Number of sockets to simultaneously keep open.
+#max_open_sockets = 
+
+
+# Example of scheduling commands: Switch between two ip's every 5
+# seconds.
+#schedule = "ip_tick1,5,10,ip=torretta"
+#schedule = "ip_tick2,10,10,ip=lampedusa"
+
+# Remove a scheduled event.
+#schedule_remove = "ip_tick1"
+
+scgi_port = 127.0.0.1:5000
+
+log.execute = /tmp/rtorrent_exec.log
diff --git a/screenfetch b/screenfetch
deleted file mode 100755
index 67a0275..0000000
--- a/screenfetch
+++ /dev/null
@@ -1,3199 +0,0 @@
-#!/usr/bin/env bash
-
-# screenFetch
-
-# Script to fetch system and theme settings for screenshots in most mainstream
-# Linux distributions.
-
-# Copyright (c) 2010-2012 Brett Bohnenkamper < kittykatt AT archlinux DOT us >
-
-# Permission is hereby granted, free of charge, to any person obtaining a copy of this software
-# and associated documentation files (the "Software"), to deal in the Software without restriction,
-# including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-# subject to the following conditions:
-
-# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# Yes, I do realize some of this is horribly ugly coding. Any ideas/suggestions would be
-# appreciated by emailing me or by stopping by http://github.com/KittyKatt/screenFetch . You
-# could also drop in on my IRC network, SilverIRC, at irc://kittykatt.silverirc.com:6667/screenFetch
-# to put forth suggestions/ideas. Thank you.
-#
-
-LANG=C
-LANGUAGE=C
-LC_ALL=C
-
-scriptVersion="3.2.0"
-
-######################
-# Settings for fetcher
-######################
-
-# This setting controls what ASCII logo is displayed. Available: Arch Linux (Old and Current Logos), Linux Mint, Ubuntu, Crunchbang, Debian, Gentoo, Mandrake/Mandriva, Slackware, SUSE, Fedora, BSD, OS X and None
-# distro="Linux"
-
-# This sets the information to be displayed. Available: distro, Kernel, DE, WM, Win_theme, Theme, Icons, Font, Background, ASCII. To get just the information, and not a text-art logo, you would take "ASCII" out of the below variable.
-#display="distro host kernel uptime pkgs shell res de wm wmtheme gtk disk cpu gpu mem"
-display=( distro host kernel uptime pkgs shell res de wm wmtheme gtk cpu gpu mem )
-# Display Type: ASCII or Text
-display_type="ASCII"
-
-# Colors to use for the information found. These are set below according to distribution. If you would like to set your OWN color scheme for these, uncomment the lines below and edit them to your heart's content.
-# textcolor="\e[0m"
-# labelcolor="\e[1;34m"
-
-# WM & DE process names
-# Removed WM's: compiz
-wmnames=( fluxbox openbox blackbox xfwm4 metacity kwin icewm pekwm fvwm dwm awesome wmaker stumpwm musca xmonad i3 ratpoison scrotwm spectrwm wmfs wmii beryl subtle e16 enlightenment sawfish emerald monsterwm dminiwm compiz Finder herbstluftwm notion bspwm )
-denames=( gnome-session xfce-mcs-manage xfce4-session xfconfd ksmserver lxsession gnome-settings-daemon mate-session mate-settings-daemon Finder )
-
-# Screenshot Settings
-# This setting lets the script know if you want to take a screenshot or not. 1=Yes 0=No
-screenshot=
-# You can specify a custom screenshot command here. Just uncomment and edit. Otherwise, we'll be using the default command: scrot -cd3.
-# screenCommand="scrot -cd5"
-hostshot=
-baseurl="http://www.example.com"
-serveraddr="www.example.com"
-scptimeout="20"
-serverdir="/path/to/directory"
-shotfile=$(printf "screenFetch-`date +'%Y-%m-%d_%H-%M-%S'`.png")
-
-# Verbose Setting - Set to 1 for verbose output.
-verbosity=
-
-#############################################
-#### CODE No need to edit past here CODE ####
-#############################################
-
-#########################################
-# Static Variables and Common Functions #
-#########################################
-c0="\033[0m" # Reset Text
-bold="\033[1m" # Bold Text
-underline="\033[4m" # Underline Text
-display_index=0
-
-# Static Color Definitions
-getColor() {
-	if [[ -n "$1" ]]; then
-		if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
-			if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
-				tmp_color=${1,,}
-			else
-				tmp_color="$(tr '[:upper:]' '[:lower:]' <<< ${1})"
-			fi
-		else
-			tmp_color="$(tr '[:upper:]' '[:lower:]' <<< ${1})"
-		fi
-		case "${tmp_color}" in
-			'black') color_ret='\033[30m';;
-			'red') color_ret='\033[31m';;
-			'green') color_ret='\033[32m';;
-			'brown') color_ret='\033[33m';;
-			'blue') color_ret='\033[34m';;
-			'purple') color_ret='\033[35m';;
-			'cyan') color_ret='\033[36m';;
-			'light grey') color_ret='\033[37m';;
-			'dark grey') color_ret='\033[1;30m';;
-			'light red') color_ret='\033[1;31m';;
-			'light green') color_ret='\033[1;32m';;
-			'yellow') color_ret='\033[1;33m';;
-			'light blue') color_ret='\033[1;34m';;
-			'light purple') color_ret='\033[1;35m';;
-			'light cyan') color_ret='\033[1;36m';;
-			'white') color_ret='\033[1;37m';;
-		esac
-		[[ -n "${color_ret}" ]] && echo "${color_ret}"
-	else
-		:
-	fi
-}
-
-function verboseOut {
-	printf "\033[1;31m:: \033[0m$1\n"
-}
-
-function errorOut {
-	printf "\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m$1\n"
-}
-
-
-####################
-#  Color Defines
-####################
-
-detectColors() {
-	my_colors=$(printf "$OPTARG" | sed 's/^,/na,/;s/,$/,na/;s/,/ /')
-	my_lcolor=$(printf "$my_colors" | awk -F' ' '{print $1}')
-	if [[ "$my_lcolor" != "na" ]]; then
-		if [[ $(tput colors) -eq "256" ]]; then my_lcolor="\033[38;5;${my_lcolor}m"
-		else
-			case $my_lcolor in
-				0|00)  export my_lcolor=$(getColor 'black');;
-				1|01)  export my_lcolor=$(getColor 'red');;
-				2|02)  export my_lcolor=$(getColor 'green');;
-				3|03)  export my_lcolor=$(getColor 'brown');;
-				4|04)  export my_lcolor=$(getColor 'blue');;
-				5|05)  export my_lcolor=$(getColor 'purple');;
-				6|06)  export my_lcolor=$(getColor 'cyan');;
-				7|07)  export my_lcolor=$(getColor 'light grey');;
-				8|08)  export my_lcolor=$(getColor 'dark grey');;
-				9|09)  export my_lcolor=$(getColor 'light red');;
-				10) export my_lcolor=$(getColor 'light green');;
-				11) export my_lcolor=$(getColor 'yellow');;
-				12) export my_lcolor=$(getColor 'light blue');;
-				13) export my_lcolor=$(getColor 'light purple');;
-				14) export my_lcolor=$(getColor 'light cyan');;
-				15) export my_lcolor=$(getColor 'white');;
-				*) unset my_lcolor; continue ;;
-			esac
-		fi
-	else
-		unset my_lcolor
-	fi
-	my_hcolor=$(printf "$my_colors" | awk -F' ' '{print $2}')
-	if [[ "$my_hcolor" != "na" ]]; then
-		if [[ $(tput colors) -eq "256" ]]; then my_hcolor="\033[38;5;${my_hcolor}m"
-		else
-			case $my_hcolor in
-				0|00)  export my_hcolor=$(getColor 'black');;
-				1|01)  export my_hcolor=$(getColor 'red');;
-				2|02)  export my_hcolor=$(getColor 'green');;
-				3|03)  export my_hcolor=$(getColor 'brown');;
-				4|04)  export my_hcolor=$(getColor 'blue');;
-				5|05)  export my_hcolor=$(getColor 'purple');;
-				6|06)  export my_hcolor=$(getColor 'cyan');;
-				7|07)  export my_hcolor=$(getColor 'light grey');;
-				8|08)  export my_hcolor=$(getColor 'dark grey');;
-				9|09)  export my_hcolor=$(getColor 'light red');;
-				10) export my_hcolor=$(getColor 'light green');;
-				11) export my_hcolor=$(getColor 'yellow');;
-				12) export my_hcolor=$(getColor 'light blue');;
-				13) export my_hcolor=$(getColor 'light purple');;
-				14) export my_hcolor=$(getColor 'light cyan');;
-				15) export my_hcolor=$(getColor 'white');;
-				*) unset my_hcolor; continue ;;
-			esac
-		fi
-	else
-		unset my_hcolor
-	fi
-}
-
-
-displayHelp() {
-	printf "${underline}Usage${c0}:\n"
-	printf "  screenFetch [OPTIONAL FLAGS]\n\n"
-	printf "screenFetch - a CLI Bash script to show system/theme info in screenshots.\n\n"
-	printf "${underline}Supported Distributions${c0}:      Arch Linux (Old and Current Logos), Linux Mint,\n"
-	printf "			      LMDE, Ubuntu, Crunchbang, Debian, Gentoo, Fedora, SolusOS,\n"
-	printf "			      Mandrake/Mandriva, Slackware, Frugalware, openSUSE, Mageia,\n"
-	printf "			      Peppermint, ParabolaGNU, Viperr, LinuxDeepin, Chakra, and FreeBSD, OpenBSD\n"
-	printf "${underline}Supported Desktop Managers${c0}:   KDE, GNOME, XFCE, and LXDE, and Not Present\n"
-	printf "${underline}Supported Window Managers${c0}:    PekWM, OpenBox, FluxBox, BlackBox, Xfwm4,\n"
-	printf "			      Metacity, StumpWM, KWin, IceWM, FVWM,\n"
-	printf "			      DWM, Awesome, XMonad, Musca, i3, WindowMaker,\n"
-	printf "			      Ratpoison, wmii, WMFS, ScrotWM, SpectrWM,\n"
-	printf "			      subtle, Emerald, E17 and Beryl.\n\n"
-	printf "${underline}Options${c0}:\n"
-	printf "   ${bold}-v${c0}                 Verbose output.\n"
-	printf "   ${bold}-o 'OPTIONS'${c0}       Allows for setting script variables on the\n"
-	printf "		      command line. Must be in the following format...\n"
-	printf "		      'OPTION1=\"OPTIONARG1\";OPTION2=\"OPTIONARG2\"'\n"
-	#echo -e "   ${bold}-d 'ARGUMENTS'${c0}     Allows for setting what information is displayed"
-	#echo -e "		      on the command line. Format must be as follows:"
-	#echo -e "		      OPTION,OPTION,OPTION,OPTION. Valid options are"
-	#echo -e "		      host, distro, kernel, uptime, pkgs, shell, res, de, wm,"
-	#echo -e "		      wmtheme, gtk, cpu, gpu, mem."
-	printf "   ${bold}-n${c0}                 Do not display ASCII distribution logo.\n"
-	printf "   ${bold}-N${c0}                 Strip all color from output.\n"
-	printf "   ${bold}-t${c0}                 Truncate output based on terminal width (Experimental!).\n"
-	printf "   ${bold}-s(m)${c0}              Using this flag tells the script that you want it\n"
-	printf "		      to take a screenshot. Use the -m flag if you would like\n"
-	printf "		      to move it to a new location afterwards.\n"
-	printf "   ${bold}-c string${c0}          You may change the outputted colors with -c. The format is\n"
-	printf "                      as follows: [0-9][0-9],[0-9][0-9]. The first argument controls the\n"
-	printf "                      ASCII logo colors and the label colors. The second argument\n"
-	printf "                      controls the colors of the information found. One argument may be\n"
-	printf "                      used without the other.\n"
-	printf "   ${bold}-S 'COMMAND'${c0}       Here you can specify a custom screenshot command for\n"
-	printf "		      the script to execute. Surrounding quotes are required.\n"
-	printf "   ${bold}-D 'DISTRO'${c0}        Here you can specify your distribution for the script\n"
-	printf "		      to use. Surrounding quotes are required.\n"
-	printf "   ${bold}-A 'DISTRO'${c0}        Here you can specify the distribution art that you want\n"
-	printf "		      displayed. This is for when you want your distro\n"
-	printf "                      detected but want to display a different logo.\n"
-	printf "   ${bold}-E${c0}                 Suppress output of errors.\n"
-	printf "   ${bold}-V${c0}                 Display current script version.\n"
-	printf "   ${bold}-h${c0}                 Display this help.\n"
-}
-
-#####################
-# Begin Flags Phase
-#####################
-
-case $1 in
-	--help) displayHelp; exit 0;;
-esac
-		
-
-while getopts ":hsmevVEnNtlS:A:D:o:Bc:d:" flags; do
-	case $flags in
-		h) displayHelp; exit 0;;
-		s) screenshot=1; continue;;
-		S) screenCommand=$OPTARG; continue;;
-		m) hostshot=1; continue;;
-		v) verbosity=1; continue;;
-		V)
-			printf $underline"screenFetch"$c0" - Version $scriptVersion\n"
-			printf "Created by and licensed to Brett Bohnenkamper (kittykatt@kittykatt.us)\n"
-			printf "OS X porting done almost solely by shrx (http://shrx.github.com/) and Hu6.\n\n"
-			printf "This is free software; see the source for copying conditions.  There is NO warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
-			exit 0
-		;;
-		E) errorSuppress="1";;
-		D) distro=$OPTARG; continue;;
-		A) asc_distro=$OPTARG; continue;;
-		t) truncateSet="Yes";;
-		n) display_type="Text";;
-		o) overrideOpts=$OPTARG; continue;;
-		c) detectColors "$OPTARGS"; continue;;
-		# d) overrideDisplay=$OPTARG; continue;;
-		d) overrideDisplay=$OPTARG; continue;;
-		N) no_color='1';;
-		:) errorOut "Error: You're missing an argument somewhere. Exiting."; exit 1;;
-		?) errorOut "Error: Invalid flag somewhere. Exiting."; exit 1;;
-		*) errorOut "Error"; exit 1;;
-	esac
-done
-
-###################
-# End Flags Phase
-###################
-
-
-####################
-# Override Options
-####################
-
-if [[ "$overrideOpts" ]]; then
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Found 'o' flag in syntax. Overriding some script variables..."
-	OLD_IFS="$IFS"
-	IFS=";"
-	for overopt in "$overrideOpts"; do
-		eval "$overrideOpts"
-	done
-	IFS="$OLD_IFS"
-fi
-
-
-#########################
-# Begin Detection Phase
-#########################
-
-# Distro Detection - Begin
-detectdistro () {
-	if [[ -z $distro ]]; then
-		distro="Unknown"
-
-		# LSB Release Check
-		if type -p lsb_release >/dev/null 2>&1; then
-			# read distro_detect distro_release distro_codename <<< $(lsb_release -sirc)
-			distro_detect=( $(lsb_release -sirc) )
-			if [[ ${#distro_detect[@]} -eq 3 ]]; then
-				distro_codename=${distro_detect[2]}
-				distro_release=${distro_detect[1]}
-				distro_detect=${distro_detect[0]}
-			else
-				for ((i=0; i<${#distro_detect[@]}; i++)); do
-					if [[ ${distro_detect[$i]} =~ ^[[:digit:]]+((.[[:digit:]]+|[[:digit:]]+|)+)$ ]]; then
-						distro_release=${distro_detect[$i]}
-						distro_codename=${distro_detect[@]:$(($i+1)):${#distro_detect[@]}+1}
-						distro_detect=${distro_detect[@]:0:${i}}
-						break 1
-					elif [[ ${distro_detect[$i]} =~ [Nn]/[Aa] || ${distro_detect[$i]} == "rolling" ]]; then
-						distro_release=${distro_detect[$i]}
-						distro_codename=${distro_detect[@]:$(($i+1)):${#distro_detect[@]}+1}
-						distro_detect=${distro_detect[@]:0:${i}}
-						break 1
-					fi
-				done
-			fi
-
-			if [[ "${distro_detect}" == "archlinux" || "${distro_detect}" == "Arch Linux" || "${distro_detect}" == "arch" || "${distro_detect}" == "archarm" ]]; then
-				distro="Arch Linux"
-				distro_release="n/a"
-			elif [[ "${distro_detect}" == "Chakra" ]]; then
-				distro="Chakra"
-				distro_release=null
-			elif [[ "${distro_detect}" == "CentOS" ]]; then
-				distro="CentOS"
-			elif [[ "${distro_detect}" == "Debian" ]]; then
-				if [[ -f /etc/crunchbang-lsb-release || -f /etc/lsb-release-crunchbang ]]; then
-					distro="CrunchBang"
-					distro_release=$(awk -F'=' '/^DISTRIB_RELEASE=/ {print $2}' /etc/lsb-release-crunchbang)
-					distro_codename=$(awk -F'=' '/^DISTRIB_DESCRIPTION=/ {print $2}' /etc/lsb-release-crunchbang)
-				else
-					distro="Debian"
-				fi
-			elif [[ "${distro_detect}" == "elementary" || "${distro_detect}" == "elementary OS" ]]; then
-				distro="elementary OS"
-			elif [[ "${distro_detect}" == "Fedora" ]]; then
-				distro="Fedora"
-			elif [[ "${distro_detect}" == "frugalware" ]]; then
-				distro="Frugalware"
-				distro_codename=null
-				distro_release=null
-			elif [[ "${distro_detect}" == "Fuduntu" ]]; then
-				distro="Fuduntu"
-				distro_codename=null
-			elif [[ "${distro_detect}" == "Gentoo" ]]; then
-				if [[ "$(lsb_release -sd)" =~ "Funtoo" ]]; then
-					distro="Funtoo"
-				else
-					distro="Gentoo"
-				fi
-			elif [[ "${distro_detect}" == "Jiyuu Linux" ]]; then
-				 distro="Jiyuu Linux"
-			elif [[ "${distro_detect}" == "LinuxDeepin" ]]; then
-				distro="LinuxDeepin"
-				distro_codename=null
-			elif [[ "${distro_detect}" == "Debian Kali Linux" ]]; then
-				 distro="Kali Linux"
-			elif [[ "${distro_detect}" == "Mageia" ]]; then
-				distro="Mageia"
-			elif [[ "$distro_detect" == "MandrivaLinux" ]]; then
-				distro="Mandriva"
-				if [[ "${distro_codename}" == "turtle" ]]; then
-					distro="Mandriva-${distro_release}"
-					distro_codename=null
-				elif [[ "${distro_codename}" == "Henry_Farman" ]]; then
-					distro="Mandriva-${distro_release}"
-					distro_codename=null
-				elif [[ "${distro_codename}" == "Farman" ]]; then
-					distro="Mandriva-${distro_release}"
-					distro_codename=null
-				elif [[ "${distro_codename}" == "Adelie" ]]; then
-					distro="Mandriva-${distro_release}"
-					distro_codename=null
-				elif [[ "${distro_codename}" == "pauillac" ]]; then
-					distro="Mandriva-${distro_release}"
-					distro_codename=null
-				fi
-			elif [[ "${distro_detect}" == "ManjaroLinux" ]]; then
-				distro="Manjaro"
-			elif [[ "${distro_detect}" == "LinuxMint" ]]; then
-				distro="Mint"
-				if [[ "${distro_codename}" == "debian" ]]; then
-					distro="LMDE"
-					distro_codename=null
-					distro_release=null
-				fi
-			elif [[ "${distro_detect}" == "SUSE LINUX" || "${distro_detect}" == "openSUSE project" ]]; then
-				distro="openSUSE"
-			elif [[ "${distro_detect}" == "ParabolaGNU/Linux-libre" ]]; then
-				distro="ParabolaGNU/Linux-libre"
-			elif [[ "${distro_detect}" == "Peppermint" ]]; then
-				distro="Peppermint"
-				distro_codename=null
-			elif [[ "${distro_detect}" == "CentOS" || "${distro_detect}" =~ "RedHatEnterprise" ]]; then
-				distro="Red Hat Linux"
-			elif [[ "${distro_detect}" == "Sabayon" ]]; then
-				distro="Sabayon"
-			elif [[ "${distro_detect}" == "SolusOS" ]]; then
-				distro="SolusOS"
-			elif [[ "${distro_detect}" == "Trisquel" ]]; then
-				distro="Trisquel"
-			elif [[ "${distro_detect}" == "Ubuntu" ]]; then
-				distro="Ubuntu"
-			elif [[ "${distro_detect}" == "Viperr" ]]; then
-				distro="Viperr"
-				distro_codename=null
-			fi
-			if [[ -n ${distro_release} && ${distro_release} != "n/a" ]]; then distro_more="$distro_release"; fi
-			if [[ -n ${distro_codename} && ${distro_codename} != "n/a" ]]; then distro_more="$distro_more $distro_codename"; fi
-			if [[ -n ${distro_more} ]]; then
-				distro_more="${distro} ${distro_more}"
-			fi
-		fi
-
-		# Existing File Check
-		if [ "$distro" == "Unknown" ]; then
-			if [ $(uname -o 2>/dev/null) ]; then
-				if [ `uname -o` == "Cygwin" ]; then distro="Cygwin"; fake_distro="${distro}"; fi
-			fi
-			if [ -f /etc/os-release ]; then
-				distrib_id=$(/dev/null; then
-						distro="Mac OS X"
-					elif [[ -f /var/run/dmesg.boot ]]; then
-						distro=$(awk 'BEGIN {
-							distro = "Unknown"
-						}
-						{
-							if ($0 ~ /DragonFly/) {
-								distro = "DragonFlyBSD"
-								exit
-							}
-							else if ($0 ~ /FreeBSD/) {
-								distro = "FreeBSD"
-								exit
-							}
-							else if ($0 ~ /NetBSD/) {
-								distro = "NetBSD"
-								exit
-							}
-							else if ($0 ~ /OpenBSD/) {
-								distro = "OpenBSD"
-								exit
-							}
-						} END {
-							print distro
-						}' /var/run/dmesg.boot)
-					fi
-				fi
-			fi
-			if [[ "${distro}" == "Unknown" ]] && [[ "${OSTYPE}" == "linux-gnu" || "${OSTYPE}" == "linux" ]]; then
-				if [[ -f /etc/issue ]]; then
-					distro=$(awk 'BEGIN {
-						distro = "Unknown"
-					}
-					{
-						if ($0 ~ /"LinuxDeepin"/) {
-							distro = "LinuxDeepin"
-							exit
-						}
-						else if ($0 ~ /"Parabola GNU\/Linux-libre"/) {
-							distro = "ParabolaGNU/Linux-libre"
-							exit
-						}
-						else if ($0 ~ /"SolusOS"/) {
-							distro = "SolusOS"
-							exit
-						}
-					} END {
-						print distro
-					}' /etc/issue)
-				fi
-			fi
-			if [[ "${distro}" == "Unknown" ]] && [[ "${OSTYPE}" == "linux-gnu" || "${OSTYPE}" == "linux" ]]; then
-				if [[ -f /etc/system-release ]]; then
-					distro=$(awk 'BEGIN {
-						distro = "Unknown"
-					}
-					{
-						if ($0 ~ /"Scientific\ Linux"/) {
-							distro = "Scientific Linux"
-							exit
-						}
-					} END {
-						print distro
-					}' /etc/system-release)
-				fi
-			fi
-
-
-
-		fi
-	fi
-	if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
-		if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
-			distro=${distro,,}
-		else
-			distro="$(tr '[:upper:]' '[:lower:]' <<< ${distro})"
-		fi
-	else
-		distro="$(tr '[:upper:]' '[:lower:]' <<< ${distro})"
-	fi
-	case $distro in
-		arch*linux*old) distro="Arch Linux - Old" ;;
-		arch*linux) distro="Arch Linux" ;;
-		arch) distro="Arch Linux";;
-		'elementary'|'elementary os') distro="elementary OS";;
-		fedora) distro="Fedora" ;;
-		mageia) distro="Mageia" ;;
-		mandriva) distro="Mandriva" ;;
-		mandrake) distro="Mandrake" ;;
-		mint) distro="Mint" ;;
-		kali*linux) distro="Kali Linux" ;;
-		lmde) distro="LMDE" ;;
-		opensuse) distro="openSUSE" ;;
-		ubuntu) distro="Ubuntu" ;;
-		debian) distro="Debian" ;;
-		freebsd) distro="FreeBSD" ;;
-		openbsd) distro="OpenBSD" ;;
-		dragonflybsd) distro="DragonFlyBSD" ;;
-		netbsd) distro="NetBSD" ;;
-		red*hat*) distro="Red Hat Linux" ;;
-		crunchbang) distro="CrunchBang" ;;
-		gentoo) distro="Gentoo" ;;
-		funtoo) distro="Funtoo" ;;
-		slackware) distro="Slackware" ;;
-		frugalware) distro="Frugalware" ;;
-		peppermint) distro="Peppermint" ;;
-		solusos) distro="SolusOS" ;;
-		parabolagnu|parabolagnu/linux-libre) distro="ParabolaGNU/Linux-libre" ;;
-		viperr) distro="Viperr" ;;
-		linuxdeepin) distro="LinuxDeepin" ;;
-		chakra) distro="Chakra" ;;
-		centos) distro="CentOS";;
-		mac*os*x) distro="Mac OS X" ;;
-		fuduntu) distro="Fuduntu" ;;
-		manjaro) distro="Manjaro" ;;
-		cygwin) distro="Cygwin" ;;
-	esac
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding distro...found as '$distro $distro_release'"
-}
-# Distro Detection - End
-
-# Host and User detection - Begin
-detecthost () {
-	myUser=${USER}
-	myHost=${HOSTNAME}
-	if [[ "${distro}" == "Mac OS X" ]]; then myHost=${myHost/.local/}; fi
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding hostname and user...found as '$myUser@$myHost'"
-}
-
-# Find Number of Running Processes
-# processnum="$(( $( ps aux | wc -l ) - 1 ))"
-
-# Kernel Version Detection - Begin
-detectkernel () {
-	kernel=( $(uname -srm) )
-	kernel="${kernel[${#kernel[@]}-1]} ${kernel[@]:0:${#kernel[@]}-1}"
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding kernel version...found as '$kernel'"
-}
-# Kernel Version Detection - End
-
-
-# Uptime Detection - Begin
-detectuptime () {
-	unset uptime
-	if [ "$distro" == "Mac OS X" ]; then
-		boot=`sysctl -n kern.boottime | cut -d "=" -f 2 | cut -d "," -f 1`
-		now=`date +%s`
-		uptime=$(($now-$boot))
-	elif [[ "${distro}" == "FreeBSD" || "${distro}" == "OpenBSD" ]]; then
-		if [[ "${distro}" == "FreeBSD" ]]; then boot=`sysctl -n kern.boottime | cut -d "=" -f 2 | cut -d "," -f 1`
-		else boot=$(sysctl -n kern.boottime); fi
-		now=$(date +%s)
-		uptime=$((${now} - ${boot}))
-	else
-		if [[ -f /proc/uptime ]]; then
-			uptime=$(/dev/null 2>&1; then
-				port_pkgs=$(port installed 2>/dev/null | wc -l)
-				pkgs=$((${pkgs} + (${port_pkgs} -1)))
-			fi
-
-			if type -p port >/dev/null 2>&1; then
-				brew_pkgs=$(brew list -1 2>/dev/null | wc -l)
-				pkgs=$((${pkgs} + ${brew_pkgs}))
-			fi
-		;;
-		'OpenBSD') 
-			pkgs=$(pkg_info | wc -l | awk '{sub(" ", "");print $1}')
-			if type -p portmaster >/dev/null 2>&1; then
-				ports=$(portmaster -l | grep -Eo '[0-9]+ total installed' | sed 's/ total installed//')
-				pkgs=$((${pkgs} + ${ports}))
-			fi
-		;;
-		'FreeBSD')
-			pkgs=$(if TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 PACKAGESITE=file:///nonexistent pkg info pkg >/dev/null 2>&1; then 
-				pkg info | wc -l | awk '{print $1}'; else pkg_info | wc -l | awk '{sub(" ", "");print $1}'; fi)
-		;;
-		'Cygwin') cygfix=2; pkgs=$(($(cygcheck -cd | wc -l)-$cygfix)) ;;
-	esac
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current package count...found as '$pkgs'"
-}
-
-
-
-
-# CPU Detection - Begin
-detectcpu () {
-	REGEXP="-r"
-	if [ "$distro" == "Mac OS X" ]; then 
-		cpu=$(echo $(sysctl -n machdep.cpu.brand_string))
-		REGEXP="-E"
-	elif [ "$distro" == "FreeBSD" ]; then cpu=$(sysctl -n hw.model)
-	elif [ "$distro" == "DragonflyBSD" ]; then cpu=$(sysctl -n hw.model)
-	elif [ "$distro" == "OpenBSD" ]; then cpu=$(sysctl -n hw.model | sed 's/@.*//')
-	else
-		cpu=$(awk 'BEGIN{FS=":"} /model name/ { print $2; exit }' /proc/cpuinfo | sed 's/ @/\n/' | head -1)
-		if [ -z "$cpu" ]; then 
-			cpu=$(awk 'BEGIN{FS=":"} /^cpu/ { gsub(/  +/," ",$2); print $2; exit}' /proc/cpuinfo | sed 's/, altivec supported//;s/^ //')
-			if [[ $cpu =~ ^(PPC)*9.+ ]]; then
-				model="IBM PowerPC G5 "
-			elif [[ $cpu =~ ^74.+ ]]; then
-				model="Motorola PowerPC G4 "
-			else
-				model="IBM PowerPC G3 "
-			fi
-			cpu="${model}${cpu}"
-		fi
-		loc="/sys/devices/system/cpu/cpu0/cpufreq"
-		if [ -f $loc/bios_limit ];then
-			cpu_mhz=$(cat $loc/bios_limit | awk '{print $1/1000}')
-		elif [ -f $loc/scaling_max_freq ];then
-			cpu_mhz=$(cat $loc/scaling_max_freq | awk '{print $1/1000}')
-		else
-			cpu_mhz=$(awk -F':' '/cpu MHz/{ print int($2+.5) }' /proc/cpuinfo | head -n 1)
-		fi
-		if [ -n "$cpu_mhz" ];then
-			if [ $cpu_mhz -gt 999 ];then
-				cpu_ghz=$(echo $cpu_mhz | awk '{print $1/1000}')
-				cpu="$cpu @ ${cpu_ghz}GHz"
-			else
-				cpu="$cpu @ ${cpu_mhz}MHz"
-			fi
-		fi
-	fi
-	cpu=$(echo "${cpu}" | sed $REGEXP 's/\([tT][mM]\)|\([Rr]\)|[pP]rocessor//g' | xargs)
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current CPU...found as '$cpu'"
-}
-# CPU Detection - End
-
-
-# GPU Detection - Begin (EXPERIMENTAL!)
-detectgpu () {
-	if [[ "${distro}" == "FreeBSD" ]]; then
-		gpu_info=$(pciconf -lv | grep -B 4 VGA)
-		gpu_info=$(echo "${gpu_info}" | grep -E 'device.*=.*')
-		gpu=$(echo "${gpu_info}" | sed 's/.*device.*= //' | sed "s/'//g")
-	else
-		if [ -n "$(type -p lspci)" ]; then
-			gpu_info=$(lspci | grep VGA)
-			gpu=$(echo "$gpu_info" | grep -oE '\[.*\]' | sed 's/\[//;s/\]//')
-			gpu=$(echo "${gpu}" | sed -n '1h;2,$H;${g;s/\n/, /g;p}')
-		elif [[ -n "$(type -p glxinfo)" && -z "$gpu" ]]; then
-			gpu_info=$(glxinfo 2>/dev/null)
-			gpu=$(echo "$gpu_info" | grep "OpenGL renderer string")
-			gpu=$(echo "$gpu" | cut -d ':' -f2)
-			gpu="${gpu:1}"
-			gpu_info=$(echo "$gpu_info" | grep "OpenGL vendor string")
-		elif [[ "${distro}" == "Mac OS X" ]]; then
-			gpu=$(system_profiler SPDisplaysDataType | awk -F': ' '/^\ *Chipset Model:/ {print $2}')
-		elif [[ "${distro}" == "Cygwin" ]]; then
-			gpu=$(wmic path Win32_VideoController get caption)
-			gpu=$(tail -1 <<< ${gpu})
-		fi
-	fi
-
-	if [ -n "$gpu" ];then
-		if [ $(echo "$gpu_info" | grep -i nvidia | wc -l) -gt 0 ];then
-			gpu_info="NVidia "
-		elif [ $(echo "$gpu_info" | grep -i intel | wc -l) -gt 0 ];then
-			gpu_info="Intel "
-		elif [ $(echo "$gpu_info" | grep -i amd | wc -l) -gt 0 ];then
-			gpu_info="AMD "
-		elif [[ $(echo "$gpu_info" | grep -i ati | wc -l) -gt 0  || $(echo "$gpu_info" | grep -i radeon | wc -l) -gt 0 ]]; then
-			gpu_info="ATI "
-		else
-			gpu_info=$(echo "$gpu_info" | cut -d ':' -f2)
-			gpu_info="${gpu_info:1} "
-		fi
-		gpu="${gpu_info}${gpu}"
-	else
-		gpu="Not Found"
-	fi
-
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current GPU...found as '$gpu'"
-}
-# GPU Detection - End
-
-
-# Disk Usage Detection - Begin
-detectdisk () {
-	diskusage="Unknown"
-	if type -p df >/dev/null 2>&1; then
-		if [[ "${distro}" =~ (Free|Net|Open|DragonFly)BSD ]]; then
-			totaldisk=$(df -h -c 2>/dev/null | tail -1)
-		elif [[ "${distro}" == "Mac OS X" ]]; then
-			totaldisk=$(df -H / 2>/dev/null | tail -1)
-		else
-			totaldisk=$(df -h --total 2>/dev/null | tail -1)
-		fi
-		disktotal=$(awk '{print $2}' <<< "${totaldisk}")
-		diskused=$(awk '{print $3}' <<< "${totaldisk}")
-		diskusedper=$(awk '{print $5}' <<< "${totaldisk}")
-		diskusage="${diskused} / ${disktotal} (${diskusedper})"
-		diskusage_verbose=$(sed 's/%/%%/' <<< $diskusage)
-	fi
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current disk usage...found as '$diskusage_verbose'"
-}	
-# Disk Usage Detection - End
-
-
-# Memory Detection - Begin
-detectmem () {
-	hw_mem=0
-	free_mem=0
-	human=1024
-	if [ "$distro" == "Mac OS X" ]; then
-		totalmem=$(echo "$(sysctl -n hw.memsize)"/${human}^2|bc)
- 		usedmem=$(top -l 1 | awk '{
- 			if ($0 ~ /PhysMem/) {
- 				for (x=1; x<=NF; x++) {
- 					if ($x ~ /wired/) {
- 						wired = $(x-1)
- 						gsub(/[^0-9]/,"",wired)
- 					}
-
- 					if ($x ~ /^active/) {
- 						active = $(x-1)
- 						gsub(/[^0-9]/,"",active)
- 					}
-
- 					if ($x ~ /inactive/) {
- 						inactive = $(x-1)
- 						gsub(/[^0-9]/,"",inactive)
- 					}
- 				}
- 				usedmem = wired + active + inactive
- 				print usedmem
- 				exit
- 			}
- 		}')
-	elif [ "$distro" == "Cygwin" ]; then
-		total_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
-		totalmem=$((${total_mem}/1024))
-		free_mem=$(awk '/MemFree/ { print $2 }' /proc/meminfo)
-		used_mem=$((${total_mem} - ${free_mem}))
-		usedmem=$((${used_mem}/1024))
-	elif [ "$distro" == "FreeBSD" ]; then
-		phys_mem=$(sysctl -n hw.physmem)
-		size_mem=$phys_mem
-		size_chip=1
-		guess_chip=`echo "$size_mem / 8 - 1" | bc`
-		while [ $guess_chip != 0 ]; do
-			guess_chip=`echo "$guess_chip / 2" | bc`
-			size_chip=`echo "$size_chip * 2" | bc`
-		done
-		round_mem=`echo "( $size_mem / $size_chip + 1 ) * $size_chip " | bc`
-		totalmem=$(($round_mem / ($human * $human) ))
-		pagesize=$(sysctl -n hw.pagesize)
-		inactive_count=$(sysctl -n vm.stats.vm.v_inactive_count)
-		inactive_mem=$(($inactive_count * $pagesize))
-		cache_count=$(sysctl -n vm.stats.vm.v_cache_count)
-		cache_mem=$(($cache_count * $pagesize))
-		free_count=$(sysctl -n vm.stats.vm.v_free_count)
-		free_mem=$(($free_count * $pagesize))
-		avail_mem=$(($inactive_mem + $cache_mem + $free_mem))
-		used_mem=$(($round_mem - $avail_mem))
-		usedmem=$(($used_mem / ($human * $human) ))
-	elif [ "$distro" == "OpenBSD" ]; then
-		totalmem=$(top -1 1 | awk '/Real:/ {k=split($3,a,"/");print a[k] }' | tr -d 'M')
-		usedmem=$(top -1 1 | awk '/Real:/ {print $3}' | sed 's/M.*//')
-	elif [ "$distro" == "NetBSD" ]; then
-		phys_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
-		totalmem=$((${phys_mem} / $human))
-		if grep -q 'Cached' /proc/meminfo; then
-			cache=$(awk '/Cached/ {print $2}' /proc/meminfo)
-			usedmem=$((${cache} / $human))
-		else
-			free_mem=$(awk '/MemFree/ { print $2 }' /proc/meminfo)
-			used_mem=$((${phys_mem} - ${free_mem}))
-			usedmem=$((${used_mem} / $human))
-		fi
-	else
-		mem_info=$(1 {print $1}')
-			shell_type=${shell_type/-}
-			shell_type=${shell_type//*\/}
-		fi
-	fi
-
-	case $shell_type in
-		bash)
-			shell_version_data=$( detectshell_ver "$shell_type" "^GNU.bash,.version" "4" )
-			;;
-		csh)
-			shell_version_data=$( detectshell_ver "$shell_type" "$shell_type" "3" )
-			;;
-		dash)
-			shell_version_data=$( detectshell_ver "$shell_type" "$shell_type" "3" )
-			;;
-		ksh)
-			shell_version_data=$( detectshell_ver "$shell_type" "version" "5" )
-			;;
-		tcsh)
-			shell_version_data=$( detectshell_ver "$shell_type" "^tcsh" "2" )
-			;;
-		zsh)
-			shell_version_data=$( detectshell_ver "$shell_type" "^zsh" "2" )
-			;;
-	esac
-
-	if [[ -n $shell_version_data ]];then
-		shell_type="$shell_type $shell_version_data"
-	fi
-
-	myShell=${shell_type}
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current shell...found as '$myShell'"
-}
-# Shell Detection - End
-
-
-# Resolution Detection - Begin
-detectres () {
-	if [[ -n ${DISPLAY} && ${distro} != "Mac OS X" && ${distro} != "Cygwin" ]]; then
-		if [[ "$distro" =~ "BSD" ]]; then
-			xResolution=$(xdpyinfo | sed -n 's/.*dim.* \([0-9]*x[0-9]*\) .*/\1/pg' | tr '\n' ' ')
-		else
-			xResolution=$(xdpyinfo | sed -n 's/.*dim.* \([0-9]*x[0-9]*\) .*/\1/pg' | sed ':a;N;$!ba;s/\n/ /g')
-		fi
-	elif [[ ${distro} == "Mac OS X" ]]; then
-		xResolution=$(system_profiler SPDisplaysDataType | awk '/Resolution:/ {print $2"x"$4" "}')
-	elif [[ "${distro}" == "Cygwin" ]]; then
-		width=$(wmic desktopmonitor get screenwidth | grep -vE '[a-z]+' | tr -d '\r\n ')
-		height=$(wmic desktopmonitor get screenheight | grep -vE '[a-z]+' | tr -d '\r\n ')
-		xResolution="${width}x${height}"
-	else
-		xResolution="No X Server"
-	fi
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding current resolution(s)...found as '$xResolution'"
-}
-# Resolution Detection - End
-
-
-# DE Detection - Begin
-detectde () {
-	DE="Not Present"
-	if [[ -n ${DISPLAY} && ${distro} != "Mac OS X" && ${distro} != "Cygwin" ]]; then
-		if type -p xprop >/dev/null 2>&1;then
-			xprop_root="$(xprop -root 2>/dev/null)"
-			if [[ -n ${xprop_root} ]]; then
-				DE=$(echo "${xprop_root}" | awk 'BEGIN {
-					de = "Not Present"
-				}
-				{
-					if ($1 ~ /^_DT_SAVE_MODE/) {
-						de = $NF
-						gsub(/\"/,"",de)
-						de = toupper(de)
-						exit
-					}
-					else if ($1 ~/^KDE_SESSION_VERSION/) {
-						de = "KDE"$NF
-						exit
-					}
-					else if ($1 ~ /^_MARCO/) {
-						de = "MATE"
-						exit
-					}
-					else if ($1 ~ /^_MUFFIN/) {
-						de = "Cinnamon"
-						exit
-					}
-					else if ($0 ~ /"xfce4"/) {
-						de = "XFCE4"
-						exit
-					}
-					else if ($0 ~ /"xfce5"/) {
-						de = "XFCE5"
-						exit
-					}
-				} END {
-					print de
-				}')
-			fi
-		fi
-
-		if [[ ${DE} == "Not Present" ]]; then
-			if [[ -n ${GNOME_DESKTOP_SESSION_ID} ]]; then
-				DE="Gnome"
-				if type -p xprop >/dev/null 2>&1; then
-					if xprop -name "unity-launcher" >/dev/null 2>&1; then
-						DE="Unity"
-					elif xprop -name "launcher" >/dev/null 2>&1 &&
-						xprop -name "panel" >/dev/null 2>&1; then
-
-						DE="Unity"
-					fi
-				fi
-			elif [[ -n ${MATE_DESKTOP_SESSION_ID} ]]; then
-				DE="MATE"
-			elif [[ -n ${KDE_SESSION_VERSION} ]]; then
-				if [[ ${KDE_SESSION_VERSION} == '5' ]]; then
-					DE="KDE5"
-				elif [[ ${KDE_SESSION_VERSION} == '4' ]]; then
-					DE="KDE4"
-				fi
-			elif [[ -n ${KDE_FULL_SESSION} ]]; then
-				if [[ ${KDE_FULL_SESSION} == 'true' ]]; then
-					DE="KDE"
-					DEver_data=$( kded --version 2>/dev/null )
-					DEver=$( grep -si '^KDE:' <<< "$DEver_data" | awk '{print $2}' )
-				fi
-			fi
-		fi
-
-		if [[ ${DE} != "Not Present" ]]; then
-			if [[ ${DE} == "Cinnamon" ]]; then
-				if type -p >/dev/null 2>&1; then
-					DEver=$(cinnamon --version)
-					DE="${DE} ${DEver//* }"
-				fi
-			elif [[ ${DE} == "Gnome" || ${DE} == "GNOME" ]]; then
-				if type -p gnome-session-properties >/dev/null 2>&1; then
-					DEver=$(gnome-session-properties --version)
-					DE="${DE} ${DEver//* }"
-				elif type -p gnome-session >/dev/null 2>&1; then
-					DEver=$(gnome-session --version)
-					DE="${DE} ${DEver//* }"
-				fi
-			elif [[ ${DE} == "KDE4" || ${DE} == "KDE5" ]]; then
-				if type -p kded${DE#KDE} >/dev/null 2>&1; then
-					DEver=$(kded${DE#KDE} --version)
-					for l in $(echo "${DEver// /_}"); do
-						if [[ ${l//:*} == "KDE_Development_Platform" ]]; then
-							DEver=${l//*:_}
-							DE="KDE ${DEver//_*}"
-						fi;
-					done
-				fi
-			elif [[ ${DE} == "MATE" ]]; then
-				if type -p mate-session >/dev/null 2>&1; then
-					DEver=$(mate-session --version)
-					DE="${DE} ${DEver//* }"
-				fi
-
-			elif [[ ${DE} == "Unity" ]]; then
-				if type -p unity >/dev/null 2>&1; then
-					DEver=$(unity --version)
-					DE="${DE} ${DEver//* }"
-				fi
-			fi
-		fi
-
-		if [[ "${DE}" == "Not Present" ]]; then
-			if pgrep -U ${UID} lxsession >/dev/null 2>&1; then
-				DE="LXDE"
-				if type -p lxpanel >/dev/null 2>&1; then
-					DEver=$(lxpanel -v)
-					DE="${DE} $DEver"
-				fi
-			elif pgrep -U ${UID} razor-session >/dev/null 2>&1; then
-				DE="RazorQt"
-			fi
-		fi
-	elif [[ "${distro}" == "Mac OS X" ]]; then
-		if ps -U ${USER} | grep [F]inder >/dev/null 2>&1; then
-			DE="Aqua"
-		fi
-	elif [[ "${distro}" == "Cygwin" ]]; then
-		winver=`wmic os get version | grep -o '^[0-9]'`
-		if [ "$winver" == "7" ]; then DE='Aero'
-		elif [ "$winver" == "6" ]; then DE='Aero'
-		else DE='Luna'; fi
-	fi
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding desktop environment...found as '$DE'"
-}
-### DE Detection - End
-
-
-# WM Detection - Begin
-detectwm () {
-	WM="Not Found"
-	if [[ -n ${DISPLAY} && ${distro} != "Cygwin" ]]; then
-
-		for each in "${wmnames[@]}"; do
-			PID="$(pgrep -U ${UID} $each)"
-			if [ "$PID" ]; then
-				case $each in
-					'awesome') WM="Awesome";;
-					'beryl') WM="Beryl";;
-					'bspwm') WM="bspwm";;
-					'blackbox') WM="Blackbox";;
-					'cinnamon') WM="Cinnamon";;
-					'compiz') WM="Compiz";;
-					'dminiwm') WM="dminiwm";;
-					'dwm') WM="dwm";;
-					'e16') WM="E16";;
-					'emerald') WM="Emerald";;
-					'enlightenment') WM="E17";;
-					'fluxbox') WM="FluxBox";;
-					'fvwm') WM="FVWM";;
-					'herbstluftwm') WM="herbstluftwm";;
-					'icewm') WM="IceWM";;
-					'kwin') WM="KWin";;
-					'metacity') WM="Metacity";;
-					'monsterwm') WM="monsterwm";;
-					'musca') WM="Musca";;
-					'notion') WM="Notion";;
-					'openbox') WM="OpenBox";;
-					'pekwm') WM="PekWM";;
-					'ratpoison') WM="Ratpoison";;
-					'sawfish') WM="Sawfish";;
-					'scrotwm') WM="ScrotWM";;
-					'spectrwm') WM="SpectrWM";;
-					'stumpwm') WM="StumpWM";;
-					'subtle') WM="subtle";;
-					'wmaker') WM="WindowMaker";;
-					'wmfs') WM="WMFS";;
-					'wmii') WM="wmii";;
-					'xfwm4') WM="Xfwm4";;
-					'i3') WM="i3";;
-					'xmonad') WM="XMonad";;
-				esac
-			fi
-
-			if [[ ${WM} != "Not Found" ]]; then
-				break 1
-			fi
-		done
-
-		if [[ ${WM} == "Not Found" ]]; then
-			if type -p xprop >/dev/null 2>&1; then
-				WM=$(xprop -root _NET_SUPPORTING_WM_CHECK)
-				if [[ "$WM" =~ 'not found' ]]; then
-					WM="Not Found"
-				elif [[ "$WM" =~ 'Not found' ]]; then
-					WM="Not Found"
-				elif [[ "$WM" =~ '[Ii]nvalid window id format' ]]; then
-					WM="Not Found"
-				elif [[ "$WM" =~ "no such" ]]; then
-					WM="Not Found"
-				else
-					WM=${WM//* }
-					WM=$(xprop -id ${WM} 8s _NET_WM_NAME)
-					WM=$(echo $(WM=${WM//*= }; echo ${WM//\"}))
-				fi
-			fi
-		else
-			if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
-				if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
-					WM=${WM,,}
-				else
-					WM="$(tr '[:upper:]' '[:lower:]' <<< ${WM})"
-				fi
-			else
-				WM="$(tr '[:upper:]' '[:lower:]' <<< ${WM})"
-			fi
-			case ${WM} in
-				'awesome') WM="Awesome";;
-				'beryl') WM="Beryl";;
-				'blackbox') WM="Blackbox";;
-				'cinnamon') WM="Cinnamon";;
-				'compiz') WM="Compiz";;
-				'dminiwm') WM="dminiwm";;
-				'dwm') WM="dwm";;
-				'e16') WM="E16";;
-				'emerald') WM="Emerald";;
-				'enlightenment') WM="E17";;
-				'fluxbox') WM="FluxBox";;
-				'fvwm') WM="FVWM";;
-				'herbstluftwm') WM="herbstluftwm";;
-				'icewm') WM="IceWM";;
-				'kwin') WM="KWin";;
-				'metacity') WM="Metacity";;
-				'monsterwm') WM="monsterwm";;
-				'musca') WM="Musca";;
-				*'gala'*) WM="Gala";;
-				'mutter'*) WM="Mutter";;
-				'gnome shell'*) WM="Mutter";;
-				'notion') WM="Notion";;
-				'openbox') WM="OpenBox";;
-				'pekwm') WM="PekWM";;
-				'ratpoison') WM="Ratpoison";;
-				'sawfish') WM="Sawfish";;
-				'scrotwm') WM="ScrotWM";;
-				'spectrwm') WM="SpectrWM";;
-				'stumpwm') WM="StumpWM";;
-				'subtle') WM="subtle";;
-				'wmaker') WM="WindowMaker";;
-				'wmfs') WM="WMFS";;
-				'wmii') WM="wmii";;
-				'xfwm4') WM="Xfwm4";;
-				'xmonad') WM="XMonad";;
-				'i3') WM="i3";;
-			esac
-		fi
-	elif [[ ${distro} == "Mac OS X" && "${WM}" == "Not Found" ]]; then
-		if ps -U ${USER} | grep [F]inder >/dev/null 2>&1; then
-			WM="Quartz Compositor"
-		fi
-	elif [[ "${distro}" == "Cygwin" ]]; then
-		bugn=$(tasklist | grep -o 'bugn' | tr -d '\r \n')
-		wind=$(tasklist | grep -o 'Windawesome' | tr -d '\r \n')
-		if [ "$bugn" = "bugn" ]; then WM="bug.n"
-		elif [ "$wind" = "Windawesome" ]; then WM="Windawesome"
-		else WM="DWM"; fi
-	fi
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Finding window manager...found as '$WM'"
-}
-# WM Detection - End
-
-
-# WM Theme Detection - BEGIN
-detectwmtheme () {
-	Win_theme="Not Found"
-	case $WM in
-		'Awesome') if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/awesome/rc.lua ]; then Win_theme="$(grep -e '^[^-].*\(theme\|beautiful\).*lua' ${XDG_CONFIG_HOME:-${HOME}/.config}/awesome/rc.lua | grep '[a-zA-Z0-9]\+/[a-zA-Z0-9]\+.lua' -o | cut -d'/' -f1 | head -n1)"; fi;;
-		'BlackBox') if [ -f $HOME/.blackboxrc ]; then Win_theme="$(awk -F"/" '/styleFile/ {print $NF}' $HOME/.blackboxrc)"; fi;;
-		'Beryl') Win_theme="Not Present";;
-		'bspwm') Win_theme="Not Present";;
-		'Cinnamon') Win_theme="$(gsettings get org.cinnamon.theme name)";;
-		'Compiz'|'Mutter'*|'GNOME Shell'|'Gala')
-			if type -p gsettings >/dev/null 2>&1; then
-				Win_theme="$(gsettings get org.gnome.desktop.wm.preferences theme)"
-				Win_theme=${Win_theme//"'"}
-			elif type -p gconftool-2 >/dev/null 2>&1; then
-				Win_theme=$(gconftool-2 -g /apps/metacity/general/theme)
-			fi
-		;;
-		'dminiwm') Win_theme="Not Present";;
-		'dwm') Win_theme="Not Present";;
-		'E16') Win_theme="$(awk -F"= " '/theme.name/ {print $2}' $HOME/.e16/e_config--0.0.cfg)";;
-		'E17'|'Enlightenment') 
-			if [ "$(which eet 2>/dev/null)" ]; then
-				econfig="$(eet -d $HOME/.e/e/config/standard/e.cfg config | awk '/value \"file\" string.*.edj/{ print $4 }')"
-				econfigend="${econfig##*/}"
-				Win_theme=${econfigend%.*}
-			fi
-		;;
-		#E17 doesn't store cfg files in text format so for now get the profile as opposed to theme. atyoung
-		#TODO: Find a way to extract and read E17 .cfg files ( google seems to have nothing ). atyoung
-		'E17') Win_theme=${E_CONF_PROFILE};;
-		'Emerald') if [ -f $HOME/.emerald/theme/theme.ini ]; then Win_theme="$(for a in /usr/share/emerald/themes/* $HOME/.emerald/themes/*; do cmp "$HOME/.emerald/theme/theme.ini" "$a/theme.ini" &>/dev/null && basename "$a"; done)"; fi;;
-		'Finder') Win_theme="Not Present";;
-		'FluxBox'|'Fluxbox') if [ -f $HOME/.fluxbox/init ]; then Win_theme="$(awk -F"/" '/styleFile/ {print $NF}' $HOME/.fluxbox/init)"; fi;;
-		'FVWM') Win_theme="Not Present";;
-		'i3') Win_theme="Not Present";;
-		'IceWM') if [ -f $HOME/.icewm/theme ]; then Win_theme="$(awk -F"[\",/]" '!/#/ {print $2}' $HOME/.icewm/theme)"; fi;;
-		'KWin'*)
-			if [[ -z $KDE_CONFIG_DIR ]]; then
-				if type -p kde5-config >/dev/null 2>&1; then
-					KDE_CONFIG_DIR=$(kde5-config --localprefix)
-				elif type -p kde4-config >/dev/null 2>&1; then
-					KDE_CONFIG_DIR=$(kde4-config --localprefix)
-				elif type -p kde-config >/dev/null 2>&1; then
-					KDE_CONFIG_DIR=$(kde-config --localprefix)
-				fi
-			fi
-
-			if [[ -n $KDE_CONFIG_DIR ]]; then
-				Win_theme=$(awk '/PluginLib=kwin3_/{gsub(/PluginLib=kwin3_/,"",$0); print $0; exit}' $KDE_CONFIG_DIR/share/config/kwinrc)
-				if [[ -z $Win_theme ]]; then
-					if [[ -f $KDE_CONFIG_DIR/share/config/kdebugrc ]]; then
-						Win_theme=$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' $KDE_CONFIG_DIR/share/config/kdebugrc)
-						if [[ -z $Win_theme ]]; then
-							Win_theme="Not Found"
-						fi
-					else
-						Win_theme="Not Found"
-					fi
-				fi
-
-				if [[ $Win_theme != 'Not Found' ]]; then
-					if [[ ${BASH_VERSINFO[0]} -ge 4 ]]; then
-						if [[ ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -gt 1 ]] || [[ ${BASH_VERSINFO[0]} -gt 4 ]]; then
-							Win_theme=${Win_theme^}
-						else
-							Win_theme="$(tr '[:lower:]' '[:upper:]' <<< ${Win_theme:0:1})${Win_theme:1}"
-						fi
-					else
-						Win_theme="$(tr '[:lower:]' '[:upper:]' <<< ${Win_theme:0:1})${Win_theme:1}"
-					fi
-				fi
-			fi
-		;;
-		'Marco')
-			Win_theme="$(gsettings get org.mate.Marco.general theme)"
-			Win_theme=${Win_theme//"'"}
-		;;
-		'Metacity') if [ "`gconftool-2 -g /apps/metacity/general/theme`" ]; then Win_theme="$(gconftool-2 -g /apps/metacity/general/theme)"; fi ;;
-		'monsterwm') Win_theme="Not Present";;
-		'Musca') Win_theme="Not Present";;\
-		'Notion') Win_theme="Not Present";;
-		'OpenBox'|'Openbox')
-			if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/openbox/rc.xml ]; then
-				Win_theme="$(awk -F"[<,>]" '/]" '//dev/null 2>&1; then
-				KDE_CONFIG_DIR=$(kde4-config --localprefix)
-				if [[ -d ${KDE_CONFIG_DIR} ]]; then
-					if [[ -f "${KDE_CONFIG_DIR}/share/config/kdeglobals" ]]; then
-						KDE_CONFIG_FILE="${KDE_CONFIG_DIR}/share/config/kdeglobals"
-					fi
-				fi
-			elif type -p kde5-config >/dev/null 2>&1; then
-				KDE_CONFIG_DIR=$(kde5-config --localprefix)
-				if [[ -d ${KDE_CONFIG_DIR} ]]; then
-					if [[ -f "${KDE_CONFIG_DIR}/share/config/kdeglobals" ]]; then
-						KDE_CONFIG_FILE="${KDE_CONFIG_DIR}/share/config/kdeglobals"
-					fi
-				fi
-			elif type -p kde-config >/dev/null 2>&1; then
-				KDE_CONFIG_DIR=$(kde-config --localprefix)
-				if [[ -d ${KDE_CONFIG_DIR} ]]; then
-					if [[ -f "${KDE_CONFIG_DIR}/share/config/kdeglobals" ]]; then
-						KDE_CONFIG_FILE="${KDE_CONFIG_DIR}/share/config/kdeglobals"
-					fi
-				fi
-			fi
-
-			if [[ -n ${KDE_CONFIG_FILE} ]]; then
-				if grep -q "widgetStyle=" "${KDE_CONFIG_FILE}"; then
-					gtk2Theme=$(awk -F"=" '/widgetStyle=/ {print $2}' "${KDE_CONFIG_FILE}")
-				elif grep -q "colorScheme=" "${KDE_CONFIG_FILE}"; then
-					gtk2Theme=$(awk -F"=" '/colorScheme=/ {print $2}' "${KDE_CONFIG_FILE}")
-				fi
-
-				if grep -q "Theme=" "${KDE_CONFIG_FILE}"; then
-					gtkIcons=$(awk -F"=" '/Theme=/ {print $2}' "${KDE_CONFIG_FILE}")
-				fi
-
-				if grep -q "Font=" "${KDE_CONFIG_FILE}"; then
-					gtkFont=$(awk -F"=" '/font=/ {print $2}' "${KDE_CONFIG_FILE}")
-				fi
-			fi
-
-			if [[ -f $HOME/.gtkrc-2.0 ]]; then
-				gtk2Theme=$(grep '^gtk-theme-name' $HOME/.gtkrc-2.0 | awk -F'=' '{print $2}')
-				gtk2Theme=${gtk2Theme//\"/}
-				gtkIcons=$(grep '^gtk-icon-theme-name' $HOME/.gtkrc-2.0 | awk -F'=' '{print $2}')
-				gtkIcons=${gtkIcons//\"/}
-				gtkFont=$(grep 'font_name' $HOME/.gtkrc-2.0 | awk -F'=' '{print $2}')
-				gtkFont=${gtkFont//\"/}
-			fi
-
-			if [[ -f $HOME/.config/gtk-3.0/settings.ini ]]; then
-				gtk3Theme=$(grep '^gtk-theme-name=' $HOME/.config/gtk-3.0/settings.ini | awk -F'=' '{print $2}')
-			fi
-		;;
-		'Cinnamon'*) # Desktop Environment found as "Cinnamon"
-			if type -p gsettings >/dev/null 2>&1; then
-				gtk3Theme=$(gsettings get org.gnome.desktop.interface gtk-theme)
-				gtk3Theme=${gtk3Theme//"'"}
-				gtk2Theme=${gtk3Theme}
-
-				gtkIcons=$(gsettings get org.gnome.desktop.interface icon-theme)
-				gtkIcons=${gtkIcons//"'"}
-				gtkFont=$(gsettings get org.gnome.desktop.interface font-name)
-				gtkFont=${gtkFont//"'"}
-				if [ "$background_detect" == "1" ]; then gtkBackground=$(gsettings get org.gnome.desktop.background picture-uri); fi
-			fi
-		;;
-		'GNOME'*|'Gnome'*|'Unity'*) # Desktop Environment found as "GNOME"
-			if type -p gsettings >/dev/null 2>&1; then
-				gtk3Theme=$(gsettings get org.gnome.desktop.interface gtk-theme)
-				gtk3Theme=${gtk3Theme//"'"}
-				gtk2Theme=${gtk3Theme}
-				gtkIcons=$(gsettings get org.gnome.desktop.interface icon-theme)
-				gtkIcons=${gtkIcons//"'"}
-				gtkFont=$(gsettings get org.gnome.desktop.interface font-name)
-				gtkFont=${gtkFont//"'"}
-				if [ "$background_detect" == "1" ]; then gtkBackground=$(gsettings get org.gnome.desktop.background picture-uri); fi
-			elif type -p gconftool-2 >/dev/null 2>&1; then
-				gtk2Theme=$(gconftool-2 -g /desktop/gnome/interface/gtk_theme)
-				gtkIcons=$(gconftool-2 -g /desktop/gnome/interface/icon_theme)
-				gtkFont=$(gconftool-2 -g /desktop/gnome/interface/font_name)
-				if [ "$background_detect" == "1" ]; then
-					gtkBackgroundFull=$(gconftool-2 -g /desktop/gnome/background/picture_filename)
-					gtkBackground=$(echo "$gtkBackgroundFull" | awk -F"/" '{print $NF}')
-				fi
-			fi
-		;;
-		'MATE'*) # MATE desktop environment
-			#if type -p gsettings >/dev/null 2&>1; then
-			gtk3Theme=$(gsettings get org.mate.interface gtk-theme)
-			# gtk3Theme=${gtk3Theme//"'"}
-			gtk2Theme=${gtk3Theme}
-			gtkIcons=$(gsettings get org.mate.interface icon-theme)
-			gtkIcons=${gtkIcons//"'"}
-			gtkFont=$(gsettings get org.mate.interface font-name)
-			gtkFont=${gtkFont//"'"}
-			#fi
-		;;
-		'XFCE'*) # Desktop Environment found as "XFCE"
-			if type -p xfconf-query >/dev/null 2>&1; then
-				gtk2Theme=$(xfconf-query -c xsettings -p /Net/ThemeName)
-			fi
-
-			if type -p xfconf-query >/dev/null 2>&1; then
-				gtkIcons=$(xfconf-query -c xsettings -p /Net/IconThemeName)
-			fi
-
-			if type -p xfconf-query >/dev/null 2>&1; then
-				gtkFont=$(xfconf-query -c xsettings -p /Gtk/FontName)
-			fi
-		;;
-		'LXDE'*)
-			if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/lxde/config ]; then
-				lxdeconf="/lxde/config"
-			elif [ "$distro" == "Trisquel" ]; then
-				lxdeconf=""
-			elif [ "$distro" == "FreeBSD" ]; then
-				lxdeconf=""
-			else
-				lxdeconf="/lxsession/LXDE/desktop.conf"
-			fi
-			# TODO: Clean me.
-			if grep -q "sNet\/ThemeName" ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf 2>/dev/null; then
-				gtk2Theme=$(awk -F'=' '/sNet\/ThemeName/ {print $2}' ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf)
-			fi
-
-			if grep -q IconThemeName ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf 2>/dev/null; then
-				gtkIcons=$(awk -F'=' '/sNet\/IconThemeName/ {print $2}' ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf)
-			fi
-
-			if grep -q FontName ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf 2>/dev/null; then
-				gtkFont=$(awk -F'=' '/sGtk\/FontName/ {print $2}' ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf)
-			fi
-		;;
-
-		# /home/me/.config/rox.sourceforge.net/ROX-Session/Settings.xml
-
-		*)	# Lightweight or No DE Found
-			if [ -f $HOME/.gtkrc-2.0 ]; then
-				if grep -q gtk-theme $HOME/.gtkrc-2.0; then
-					gtk2Theme=$(awk -F'"' '/^gtk-theme/ {print $2}' $HOME/.gtkrc-2.0)
-				fi
-
-				if grep -q icon-theme $HOME/.gtkrc-2.0; then
-					gtkIcons=$(awk -F'"' '/^gtk-icon-theme/ {print $2}' $HOME/.gtkrc-2.0)
-				fi
-
-				if grep -q font $HOME/.gtkrc-2.0; then
-					gtkFont=$(awk -F'"' '/^gtk-font-name/ {print $2}' $HOME/.gtkrc-2.0)
-				fi
-			fi
-			# $HOME/.gtkrc.mine theme detect only
-			if [ -f $HOME/.gtkrc.mine ]; then
-				if grep -q "^include" $HOME/.gtkrc.mine; then
-					gtk2Theme=$(grep '^include.*gtkrc' $HOME/.gtkrc.mine | awk -F "/" '{ print $5 }')
-				fi
-				if grep -q "^gtk-icon-theme-name" $HOME/.gtkrc.mine; then
-					gtkIcons=$(grep '^gtk-icon-theme-name' $HOME/.gtkrc.mine | awk -F '"' '{print $2}')
-				fi
-			fi
-			# /etc/gtk-2.0/gtkrc compatability
-			if [[ -f /etc/gtk-2.0/gtkrc && ! -f $HOME/.gtkrc-2.0 && ! -f $HOME/.gtkrc.mine ]]; then
-				if grep -q gtk-theme-name /etc/gtk-2.0/gtkrc; then
-					gtk2Theme=$(awk -F'"' '/^gtk-theme-name/ {print $2}' /etc/gtk-2.0/gtkrc)
-				fi
-				if grep -q gtk-fallback-theme-name /etc/gtk-2.0/gtkrc  && ! [ "x$gtk2Theme" = "x" ]; then
-					gtk2Theme=$(awk -F'"' '/^gtk-fallback-theme-name/ {print $2}' /etc/gtk-2.0/gtkrc)
-				fi
-
-				if grep -q icon-theme /etc/gtk-2.0/gtkrc; then
-					gtkIcons=$(awk -F'"' '/^icon-theme/ {print $2}' /etc/gtk-2.0/gtkrc)
-				fi
-				if  grep -q gtk-fallback-icon-theme /etc/gtk-2.0/gtkrc  && ! [ "x$gtkIcons" = "x" ]; then
-					gtkIcons=$(awk -F'"' '/^gtk-fallback-icon-theme/ {print $2}' /etc/gtk-2.0/gtkrc)
-				fi
-
-				if grep -q font /etc/gtk-2.0/gtkrc; then
-					gtkFont=$(awk -F'"' '/^gtk-font-name/ {print $2}' /etc/gtk-2.0/gtkrc)
-				fi
-			fi
-
-			# EXPERIMENTAL gtk3 Theme detection
-			if [ -f $HOME/.config/gtk-3.0/settings.ini ]; then
-				if grep -q gtk-theme-name $HOME/.config/gtk-3.0/settings.ini; then
-					gtk3Theme=$(awk -F'=' '/^gtk-theme-name/ {print $2}' $HOME/.config/gtk-3.0/settings.ini)
-				fi
-			fi
-
-			# Proper gtk3 Theme detection
-			#if [ $(which gsettings) ] && [ "$distro" != "Mac OS X" ]; then
-			#	gtk3Theme="$(gsettings get org.gnome.desktop.interface gtk-theme | tr -d \"\'\")"
-			#fi
-			if type -p gsettings >/dev/null 2>&1; then
-				gtk3Theme=$(gsettings get org.gnome.desktop.interface gtk-theme 2>/dev/null)
-				gtk3Theme=${gtk3Theme//"'"}
-			fi
-
-			# ROX-Filer icon detect only
-			if [ -a ${XDG_CONFIG_HOME:-${HOME}/.config}/rox.sourceforge.net/ROX-Filer/Options ]; then
-				gtkIcons=$(awk -F'[>,<]' '/^icon_theme/ {print $3}' ${XDG_CONFIG_HOME:-${HOME}/.config}/rox.sourceforge.net/ROX-Filer/Options)
-			fi
-
-			# E17 detection
-			if [ $E_ICON_THEME ]; then
-				gtkIcons=${E_ICON_THEME}
-				gtk2Theme="Not available."
-				gtkFont="Not available."
-			fi
-
-			# Background Detection (feh, nitrogen)
-			if [ "$background_detect" == "1" ]; then
-				if [ -a $HOME/.fehbg ]; then
-					gtkBackgroundFull=$(awk -F"'" '/feh --bg/{print $2}' $HOME/.fehbg 2>/dev/null)
-					gtkBackground=$(echo "$gtkBackgroundFull" | awk -F"/" '{print $NF}')
-				elif [ -a ${XDG_CONFIG_HOME:-${HOME}/.config}/nitrogen/bg-saved.cfg ]; then
-					gtkBackground=$(awk -F"/" '/file=/ {print $NF}' ${XDG_CONFIG_HOME:-${HOME}/.config}/nitrogen/bg-saved.cfg)
-				fi
-			fi
-
-			# Font detection (OS X)
-			if [[ ${distro} == "Mac OS X" ]]; then
-				if ps -U ${USER} | grep [F]inder >/dev/null 2>&1; then
-					gtkFont="Not Found"
-					if [ -f ~/Library/Preferences/com.googlecode.iterm2.plist ]; then
-						gtkFont=$(str1=$(defaults read com.googlecode.iTerm2|grep -m 1 "Normal Font");echo ${str1:29:${#str1}-29-2})
-					fi
-				fi
-			fi
-
-			if [ "$distro" == "Cygwin" -a "$gtkFont" == "Not Found" ]; then
-				if [ -f $HOME/.minttyrc ]; then
-					gtkFont="$(cat $HOME/.minttyrc | grep '^Font=.*' | grep -o '[0-9A-z ]*$')"
-				fi
-			fi
-		;;
-	esac
-	if [[ "$verbosity" -eq "1" ]]; then
-		verboseOut "Finding GTK2 theme...found as '$gtk2Theme'"
-		verboseOut "Finding GTK3 theme...found as '$gtk3Theme'"
-		verboseOut "Finding icon theme...found as '$gtkIcons'"
-		verboseOut "Finding user font...found as '$gtkFont'"
-		[[ $gtkBackground ]] && verboseOut "Finding background...found as '$gtkBackground'"
-	fi
-}
-# GTK Theme\Icon\Font Detection - END
-
-# Android-specific detections
-detectdroid () {
-	distro_ver=$(getprop ro.build.version.release)
-
-	hostname=$(getprop net.hostname)
-
-	_device=$(getprop ro.product.device)
-	_model=$(getprop ro.product.model)
-	device="${_model} (${_device})"
-
-	if [[ $(getprop ro.build.host) == "cyanogenmod" ]]; then
-		rom=$(getprop ro.cm.version)
-	else
-		rom=$(getprop ro.build.display.id)
-	fi
-
-	baseband=$(getprop ro.baseband)
-
-	cpu=$(grep '^Processor' /proc/cpuinfo)
-	cpu=$(echo "$cpu" | sed 's/Processor.*: //')
-}
-
-
-#######################
-# End Detection Phase
-#######################
-
-takeShot () {
-	if [[ -z $screenCommand ]]; then
-		if [[ "$hostshot" == "1" ]]; then
-			if [ "$distro" == "Mac OS X" ]; then printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x "${shotfile}" &> /dev/null
-			else scrot -cd3 "${shotfile}"; fi
-			if [ -f "${shotfile}" ]; then
-				[[ "$verbosity" -eq "1" ]] && verboseOut "Screenshot saved at '${shotfile}'"
-				scp -qo ConnectTimeout="${scptimeout}" "${shotfile}" "${serveraddr}:${serverdir}"
-				echo -e "${bold}==>${c0} Your screenshot can be viewed at ${baseurl}/$shotfile"
-			else
-				verboseOut "ERROR: Problem saving screenshot to ${shotfile}"
-			fi
-		else
-			if [ "$distro" == "Mac OS X" ]; then printf "Taking shot in 3.. "; sleep 1; printf "2.. "; sleep 1; printf "1.. "; sleep 1; printf "0.\n"; screencapture -x "${shotfile}" &> /dev/null
-			else scrot -cd3 "${shotfile}"; fi
-			if [ -f "${shotfile}" ]; then
-				[[ "$verbosity" -eq "1" ]] && verboseOut "Screenshot saved at '${shotfile}'"
-			else
-				verboseOut "ERROR: Problem saving screenshot to ${shotfile}"
-			fi
-		fi
-	else
-		$screenCommand
-	fi
-}
-
-
-
-asciiText () {
-# Distro logos and ASCII outputs
-	if [[ "$fake_distro" ]]; then distro="${fake_distro}"; fi
-	if [[ "$asc_distro" ]]; then myascii="${asc_distro}"
-	else myascii="${distro}"; fi
-	case ${myascii} in
-		"Arch Linux - Old")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light blue') # Light Blue
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("$c1              __                      %s"
-"$c1          _=(SDGJT=_                 %s"
-"$c1        _GTDJHGGFCVS)                %s"
-"$c1       ,GTDJGGDTDFBGX0               %s"
-"$c1      JDJDIJHRORVFSBSVL$c2-=+=,_        %s"
-"$c1     IJFDUFHJNXIXCDXDSV,$c2  \"DEBL      %s"
-"$c1    [LKDSDJTDU=OUSCSBFLD.$c2   '?ZWX,   %s"
-"$c1   ,LMDSDSWH'     \`DCBOSI$c2     DRDS], %s"
-"$c1   SDDFDFH'         !YEWD,$c2   )HDROD  %s"
-"$c1  !KMDOCG            &GSU|$c2\_GFHRGO\'  %s"
-"$c1  HKLSGP'$c2           __$c1\TKM0$c2\GHRBV)'  %s"
-"$c1 JSNRVW'$c2       __+MNAEC$c1\IOI,$c2\BN'     %s"
-"$c1 HELK['$c2    __,=OFFXCBGHC$c1\FD)         %s"
-"$c1 ?KGHE $c2\_-#DASDFLSV='$c1    'EF         %s"
-"$c1 'EHTI                    !H         %s"
-"$c1  \`0F'                    '!         %s"
-"                                     %s"
-"                                     %s")
-		;;
-
-		"Arch Linux")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light cyan') # Light
-				c2=$(getColor 'cyan') # Dark
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="1"
-			fulloutput=("${c1}                   -\`"
-"${c1}                  .o+\`                 %s"
-"${c1}                 \`ooo/                %s"
-"${c1}                \`+oooo:               %s"
-"${c1}               \`+oooooo:              %s"
-"${c1}               -+oooooo+:             %s"
-"${c1}             \`/:-:++oooo+:            %s"
-"${c1}            \`/++++/+++++++:           %s"
-"${c1}           \`/++++++++++++++:          %s"
-"${c1}          \`/+++o"${c2}"oooooooo"${c1}"oooo/\`        %s"
-"${c2}         "${c1}"./"${c2}"ooosssso++osssssso"${c1}"+\`       %s"
-"${c2}        .oossssso-\`\`\`\`/ossssss+\`      %s"
-"${c2}       -osssssso.      :ssssssso.     %s"
-"${c2}      :osssssss/        osssso+++.    %s"
-"${c2}     /ossssssss/        +ssssooo/-    %s"
-"${c2}   \`/ossssso+/:-        -:/+osssso+-  %s"
-"${c2}  \`+sso+:-\`                 \`.-/+oso: %s"
-"${c2} \`++:.                           \`-/+/%s"
-"${c2} .\`                                 \`/%s")
-		;;
-
-		"Mint")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light green') # Bold Green
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("                                       %s"
-"$c2 MMMMMMMMMMMMMMMMMMMMMMMMMmds+.       %s"
-"$c2 MMm----::-://////////////oymNMd+\`    %s"
-"$c2 MMd      "$c1"/++                "$c2"-sNMd:   %s"
-"$c2 MMNso/\`  "$c1"dMM    \`.::-. .-::.\` "$c2".hMN:  %s"
-"$c2 ddddMMh  "$c1"dMM   :hNMNMNhNMNMNh: "$c2"\`NMm  %s"
-"$c2     NMm  "$c1"dMM  .NMN/-+MMM+-/NMN\` "$c2"dMM  %s"
-"$c2     NMm  "$c1"dMM  -MMm  \`MMM   dMM. "$c2"dMM  %s"
-"$c2     NMm  "$c1"dMM  -MMm  \`MMM   dMM. "$c2"dMM  %s"
-"$c2     NMm  "$c1"dMM  .mmd  \`mmm   yMM. "$c2"dMM  %s"
-"$c2     NMm  "$c1"dMM\`  ..\`   ...   ydm. "$c2"dMM  %s"
-"$c2     hMM- "$c1"+MMd/-------...-:sdds  "$c2"dMM  %s"
-"$c2     -NMm- "$c1":hNMNNNmdddddddddy/\`  "$c2"dMM  %s"
-"$c2      -dMNs-"$c1"\`\`-::::-------.\`\`    "$c2"dMM  %s"
-"$c2       \`/dMNmy+/:-------------:/yMMM  %s"
-"$c2          ./ydNMMMMMMMMMMMMMMMMMMMMM  %s"
-"$c2             \.MMMMMMMMMMMMMMMMMMM    %s"
-"                                      %s")
-		;;
-
-
-		"LMDE")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light green') # Bold Green
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("          "${c1}"\`.-::---..            %s"
-"${c2}       .:++++ooooosssoo:.      %s"
-"${c2}     .+o++::.      \`.:oos+.    %s"
-"${c2}    :oo:.\`             -+oo"${c1}":   %s"
-"${c2}  "${c1}"\`"${c2}"+o/\`    ."${c1}"::::::"${c2}"-.    .++-"${c1}"\`  %s"
-"${c2} "${c1}"\`"${c2}"/s/    .yyyyyyyyyyo:   +o-"${c1}"\`  %s"
-"${c2} "${c1}"\`"${c2}"so     .ss       ohyo\` :s-"${c1}":  %s"
-"${c2} "${c1}"\`"${c2}"s/     .ss  h  m  myy/ /s\`"${c1}"\`  %s"
-"${c2} \`s:     \`oo  s  m  Myy+-o:\`   %s"
-"${c2} \`oo      :+sdoohyoydyso/.     %s"
-"${c2}  :o.      .:////////++:       %s"
-"${c2}  \`/++        "${c1}"-:::::-          %s"
-"${c2}   "${c1}"\`"${c2}"++-                        %s"
-"${c2}    "${c1}"\`"${c2}"/+-                       %s"
-"${c2}      "${c1}"."${c2}"+/.                     %s"
-"${c2}        "${c1}"."${c2}":+-.                  %s"
-"${c2}           \`--.\`\`              %s"
-"                               %s")
-		;;
-
-		"Ubuntu")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light red') # Light Red
-				c3=$(getColor 'yellow') # Bold Yellow
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("$c2                          ./+o+-       %s"
-"$c1                  yyyyy- $c2-yyyyyy+     %s"
-"$c1               $c1://+//////$c2-yyyyyyo     %s"
-"$c3           .++ $c1.:/++++++/-$c2.+sss/\`     %s"
-"$c3         .:++o:  $c1/++++++++/:--:/-     %s"
-"$c3        o:+o+:++.$c1\`..\`\`\`.-/oo+++++/    %s"
-"$c3       .:+o:+o/.$c1          \`+sssoo+/   %s"
-"$c1  .++/+:$c3+oo+o:\`$c1             /sssooo.  %s"
-"$c1 /+++//+:$c3\`oo+o$c1               /::--:.  %s"
-"$c1 \+/+o+++$c3\`o++o$c2               ++////.  %s"
-"$c1  .++.o+$c3++oo+:\`$c2             /dddhhh.  %s"
-"$c3       .+.o+oo:.$c2          \`oddhhhh+   %s"
-"$c3        \+.++o+o\`\`-\`\`$c2\`\`.:ohdhhhhh+    %s"
-"$c3         \`:o+++ $c2\`ohhhhhhhhyo++os:     %s"
-"$c3           .o:$c2\`.syhhhhhhh/$c3.oo++o\`     %s"
-"$c2               /osyyyyyyo$c3++ooo+++/    %s"
-"$c2                   \`\`\`\`\` $c3+oo+++o\:    %s"
-"$c3                          \`oo++.      %s")
-		;;
-
-		"Debian")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light red') # Light Red
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-                        fulloutput=("  $c1       _,met\$\$\$\$\$gg.           %s"
-"  $c1    ,g\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$P.       %s"
-"  $c1  ,g\$\$P\"\"       \"\"\"Y\$\$.\".     %s"
-"  $c1 ,\$\$P'              \`\$\$\$.     %s"
-"  $c1',\$\$P       ,ggs.     \`\$\$b:   %s"
-"  $c1\`d\$\$'     ,\$P\"\'   $c2.$c1    \$\$\$    %s"
-"  $c1 \$\$P      d\$\'     $c2,$c1    \$\$P    %s"
-"  $c1 \$\$:      \$\$.   $c2-$c1    ,d\$\$'    %s"
-"  $c1 \$\$\;      Y\$b._   _,d\$P'     %s"
-"  $c1 Y\$\$.    $c2\`.$c1\`\"Y\$\$\$\$P\"'         %s"
-"  $c1 \`\$\$b      $c2\"-.__              %s"
-"  $c1  \`Y\$\$                        %s"
-"  $c1   \`Y\$\$.                      %s"
-"  $c1     \`\$\$b.                    %s"
-"  $c1       \`Y\$\$b.                 %s"
-"  $c1          \`\"Y\$b._             %s"
-"  $c1              \`\"\"\"\"           %s"
-"                                %s")
-		;;
-
-
-		"CrunchBang")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-            fulloutput=("                                       %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
-"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
-"$c2  "$c1"████████████████████████████"$c2"   "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"               %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"               %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2         "$c1"███"$c2"        "$c1"███"$c2"          "$c1"███"$c2"  %s"
-"$c2                                      %s")
-		;;
-
-		"Gentoo")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light purple') # Light Purple
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("$c2         -/oyddmdhs+:.                %s"
-"$c2     -o"$c1"dNMMMMMMMMNNmhy+"$c2"-\`            %s"
-"$c2   -y"$c1"NMMMMMMMMMMMNNNmmdhy"$c2"+-          %s"
-"$c2 \`o"$c1"mMMMMMMMMMMMMNmdmmmmddhhy"$c2"/\`       %s"
-"$c2 om"$c1"MMMMMMMMMMMN"$c2"hhyyyo"$c1"hmdddhhhd"$c2"o\`     %s"
-"$c2.y"$c1"dMMMMMMMMMMd"$c2"hs++so/s"$c1"mdddhhhhdm"$c2"+\`   %s"
-"$c2 oy"$c1"hdmNMMMMMMMN"$c2"dyooy"$c1"dmddddhhhhyhN"$c2"d.  %s"
-"$c2  :o"$c1"yhhdNNMMMMMMMNNNmmdddhhhhhyym"$c2"Mh  %s"
-"$c2    .:"$c1"+sydNMMMMMNNNmmmdddhhhhhhmM"$c2"my  %s"
-"$c2       /m"$c1"MMMMMMNNNmmmdddhhhhhmMNh"$c2"s:  %s"
-"$c2    \`o"$c1"NMMMMMMMNNNmmmddddhhdmMNhs"$c2"+\`   %s"
-"$c2  \`s"$c1"NMMMMMMMMNNNmmmdddddmNMmhs"$c2"/.     %s"
-"$c2 /N"$c1"MMMMMMMMNNNNmmmdddmNMNdso"$c2":\`       %s"
-"$c2+M"$c1"MMMMMMNNNNNmmmmdmNMNdso"$c2"/-          %s"
-"$c2yM"$c1"MNNNNNNNmmmmmNNMmhs+/"$c2"-\`              %s"
-"$c2/h"$c1"MMNNNNNNNNMNdhs++/"$c2"-\`               %s"
-"$c2\`/"$c1"ohdmmddhys+++/:"$c2".\`                  %s"
-"$c2  \`-//////:--.                       %s")
-		;;
-
-
-		"Funtoo")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light purple') # Light Purple
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("                                                     %s"
-"                                                    %s"
-"                                                    %s"
-"                                                    %s"
-"${c1}     _______               ____                     %s"
-"${c1}    /MMMMMMM/             /MMMM| _____  _____       %s"
-"${c1} __/M${c2}.MMM.${c1}M/_____________|M${c2}.M${c1}MM|/MMMMM\/MMMMM\      %s"
-"${c1}|MMMM${c2}MM'${c1}MMMMMMMMMMMMMMMMMMM${c2}MM${c1}MMMM${c2}.MMMM..MMMM.${c1}MM\    %s"
-"${c1}|MM${c2}MMMMMMM${c1}/m${c2}MMMMMMMMMMMMMMMMMMMMMM${c1}MMMM${c2}MM${c1}MMMM${c2}MM${c1}MM|   %s"
-"${c1}|MMMM${c2}MM${c1}MMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MMMMM${c2}\MMM${c1}MMM${c2}MM${c1}MMMM${c2}MM${c1}MMMM${c2}MM${c1}MM|   %s"
-"${c1}  |MM${c2}MM${c1}MMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MMM${c1}MMMM${c2}'MMMM''MMMM'${c1}MM/    %s"
-"${c1}  |MM${c2}MM${c1}MMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MMM${c1}MMM\MMMMM/\MMMMM/      %s"
-"${c1}  |MM${c2}MM${c1}MMM${c2}MM${c1}MMMMMM${c2}MM${c1}MM${c2}MM${c1}MM${c2}MMMMM'${c1}M|                  %s"
-"${c1}  |MM${c2}MM${c1}MMM${c2}MMMMMMMMMMMMMMMMM MM'${c1}M/                   %s"
-"${c1}  |MMMMMMMMMMMMMMMMMMMMMMMMMMMM/                    %s"
-"                                                    %s"
-"                                                    %s"
-"                                                    %s")
-		;;
-
-		"Fedora")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light blue') # Light Blue
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("$c2           /:-------------:\          %s"
-"$c2        :-------------------::       %s"
-"$c2      :-----------"$c1"/shhOHbmp"$c2"---:\\     %s"
-"$c2    /-----------"$c1"omMMMNNNMMD  "$c2"---:    %s"
-"$c2   :-----------"$c1"sMMMMNMNMP"$c2"     ---:   %s"
-"$c2  :-----------"$c1":MMMdP"$c2"-----      ---   %s"
-"$c2 ,------------"$c1":MMMd"$c2"------      ---:  %s"
-"$c2 :------------"$c1":MMMd"$c2"-----      .---:  %s"
-"$c2 :----    "$c1"oNMMMMMMMMMNho"$c2"     .----:  %s"
-"$c2 :--      "$c1"+shhhMMMmhhy++"$c2"   .------   %s"
-"$c2 :-      -----"$c1":MMMd"$c2"--------------:   %s"
-"$c2 :-     ------"$c1"/MMMd"$c2"-------------;    %s"
-"$c2 :-    ${c1}..${c2}----"$c1"/hMMMy"$c2"------------:     %s"
-"$c2 :--"$c1" :dMNdhhdNMMNo"$c2"------------;      %s"
-"$c2 :---"$c1":sdNMMMMNds:"$c2"------------:       %s"
-"$c2 :------"$c1":://:"$c2"-------------::         %s"
-"$c2 :---------------------://           %s"
-"                                     %s")
-		;;
-
-		"FreeBSD")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # white
-				c2=$(getColor 'light red') # Light Red
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("                                      %s"   # user@host
-"   "$c1"\`\`\`                        "$c2"\`      %s"      # OS
-"  "$c1"\` \`.....---..."$c2"....--.\`\`\`   -/      %s"     # Kernel
-"  "$c1"+o   .--\`         "$c2"/y:\`      +.     %s"        # Uptime
-"  "$c1" yo\`:.            "$c2":o      \`+-      %s"        # Packages
-"    "$c1"y/               "$c2"-/\`   -o/       %s"         # Shell
-"   "$c1".-                  "$c2"::/sy+:.      %s"          # Resolution
-"   "$c1"/                     "$c2"\`--  /      %s"         # DE
-"  "$c1"\`:                          "$c2":\`     %s"        # WM 
-"  "$c1"\`:                          "$c2":\`     %s"        # WM Theme
-"   "$c1"/                          "$c2"/      %s"          # GTK2 Theme
-"   "$c1".-                        "$c2"-.      %s"          # GTK3 Theme
-"    "$c1"--                      "$c2"-.       %s"          # Icon Theme
-"     "$c1"\`:\`                  "$c2"\`:\`        %s"      # Font
-"       "$c2".--             \`--.          %s"              # Disk
-"         "$c2" .---.....----.             %s"               # CPU
-"                                     %s"                    # GPU
-"                                     %s"                    # RAM
-)
-                ;;
-
-
-		"OpenBSD")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'yellow') # Light Yellow
-				c2=$(getColor 'brown') # Bold Yellow
-				c3=$(getColor 'light cyan') # Light Cyan
-				c4=$(getColor 'light red') # Light Red
-				c5=$(getColor 'dark grey')
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="$my_lcolor"; c2="${my_color}"; fi
-			startline="3"
-			fulloutput=(
-"                                       "$c3" _      "
-"                                       "$c3"(_)      "
-""$c1"              |    .                            "
-""$c1"          .   |L  /|   .         "$c3" _      %s"
-""$c1"      _ . |\ _| \--+._/| .       "$c3"(_)    %s"
-""$c1"     / ||\| Y J  )   / |/| ./           %s"
-""$c1"    J  |)'( |        \` F\`.'/       "$c3" _   %s"
-""$c1"  -<|  F         __     .-<        "$c3"(_)  %s"
-""$c1"    | /       .-'"$c3". "$c1"\`.  /"$c3"-. "$c1"L___         %s"
-""$c1"    J \      <    "$c3"\ "$c1" | | "$c5"O"$c3"\\\\"$c1"|.-' "$c3" _      %s"
-""$c1"  _J \  .-    \\\\"$c3"/ "$c5"O "$c3"| "$c1"| \  |"$c1"F    "$c3"(_)     %s"
-""$c1" '-F  -<_.     \   .-'  \`-' L__         %s"
-""$c1"__J  _   _.     >-'  "$c2")"$c4"._.   "$c1"|-'         %s         "
-""$c1" \`-|.'   /_.          "$c4"\_|  "$c1" F           %s     "
-""$c1"  /.-   .                _.<            %s"
-""$c1" /'    /.'             .'  \`\           %s"
-""$c1"  /L  /'   |/      _.-'-\               %s "
-""$c1" /'J       ___.---'\|                   %s"
-""$c1"   |\  .--' V  | \`. \`                   %s "
-""$c1"   |/\`. \`-.     \`._)                    %s"
-""$c1"      / .-.\                            %s"
-""$c1"      \ (  \`\                           "
-""$c1"       \`.\                                  "
-)
-		;;
-
-		"DragonFlyBSD")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light red') # Red
-				c2=$(getColor 'white') # White
-				c3=$(getColor 'yellow') #
-				c4=$(getColor 'light red')
-			fi
-			startline="0"
-			fulloutput=("                     "$c1" |                     %s"
-"                    "$c1" .-.                   %s"
-"                   "$c3" ()"$c1"I"$c3"()                  %s"
-"              "$c1" \"==.__:-:__.==\"             %s"
-"              "$c1"\"==.__/~|~\__.==\"            %s"
-"              "$c1"\"==._(  Y  )_.==\"            %s"
-"   "$c2".-'~~\"\"~=--...,__"$c1"\/|\/"$c2"__,...--=~\"\"~~'-. %s"
-"  "$c2"(               ..="$c1"\\\\="$c1"/"$c2"=..               )%s"
-"   "$c2"\`'-.        ,.-\"\`;"$c1"/=\\\\"$c2" ;\"-.,_        .-'\`%s"
-"      "$c2" \`~\"-=-~\` .-~\` "$c1"|=|"$c2" \`~-. \`~-=-\"~\`     %s"
-"       "$c2"     .-~\`    /"$c1"|=|"$c2"\    \`~-.          %s"
-"       "$c2"  .~\`       / "$c1"|=|"$c2" \       \`~.       %s"
-" "$c2"    .-~\`        .'  "$c1"|=|"$c2"  \\\\\`.        \`~-.  %s"
-" "$c2"  (\`     _,.-=\"\`  "$c1"  |=|"$c2"    \`\"=-.,_     \`) %s"
-" "$c2"   \`~\"~\"\`        "$c1"   |=|"$c2"           \`\"~\"~\`  %s"
-"                   "$c1"  /=\                   %s"
-"                   "$c1"  \=/                   %s"
-"                   "$c1"   ^                    %s"
-)
-		;;
-
-		"NetBSD")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light red') # Light Red
-				c2=$(getColor 'white') # White
-			fi
-			startline="0"
-			fulloutput=(
-"                                  "$c1"__,gnnnOCCCCCOObaau,_      %s"
-"   "$c2"_._                    "$c1"__,gnnCCCCCCCCOPF\"''              %s"
-"  "$c2"(N\\\\\\\\"$c1"XCbngg,._____.,gnnndCCCCCCCCCCCCF\"___,,,,___          %s"
-"   "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOOOOPYvv.     %s"
-"    "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCPF\"''               %s"
-"     "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCCCCCCOF\"'                     %s"
-"      "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCCCCCCOF\"'                         %s"
-"       "$c2"\\\\N\\\\\\\\"$c1"XCCCCCCCCCCCCCCCPF\"'                             %s"
-"        "$c2"\\\\N\\\\\\\\"$c1"\"PCOCCCOCCFP\"\"                                  %s"
-"         "$c2"\\\\N\                                                %s"
-"          "$c2"\\\\N\                                               %s"
-"           "$c2"\\\\N\                                              %s"
-"            "$c2"\\\\NN\                                            %s"
-"             "$c2"\\\\NN\                                           %s"
-"              "$c2"\\\\NNA.                                         %s"
-"               "$c2"\\\\NNA,                                        %s"
-"                "$c2"\\\\NNN,                                       %s"
-"                 "$c2"\\\\NNN\                                      %s"
-"                  "$c2"\\\\NNN\ "
-"                   "$c2"\\\\NNNA")
-		;;
-
-		"Mandriva"|"Mandrake")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light blue') # Light Blue
-				c2=$(getColor 'yellow') # Bold Yellow
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("                                          %s"
-"$c2                         \`\`              %s"
-"$c2                        \`-.              %s"
-"$c1       \`               $c2.---              %s"
-"$c1     -/               $c2-::--\`             %s"
-"$c1   \`++    $c2\`----...\`\`\`-:::::.             %s"
-"$c1  \`os.      $c2.::::::::::::::-\`\`\`     \`  \` %s"
-"$c1  +s+         $c2.::::::::::::::::---...--\` %s"
-"$c1 -ss:          $c2\`-::::::::::::::::-.\`\`.\`\` %s"
-"$c1 /ss-           $c2.::::::::::::-.\`\`   \`    %s"
-"$c1 +ss:          $c2.::::::::::::-            %s"
-"$c1 /sso         $c2.::::::-::::::-            %s"
-"$c1 .sss/       $c2-:::-.\`   .:::::            %s"
-"$c1  /sss+.    $c2..\`$c1  \`--\`    $c2.:::            %s"
-"$c1   -ossso+/:://+/-\`        $c2.:\`           %s"
-"$c1     -/+ooo+/-.              $c2\`           %s"
-"                                         %s"
-"                                         %s")
-		;;
-
-		"openSUSE")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light green') # Bold Green
-				c2=$(getColor 'white') # Bold White
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("$c2             .;ldkO0000Okdl;.                %s"
-"$c2         .;d00xl:,'....';:ok00d;.           %s"
-"$c2       .d00l'                ,o00d.         %s"
-"$c2     .d0Kd."$c1" :Okxol:;'.          "$c2":O0d.       %s"
-"$c2    'OK"$c1"KKK0kOKKKKKKKKKKOxo:'      "$c2"lKO'      %s"
-"$c2   ,0K"$c1"KKKKKKKKKKKKKKK0d:"$c2",,,"$c1":dx:"$c2"    ;00,     %s"
-"$c2  .OK"$c1"KKKKKKKKKKKKKKKk."$c2".oOkdl."$c1"'0k."$c2"   cKO.    %s"
-"$c2  :KK"$c1"KKKKKKKKKKKKKKK: "$c2"kKx..od "$c1"lKd"$c2"   .OK:    %s"
-"$c2  dKK"$c1"KKKKKKKKKOx0KKKd "$c2";0KKKO, "$c1"kKKc"$c2"   dKd    %s"
-"$c2  dKK"$c1"KKKKKKKKKK;.;oOKx,.."$c2"'"$c1"..;kKKK0."$c2"  dKd    %s"
-"$c2  :KK"$c1"KKKKKKKKKK0o;...;cdxxOK0Oxc,.  "$c2".0K:    %s"
-"$c2   kKK"$c1"KKKKKKKKKKKKK0xl;'......,cdo  "$c2"lKk     %s"
-"$c2   '0K"$c1"KKKKKKKKKKKKKKKKKKKK00KKOo;  "$c2"c00'     %s"
-"$c2    .kK"$c1"KKOxddxkOO00000Okxoc;'.   "$c2".dKk.      %s"
-"$c2      l0Ko.                    .c00l.       %s"
-"$c2       .l0Kk:.              .;xK0l.         %s"
-"$c2          ,lkK0xl:;,,,,;:ldO0kl,            %s"
-"$c2              .':ldxkkkkxdl:'.              %s")
-		;;
-
-		"Slackware")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light blue') # Light Blue
-				c2=$(getColor 'white') # Bold White
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="1"
-			fulloutput=("$c1                   :::::::"
-"$c1             :::::::::::::::::::               %s"
-"$c1          :::::::::::::::::::::::::           %s"
-"$c1        ::::::::"${c2}"cllcccccllllllll"${c1}"::::::        %s"
-"$c1     :::::::::"${c2}"lc               dc"${c1}":::::::      %s"
-"$c1    ::::::::"${c2}"cl   clllccllll    oc"${c1}":::::::::    %s"
-"$c1   :::::::::"${c2}"o   lc"${c1}"::::::::"${c2}"co   oc"${c1}"::::::::::   %s"
-"$c1  ::::::::::"${c2}"o    cccclc"${c1}":::::"${c2}"clcc"${c1}"::::::::::::  %s"
-"$c1  :::::::::::"${c2}"lc        cclccclc"${c1}":::::::::::::  %s"
-"$c1 ::::::::::::::"${c2}"lcclcc          lc"${c1}":::::::::::: %s"
-"$c1 ::::::::::"${c2}"cclcc"${c1}":::::"${c2}"lccclc     oc"${c1}"::::::::::: %s"
-"$c1 ::::::::::"${c2}"o    l"${c1}"::::::::::"${c2}"l    lc"${c1}"::::::::::: %s"
-"$c1  :::::"${c2}"cll"${c1}":"${c2}"o     clcllcccll     o"${c1}":::::::::::  %s"
-"$c1  :::::"${c2}"occ"${c1}":"${c2}"o                  clc"${c1}":::::::::::  %s"
-"$c1   ::::"${c2}"ocl"${c1}":"${c2}"ccslclccclclccclclc"${c1}":::::::::::::   %s"
-"$c1    :::"${c2}"oclcccccccccccccllllllllllllll"${c1}":::::    %s"
-"$c1     ::"${c2}"lcc1lcccccccccccccccccccccccco"${c1}"::::     %s"
-"$c1       ::::::::::::::::::::::::::::::::       %s"
-"$c1         ::::::::::::::::::::::::::::         %s"
-"$c1            ::::::::::::::::::::::"
-"$c1                 ::::::::::::")
-		;;
-
-		"Red Hat Linux")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light red') # Light Red
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("                                           %s"
-"$c2              \`.-..........\`              %s"
-"$c2             \`////////::.\`-/.             %s"
-"$c2             -: ....-////////.            %s"
-"$c2             //:-::///////////\`           %s"
-"$c2      \`--::: \`-://////////////:           %s"
-"$c2      //////-    \`\`.-:///////// .\`        %s"
-"$c2      \`://////:-.\`    :///////::///:\`     %s"
-"$c2        .-/////////:---/////////////:     %s"
-"$c2           .-://////////////////////.     %s"
-"$c1          yMN+\`.-$c2::///////////////-\`      %s"
-"$c1       .-\`:NMMNMs\`  \`..-------..\`         %s"
-"$c1        MN+/mMMMMMhoooyysshsss            %s"
-"$c1 MMM    MMMMMMMMMMMMMMyyddMMM+            %s"
-"$c1  MMMM   MMMMMMMMMMMMMNdyNMMh\`     hyhMMM %s"
-"$c1   MMMMMMMMMMMMMMMMyoNNNMMM+.   MMMMMMMM  %s"
-"$c1    MMNMMMNNMMMMMNM+ mhsMNyyyyMNMMMMsMM   %s"
-"                                          %s")
-		;;
-
-		"Frugalware")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light blue') # Light Blue
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="3"
-			fulloutput=("${c2}          \`++/::-.\`"
-"${c2}         /o+++++++++/::-.\`"
-"${c2}        \`o+++++++++++++++o++/::-.\`"
-"${c2}        /+++++++++++++++++++++++oo++/:-.\`\`         %s"
-"${c2}       .o+ooooooooooooooooooosssssssso++oo++/:-\`  %s"
-"${c2}       ++osoooooooooooosssssssssssssyyo+++++++o:  %s"
-"${c2}      -o+ssoooooooooooosssssssssssssyyo+++++++s\`  %s"
-"${c2}      o++ssoooooo++++++++++++++sssyyyyo++++++o:   %s"
-"${c2}     :o++ssoooooo"${c1}"/-------------"${c2}"+syyyyyo+++++oo    %s"
-"${c2}    \`o+++ssoooooo"${c1}"/-----"${c2}"+++++ooosyyyyyyo++++os:    %s"
-"${c2}    /o+++ssoooooo"${c1}"/-----"${c2}"ooooooosyyyyyyyo+oooss     %s"
-"${c2}   .o++++ssooooos"${c1}"/------------"${c2}"syyyyyyhsosssy-     %s"
-"${c2}   ++++++ssooooss"${c1}"/-----"${c2}"+++++ooyyhhhhhdssssso      %s"
-"${c2}  -s+++++syssssss"${c1}"/-----"${c2}"yyhhhhhhhhhhhddssssy.      %s"
-"${c2}  sooooooyhyyyyyh"${c1}"/-----"${c2}"hhhhhhhhhhhddddyssy+       %s"
-"${c2} :yooooooyhyyyhhhyyyyyyhhhhhhhhhhdddddyssy\`       %s"
-"${c2} yoooooooyhyyhhhhhhhhhhhhhhhhhhhddddddysy/        %s"
-"${c2}-ysooooooydhhhhhhhhhhhddddddddddddddddssy         %s"
-"${c2} .-:/+osssyyyysyyyyyyyyyyyyyyyyyyyyyyssy:         %s"
-"${c2}       \`\`.-/+oosysssssssssssssssssssssss          %s"
-"${c2}               \`\`.:/+osyysssssssssssssh.          %s"
-"${c2}                        \`-:/+osyyssssyo"
-"${c2}                                .-:+++\`")
-		;;
-
-
-		"Peppermint")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light red') # Light Red
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("${c2}             8ZZZZZZ"${c1}"MMMMM               %s"
-"${c2}          .ZZZZZZZZZ"${c1}"MMMMMMM.           %s"
-"${c1}        MM"${c2}"ZZZZZZZZZ"${c1}"MMMMMMM"${c2}"ZZZZ         %s"
-"${c1}      MMMMM"${c2}"ZZZZZZZZ"${c1}"MMMMM"${c2}"ZZZZZZZM       %s"
-"${c1}     MMMMMMM"${c2}"ZZZZZZZ"${c1}"MMMM"${c2}"ZZZZZZZZZ.      %s"
-"${c1}    MMMMMMMMM"${c2}"ZZZZZZ"${c1}"MMM"${c2}"ZZZZZZZZZZZI     %s"
-"${c1}   MMMMMMMMMMM"${c2}"ZZZZZZ"${c1}"MM"${c2}"ZZZZZZZZZZ"${c1}"MMM    %s"
-"${c2}   .ZZZ"${c1}"MMMMMMMMMM"${c2}"IZZ"${c1}"MM"${c2}"ZZZZZ"${c1}"MMMMMMMMM   %s"
-"${c2}   ZZZZZZZ"${c1}"MMMMMMMM"${c2}"ZZ"${c1}"M"${c2}"ZZZZ"${c1}"MMMMMMMMMMM   %s"
-"${c2}   ZZZZZZZZZZZZZZZZ"${c1}"M"${c2}"Z"${c1}"MMMMMMMMMMMMMMM   %s"
-"${c2}   .ZZZZZZZZZZZZZ"${c1}"MMM"${c2}"Z"${c1}"M"${c2}"ZZZZZZZZZZ"${c1}"MMMM   %s"
-"${c2}   .ZZZZZZZZZZZ"${c1}"MMM"${c2}"7ZZ"${c1}"MM"${c2}"ZZZZZZZZZZ7"${c1}"M    %s"
-"${c2}    ZZZZZZZZZ"${c1}"MMMM"${c2}"ZZZZ"${c1}"MMMM"${c2}"ZZZZZZZ77     %s"
-"${c1}     MMMMMMMMMMMM"${c2}"ZZZZZ"${c1}"MMMM"${c2}"ZZZZZ77      %s"
-"${c1}      MMMMMMMMMM"${c2}"7ZZZZZZ"${c1}"MMMMM"${c2}"ZZ77       %s"
-"${c1}       .MMMMMMM"${c2}"ZZZZZZZZ"${c1}"MMMMM"${c2}"Z7Z        %s"
-"${c1}         MMMMM"${c2}"ZZZZZZZZZ"${c1}"MMMMMMM         %s"
-"${c2}           NZZZZZZZZZZZ"${c1}"MMMMM           %s"
-"${c2}              ZZZZZZZZZ"${c1}"MM")
-		;;
-
-		"SolusOS")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'dark grey') # Light Gray
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("${c1}               e         e      %s"
-"${c1}             eee       ee      %s"
-"${c1}            eeee     eee       %s"
-"${c2}        wwwwwwwww"${c1}"eeeeee        %s"
-"${c2}     wwwwwwwwwwwwwww"${c1}"eee        %s"
-"${c2}   wwwwwwwwwwwwwwwwwww"${c1}"eeeeeeee %s"
-"${c2}  wwwww     "${c1}"eeeee"${c2}"wwwwww"${c1}"eeee    %s"
-"${c2} www          "${c1}"eeee"${c2}"wwwwww"${c1}"e      %s"
-"${c2} ww             "${c1}"ee"${c2}"wwwwww       %s"
-"${c2} w                 wwwww       %s"
-"${c2}                   wwwww       %s"
-"${c2}                  wwwww        %s"
-"${c2}                 wwwww         %s"
-"${c2}                wwww           %s"
-"${c2}               wwww            %s"
-"${c2}             wwww              %s"
-"${c2}           www                 %s"
-"${c2}         ww                    %s")
-		;;
-
-		"Mageia")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-			 	c2=$(getColor 'light cyan') # Light Cyan
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("$c2               .°°.               %s"
-"$c2                °°   .°°.        %s"
-"$c2                .°°°. °°         %s"
-"$c2                .   .            %s"
-"$c2                 °°° .°°°.       %s"
-"$c2             .°°°.   '___'       %s"
-"$c1            .${c2}'___'     $c1   .      %s"
-"$c1          :dkxc;'.  ..,cxkd;     %s"
-"$c1        .dkk. kkkkkkkkkk .kkd.   %s"
-"$c1       .dkk.  ';cloolc;.  .kkd   %s"
-"$c1       ckk.                .kk;  %s"
-"$c1       xO:                  cOd  %s"
-"$c1       xO:                  lOd  %s"
-"$c1       lOO.                .OO:  %s"
-"$c1       .k00.              .00x   %s"
-"$c1        .k00;            ;00O.   %s"
-"$c1         .lO0Kc;,,,,,,;c0KOc.    %s"
-"$c1            ;d00KKKKKK00d;       %s"
-"$c1               .,KKKK,.            ")
-		;;
-
-
-		"ParabolaGNU/Linux-libre")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light purple') # Light Purple
-				c2=$(getColor 'white') # White
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("                                  %s"
-"${c1}              eeeeeeeee          %s"
-"${c1}          eeeeeeeeeeeeeee        %s"
-"${c1}       eeeeee"${c2}"//////////"${c1}"eeeee     %s"
-"${c1}     eeeee"${c2}"///////////////"${c1}"eeeee   %s"
-"${c1}   eeeee"${c2}"///           ////"${c1}"eeee   %s"
-"${c1}  eeee"${c2}"//              ///"${c1}"eeeee   %s"
-"${c1} eee                 "${c2}"///"${c1}"eeeee    %s"
-"${c1}ee                  "${c2}"//"${c1}"eeeeee     %s"
-"${c1}e                  "${c2}"/"${c1}"eeeeeee      %s"
-"${c1}                  eeeeeee        %s"
-"${c1}                 eeeeee          %s"
-"${c1}                eeeeee           %s"
-"${c1}               eeeee             %s"
-"${c1}              eeee               %s"
-"${c1}            eee                  %s"
-"${c1}           ee                    %s"
-"${c1}          e                      %s")
-		;;
-
-
-		"Viperr")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'dark grey') # Dark Gray
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("${c1}    wwzapd         dlzazw       %s"
-"${c1}   an"${c2}"#"${c1}"zncmqzepweeirzpas"${c2}"#"${c1}"xz     %s"
-"${c1} apez"${c2}"##"${c1}"qzdkawweemvmzdm"${c2}"##"${c1}"dcmv   %s"
-"${c1}zwepd"${c2}"####"${c1}"qzdweewksza"${c2}"####"${c1}"ezqpa  %s"
-"${c1}ezqpdkapeifjeeazezqpdkazdkwqz  %s"
-"${c1} ezqpdksz"${c2}"##"${c1}"wepuizp"${c2}"##"${c1}"wzeiapdk   %s"
-"${c1}  zqpakdpa"${c2}"#"${c1}"azwewep"${c2}"#"${c1}"zqpdkqze    %s"
-"${c1}    apqxalqpewenwazqmzazq      %s"
-"${c1}     mn"${c2}"##"${c1}"=="${c2}"#######"${c1}"=="${c2}"##"${c1}"qp       %s"
-"${c1}      qw"${c2}"##"${c1}"="${c2}"#######"${c1}"="${c2}"##"${c1}"zl        %s"
-"${c1}      z0"${c2}"######"${c1}"="${c2}"######"${c1}"0a        %s"
-"${c1}       qp"${c2}"#####"${c1}"="${c2}"#####"${c1}"mq         %s"
-"${c1}       az"${c2}"####"${c1}"==="${c2}"####"${c1}"mn         %s"
-"${c1}        ap"${c2}"#########"${c1}"qz          %s"
-"${c1}         9qlzskwdewz           %s"
-"${c1}          zqwpakaiw            %s"
-"${c1}            qoqpe              %s"
-"                               %s")
-		;;
-
-
-		"LinuxDeepin")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light green') # Bold Green
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("${c1}  eeeeeeeeeeeeeeeeeeeeeeeeeeee    %s"
-"${c1} eee  eeeeeee          eeeeeeee  %s"
-"${c1}ee   eeeeeeeee      eeeeeeeee ee %s"
-"${c1}e   eeeeeeeee     eeeeeeeee    e %s"
-"${c1}e   eeeeeee    eeeeeeeeee      e %s"
-"${c1}e   eeeeee    eeeee            e %s"
-"${c1}e    eeeee    eee  eee         e %s"
-"${c1}e     eeeee   ee eeeeee        e %s"
-"${c1}e      eeeee   eee   eee       e %s"
-"${c1}e       eeeeeeeeee  eeee       e %s"
-"${c1}e         eeeee    eeee        e %s"
-"${c1}e               eeeeee         e %s"
-"${c1}e            eeeeeee           e %s"
-"${c1}e eee     eeeeeeee             e %s"
-"${c1}eeeeeeeeeeeeeeee               e %s"
-"${c1}eeeeeeeeeeeee                 ee %s"
-"${c1} eeeeeeeeeee                eee  %s"
-"${c1}  eeeeeeeeeeeeeeeeeeeeeeeeeeee   %s"
-"                                 %s")
-		;;
-
-
-		"Chakra")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light blue') # Light Blue
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("${c1}      _ _ _        \"kkkkkkkk.          %s"
-"${c1}    ,kkkkkkkk.,    \'kkkkkkkkk,        %s"
-"${c1}    ,kkkkkkkkkkkk., \'kkkkkkkkk.       %s"
-"${c1}   ,kkkkkkkkkkkkkkkk,\'kkkkkkkk,       %s"
-"${c1}  ,kkkkkkkkkkkkkkkkkkk\'kkkkkkk.       %s"
-"${c1}   \"\'\'\"\'\'\',;::,,\"\'\'kkk\'\'kkkkk;   __   %s"
-"${c1}       ,kkkkkkkkkk, \"k\'\'kkkkk\' ,kkkk  %s"
-"${c1}     ,kkkkkkk\' ., \' .: \'kkkk\',kkkkkk  %s"
-"${c1}   ,kkkkkkkk\'.k\'   ,  ,kkkk;kkkkkkkkk %s"
-"${c1}  ,kkkkkkkk\';kk \'k  \"\'k\',kkkkkkkkkkkk %s"
-"${c1} .kkkkkkkkk.kkkk.\'kkkkkkkkkkkkkkkkkk\' %s"
-"${c1} ;kkkkkkkk\'\'kkkkkk;\'kkkkkkkkkkkkk\'\'   %s"
-"${c1} \'kkkkkkk; \'kkkkkkkk.,\"\"\'\'\"\'\'\"\"       %s"
-"${c1}   \'\'kkkk;  \'kkkkkkkkkk.,             %s"
-"${c1}      \';\'    \'kkkkkkkkkkkk.,          %s"
-"${c1}              ';kkkkkkkkkk\'           %s"
-"${c1}                ';kkkkkk\'             %s"
-"${c1}                   \"\'\'\"               %s")
-		;;
-
-
-		"Fuduntu")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'dark grey') # Dark Gray
-				c2=$(getColor 'yellow') # Bold Yellow
-				c3=$(getColor 'light red') # Light Red
-				c4=$(getColor 'white') # White
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-			startline="1"
-			fulloutput=("${c1}       \`dwoapfjsod\`"${c2}"           \`dwoapfjsod\`"
-"${c1}    \`xdwdsfasdfjaapz\`"${c2}"       \`dwdsfasdfjaapzx\`     %s"
-"${c1}  \`wadladfladlafsozmm\`"${c2}"     \`wadladfladlafsozmm\`  %s"
-"${c1} \`aodowpwafjwodisosoaas\`"${c2}" \`odowpwafjwodisosoaaso\` %s"
-"${c1} \`adowofaowiefawodpmmxs\`"${c2}" \`dowofaowiefawodpmmxso\` %s"
-"${c1} \`asdjafoweiafdoafojffw\`"${c2}" \`sdjafoweiafdoafojffwq\` %s"
-"${c1}  \`dasdfjalsdfjasdlfjdd\`"${c2}" \`asdfjalsdfjasdlfjdda\`  %s"
-"${c1}   \`dddwdsfasdfjaapzxaw\`"${c2}" \`ddwdsfasdfjaapzxawo\`   %s"
-"${c1}     \`dddwoapfjsowzocmw\`"${c2}" \`ddwoapfjsowzocmwp\`     %s"
-"${c1}       \`ddasowjfowiejao\`"${c2}" \`dasowjfowiejaow\`       %s"
-"                                                 %s"
-"${c3}       \`ddasowjfowiejao\`"${c4}" \`dasowjfowiejaow\`       %s"
-"${c3}     \`dddwoapfjsowzocmw\`"${c4}" \`ddwoapfjsowzocmwp\`     %s"
-"${c3}   \`dddwdsfasdfjaapzxaw\`"${c4}" \`ddwdsfasdfjaapzxawo\`   %s"
-"${c3}  \`dasdfjalsdfjasdlfjdd\`"${c4}" \`asdfjalsdfjasdlfjdda\`  %s"
-"${c3} \`asdjafoweiafdoafojffw\`"${c4}" \`sdjafoweiafdoafojffwq\` %s"
-"${c3} \`adowofaowiefawodpmmxs\`"${c4}" \`dowofaowiefawodpmmxso\` %s"
-"${c3} \`aodowpwafjwodisosoaas\`"${c4}" \`odowpwafjwodisosoaaso\` %s"
-"${c3}   \`wadladfladlafsozmm\`"${c4}"     \`wadladfladlafsozmm\` %s"
-"${c3}     \`dwdsfasdfjaapzx\`"${c4}"       \`dwdsfasdfjaapzx\`"
-"${c3}        \`woapfjsod\`"${c4}"             \`woapfjsod\`")
-		;;
-
-		"Mac OS X")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'green') # Green
-				c2=$(getColor 'brown') # Yellow
-				c3=$(getColor 'light red') # Orange
-				c4=$(getColor 'red') # Red
-				c5=$(getColor 'purple') # Purple
-				c6=$(getColor 'blue') # Blue
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; c4="${my_lcolor}"; c5="${my_lcolor}"; c6="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("\n${c1}                 -/+:.          %s"
-"${c1}                :++++.         %s"
-"${c1}               /+++/.          %s"
-"${c1}       .:-::- .+/:-\`\`.::-      %s"
-"${c1}    .:/++++++/::::/++++++/:\`   %s"
-"${c2}  .:///////////////////////:\`  %s"
-"${c2}  ////////////////////////\`    %s"
-"${c3} -+++++++++++++++++++++++\`     %s"
-"${c3} /++++++++++++++++++++++/      %s"
-"${c4} /sssssssssssssssssssssss.     %s"
-"${c4} :ssssssssssssssssssssssss-    %s"
-"${c5}  osssssssssssssssssssssssso/\` %s"
-"${c5}  \`syyyyyyyyyyyyyyyyyyyyyyyy+\` %s"
-"${c6}   \`ossssssssssssssssssssss/   %s"
-"${c6}     :ooooooooooooooooooo+.    %s"
-"${c6}      \`:+oo+/:-..-:/+o+/-      %s\n")
-		;;
-
-		"Windows"|"Cygwin")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light red') # Red
-				c2=$(getColor 'light green') # Green
-				c3=$(getColor 'light blue') # Blue
-				c4=$(getColor 'yellow') # Yellow
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; c4="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("${c1}        ,.=:!!t3Z3z.,                 %s"
-"${c1}       :tt:::tt333EE3                %s"
-"${c1}       Et:::ztt33EEEL${c2} @Ee.,      .., %s"
-"${c1}      ;tt:::tt333EE7${c2} ;EEEEEEttttt33# %s"
-"${c1}     :Et:::zt333EEQ.${c2} \$EEEEEttttt33QL %s"
-"${c1}     it::::tt333EEF${c2} @EEEEEEttttt33F  %s"
-"${c1}    ;3=*^\`\`\`\"*4EEV${c2} :EEEEEEttttt33@.  %s"
-"${c3}    ,.=::::!t=., ${c1}\`${c2} @EEEEEEtttz33QF   %s"
-"${c3}   ;::::::::zt33)${c2}   \"4EEEtttji3P*    %s"
-"${c3}  :t::::::::tt33.${c4}:Z3z..${c2}  \`\`${c4} ,..g.    %s"
-"${c3}  i::::::::zt33F${c4} AEEEtttt::::ztF     %s"
-"${c3} ;:::::::::t33V${c4} ;EEEttttt::::t3      %s"
-"${c3} E::::::::zt33L${c4} @EEEtttt::::z3F      %s"
-"${c3}{3=*^\`\`\`\"*4E3)${c4} ;EEEtttt:::::tZ\`      %s"
-"${c3}             \`${c4} :EEEEtttt::::z7       %s"
-"${c4}                 \"VEzjt:;;z>*\`       %s")
-		;;
-
-		"Trisquel")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light blue') # Light Blue
-				c2=$(getColor 'light cyan') # Blue
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=(
-"${c1}                          â–„â–„â–„â–„â–„â–„       %s"
-"${c1}                       ▄█████████▄    %s"
-"${c1}       ▄▄▄▄▄▄         ████▀   ▀████   %s"
-"${c1}    ▄██████████▄     ████▀   ▄▄ ▀███  %s"
-"${c1}  ▄███▀▀   ▀▀████     ███▄   ▄█   ███ %s"
-"${c1} ▄███   ▄▄▄   ████▄    ▀██████   ▄███ %s"
-"${c1} ███   █▀▀██▄  █████▄     ▀▀   ▄████  %s"
-"${c1} ▀███      ███  ███████▄▄  ▄▄██████   %s"
-"${c1}  ▀███▄   ▄███  █████████████${c2}████▀    %s"
-"${c1}   ▀█████████    ███████${c2}███▀▀▀        %s"
-"${c1}     ▀▀███▀▀     ██${c2}████▀▀             %s"
-"${c2}                ██████▀   ▄▄▄▄        %s"
-"${c2}               █████▀   ████████      %s"
-"${c2}               █████   ███▀  ▀███     %s"
-"${c2}                ████▄   ██▄▄▄  ███    %s"
-"${c2}                 █████▄   ▀▀  ▄██     %s"
-"${c2}                   ██████▄▄▄████      %s"
-"${c2}                      ▀▀█████▀▀       %s")
-		;;
-
-		"Manjaro")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light green') # Green
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=(
-"${c1} ██████████████████  ████████     %s"
-"${c1} ██████████████████  ████████    %s"
-"${c1} ██████████████████  ████████    %s"
-"${c1} ██████████████████  ████████    %s"
-"${c1} ████████            ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1}           ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"${c1} ████████  ████████  ████████    %s"
-"                                 %s")
-		;;
-
-
-		"Manjaro-tree")
-			if [[ "$no_color" != "1" ]]; then
-				c1="\e[1;32m" # Green
-				c2="\e[1;33m" # Yellow
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=(
-"${c1}                         ###      %s"
-"${c1}     ###             ####        %s"
-"${c1}        ###       ####           %s"
-"${c1}         ##### #####             %s"
-"${c1}      #################          %s"
-"${c1}    ###     #####    ####        %s"
-"${c1}   ##        ${c2}OOO       ${c1}###       %s"
-"${c1}  #          ${c2}WW         ${c1}##       %s"
-"${c1}            ${c2}WW            ${c1}#      %s"
-"${c2}            WW                   %s"
-"${c2}            WW                   %s"
-"${c2}           WW                    %s"
-"${c2}           WW                    %s"
-"${c2}           WW                    %s"
-"${c2}          WW                     %s"
-"${c2}          WW                     %s"
-"${c2}          WW                     %s"
-"                                 %s")
-		;;
-
-
-
-		"elementary OS"|"elementary os")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=(
-"                                     %s"
-"${c1}         eeeeeeeeeeeeeeeee          %s"
-"${c1}      eeeeeeeeeeeeeeeeeeeeeee       %s"
-"${c1}    eeeee  eeeeeeeeeeee   eeeee     %s"
-"${c1}  eeee   eeeee       eee     eeee   %s"
-"${c1} eeee   eeee          eee     eeee  %s"
-"${c1}eee    eee            eee       eee %s"
-"${c1}eee   eee            eee        eee %s"
-"${c1}ee    eee           eeee       eeee %s"
-"${c1}ee    eee         eeeee      eeeeee %s"
-"${c1}ee    eee       eeeee      eeeee ee %s"
-"${c1}eee   eeee   eeeeee      eeeee  eee %s"
-"${c1}eee    eeeeeeeeee     eeeeee    eee %s"
-"${c1} eeeeeeeeeeeeeeeeeeeeeeee    eeeee  %s"
-"${c1}  eeeeeeee eeeeeeeeeeee      eeee   %s"
-"${c1}    eeeee                 eeeee     %s"
-"${c1}      eeeeeee         eeeeeee       %s"
-"${c1}         eeeeeeeeeeeeeeeee          %s")
-	;;
-
-
-		"Android")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light green') # Bold Green
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-			startline="2"
-	                fulloutput=(
-"${c2}       ╲ â–▂▂▂■╱"
-"${c2}       ▄███████▄ "
-"${c2}      ▄██${c1} ${c2}███${c1} ${c2}██▄        %s"
-"${c2}     ▄███████████▄      %s"
-"${c2}  ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄ █▄   %s"
-"${c2}  ██ █████████████ ██   %s"
-"${c2}  ██ █████████████ ██   %s"
-"${c2}  ██ █████████████ ██   %s"
-"${c2}  ██ █████████████ ██   %s"
-"${c2}     █████████████      %s"
-"${c2}      ███████████       %s"
-"${c2}       ██     ██"
-"${c2}       ██     ██")
-		;;
-
-		"Scientific Linux")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light blue')
-				c2=$(getColor 'light red')
-				c3=$(getColor 'white')
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="1"
-			fulloutput=("${c1}                  =/;;/-"
-"${c1}                 +:    //                    %s"
-"${c1}                /;      /;                  %s"
-"${c1}               -X        H.                 %s"
-"${c1} .//;;;:;;-,   X=        :+   .-;:=;:;#;.   %s"
-"${c1} M-       ,=;;;#:,      ,:#;;:=,       ,@   %s"
-"${c1} :#           :#.=/++++/=.$=           #=   %s"
-"${c1}  ,#;         #/:+/;,,/++:+/         ;+.    %s"
-"${c1}    ,+/.    ,;@+,        ,#H;,    ,/+,      %s"
-"${c1}       ;+;;/= @.  ${c2}.H${c3}#${c2}#X   ${c1}-X :///+;         %s"
-"${c1}       ;+=;;;.@,  ${c3}.X${c2}M${c3}@$.  ${c1}=X.//;=#/.        %s"
-"${c1}    ,;:      :@#=        =\$H:     .+#-      %s"
-"${c1}  ,#=         #;-///==///-//         =#,    %s"
-"${c1} ;+           :#-;;;:;;;;-X-           +:   %s"
-"${c1} @-      .-;;;;M-        =M/;;;-.      -X   %s"
-"${c1}  :;;::;;-.    #-        :+    ,-;;-;:==    %s"
-"${c1}               ,X        H.                 %s"
-"${c1}                ;/      #=                  %s"
-"${c1}                 //    +;                   %s"
-"${c1}                  '////'")
-		;;
-
-		"BackTrack Linux")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'light red') # Light Red
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="1"
-			fulloutput=("${c1}.............."
-"${c1}            ..,;:ccc,.                           %s"
-"${c1}          ......''';lxO.                        %s"
-"${c1}.....''''..........,:ld;                        %s"
-"${c1}           .';;;:::;,,.x,                       %s"
-"${c1}      ..'''.            0Xxoc:,.  ...           %s"
-"${c1}  ....                ,ONkc;,;cokOdc',.         %s"
-"${c1} .                   OMo           ':"${c2}"dd"${c1}"o.       %s"
-"${c1}                    dMc               :OO;      %s"
-"${c1}                    0M.                 .:o.    %s"
-"${c1}                    ;Wd                         %s"
-"${c1}                     ;XO,                       %s"
-"${c1}                       ,d0Odlc;,..              %s"
-"${c1}                           ..',;:cdOOd::,.      %s"
-"${c1}                                    .:d;.':;.   %s"
-"${c1}                                       'd,  .'  %s"
-"${c1}                                         ;l   ..%s"
-"${c1}                                          .o    %s"
-"${c1}                                            c   %s"
-"${c1}                                            .'"
-"${c1}                                             .")
-		;;
-		
-		"Kali Linux")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light blue') # White
-				c2=$(getColor 'black') # Light Red
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; fi
-			startline="1"
-			fulloutput=("${c1}.............."
-"${c1}            ..,;:ccc,.                           %s"
-"${c1}          ......''';lxO.                        %s"
-"${c1}.....''''..........,:ld;                        %s"
-"${c1}           .';;;:::;,,.x,                       %s"
-"${c1}      ..'''.            0Xxoc:,.  ...           %s"
-"${c1}  ....                ,ONkc;,;cokOdc',.         %s"
-"${c1} .                   OMo           ':"${c2}"dd"${c1}"o.       %s"
-"${c1}                    dMc               :OO;      %s"
-"${c1}                    0M.                 .:o.    %s"
-"${c1}                    ;Wd                         %s"
-"${c1}                     ;XO,                       %s"
-"${c1}                       ,d0Odlc;,..              %s"
-"${c1}                           ..',;:cdOOd::,.      %s"
-"${c1}                                    .:d;.':;.   %s"
-"${c1}                                       'd,  .'  %s"
-"${c1}                                         ;l   ..%s"
-"${c1}                                          .o    %s"
-"${c1}                                            c   %s"
-"${c1}                                            .'"
-"${c1}                                             .")
-		;;
-
-                "Sabayon")
-                        if [[ "$no_color" != "1" ]]; then
-                                c1=$(getColor 'white') # White
-				c2=$(getColor 'light blue') # Blue
-                        fi
-                        if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-                        startline="0"
-                        fulloutput=("${c2}            ...........                %s"
-"${c2}         ..             ..            %s"
-"${c2}      ..                   ..         %s"
-"${c2}    ..           ${c1}o           ${c2}..       %s"
-"${c2}  ..            ${c1}:W'            ${c2}..     %s"
-"${c2} ..             ${c1}.d.             ${c2}..    %s"
-"${c2}:.             ${c1}.KNO              ${c2}.:   %s"
-"${c2}:.             ${c1}cNNN.             ${c2}.:   %s"
-"${c2}:              ${c1}dXXX,              ${c2}:   %s"
-"${c2}:   ${c1}.          dXXX,       .cd,   ${c2}:   %s"
-"${c2}:   ${c1}'kc ..     dKKK.    ,ll;:'    ${c2}:   %s"
-"${c2}:     ${c1}.xkkxc;..dkkkc',cxkkl       ${c2}:   %s"
-"${c2}:.     ${c1}.,cdddddddddddddo:.       ${c2}.:   %s"
-"${c2} ..         ${c1}:lllllll:           ${c2}..    %s"
-"${c2}   ..         ${c1}',,,,,          ${c2}..      %s"
-"${c2}     ..                     ..        %s"
-"${c2}        ..               ..           %s"
-"${c2}          ...............             %s")
-                ;;
-
-                "CentOS")
-                        if [[ "$no_color" != "1" ]]; then
-                                c1=$(getColor 'yellow') # White
-                                c2=$(getColor 'light green') # White
-                                c3=$(getColor 'light blue') # White
-                                c4=$(getColor 'light purple') # White
-                                c5=$(getColor 'white') # White
-                        fi
-                        if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-                        startline="0"
-                        fulloutput=("${c1}                   ..                    %s"
-"${c1}                 .PLTJ.                 %s"
-"${c1}                <><><><>                %s"
-"       ${c2}KKSSV' 4KKK ${c1}LJ${c4} KKKL.'VSSKK       %s"
-"       ${c2}KKV' 4KKKKK ${c1}LJ${c4} KKKKAL 'VKK       %s"
-"       ${c2}V' ' 'VKKKK ${c1}LJ${c4} KKKKV' ' 'V       %s"
-"       ${c2}.4MA.' 'VKK ${c1}LJ${c4} KKV' '.4Mb.       %s"
-"${c4}     . ${c2}KKKKKA.' 'V ${c1}LJ${c4} V' '.4KKKKK ${c3}.     %s"
-"${c4}   .4D ${c2}KKKKKKKA.'' ${c1}LJ${c4} ''.4KKKKKKK ${c3}FA.   %s"
-"${c4}    %s"
-"${c4}   'VD ${c3}KKKKKKKK'.. ${c2}LJ ${c1}..'KKKKKKKK ${c3}FV    %s"
-"${c4}     ' ${c3}VKKKKK'. .4 ${c2}LJ ${c1}K. .'KKKKKV ${c3}'     %s"
-"       ${c3} 'VK'. .4KK ${c2}LJ ${c1}KKA. .'KV'        %s"
-"       ${c3}A. . .4KKKK ${c2}LJ ${c1}KKKKA. . .4       %s"
-"       ${c3}KKA. 'KKKKK ${c2}LJ ${c1}KKKKK' .4KK       %s"
-"       ${c3}KKSSA. VKKK ${c2}LJ ${c1}KKKV .4SSKK       %s"
-"${c2}                <><><><>                 %s"
-"${c2}                 'MKKM'                  %s"
-"${c2}                   ''")
-		;;
-
-
-		"Jiyuu Linux")
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'light blue') # Light Blue
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("${c1}+++++++++++++++++++++++.        %s"
-"${c1}ss:-......-+so/:----.os-       %s"
-"${c1}ss        +s/        os-       %s"
-"${c1}ss       :s+         os-       %s"
-"${c1}ss       os.         os-       %s"
-"${c1}ss      .so          os-       %s"
-"${c1}ss      :s+          os-       %s"
-"${c1}ss      /s/          os-       %s"
-"${c1}ss      /s:          os-       %s"
-"${c1}ss      +s-          os-       %s"
-"${c1}ss-.....os:..........os-       %s"
-"${c1}++++++++os+++++++++oooo.       %s"
-"${c1}        os.     ./oo/.         %s"
-"${c1}        os.   ./oo:            %s"
-"${c1}        os. ./oo:              %s"
-"${c1}        os oo+-                %s"
-"${c1}        os+-                   %s"
-"${c1}        /.                     %s")
-		;;
-
-
-		*)
-			if [[ "$no_color" != "1" ]]; then
-				c1=$(getColor 'white') # White
-				c2=$(getColor 'dark grey') # Light Gray
-				c3=$(getColor 'yellow') # Light Yellow
-			fi
-			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
-			startline="0"
-			fulloutput=("                             %s"
-"                            %s"
-"                            %s"
-"$c2         #####$c0              %s"
-"$c2        #######             %s"
-"$c2        ##"$c1"O$c2#"$c1"O$c2##             %s"
-"$c2        #$c3#####$c2#             %s"
-"$c2      ##$c1##$c3###$c1##$c2##           %s"
-"$c2     #$c1##########$c2##          %s"
-"$c2    #$c1############$c2##         %s"
-"$c2    #$c1############$c2###        %s"
-"$c3   ##$c2#$c1###########$c2##$c3#        %s"
-"$c3 ######$c2#$c1#######$c2#$c3######      %s"
-"$c3 #######$c2#$c1#####$c2#$c3#######      %s"
-"$c3   #####$c2#######$c3#####        %s"
-"                            %s"
-"                            %s"
-"                            %s")
-  		;;
-	esac
-
-
-	# Truncate lines based on terminal width.
-	if [ "$truncateSet" == "Yes" ]; then
-		for ((i=0; i<${#fulloutput[@]}; i++)); do
-			my_out=$(printf "${fulloutput[i]}$c0\n" "${out_array}")
-			my_out_full=$(echo "$my_out" | cat -v)
-			termWidth=$(tput cols)
-			SHOPT_EXTGLOB_STATE=$(shopt -p extglob)
-			read SHOPT_CMD SHOPT_STATE SHOPT_OPT <<< ${SHOPT_EXTGLOB_STATE}
-			if [[ ${SHOPT_STATE} == "-u" ]]; then
-				shopt -s extglob
-			fi
-
-			stringReal="${my_out_full//\^\[\[@([0-9]|[0-9];[0-9][0-9])m}"
-
-			if [[ ${SHOPT_STATE} == "-u" ]]; then
-				shopt -u extglob
-			fi
-
-			if [[ "${#stringReal}" -le "${termWidth}" ]]; then
-				echo -e "${my_out}"$c0
-			elif [[ "${#stringReal}" -gt "${termWidth}" ]]; then
-				((NORMAL_CHAR_COUNT=0))
-				for ((j=0; j<=${#my_out_full}; j++)); do
-					if [[ "${my_out_full:${j}:3}" == '^[[' ]]; then
-						if [[ "${my_out_full:${j}:5}" =~ ^\^\[\[[[:digit:]]m$ ]]; then
-							if [[ ${j} -eq 0 ]]; then
-								j=$((${j} + 5))
-							else
-								j=$((${j} + 4))
-							fi
-						elif [[ "${my_out_full:${j}:8}" =~ ^\^\[\[[[:digit:]]\;[[:digit:]][[:digit:]]m ]]; then
-							if [[ ${j} -eq 0 ]]; then
-								j=$((${j} + 8))
-							else
-								j=$((${j} + 7))
-							fi
-						fi
-					else
-						((NORMAL_CHAR_COUNT++))
-						if [[ ${NORMAL_CHAR_COUNT} -ge ${termWidth} ]]; then
-							echo -e "${my_out:0:$((${j} - 5))}"$c0
-							break 1
-						fi
-					fi
-				done
-			fi
-
-			if [[ "$i" -ge "$startline" ]]; then
-				unset out_array[0]
-				out_array=( "${out_array[@]}" )
-			fi
-		done
-	else
-		#n=${#fulloutput[*]}
-		for ((i=0; i<${#fulloutput[*]}; i++)); do
-			# echo "${out_array[@]}"
-			printf "${fulloutput[i]}$c0\n" "${out_array}"
-			if [[ "$i" -ge "$startline" ]]; then
-				unset out_array[0]
-				out_array=( "${out_array[@]}" )
-			fi
-		done
-	fi
-	# Done with ASCII output
-}
-
-infoDisplay () {
-	textcolor="\033[0m"
-	[[ "$my_hcolor" ]] && textcolor="${my_hcolor}"
-	#TODO: Centralize colors and use them across the board so we only change them one place.
-	myascii="${distro}"
-	[[ "${asc_distro}" ]] && myascii="${asc_distro}"
-	case ${myascii} in
-		"Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake"|"Chakra"|"Sabayon"|"Slackware"|"Mac OS X"|"Trisquel"|"Kali Linux"|"Jiyuu Linux") labelcolor=$(getColor 'light blue');;
-		"Arch Linux"|"Frugalware"|"Mageia") labelcolor=$(getColor 'light cyan');;
-		"Mint"|"LMDE"|"openSUSE"|"LinuxDeepin"|"DragonflyBSD"|"Manjaro"|"Manjaro-tree"|"Android") labelcolor=$(getColor 'light green');;
-		"Ubuntu"|"FreeBSD"|"Debian"|"BSD"|"Red Hat Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');;
-		"CrunchBang"|"SolusOS"|"Viperr"|"elementary"*) labelcolor=$(getColor 'dark grey');;
-		"Gentoo"|"ParabolaGNU/Linux-libre"|"Funtoo"|"Funtoo-text") labelcolor=$(getColor 'light purple');;
-		"CentOS"|*) labelcolor=$(getColor 'yellow');;
-	esac
-	[[ "$my_lcolor" ]] && labelcolor="${my_lcolor}"
-	if [[ "$no_color" == "1" ]]; then labelcolor=""; bold=""; c0=""; textcolor=""; fi
-	# Some verbosity stuff
-	[[ "$verbosity" == "1" ]] && [[ "$screenshot" == "1" ]] && verboseOut "Screenshot will be taken after info is displayed."
-	[[ "$verbosity" == "1" ]] && [[ "$hostshot" == "1" ]] && verboseOut "Screenshot will be transferred/uploaded to specified location."
-	#########################
-	# Info Variable Setting #
-	#########################
-	if [[ "${distro}" == "Android" ]]; then
-		myhostname=$(echo -e "${labelcolor}${hostname}"); out_array=( "${out_array[@]}" "$myhostname" )
-		mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $distro_ver"); out_array=( "${out_array[@]}" "$mydistro" )
-		mydevice=$(echo -e "$labelcolor Device:$textcolor $device"); out_array=( "${out_array[@]}" "$mydevice" )
-		myrom=$(echo -e "$labelcolor ROM:$textcolor $rom"); out_array=( "${out_array[@]}" "$myrom" )
-		mybaseband=$(echo -e "$labelcolor Baseband:$textcolor $baseband"); out_array=( "${out_array[@]}" "$mybaseband" )
-		mykernel=$(echo -e "$labelcolor Kernel:$textcolor $kernel"); out_array=( "${out_array[@]}" "$mykernel" )
-		myuptime=$(echo -e "$labelcolor Uptime:$textcolor $uptime"); out_array=( "${out_array[@]}" "$myuptime" )
-		mycpu=$(echo -e "$labelcolor CPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mycpu" )
-		mygpu=$(echo -e "$labelcolor GPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mygpu" )
-		mymem=$(echo -e "$labelcolor RAM:$textcolor $mem"); out_array=( "${out_array[@]}" "$mymem" )
-	else
-		if [[ "${display[@]}" =~ "host" ]]; then myinfo=$(echo -e "${labelcolor}${myUser}$textcolor${bold}@${c0}${labelcolor}${myHost}"); out_array=( "${out_array[@]}" "$myinfo" ); ((display_index++)); fi
-		if [[ "${display[@]}" =~ "distro" ]]; then
-			if [ "$distro" == "Mac OS X" ]; then
-				sysArch=`str1=$(ioreg -l -p IODeviceTree | grep firmware-abi);echo ${str1: -4: 2}bit`
-				prodVers=`prodVers=$(sw_vers|grep ProductVersion);echo ${prodVers:15}`
-				buildVers=`buildVers=$(sw_vers|grep BuildVersion);echo ${buildVers:14}`
-				if [ -n "$distro_more" ]; then mydistro=$(echo -e "$labelcolor OS:$textcolor $distro_more $sysArch")
-				else mydistro=$(echo -e "$labelcolor OS:$textcolor $sysArch $distro $prodVers $buildVers"); fi
-			elif [[ "$distro" == "Cygwin" ]]; then
-				distro=$(wmic os get name | head -2 | tail -1)
-				distro=$(expr match "$distro" '\(Microsoft Windows [A-Za-z0-9]\+\)')
-				sysArch=$(wmic os get OSArchitecture | head -2 | tail -1 | tr -d '\r ')
-				mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $sysArch")
-			else
-				if [ -n "$distro_more" ]; then mydistro=$(echo -e "$labelcolor OS:$textcolor $distro_more")
-				else mydistro=$(echo -e "$labelcolor OS:$textcolor $distro $sysArch"); fi
-			fi
-			out_array=( "${out_array[@]}" "$mydistro" )
-			((display_index++))
-		fi
-		if [[ "${display[@]}" =~ "kernel" ]]; then mykernel=$(echo -e "$labelcolor Kernel:$textcolor $kernel"); out_array=( "${out_array[@]}" "$mykernel" ); ((display_index++)); fi
-		if [[ "${display[@]}" =~ "uptime" ]]; then myuptime=$(echo -e "$labelcolor Uptime:$textcolor $uptime"); out_array=( "${out_array[@]}" "$myuptime" ); ((display_index++)); fi
-		if [[ "${display[@]}" =~ "pkgs" ]]; then mypkgs=$(echo -e "$labelcolor Packages:$textcolor $pkgs"); out_array=( "${out_array[@]}" "$mypkgs" ); ((display_index++)); fi
-		if [[ "${display[@]}" =~ "shell" ]]; then myshell=$(echo -e "$labelcolor Shell:$textcolor $myShell"); out_array=( "${out_array[@]}" "$myshell" ); ((display_index++)); fi
-		if [[ -n "$DISPLAY" ]]; then
-			if [[ "${display[@]}" =~ "res" ]]; then myres=$(echo -e "$labelcolor Resolution:${textcolor} $xResolution"); out_array=( "${out_array[@]}" "$myres" ); ((display_index++)); fi
-			if [[ "${display[@]}" =~ "de" ]]; then
-				if [[ "${DE}" != "Not Present" ]]; then
-					myde=$(echo -e "$labelcolor DE:$textcolor $DE"); out_array=( "${out_array[@]}" "$myde" ); ((display_index++))
-				fi
-			fi
-			if [[ "${display[@]}" =~ "wm" ]]; then mywm=$(echo -e "$labelcolor WM:$textcolor $WM"); out_array=( "${out_array[@]}" "$mywm" ); ((display_index++)); fi
-			if [[ "${display[@]}" =~ "wmtheme" ]]; then
-					if [[ "${Win_theme}" == "Not Present" ]]; then
-						:
-					else
-						mywmtheme=$(echo -e "$labelcolor WM Theme:$textcolor $Win_theme"); out_array=( "${out_array[@]}" "$mywmtheme" ); ((display_index++)); fi
-					fi
-			if [[ "${display[@]}" =~ "gtk" ]]; then
-				if [ "$distro" == "Mac OS X" ]; then
-					if [ "$gtkIcons" != "Not Found" ]; then
-						if [ -n "$gtkIcons" ]; then 
-							myicons=$(echo -e "$labelcolor Icon Theme:$textcolor $gtkIcons"); out_array=( "${out_array[@]}" "$myicons" ); ((display_index++))
-						fi
-					fi
-					if [ "$gtkFont" != "Not Found" ]; then
-						if [ -n "$gtkFont" ]; then 
-							myfont=$(echo -e "$labelcolor Font:$textcolor $gtkFont"); out_array=( "${out_array[@]}" "$myfont" ); ((display_index++))
-						fi
-					fi
-				else
-					if [ "$gtk2Theme" != "Not Found" ]; then
-						if [ -n "$gtk2Theme" ]; then 
-							mygtk2="${gtk2Theme} [GTK2]"
-						fi
-					fi
-					if [ "$gtk3Theme" != "Not Found" ]; then
-						if [ -n "$mygtk2" ]; then 
-							mygtk3=", ${gtk3Theme} [GTK3]"
-						else
-							mygtk3="${gtk3Theme} [GTK3]"
-						fi
-					fi
-					mygtk=$(echo -e "$labelcolor GTK Theme:$textcolor ${mygtk2}${mygtk3}"); out_array=( "${out_array[@]}" "$mygtk" ); ((display_index++))
-					if [ "$gtkIcons" != "Not Found" ]; then
-						if [ -n "$gtkIcons" ]; then 
-							myicons=$(echo -e "$labelcolor Icon Theme:$textcolor $gtkIcons"); out_array=( "${out_array[@]}" "$myicons" ); ((display_index++))
-						fi
-					fi
-					if [ "$gtkFont" != "Not Found" ]; then
-						if [ -n "$gtkFont" ]; then 
-							myfont=$(echo -e "$labelcolor Font:$textcolor $gtkFont"); out_array=( "${out_array[@]}" "$myfont" ); ((display_index++))
-						fi
-					fi
-					# [ "$gtkBackground" ] && mybg=$(echo -e "$labelcolor BG:$textcolor $gtkBackground"); out_array=( "${out_array[@]}" "$mybg" ); ((display_index++))
-				fi
-			fi
-		elif [[ "$fake_distro" == "Cygwin" ]]; then
-			if [[ "${display[@]}" =~ "res" ]]; then myres=$(echo -e "$labelcolor Resolution:${textcolor} $xResolution"); out_array=( "${out_array[@]}" "$myres" ); ((display_index++)); fi
-			if [[ "${display[@]}" =~ "de" ]]; then
-				if [[ "${DE}" != "Not Present" ]]; then
-					myde=$(echo -e "$labelcolor DE:$textcolor $DE"); out_array=( "${out_array[@]}" "$myde" ); ((display_index++))
-				fi
-			fi
-			if [[ "${display[@]}" =~ "wm" ]]; then mywm=$(echo -e "$labelcolor WM:$textcolor $WM"); out_array=( "${out_array[@]}" "$mywm" ); ((display_index++)); fi
-			if [[ "${display[@]}" =~ "wmtheme" ]]; then
-				if [[ "${Win_theme}" == "Not Present" ]]; then
-					:
-				else
-					mywmtheme=$(echo -e "$labelcolor WM Theme:$textcolor $Win_theme"); out_array=( "${out_array[@]}" "$mywmtheme" ); ((display_index++))
-				fi
-			fi
-		fi
-		[[ "${fake_distro}" != "Cygwin" ]] && if [[ "${display[@]}" =~ "disk" ]]; then mydisk=$(echo -e "$labelcolor Disk:$textcolor $diskusage"); out_array=( "${out_array[@]}" "$mydisk" ); ((display_index++)); fi
-		if [[ "${display[@]}" =~ "cpu" ]]; then mycpu=$(echo -e "$labelcolor CPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mycpu" ); ((display_index++)); fi
-		if [[ "${display[@]}" =~ "gpu" ]] && [[ "$gpu" != "Not Found" ]]; then mygpu=$(echo -e "$labelcolor GPU:$textcolor $gpu"); out_array=( "${out_array[@]}" "$mygpu" ); ((display_index++)); fi
-		if [[ "${display[@]}" =~ "mem" ]]; then mymem=$(echo -e "$labelcolor RAM:$textcolor $mem"); out_array=( "${out_array[@]}" "$mymem" ); ((display_index++)); fi
-	fi
-	if [[ "$display_type" == "ASCII" ]]; then
-		asciiText
-	else
-		if [[ "${display[@]}" =~ "host" ]]; then echo -e " $myinfo"; fi
-		if [[ "${display[@]}" =~ "distro" ]]; then echo -e "$mydistro"; fi
-		if [[ "${display[@]}" =~ "kernel" ]]; then echo -e "$mykernel"; fi
-		if [[ "${distro}" == "Android" ]]; then
-			echo -e "$mydevice"
-			echo -e "$myrom"
-			echo -e "$mybaseband"
-			echo -e "$mykernel"
-			echo -e "$myuptime"
-			echo -e "$mycpu"
-			echo -e "$mymem"
-		else
-			if [[ "${display[@]}" =~ "uptime" ]]; then echo -e "$myuptime"; fi
-			if [[ "${display[@]}" =~ "pkgs" ]]; then echo -e "$mypkgs"; fi
-			if [[ "${display[@]}" =~ "shell" ]]; then echo -e "$myshell"; fi
-			if [[ "${display[@]}" =~ "res" ]]; then echo -e "$myres"; fi
-			if [[ "${display[@]}" =~ "de" ]]; then
-				if [[ "${DE}" != "Not Present" ]]; then echo -e "$myde"; fi
-			fi
-			if [[ "${display[@]}" =~ "wm" ]]; then
-				echo -e "$mywm"
-				if [[ "${Win_theme}" != "Not Present" ]]; then
-					echo -e "$mywmtheme"
-				fi
-			fi
-			if [[ "${display[@]}" =~ "gtk" ]]; then
-				echo -e "$mygtk2"
-				echo -e "$mygtk3"
-				echo -e "$myicons"
-				echo -e "$myfont"
-			fi
-			if [[ "${display[@]}" =~ "disk" ]]; then echo -e "$mydisk"; fi
-			if [[ "${display[@]}" =~ "cpu" ]]; then echo -e "$mycpu"; fi
-			if [[ "${display[@]}" =~ "gpu" ]]; then echo -e "$mygpu"; fi
-			if [[ "${display[@]}" =~ "mem" ]]; then echo -e "$mymem"; fi
-		fi
-	fi
-}
-
-##################
-# Let's Do This!
-##################
-
-if [[ -f "$HOME/.screenfetchOR" ]]; then
-    source $HOME/.screenfetchOR
-fi
-
-
-if [[ "$overrideDisplay" ]]; then
-	[[ "$verbosity" -eq "1" ]] && verboseOut "Found 'd' flag in syntax. Overriding some display options..."
-	overrideDisplay=${overrideDisplay//,/ }
-	display=( $overrideDisplay )
-fi
-
-# Check for android
-if type -p getprop >/dev/null 2>&1; then
-	distro="Android"
-	detectmem
-	detectuptime
-	detectkernel
-	detectdroid
-	infoDisplay
-	exit 0
-fi
-
-for i in "${display[@]}"; do
-	if [[ $i =~ wm ]]; then
-		 ! [[ $WM  ]] && detectwm;
-		 ! [[ $Win_theme ]] && detectwmtheme;
-	else
-		if [[ "${display[*]}" =~ "$i" ]]; then 
-			if [[ "$errorSuppress" == "1" ]]; then detect${i} 2>/dev/null
-			else detect${i}; fi
-		fi
-	fi
-done
-
-infoDisplay
-[ "$screenshot" == "1" ] && takeShot
-[ "$exportTheme" == "1" ] && themeExport
-
-exit 0
diff --git a/updatekernel.sh b/updatekernel.sh
deleted file mode 100755
index ac2b579..0000000
--- a/updatekernel.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-### run: sh updatekernel.sh
-
-#download amd64|i386
-DownInstall() { wget $(lynx -dump -listonly $link | egrep 'all|'$@ ) ; echo dpkg -i *.deb ; }
-
-link=$(lynx --dump http://kernel.ubuntu.com/~kernel-ppa/mainline/ | awk '/http/{print $2}'  | grep -v rc | tail -n 1)
-KVERSION=$(echo $link | cut -d "/" -f 6)
-
-LastKernelInstalled=$(ls /boot/ | grep img | cut -d "-" -f2 | tail -n 1)
-LastKernelAvaliable=$(echo $KVERSION | sed -e "s/v//g"  | cut -d "-" -f1 )
-LastKernelRC=$(lynx --dump http://kernel.ubuntu.com/~kernel-ppa/mainline/ | awk '/http/{print $2}'  | grep rc | tail -n 1 | cut -d "/" -f 6)
-
-echo "\n\n\t\t[UBUNTU KERNELS] \
-\n\n\tLast installed :\t $LastKernelInstalled \
-\n\tLast Stable online :\t $LastKernelAvaliable
-\n\tLast RC online :\t $LastKernelRC"
-
-
-if [ $LastKernelInstalled = $LastKernelAvaliable ]  
-   then echo  "\n\n\t already updated to version" $KVERSION  "\n\n" # non serve "echo -e"
-	exit
-   else echo "\n\n\t upgrading to version" $KVERSION  "\n\n"
-fi
-
-
-########################
-
-echo "$(tput setaf 3)---kernel $KVERSION will be installed in an `uname -i` system---$(tput sgr0)"
-sleep 2
-read -p "Press Enter to continue, or abort by pressing CTRL+C" nothing
-echo "/n/n"
-
-DownloadFolder=$HOME/.kernel_update/kernel_$KVERSION
-echo $DownloadFolder
-mkdir -p $DownloadFolder
-cd $DownloadFolder
-
-#System architecture
-arch=`uname -m`
-if  [ $arch = i686 ] || [ $arch = i386 ]; then
-	DownInstall i386
-  elif [ $arch = "x86_64" ]; then
-	DownInstall amd64
-  else
-        echo "Unsupported Architecture"
-fi
-dpkg -i *.deb
-apt-get install -f
-rm -Rf $DownloadFolder
diff --git a/vim/.vimrc b/vim/.vimrc
new file mode 100644
index 0000000..c6da008
--- /dev/null
+++ b/vim/.vimrc
@@ -0,0 +1,15 @@
+set number
+set ruler
+set ignorecase
+set hlsearch		"highlighted gesuchte wörter
+set incsearch
+set magic 
+set showmatch
+set autoindent		"auto einrücken
+set scrolloff=4		"scrollt schon 4 Zeilen vor Ende
+set matchpairs=(:),{:},[:],<:>
+
+syntax enable
+set encoding=utf8
+
+"map! jj 
diff --git a/vim/plugin/autoclose.vim b/vim/plugin/autoclose.vim
new file mode 100644
index 0000000..957399e
--- /dev/null
+++ b/vim/plugin/autoclose.vim
@@ -0,0 +1,189 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" AutoClose.vim - Automatically close pair of characters: ( with ), [ with ], { with }, etc.
+" Version: 1.1
+" Author: Thiago Alves 
+" Maintainer: Thiago Alves 
+" URL: http://thiagoalves.org
+" Licence: This script is released under the Vim License.
+" Last modified: 08/25/2008 
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+let s:debug = 1
+
+" check if script is already loaded
+if s:debug == 0 && exists("g:loaded_AutoClose")
+    finish "stop loading the script"
+endif
+let g:loaded_AutoClose = 1
+
+let s:global_cpo = &cpo " store compatible-mode in local variable
+set cpo&vim             " go into nocompatible-mode
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Functions
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! s:GetNextChar()
+    if col('$') == col('.')
+        return "\0"
+    endif
+    return strpart(getline('.'), col('.')-1, 1)
+endfunction
+
+function! s:GetPrevChar()
+    if col('.') == 1
+        return "\0"
+    endif
+    return strpart(getline('.'), col('.')-2, 1)
+endfunction
+
+function! s:IsEmptyPair()
+    let l:prev = s:GetPrevChar()
+    let l:next = s:GetNextChar()
+    if l:prev == "\0" || l:next == "\0"
+        return 0
+    endif
+    return get(s:charsToClose, l:prev, "\0") == l:next
+endfunction
+
+function! s:GetCurrentSyntaxRegion()
+    return synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+endfunction
+
+function! s:GetCurrentSyntaxRegionIf(char)
+    let l:origin_line = getline('.')
+    let l:changed_line = strpart(l:origin_line, 0, col('.')-1) . a:char . strpart(l:origin_line, col('.')-1)
+    call setline('.', l:changed_line)
+    let l:region = synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
+    call setline('.', l:origin_line)
+    return l:region
+endfunction
+
+function! s:IsForbidden(char)
+    let l:result = index(s:protectedRegions, s:GetCurrentSyntaxRegion()) >= 0
+    if l:result
+        return l:result
+    endif
+    let l:region = s:GetCurrentSyntaxRegionIf(a:char)
+    let l:result = index(s:protectedRegions, l:region) >= 0
+    return l:result && l:region == 'Comment'
+endfunction
+
+function! s:InsertPair(char)
+    let l:next = s:GetNextChar()
+    let l:result = a:char
+    if s:running && !s:IsForbidden(a:char) && (l:next == "\0" || l:next !~ '\w')
+        let l:result .= s:charsToClose[a:char] . "\"
+    endif
+    return l:result
+endfunction
+
+function! s:ClosePair(char)
+    if s:running && s:GetNextChar() == a:char
+        let l:result = "\"
+    else
+        let l:result = a:char
+    endif
+    return l:result
+endfunction
+
+function! s:CheckPair(char)
+    let l:lastpos = 0
+    let l:occur = stridx(getline('.'), a:char, l:lastpos) == 0 ? 1 : 0
+
+    while l:lastpos > -1
+        let l:lastpos = stridx(getline('.'), a:char, l:lastpos+1)
+        if l:lastpos > col('.')-2
+            break
+        endif
+        if l:lastpos >= 0
+            let l:occur += 1
+        endif
+    endwhile
+
+    if l:occur == 0 || l:occur%2 == 0
+        " Opening char
+        return s:InsertPair(a:char)
+    else
+        " Closing char
+        return s:ClosePair(a:char)
+    endif
+endfunction
+
+function! s:Backspace()
+    if s:running && s:IsEmptyPair()
+        return "\\"
+    endif    
+    return "\"
+endfunction
+
+function! s:ToggleAutoClose()
+    let s:running = !s:running
+    if s:running
+        echo "AutoClose ON"
+    else
+        echo "AutoClose OFF"
+    endif
+endfunction
+
+function! s:SetVEAll()
+    let s:save_ve = &ve
+    set ve=all
+    return ""
+endfunction
+
+function! s:RestoreVE()
+    exec "set ve=" . s:save_ve
+    unlet s:save_ve
+    return ""
+endfunction
+
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Configuration
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" let user define which character he/she wants to autocomplete
+if exists("g:AutoClosePairs") && type(g:AutoClosePairs) == type({})
+    let s:charsToClose = g:AutoClosePairs
+    unlet g:AutoClosePairs
+else
+    let s:charsToClose = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'"}
+endif
+
+" let user define in which regions the autocomplete feature should not occur
+if exists("g:AutoCloseProtectedRegions") && type(g:AutoCloseProtectedRegions) == type([])
+    let s:protectedRegions = g:AutoCloseProtectedRegions
+    unlet g:AutoCloseProtectedRegions
+else
+    let s:protectedRegions = ["Comment", "String", "Character"]
+endif
+
+" let user define if he/she wants the plugin turned on when vim start. Defaul is YES
+if exists("g:AutoCloseOn") && type(g:AutoCloseOn) == type(0)
+    let s:running = g:AutoCloseOn
+    unlet g:AutoCloseOn
+else
+    let s:running = 1
+endif
+
+" create appropriate maps to defined open/close characters
+for key in keys(s:charsToClose)
+    if key == '"'
+        let open_func_arg = '"\""'
+        let close_func_arg = '"\""'
+    else
+        let open_func_arg = '"' . key . '"'
+        let close_func_arg = '"' . s:charsToClose[key] . '"'
+    endif 
+     
+    if key == s:charsToClose[key]
+        exec "inoremap  " . key . " =SetVEAll()=CheckPair(" . open_func_arg . ")=RestoreVE()"
+    else
+        exec "inoremap  " . s:charsToClose[key] . " =SetVEAll()=ClosePair(" . close_func_arg . ")=RestoreVE()"
+        exec "inoremap  " . key . " =SetVEAll()=InsertPair(" . open_func_arg . ")=RestoreVE()"
+    endif
+endfor
+exec "inoremap   =SetVEAll()=Backspace()=RestoreVE()"
+
+" Define convenient commands
+command! AutoCloseOn :let s:running = 1
+command! AutoCloseOff :let s:running = 0
+command! AutoCloseToggle :call s:ToggleAutoClose()
diff --git a/zsh/.zsh_aliases b/zsh/.zsh_aliases
new file mode 100644
index 0000000..ba2299b
--- /dev/null
+++ b/zsh/.zsh_aliases
@@ -0,0 +1,17 @@
+alias q=exit
+alias -g H=' | head'
+alias -g T=' | tail'
+alias -g A=' \[ '
+alias -g G=' | grep'
+alias mv='mv -vi'
+alias cp='cp -vi'
+alias 'cd..'='cd ..'
+alias 'cd.'='cd'
+alias rm='rm -vi'
+alias k='l'
+alias ö='l'
+alias ks='ls'
+alias ös='ls'
+alias nano='nano -wc'
+alias du='du -h'
+alias down='sudo shutdown -hP now'
diff --git a/zsh/.zsh_dirstack b/zsh/.zsh_dirstack
new file mode 100644
index 0000000..88e6fe7
--- /dev/null
+++ b/zsh/.zsh_dirstack
@@ -0,0 +1,20 @@
+alias 1='cd $dirstack[1]'
+alias 2='cd $dirstack[2]'
+alias 3='cd $dirstack[3]'
+alias 4='cd $dirstack[4]'
+alias 5='cd $dirstack[5]'
+alias 6='cd $dirstack[6]'
+alias 7='cd $dirstack[7]'
+alias 8='cd $dirstack[8]'
+alias 9='cd $dirstack[9]'
+alias 10='cd $dirstack[10]'
+alias 11='cd $dirstack[11]'
+alias 12='cd $dirstack[12]'
+alias 13='cd $dirstack[13]'
+alias 14='cd $dirstack[14]'
+alias 15='cd $dirstack[15]'
+alias 16='cd $dirstack[16]'
+alias 17='cd $dirstack[17]'
+alias 18='cd $dirstack[18]'
+alias 19='cd $dirstack[19]'
+alias dirhist='. ~/bin/dirhistory.sh'
diff --git a/zsh/.zshrc b/zsh/.zshrc
new file mode 100644
index 0000000..612f5c1
--- /dev/null
+++ b/zsh/.zshrc
@@ -0,0 +1,3327 @@
+# Filename:      /etc/zsh/zshrc
+# Purpose:       config file for zsh (z shell)
+# Authors:       grml-team (grml.org), (c) Michael Prokop 
+# Bug-Reports:   see http://grml.org/bugs/
+# License:       This file is licensed under the GPL v2.
+################################################################################
+# This file is sourced only for interactive shells. It
+# should contain commands to set up aliases, functions,
+# options, key bindings, etc.
+#
+# Global Order: zshenv, zprofile, zshrc, zlogin
+################################################################################
+
+# USAGE
+# If you are using this file as your ~/.zshrc file, please use ~/.zshrc.pre
+# and ~/.zshrc.local for your own customisations. The former file is read
+# before ~/.zshrc, the latter is read after it. Also, consider reading the
+# refcard and the reference manual for this setup, both available from:
+#     
+
+# Contributing:
+# If you want to help to improve grml's zsh setup, clone the grml-etc-core
+# repository from git.grml.org:
+#   git clone git://git.grml.org/grml-etc-core.git
+#
+# Make your changes, commit them; use 'git format-patch' to create a series
+# of patches and send those to the following address via 'git send-email':
+#   grml-etc-core@grml.org
+#
+# Doing so makes sure the right people get your patches for review and
+# possibly inclusion.
+
+# zsh-refcard-tag documentation:
+#   You may notice strange looking comments in this file.
+#   These are there for a purpose. grml's zsh-refcard can now be
+#   automatically generated from the contents of the actual configuration
+#   file. However, we need a little extra information on which comments
+#   and what lines of code to take into account (and for what purpose).
+#
+# Here is what they mean:
+#
+# List of tags (comment types) used:
+#   #a#     Next line contains an important alias, that should
+#           be included in the grml-zsh-refcard.
+#           (placement tag: @@INSERT-aliases@@)
+#   #f#     Next line contains the beginning of an important function.
+#           (placement tag: @@INSERT-functions@@)
+#   #v#     Next line contains an important variable.
+#           (placement tag: @@INSERT-variables@@)
+#   #k#     Next line contains an important keybinding.
+#           (placement tag: @@INSERT-keybindings@@)
+#   #d#     Hashed directories list generation:
+#               start   denotes the start of a list of 'hash -d'
+#                       definitions.
+#               end     denotes its end.
+#           (placement tag: @@INSERT-hasheddirs@@)
+#   #A#     Abbreviation expansion list generation:
+#               start   denotes the beginning of abbreviations.
+#               end     denotes their end.
+#           Lines within this section that end in '#d .*' provide
+#           extra documentation to be included in the refcard.
+#           (placement tag: @@INSERT-abbrev@@)
+#   #m#     This tag allows you to manually generate refcard entries
+#           for code lines that are hard/impossible to parse.
+#               Example:
+#                   #m# k ESC-h Call the run-help function
+#               That would add a refcard entry in the keybindings table
+#               for 'ESC-h' with the given comment.
+#           So the syntax is: #m# 
+# #o# This tag lets you insert entries to the 'other' hash. +# Generally, this should not be used. It is there for +# things that cannot be done easily in another way. +# (placement tag: @@INSERT-other-foobar@@) +# +# All of these tags (except for m and o) take two arguments, the first +# within the tag, the other after the tag: +# +# #
# +# +# Where
is really just a number, which are defined by the +# @secmap array on top of 'genrefcard.pl'. The reason for numbers +# instead of names is, that for the reader, the tag should not differ +# much from a regular comment. For zsh, it is a regular comment indeed. +# The numbers have got the following meanings: +# 0 -> "default" +# 1 -> "system" +# 2 -> "user" +# 3 -> "debian" +# 4 -> "search" +# 5 -> "shortcuts" +# 6 -> "services" +# +# So, the following will add an entry to the 'functions' table in the +# 'system' section, with a (hopefully) descriptive comment: +# #f1# Edit an alias via zle +# edalias() { +# +# It will then show up in the @@INSERT-aliases-system@@ replacement tag +# that can be found in 'grml-zsh-refcard.tex.in'. +# If the section number is omitted, the 'default' section is assumed. +# Furthermore, in 'grml-zsh-refcard.tex.in' @@INSERT-aliases@@ is +# exactly the same as @@INSERT-aliases-default@@. If you want a list of +# *all* aliases, for example, use @@INSERT-aliases-all@@. + +# zsh profiling +# just execute 'ZSH_PROFILE_RC=1 zsh' and run 'zprof' to get the details +if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then + zmodload zsh/zprof +fi + +# load .zshrc.pre to give the user the chance to overwrite the defaults +[[ -r ${ZDOTDIR:-${HOME}}/.zshrc.pre ]] && source ${ZDOTDIR:-${HOME}}/.zshrc.pre + +# check for version/system +# check for versions (compatibility reasons) +is4(){ + [[ $ZSH_VERSION == <4->* ]] && return 0 + return 1 +} + +is41(){ + [[ $ZSH_VERSION == 4.<1->* || $ZSH_VERSION == <5->* ]] && return 0 + return 1 +} + +is42(){ + [[ $ZSH_VERSION == 4.<2->* || $ZSH_VERSION == <5->* ]] && return 0 + return 1 +} + +is425(){ + [[ $ZSH_VERSION == 4.2.<5->* || $ZSH_VERSION == 4.<3->* || $ZSH_VERSION == <5->* ]] && return 0 + return 1 +} + +is43(){ + [[ $ZSH_VERSION == 4.<3->* || $ZSH_VERSION == <5->* ]] && return 0 + return 1 +} + +is433(){ + [[ $ZSH_VERSION == 4.3.<3->* || $ZSH_VERSION == 4.<4->* \ + || $ZSH_VERSION == <5->* ]] && return 0 + return 1 +} + +is437(){ + [[ $ZSH_VERSION == 4.3.<7->* || $ZSH_VERSION == 4.<4->* \ + || $ZSH_VERSION == <5->* ]] && return 0 + return 1 +} + +is439(){ + [[ $ZSH_VERSION == 4.3.<9->* || $ZSH_VERSION == 4.<4->* \ + || $ZSH_VERSION == <5->* ]] && return 0 + return 1 +} + +#f1# Checks whether or not you're running grml +isgrml(){ + [[ -f /etc/grml_version ]] && return 0 + return 1 +} + +#f1# Checks whether or not you're running a grml cd +isgrmlcd(){ + [[ -f /etc/grml_cd ]] && return 0 + return 1 +} + +if isgrml ; then +#f1# Checks whether or not you're running grml-small + isgrmlsmall() { + if [[ ${${${(f)"$( autologin +# Thanks go to Bart Schaefer! +isgrml && checkhome() { + if [[ -z "$ALREADY_DID_CD_HOME" ]] ; then + export ALREADY_DID_CD_HOME=$HOME + cd + fi +} + +# check for zsh v3.1.7+ + +if ! [[ ${ZSH_VERSION} == 3.1.<7->* \ + || ${ZSH_VERSION} == 3.<2->.<->* \ + || ${ZSH_VERSION} == <4->.<->* ]] ; then + + printf '-!-\n' + printf '-!- In this configuration we try to make use of features, that only\n' + printf '-!- require version 3.1.7 of the shell; That way this setup can be\n' + printf '-!- used with a wide range of zsh versions, while using fairly\n' + printf '-!- advanced features in all supported versions.\n' + printf '-!-\n' + printf '-!- However, you are running zsh version %s.\n' "$ZSH_VERSION" + printf '-!-\n' + printf '-!- While this *may* work, it might as well fail.\n' + printf '-!- Please consider updating to at least version 3.1.7 of zsh.\n' + printf '-!-\n' + printf '-!- DO NOT EXPECT THIS TO WORK FLAWLESSLY!\n' + printf '-!- If it does today, you'\''ve been lucky.\n' + printf '-!-\n' + printf '-!- Ye been warned!\n' + printf '-!-\n' + + function zstyle() { : } +fi + +# autoload wrapper - use this one instead of autoload directly +# We need to define this function as early as this, because autoloading +# 'is-at-least()' needs it. +function zrcautoload() { + emulate -L zsh + setopt extended_glob + local fdir ffile + local -i ffound + + ffile=$1 + (( ffound = 0 )) + for fdir in ${fpath} ; do + [[ -e ${fdir}/${ffile} ]] && (( ffound = 1 )) + done + + (( ffound == 0 )) && return 1 + if [[ $ZSH_VERSION == 3.1.<6-> || $ZSH_VERSION == <4->* ]] ; then + autoload -U ${ffile} || return 1 + else + autoload ${ffile} || return 1 + fi + return 0 +} + +# Load is-at-least() for more precise version checks Note that this test will +# *always* fail, if the is-at-least function could not be marked for +# autoloading. +zrcautoload is-at-least || is-at-least() { return 1 } + +# set some important options (as early as possible) + +# append history list to the history file; this is the default but we make sure +# because it's required for share_history. +setopt append_history + +# import new commands from the history file also in other zsh-session +is4 && setopt share_history + +# save each command's beginning timestamp and the duration to the history file +setopt extended_history + +# If a new command line being added to the history list duplicates an older +# one, the older command is removed from the list +is4 && setopt histignorealldups + +# remove command lines from the history list when the first character on the +# line is a space +setopt histignorespace + +# if a command is issued that can't be executed as a normal command, and the +# command is the name of a directory, perform the cd command to that directory. +setopt auto_cd + +# in order to use #, ~ and ^ for filename generation grep word +# *~(*.gz|*.bz|*.bz2|*.zip|*.Z) -> searches for word not in compressed files +# don't forget to quote '^', '~' and '#'! +setopt extended_glob + +# display PID when suspending processes as well +setopt longlistjobs + +# try to avoid the 'zsh: no matches found...' +setopt nonomatch + +# report the status of backgrounds jobs immediately +setopt notify + +# whenever a command completion is attempted, make sure the entire command path +# is hashed first. +setopt hash_list_all + +# not just at the end +setopt completeinword + +# Don't send SIGHUP to background processes when the shell exits. +setopt nohup + +# make cd push the old directory onto the directory stack. +setopt auto_pushd + +# avoid "beep"ing +setopt nobeep + +# don't push the same dir twice. +setopt pushd_ignore_dups + +# * shouldn't match dotfiles. ever. +setopt noglobdots + +# use zsh style word splitting +setopt noshwordsplit + +# don't error out when unset parameters are used +setopt unset + +# setting some default values +NOCOR=${NOCOR:-0} +NOMENU=${NOMENU:-0} +NOPRECMD=${NOPRECMD:-0} +COMMAND_NOT_FOUND=${COMMAND_NOT_FOUND:-0} +GRML_ZSH_CNF_HANDLER=${GRML_ZSH_CNF_HANDLER:-/usr/share/command-not-found/command-not-found} +BATTERY=${BATTERY:-0} +GRMLSMALL_SPECIFIC=${GRMLSMALL_SPECIFIC:-1} +ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0} + +typeset -ga ls_options +typeset -ga grep_options +if ls --help 2> /dev/null | grep -q GNU; then + ls_options=( --color=auto ) +elif [[ $OSTYPE == freebsd* ]]; then + ls_options=( -G ) +fi +if grep --help 2> /dev/null | grep -q GNU || \ + [[ $OSTYPE == freebsd* ]]; then + grep_options=( --color=auto ) +fi + +# utility functions +# this function checks if a command exists and returns either true +# or false. This avoids using 'which' and 'whence', which will +# avoid problems with aliases for which on certain weird systems. :-) +# Usage: check_com [-c|-g] word +# -c only checks for external commands +# -g does the usual tests and also checks for global aliases +check_com() { + emulate -L zsh + local -i comonly gatoo + + if [[ $1 == '-c' ]] ; then + (( comonly = 1 )) + shift + elif [[ $1 == '-g' ]] ; then + (( gatoo = 1 )) + else + (( comonly = 0 )) + (( gatoo = 0 )) + fi + + if (( ${#argv} != 1 )) ; then + printf 'usage: check_com [-c] \n' >&2 + return 1 + fi + + if (( comonly > 0 )) ; then + [[ -n ${commands[$1]} ]] && return 0 + return 1 + fi + + if [[ -n ${commands[$1]} ]] \ + || [[ -n ${functions[$1]} ]] \ + || [[ -n ${aliases[$1]} ]] \ + || [[ -n ${reswords[(r)$1]} ]] ; then + + return 0 + fi + + if (( gatoo > 0 )) && [[ -n ${galiases[$1]} ]] ; then + return 0 + fi + + return 1 +} + +# creates an alias and precedes the command with +# sudo if $EUID is not zero. +salias() { + emulate -L zsh + local only=0 ; local multi=0 + local key val + while [[ $1 == -* ]] ; do + case $1 in + (-o) only=1 ;; + (-a) multi=1 ;; + (--) shift ; break ;; + (-h) + printf 'usage: salias [-h|-o|-a] \n' + printf ' -h shows this help text.\n' + printf ' -a replace '\'' ; '\'' sequences with '\'' ; sudo '\''.\n' + printf ' be careful using this option.\n' + printf ' -o only sets an alias if a preceding sudo would be needed.\n' + return 0 + ;; + (*) printf "unkown option: '%s'\n" "$1" ; return 1 ;; + esac + shift + done + + if (( ${#argv} > 1 )) ; then + printf 'Too many arguments %s\n' "${#argv}" + return 1 + fi + + key="${1%%\=*}" ; val="${1#*\=}" + if (( EUID == 0 )) && (( only == 0 )); then + alias -- "${key}=${val}" + elif (( EUID > 0 )) ; then + (( multi > 0 )) && val="${val// ; / ; sudo }" + alias -- "${key}=sudo ${val}" + fi + + return 0 +} + +# a "print -l ${(u)foo}"-workaround for pre-4.2.0 shells +# usage: uprint foo +# Where foo is the *name* of the parameter you want printed. +# Note that foo is no typo; $foo would be wrong here! +if ! is42 ; then + uprint () { + emulate -L zsh + local -a u + local w + local parameter=$1 + + if [[ -z ${parameter} ]] ; then + printf 'usage: uprint \n' + return 1 + fi + + for w in ${(P)parameter} ; do + [[ -z ${(M)u:#$w} ]] && u=( $u $w ) + done + + builtin print -l $u + } +fi + +# Check if we can read given files and source those we can. +xsource() { + if (( ${#argv} < 1 )) ; then + printf 'usage: xsource FILE(s)...\n' >&2 + return 1 + fi + + while (( ${#argv} > 0 )) ; do + [[ -r "$1" ]] && source "$1" + shift + done + return 0 +} + +# Check if we can read a given file and 'cat(1)' it. +xcat() { + emulate -L zsh + if (( ${#argv} != 1 )) ; then + printf 'usage: xcat FILE\n' >&2 + return 1 + fi + + [[ -r $1 ]] && cat $1 + return 0 +} + +# Remove these functions again, they are of use only in these +# setup files. This should be called at the end of .zshrc. +xunfunction() { + emulate -L zsh + local -a funcs + funcs=(salias xcat xsource xunfunction zrcautoload zrcautozle) + for func in $funcs ; do + [[ -n ${functions[$func]} ]] \ + && unfunction $func + done + return 0 +} + +# this allows us to stay in sync with grml's zshrc and put own +# modifications in ~/.zshrc.local +zrclocal() { + xsource "/etc/zsh/zshrc.local" + xsource "${ZDOTDIR:-${HOME}}/.zshrc.local" + return 0 +} + +# locale setup +if (( ZSH_NO_DEFAULT_LOCALE == 0 )); then + xsource "/etc/default/locale" +fi + +for var in LANG LC_ALL LC_MESSAGES ; do + [[ -n ${(P)var} ]] && export $var +done + +xsource "/etc/sysconfig/keyboard" + +TZ=$(xcat /etc/timezone) + +# set some variables +if check_com -c vim ; then +#v# + export EDITOR=${EDITOR:-vim} +else + export EDITOR=${EDITOR:-vi} +fi + +#v# +export PAGER=${PAGER:-less} + +#v# +export MAIL=${MAIL:-/var/mail/$USER} + +# if we don't set $SHELL then aterm, rxvt,.. will use /bin/sh or /bin/bash :-/ +export SHELL='/bin/zsh' + +# color setup for ls: +check_com -c dircolors && eval $(dircolors -b) +# color setup for ls on OS X / FreeBSD: +isdarwin && export CLICOLOR=1 +isfreebsd && export CLICOLOR=1 + +# do MacPorts setup on darwin +if isdarwin && [[ -d /opt/local ]]; then + # Note: PATH gets set in /etc/zprofile on Darwin, so this can't go into + # zshenv. + PATH="/opt/local/bin:/opt/local/sbin:$PATH" + MANPATH="/opt/local/share/man:$MANPATH" +fi +# do Fink setup on darwin +isdarwin && xsource /sw/bin/init.sh + +# load our function and completion directories +for fdir in /usr/share/grml/zsh/completion /usr/share/grml/zsh/functions; do + fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} ) + if [[ ${fdir} == '/usr/share/grml/zsh/functions' ]] ; then + for func in ${fdir}/**/[^_]*[^~](N.) ; do + zrcautoload ${func:t} + done + fi +done +unset fdir func + +# support colors in less +export LESS_TERMCAP_mb=$'\E[01;31m' +export LESS_TERMCAP_md=$'\E[01;31m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[01;44;33m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[01;32m' + +# mailchecks +MAILCHECK=30 + +# report about cpu-/system-/user-time of command if running longer than +# 5 seconds +REPORTTIME=5 + +# watch for everyone but me and root +watch=(notme root) + +# automatically remove duplicates from these arrays +typeset -U path cdpath fpath manpath + +# Load a few modules +is4 && \ +for mod in parameter complist deltochar mathfunc ; do + zmodload -i zsh/${mod} 2>/dev/null || print "Notice: no ${mod} available :(" +done + +# autoload zsh modules when they are referenced +if is4 ; then + zmodload -a zsh/stat zstat + zmodload -a zsh/zpty zpty + zmodload -ap zsh/mapfile mapfile +fi + +# completion system +if zrcautoload compinit ; then + compinit || print 'Notice: no compinit available :(' +else + print 'Notice: no compinit available :(' + function compdef { } +fi + +# completion system + +# called later (via is4 && grmlcomp) +# note: use 'zstyle' for getting current settings +# press ^xh (control-x h) for getting tags in context; ^x? (control-x ?) to run complete_debug with trace output +grmlcomp() { + # TODO: This could use some additional information + + # Make sure the completion system is initialised + (( ${+_comps} )) || return 1 + + # allow one error for every three characters typed in approximate completer + zstyle ':completion:*:approximate:' max-errors 'reply=( $((($#PREFIX+$#SUFFIX)/3 )) numeric )' + + # don't complete backup files as executables + zstyle ':completion:*:complete:-command-::commands' ignored-patterns '(aptitude-*|*\~)' + + # start menu completion only if it could find no unambiguous initial string + zstyle ':completion:*:correct:*' insert-unambiguous true + zstyle ':completion:*:corrections' format $'%{\e[0;31m%}%d (errors: %e)%{\e[0m%}' + zstyle ':completion:*:correct:*' original true + + # activate color-completion + zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} + + # format on completion + zstyle ':completion:*:descriptions' format $'%{\e[0;31m%}completing %B%d%b%{\e[0m%}' + + # automatically complete 'cd -' and 'cd -' with menu + # zstyle ':completion:*:*:cd:*:directory-stack' menu yes select + + # insert all expansions for expand completer + zstyle ':completion:*:expand:*' tag-order all-expansions + zstyle ':completion:*:history-words' list false + + # activate menu + zstyle ':completion:*:history-words' menu yes + + # ignore duplicate entries + zstyle ':completion:*:history-words' remove-all-dups yes + zstyle ':completion:*:history-words' stop yes + + # match uppercase from lowercase + zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' + + # separate matches into groups + zstyle ':completion:*:matches' group 'yes' + zstyle ':completion:*' group-name '' + + if [[ "$NOMENU" -eq 0 ]] ; then + # if there are more than 5 options allow selecting from a menu + zstyle ':completion:*' menu select=5 + else + # don't use any menus at all + setopt no_auto_menu + fi + + zstyle ':completion:*:messages' format '%d' + zstyle ':completion:*:options' auto-description '%d' + + # describe options in full + zstyle ':completion:*:options' description 'yes' + + # on processes completion complete all user processes + zstyle ':completion:*:processes' command 'ps -au$USER' + + # offer indexes before parameters in subscripts + zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters + + # provide verbose completion information + zstyle ':completion:*' verbose true + + # recent (as of Dec 2007) zsh versions are able to provide descriptions + # for commands (read: 1st word in the line) that it will list for the user + # to choose from. The following disables that, because it's not exactly fast. + zstyle ':completion:*:-command-:*:' verbose false + + # set format for warnings + zstyle ':completion:*:warnings' format $'%{\e[0;31m%}No matches for:%{\e[0m%} %d' + + # define files to ignore for zcompile + zstyle ':completion:*:*:zcompile:*' ignored-patterns '(*~|*.zwc)' + zstyle ':completion:correct:' prompt 'correct to: %e' + + # Ignore completion functions for commands you don't have: + zstyle ':completion::(^approximate*):*:functions' ignored-patterns '_*' + + # Provide more processes in completion of programs like killall: + zstyle ':completion:*:processes-names' command 'ps c -u ${USER} -o command | uniq' + + # complete manual by their section + zstyle ':completion:*:manuals' separate-sections true + zstyle ':completion:*:manuals.*' insert-sections true + zstyle ':completion:*:man:*' menu yes select + + # Search path for sudo completion + zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \ + /usr/local/bin \ + /usr/sbin \ + /usr/bin \ + /sbin \ + /bin \ + /usr/X11R6/bin + + # provide .. as a completion + zstyle ':completion:*' special-dirs .. + + # run rehash on completion so new installed program are found automatically: + _force_rehash() { + (( CURRENT == 1 )) && rehash + return 1 + } + + ## correction + # some people don't like the automatic correction - so run 'NOCOR=1 zsh' to deactivate it + if [[ "$NOCOR" -gt 0 ]] ; then + zstyle ':completion:*' completer _oldlist _expand _force_rehash _complete _files _ignored + setopt nocorrect + else + # try to be smart about when to use what completer... + setopt correct + zstyle -e ':completion:*' completer ' + if [[ $_last_try != "$HISTNO$BUFFER$CURSOR" ]] ; then + _last_try="$HISTNO$BUFFER$CURSOR" + reply=(_complete _match _ignored _prefix _files) + else + if [[ $words[1] == (rm|mv) ]] ; then + reply=(_complete _files) + else + reply=(_oldlist _expand _force_rehash _complete _ignored _correct _approximate _files) + fi + fi' + fi + + # command for process lists, the local web server details and host completion + zstyle ':completion:*:urls' local 'www' '/var/www/' 'public_html' + + # caching + [[ -d $ZSHDIR/cache ]] && zstyle ':completion:*' use-cache yes && \ + zstyle ':completion::complete:*' cache-path $ZSHDIR/cache/ + + # host completion + if is42 ; then + [[ -r ~/.ssh/known_hosts ]] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=() + [[ -r /etc/hosts ]] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(, Bernhard Tittelbach +beginning-or-end-of-somewhere() { + local hno=$HISTNO + if [[ ( "${LBUFFER[-1]}" == $'\n' && "${WIDGET}" == beginning-of* ) || \ + ( "${RBUFFER[1]}" == $'\n' && "${WIDGET}" == end-of* ) ]]; then + zle .${WIDGET:s/somewhere/buffer-or-history/} "$@" + else + zle .${WIDGET:s/somewhere/line-hist/} "$@" + if (( HISTNO != hno )); then + zle .${WIDGET:s/somewhere/buffer-or-history/} "$@" + fi + fi +} +zle -N beginning-of-somewhere beginning-or-end-of-somewhere +zle -N end-of-somewhere beginning-or-end-of-somewhere + +## toggle the ,. abbreviation feature on/off +# NOABBREVIATION: default abbreviation-state +# 0 - enabled (default) +# 1 - disabled +NOABBREVIATION=${NOABBREVIATION:-0} + +grml_toggle_abbrev() { + if (( ${NOABBREVIATION} > 0 )) ; then + NOABBREVIATION=0 + else + NOABBREVIATION=1 + fi +} +zle -N grml_toggle_abbrev + +# add a command line to the shells history without executing it +commit-to-history() { + print -s ${(z)BUFFER} + zle send-break +} +zle -N commit-to-history + +# only slash should be considered as a word separator: +slash-backward-kill-word() { + local WORDCHARS="${WORDCHARS:s@/@}" + # zle backward-word + zle backward-kill-word +} +zle -N slash-backward-kill-word + +# a generic accept-line wrapper + +# This widget can prevent unwanted autocorrections from command-name +# to _command-name, rehash automatically on enter and call any number +# of builtin and user-defined widgets in different contexts. +# +# For a broader description, see: +# +# +# The code is imported from the file 'zsh/functions/accept-line' from +# , which +# distributed under the same terms as zsh itself. + +# A newly added command will may not be found or will cause false +# correction attempts, if you got auto-correction set. By setting the +# following style, we force accept-line() to rehash, if it cannot +# find the first word on the command line in the $command[] hash. +zstyle ':acceptline:*' rehash true + +function Accept-Line() { + setopt localoptions noksharrays + local -a subs + local -xi aldone + local sub + local alcontext=${1:-$alcontext} + + zstyle -a ":acceptline:${alcontext}" actions subs + + (( ${#subs} < 1 )) && return 0 + + (( aldone = 0 )) + for sub in ${subs} ; do + [[ ${sub} == 'accept-line' ]] && sub='.accept-line' + zle ${sub} + + (( aldone > 0 )) && break + done +} + +function Accept-Line-getdefault() { + emulate -L zsh + local default_action + + zstyle -s ":acceptline:${alcontext}" default_action default_action + case ${default_action} in + ((accept-line|)) + printf ".accept-line" + ;; + (*) + printf ${default_action} + ;; + esac +} + +function Accept-Line-HandleContext() { + zle Accept-Line + + default_action=$(Accept-Line-getdefault) + zstyle -T ":acceptline:${alcontext}" call_default \ + && zle ${default_action} +} + +function accept-line() { + setopt localoptions noksharrays + local -ax cmdline + local -x alcontext + local buf com fname format msg default_action + + alcontext='default' + buf="${BUFFER}" + cmdline=(${(z)BUFFER}) + com="${cmdline[1]}" + fname="_${com}" + + Accept-Line 'preprocess' + + zstyle -t ":acceptline:${alcontext}" rehash \ + && [[ -z ${commands[$com]} ]] \ + && rehash + + if [[ -n ${com} ]] \ + && [[ -n ${reswords[(r)$com]} ]] \ + || [[ -n ${aliases[$com]} ]] \ + || [[ -n ${functions[$com]} ]] \ + || [[ -n ${builtins[$com]} ]] \ + || [[ -n ${commands[$com]} ]] ; then + + # there is something sensible to execute, just do it. + alcontext='normal' + Accept-Line-HandleContext + + return + fi + + if [[ -o correct ]] \ + || [[ -o correctall ]] \ + && [[ -n ${functions[$fname]} ]] ; then + + # nothing there to execute but there is a function called + # _command_name; a completion widget. Makes no sense to + # call it on the commandline, but the correct{,all} options + # will ask for it nevertheless, so warn the user. + if [[ ${LASTWIDGET} == 'accept-line' ]] ; then + # Okay, we warned the user before, he called us again, + # so have it his way. + alcontext='force' + Accept-Line-HandleContext + + return + fi + + if zstyle -t ":acceptline:${alcontext}" nocompwarn ; then + alcontext='normal' + Accept-Line-HandleContext + else + # prepare warning message for the user, configurable via zstyle. + zstyle -s ":acceptline:${alcontext}" compwarnfmt msg + + if [[ -z ${msg} ]] ; then + msg="%c will not execute and completion %f exists." + fi + + zformat -f msg "${msg}" "c:${com}" "f:${fname}" + + zle -M -- "${msg}" + fi + return + elif [[ -n ${buf//[$' \t\n']##/} ]] ; then + # If we are here, the commandline contains something that is not + # executable, which is neither subject to _command_name correction + # and is not empty. might be a variable assignment + alcontext='misc' + Accept-Line-HandleContext + + return + fi + + # If we got this far, the commandline only contains whitespace, or is empty. + alcontext='empty' + Accept-Line-HandleContext +} + +zle -N accept-line +zle -N Accept-Line +zle -N Accept-Line-HandleContext + +# power completion / abbreviation expansion / buffer expansion +# see http://zshwiki.org/home/examples/zleiab for details +# less risky than the global aliases but powerful as well +# just type the abbreviation key and afterwards 'ctrl-x .' to expand it +declare -A abk +setopt extendedglob +setopt interactivecomments +abk=( +# key # value (#d additional doc string) +#A# start + '...' '../..' + '....' '../../..' + 'BG' '& exit' + 'C' '| wc -l' + 'G' '|& grep '${grep_options:+"${grep_options[*]}"} + 'H' '| head' + 'Hl' ' --help |& less -r' #d (Display help in pager) + 'L' '| less' + 'LL' '|& less -r' + 'M' '| most' + 'N' '&>/dev/null' #d (No Output) + 'R' '| tr A-z N-za-m' #d (ROT13) + 'SL' '| sort | less' + 'S' '| sort -u' + 'T' '| tail' + 'V' '|& vim -' +#A# end + 'co' './configure && make && sudo make install' +) + +zleiab() { + emulate -L zsh + setopt extendedglob + local MATCH + + if (( NOABBREVIATION > 0 )) ; then + LBUFFER="${LBUFFER},." + return 0 + fi + + LBUFFER=${LBUFFER%%(#m)[.\-+:|_a-zA-Z0-9]#} + LBUFFER+=${abk[$MATCH]:-$MATCH} +} + +zle -N zleiab + +help-show-abk() +{ + zle -M "$(print "Type ,. after these abbreviations to expand them:"; print -a -C 2 ${(kv)abk})" +} + +zle -N help-show-abk + +# press "ctrl-e d" to insert the actual date in the form yyyy-mm-dd +insert-datestamp() { LBUFFER+=${(%):-'%D{%Y-%m-%d}'}; } +zle -N insert-datestamp + +# press esc-m for inserting last typed word again (thanks to caphuso!) +insert-last-typed-word() { zle insert-last-word -- 0 -1 }; +zle -N insert-last-typed-word; + +function grml-zsh-fg() { + if (( ${#jobstates} )); then + zle .push-input + [[ -o hist_ignore_space ]] && BUFFER=' ' || BUFFER='' + BUFFER="${BUFFER}fg" + zle .accept-line + else + zle -M 'No background jobs. Doing nothing.' + fi +} +zle -N grml-zsh-fg + +# run command line as user root via sudo: +sudo-command-line() { + [[ -z $BUFFER ]] && zle up-history + if [[ $BUFFER != sudo\ * ]]; then + BUFFER="sudo $BUFFER" + CURSOR=$(( CURSOR+5 )) + fi +} +zle -N sudo-command-line + +### jump behind the first word on the cmdline. +### useful to add options. +function jump_after_first_word() { + local words + words=(${(z)BUFFER}) + + if (( ${#words} <= 1 )) ; then + CURSOR=${#BUFFER} + else + CURSOR=${#${words[1]}} + fi +} +zle -N jump_after_first_word + +#f5# Create directory under cursor or the selected area +inplaceMkDirs() { + # Press ctrl-xM to create the directory under the cursor or the selected area. + # To select an area press ctrl-@ or ctrl-space and use the cursor. + # Use case: you type "mv abc ~/testa/testb/testc/" and remember that the + # directory does not exist yet -> press ctrl-XM and problem solved + local PATHTOMKDIR + if ((REGION_ACTIVE==1)); then + local F=$MARK T=$CURSOR + if [[ $F -gt $T ]]; then + F=${CURSOR} + T=${MARK} + fi + # get marked area from buffer and eliminate whitespace + PATHTOMKDIR=${BUFFER[F+1,T]%%[[:space:]]##} + PATHTOMKDIR=${PATHTOMKDIR##[[:space:]]##} + else + local bufwords iword + bufwords=(${(z)LBUFFER}) + iword=${#bufwords} + bufwords=(${(z)BUFFER}) + PATHTOMKDIR="${(Q)bufwords[iword]}" + fi + [[ -z "${PATHTOMKDIR}" ]] && return 1 + PATHTOMKDIR=${~PATHTOMKDIR} + if [[ -e "${PATHTOMKDIR}" ]]; then + zle -M " path already exists, doing nothing" + else + zle -M "$(mkdir -p -v "${PATHTOMKDIR}")" + zle end-of-line + fi +} + +#k# mkdir -p from string under cursor or marked area +zle -N inplaceMkDirs + +#v1# set number of lines to display per page +HELP_LINES_PER_PAGE=20 +#v1# set location of help-zle cache file +HELP_ZLE_CACHE_FILE=~/.cache/zsh_help_zle_lines.zsh +# helper function for help-zle, actually generates the help text +help_zle_parse_keybindings() +{ + emulate -L zsh + setopt extendedglob + unsetopt ksharrays #indexing starts at 1 + + #v1# choose files that help-zle will parse for keybindings + ((${+HELPZLE_KEYBINDING_FILES})) || HELPZLE_KEYBINDING_FILES=( /etc/zsh/zshrc ~/.zshrc.pre ~/.zshrc ~/.zshrc.local ) + + if [[ -r $HELP_ZLE_CACHE_FILE ]]; then + local load_cache=0 + for f ($HELPZLE_KEYBINDING_FILES) [[ $f -nt $HELP_ZLE_CACHE_FILE ]] && load_cache=1 + [[ $load_cache -eq 0 ]] && . $HELP_ZLE_CACHE_FILE && return + fi + + #fill with default keybindings, possibly to be overwriten in a file later + #Note that due to zsh inconsistency on escaping assoc array keys, we encase the key in '' which we will remove later + local -A help_zle_keybindings + help_zle_keybindings['@']="set MARK" + help_zle_keybindings['xj']="vi-join lines" + help_zle_keybindings['xb']="jump to matching brace" + help_zle_keybindings['xu']="undo" + help_zle_keybindings['_']="undo" + help_zle_keybindings['xf']="find in cmdline" + help_zle_keybindings['a']="goto beginning of line" + help_zle_keybindings['e']="goto end of line" + help_zle_keybindings['t']="transpose charaters" + help_zle_keybindings['t']="transpose words" + help_zle_keybindings['s']="spellcheck word" + help_zle_keybindings['k']="backward kill buffer" + help_zle_keybindings['u']="forward kill buffer" + help_zle_keybindings['y']="insert previously killed word/string" + help_zle_keybindings["'"]="quote line" + help_zle_keybindings['"']="quote from mark to cursor" + help_zle_keybindings['']="repeat next cmd/char times (-10a -> -10 times 'a')" + help_zle_keybindings['u']="make next word Uppercase" + help_zle_keybindings['l']="make next word lowercase" + help_zle_keybindings['xd']="preview expansion under cursor" + help_zle_keybindings['q']="push current CL into background, freeing it. Restore on next CL" + help_zle_keybindings['.']="insert (and interate through) last word from prev CLs" + help_zle_keybindings[',']="complete word from newer history (consecutive hits)" + help_zle_keybindings['m']="repeat last typed word on current CL" + help_zle_keybindings['v']="insert next keypress symbol literally (e.g. for bindkey)" + help_zle_keybindings['!!:n*']="insert last n arguments of last command" + help_zle_keybindings['!!:n-']="insert arguments n..N-2 of last command (e.g. mv s s d)" + help_zle_keybindings['h']="show help/manpage for current command" + + #init global variables + unset help_zle_lines help_zle_sln + typeset -g -a help_zle_lines + typeset -g help_zle_sln=1 + + local k v + local lastkeybind_desc contents #last description starting with #k# that we found + local num_lines_elapsed=0 #number of lines between last description and keybinding + #search config files in the order they a called (and thus the order in which they overwrite keybindings) + for f in $HELPZLE_KEYBINDING_FILES; do + [[ -r "$f" ]] || continue #not readable ? skip it + contents="$(<$f)" + for cline in "${(f)contents}"; do + #zsh pattern: matches lines like: #k# .............. + if [[ "$cline" == (#s)[[:space:]]#\#k\#[[:space:]]##(#b)(*)[[:space:]]#(#e) ]]; then + lastkeybind_desc="$match[*]" + num_lines_elapsed=0 + #zsh pattern: matches lines that set a keybinding using bind2map, bindkey or compdef -k + # ignores lines that are commentend out + # grabs first in '' or "" enclosed string with length between 1 and 6 characters + elif [[ "$cline" == [^#]#(bind2maps[[:space:]](*)-s|bindkey|compdef -k)[[:space:]](*)(#b)(\"((?)(#c1,6))\"|\'((?)(#c1,6))\')(#B)(*) ]]; then + #description prevously found ? description not more than 2 lines away ? keybinding not empty ? + if [[ -n $lastkeybind_desc && $num_lines_elapsed -lt 2 && -n $match[1] ]]; then + #substitute keybinding string with something readable + k=${${${${${${${match[1]/\\e\^h/}/\\e\^\?/}/\\e\[5~/}/\\e\[6~/}//(\\e|\^\[)/}//\^/}/3~/} + #put keybinding in assoc array, possibly overwriting defaults or stuff found in earlier files + #Note that we are extracting the keybinding-string including the quotes (see Note at beginning) + help_zle_keybindings[${k}]=$lastkeybind_desc + fi + lastkeybind_desc="" + else + ((num_lines_elapsed++)) + fi + done + done + unset contents + #calculate length of keybinding column + local kstrlen=0 + for k (${(k)help_zle_keybindings[@]}) ((kstrlen < ${#k})) && kstrlen=${#k} + #convert the assoc array into preformated lines, which we are able to sort + for k v in ${(kv)help_zle_keybindings[@]}; do + #pad keybinding-string to kstrlen chars and remove outermost characters (i.e. the quotes) + help_zle_lines+=("${(r:kstrlen:)k[2,-2]}${v}") + done + #sort lines alphabetically + help_zle_lines=("${(i)help_zle_lines[@]}") + [[ -d ${HELP_ZLE_CACHE_FILE:h} ]] || mkdir -p "${HELP_ZLE_CACHE_FILE:h}" + echo "help_zle_lines=(${(q)help_zle_lines[@]})" >| $HELP_ZLE_CACHE_FILE + zcompile $HELP_ZLE_CACHE_FILE +} +typeset -g help_zle_sln +typeset -g -a help_zle_lines + +# Provides (partially autogenerated) help on keybindings and the zsh line editor +help-zle() +{ + emulate -L zsh + unsetopt ksharrays #indexing starts at 1 + #help lines already generated ? no ? then do it + [[ ${+functions[help_zle_parse_keybindings]} -eq 1 ]] && {help_zle_parse_keybindings && unfunction help_zle_parse_keybindings} + #already displayed all lines ? go back to the start + [[ $help_zle_sln -gt ${#help_zle_lines} ]] && help_zle_sln=1 + local sln=$help_zle_sln + #note that help_zle_sln is a global var, meaning we remember the last page we viewed + help_zle_sln=$((help_zle_sln + HELP_LINES_PER_PAGE)) + zle -M "${(F)help_zle_lines[sln,help_zle_sln-1]}" +} +zle -N help-zle + +## complete word from currently visible Screen or Tmux buffer. +if check_com -c screen || check_com -c tmux; then + _complete_screen_display() { + [[ "$TERM" != "screen" ]] && return 1 + + local TMPFILE=$(mktemp) + local -U -a _screen_display_wordlist + trap "rm -f $TMPFILE" EXIT + + # fill array with contents from screen hardcopy + if ((${+TMUX})); then + #works, but crashes tmux below version 1.4 + #luckily tmux -V option to ask for version, was also added in 1.4 + tmux -V &>/dev/null || return + tmux -q capture-pane \; save-buffer -b 0 $TMPFILE \; delete-buffer -b 0 + else + screen -X hardcopy $TMPFILE + # screen sucks, it dumps in latin1, apparently always. so recode it + # to system charset + check_com recode && recode latin1 $TMPFILE + fi + _screen_display_wordlist=( ${(QQ)$(<$TMPFILE)} ) + # remove PREFIX to be completed from that array + _screen_display_wordlist[${_screen_display_wordlist[(i)$PREFIX]}]="" + compadd -a _screen_display_wordlist + } + #m# k CTRL-x\,\,\,S Complete word from GNU screen buffer + bindkey -r "^xS" + compdef -k _complete_screen_display complete-word '^xS' +fi + +# Load a few more functions and tie them to widgets, so they can be bound: + +function zrcautozle() { + emulate -L zsh + local fnc=$1 + zrcautoload $fnc && zle -N $fnc +} + +function zrcgotwidget() { + (( ${+widgets[$1]} )) +} + +function zrcgotkeymap() { + [[ -n ${(M)keymaps:#$1} ]] +} + +zrcautozle insert-files +zrcautozle edit-command-line +zrcautozle insert-unicode-char +if zrcautoload history-search-end; then + zle -N history-beginning-search-backward-end history-search-end + zle -N history-beginning-search-forward-end history-search-end +fi +zle -C hist-complete complete-word _generic +zstyle ':completion:hist-complete:*' completer _history + +# The actual terminal setup hooks and bindkey-calls: + +# An array to note missing features to ease diagnosis in case of problems. +typeset -ga grml_missing_features + +function zrcbindkey() { + if (( ARGC )) && zrcgotwidget ${argv[-1]}; then + bindkey "$@" + fi +} + +function bind2maps () { + local i sequence widget + local -a maps + + while [[ "$1" != "--" ]]; do + maps+=( "$1" ) + shift + done + shift + + if [[ "$1" == "-s" ]]; then + shift + sequence="$1" + else + sequence="${key[$1]}" + fi + widget="$2" + + [[ -z "$sequence" ]] && return 1 + + for i in "${maps[@]}"; do + zrcbindkey -M "$i" "$sequence" "$widget" + done +} + +if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then + function zle-smkx () { + emulate -L zsh + printf '%s' ${terminfo[smkx]} + } + function zle-rmkx () { + emulate -L zsh + printf '%s' ${terminfo[rmkx]} + } + function zle-line-init () { + zle-smkx + } + function zle-line-finish () { + zle-rmkx + } + zle -N zle-line-init + zle -N zle-line-finish +else + for i in {s,r}mkx; do + (( ${+terminfo[$i]} )) || grml_missing_features+=($i) + done + unset i +fi + +typeset -A key +key=( + Home "${terminfo[khome]}" + End "${terminfo[kend]}" + Insert "${terminfo[kich1]}" + Delete "${terminfo[kdch1]}" + Up "${terminfo[kcuu1]}" + Down "${terminfo[kcud1]}" + Left "${terminfo[kcub1]}" + Right "${terminfo[kcuf1]}" + PageUp "${terminfo[kpp]}" + PageDown "${terminfo[knp]}" + BackTab "${terminfo[kcbt]}" +) + +# Guidelines for adding key bindings: +# +# - Do not add hardcoded escape sequences, to enable non standard key +# combinations such as Ctrl-Meta-Left-Cursor. They are not easily portable. +# +# - Adding Ctrl characters, such as '^b' is okay; note that '^b' and '^B' are +# the same key. +# +# - All keys from the $key[] mapping are obviously okay. +# +# - Most terminals send "ESC x" when Meta-x is pressed. Thus, sequences like +# '\ex' are allowed in here as well. + +bind2maps emacs -- Home beginning-of-somewhere +bind2maps viins vicmd -- Home vi-beginning-of-line +bind2maps emacs -- End end-of-somewhere +bind2maps viins vicmd -- End vi-end-of-line +bind2maps emacs viins -- Insert overwrite-mode +bind2maps vicmd -- Insert vi-insert +bind2maps emacs -- Delete delete-char +bind2maps viins vicmd -- Delete vi-delete-char +bind2maps emacs viins vicmd -- Up up-line-or-search +bind2maps emacs viins vicmd -- Down down-line-or-search +bind2maps emacs -- Left backward-char +bind2maps viins vicmd -- Left vi-backward-char +bind2maps emacs -- Right forward-char +bind2maps viins vicmd -- Right vi-forward-char +bind2maps viins vicmd -- Right vi-forward-char +#k# Display list of abbreviations that expand when followed by ,. +bind2maps emacs viins -- -s '^x.' zleiab +bind2maps emacs viins -- -s '^xb' help-show-abk +bind2maps emacs viins -- -s '^xM' inplaceMkDirs +#k# display help for keybindings and ZLE +bind2maps emacs viins -- -s '^xz' help-zle +#k# Insert files and test globbing +bind2maps emacs viins -- -s "^xf" insert-files +#k# Edit the current line in \kbd{\$EDITOR} +bind2maps emacs viins -- -s '\ee' edit-command-line +#k# search history backward for entry beginning with typed text +bind2maps emacs viins -- -s '^xp' history-beginning-search-backward-end +#k# search history forward for entry beginning with typed text +bind2maps emacs viins -- -s '^xP' history-beginning-search-forward-end +#k# search history backward for entry beginning with typed text +bind2maps emacs viins -- PageUp history-beginning-search-backward-end +#k# search history forward for entry beginning with typed text +bind2maps emacs viins -- PageDown history-beginning-search-forward-end +#k# Toggle abbreviation expansion on/off +bind2maps emacs viins -- -s '^xA' grml_toggle_abbrev +bind2maps emacs viins -- -s "^x^h" commit-to-history +#k# Kill left-side word or everything up to next slash +bind2maps emacs viins -- -s '\ev' slash-backward-kill-word +#k# Kill left-side word or everything up to next slash +bind2maps emacs viins -- -s '\e^h' slash-backward-kill-word +#k# Kill left-side word or everything up to next slash +bind2maps emacs viins -- -s '\e^?' slash-backward-kill-word +# Do history expansion on space: +bind2maps emacs viins -- -s ' ' magic-space +#k# Trigger menu-complete +bind2maps emacs viins -- -s '\ei' menu-complete # menu completion via esc-i +#k# Insert a timestamp on the command line (yyyy-mm-dd) +bind2maps emacs viins -- -s '^ed' insert-datestamp +#k# Insert last typed word +bind2maps emacs viins -- -s "\em" insert-last-typed-word +#k# A smart shortcut for \kbd{fg} +bind2maps emacs viins -- -s '^z' grml-zsh-fg +#k# prepend the current command with "sudo" +bind2maps emacs viins -- -s "^os" sudo-command-line +#k# jump to after first word (for adding options) +bind2maps emacs viins -- -s '^x1' jump_after_first_word +#k# complete word from history with menu +bind2maps emacs viins -- -s "^x^x" hist-complete + +# insert unicode character +# usage example: 'ctrl-x i' 00A7 'ctrl-x i' will give you an § +# See for example http://unicode.org/charts/ for unicode characters code +#k# Insert Unicode character +bind2maps emacs viins -- -s '^xi' insert-unicode-char + +# use the new *-pattern-* widgets for incremental history search +if zrcgotwidget history-incremental-pattern-search-backward; then + for seq wid in '^r' history-incremental-pattern-search-backward \ + '^s' history-incremental-pattern-search-forward + do + bind2maps emacs viins vicmd -- -s $seq $wid + done +fi + +if zrcgotkeymap menuselect; then + #m# k Shift-tab Perform backwards menu completion + bind2maps menuselect -- BackTab reverse-menu-complete + + #k# menu selection: pick item but stay in the menu + bind2maps menuselect -- -s '\e^M' accept-and-menu-complete + # also use + and INSERT since it's easier to press repeatedly + bind2maps menuselect -- -s '+' accept-and-menu-complete + bind2maps menuselect -- Insert accept-and-menu-complete + + # accept a completion and try to complete again by using menu + # completion; very useful with completing directories + # by using 'undo' one's got a simple file browser + bind2maps menuselect -- -s '^o' accept-and-infer-next-history +fi + +# Finally, here are still a few hardcoded escape sequences; Special sequences +# like Ctrl- etc do suck a fair bit, because they are not +# standardised and most of the time are not available in a terminals terminfo +# entry. +# +# While we do not encourage adding bindings like these, we will keep these for +# backward compatibility. + +## use Ctrl-left-arrow and Ctrl-right-arrow for jumping to word-beginnings on +## the command line. +# URxvt sequences: +bind2maps emacs viins vicmd -- -s '\eOc' forward-word +bind2maps emacs viins vicmd -- -s '\eOd' backward-word +# These are for xterm: +bind2maps emacs viins vicmd -- -s '\e[1;5C' forward-word +bind2maps emacs viins vicmd -- -s '\e[1;5D' backward-word +## the same for alt-left-arrow and alt-right-arrow +# URxvt again: +bind2maps emacs viins vicmd -- -s '\e\e[C' forward-word +bind2maps emacs viins vicmd -- -s '\e\e[D' backward-word +# Xterm again: +bind2maps emacs viins vicmd -- -s '^[[1;3C' forward-word +bind2maps emacs viins vicmd -- -s '^[[1;3D' backward-word +# Also try ESC Left/Right: +bind2maps emacs viins vicmd -- -s '\e'${key[Right]} forward-word +bind2maps emacs viins vicmd -- -s '\e'${key[Left]} backward-word + +# autoloading + +zrcautoload zmv +zrcautoload zed + +# we don't want to quote/espace URLs on our own... +# if autoload -U url-quote-magic ; then +# zle -N self-insert url-quote-magic +# zstyle ':url-quote-magic:*' url-metas '*?[]^()~#{}=' +# else +# print 'Notice: no url-quote-magic available :(' +# fi +alias url-quote='autoload -U url-quote-magic ; zle -N self-insert url-quote-magic' + +#m# k ESC-h Call \kbd{run-help} for the 1st word on the command line +alias run-help >&/dev/null && unalias run-help +for rh in run-help{,-git,-svk,-svn}; do + zrcautoload $rh +done; unset rh + +# command not found handling + +(( ${COMMAND_NOT_FOUND} == 1 )) && +function command_not_found_handler() { + emulate -L zsh + if [[ -x ${GRML_ZSH_CNF_HANDLER} ]] ; then + ${GRML_ZSH_CNF_HANDLER} $1 + fi + return 1 +} + +# history + +ZSHDIR=${ZDOTDIR:-${HOME}/.zsh} + +#v# +HISTFILE=${ZDOTDIR:-${HOME}}/.zsh_history +isgrmlcd && HISTSIZE=500 || HISTSIZE=5000 +isgrmlcd && SAVEHIST=1000 || SAVEHIST=10000 # useful for setopt append_history + +# dirstack handling + +DIRSTACKSIZE=${DIRSTACKSIZE:-20} +DIRSTACKFILE=${DIRSTACKFILE:-${ZDOTDIR:-${HOME}}/.zdirs} + +if [[ -f ${DIRSTACKFILE} ]] && [[ ${#dirstack[*]} -eq 0 ]] ; then + dirstack=( ${(f)"$(< $DIRSTACKFILE)"} ) + # "cd -" won't work after login by just setting $OLDPWD, so + [[ -d $dirstack[1] ]] && cd $dirstack[1] && cd $OLDPWD +fi + +chpwd() { + local -ax my_stack + my_stack=( ${PWD} ${dirstack} ) + if is42 ; then + builtin print -l ${(u)my_stack} >! ${DIRSTACKFILE} + else + uprint my_stack >! ${DIRSTACKFILE} + fi +} + +# directory based profiles + +if is433 ; then + +# chpwd_profiles(): Directory Profiles, Quickstart: +# +# In .zshrc.local: +# +# zstyle ':chpwd:profiles:/usr/src/grml(|/|/*)' profile grml +# zstyle ':chpwd:profiles:/usr/src/debian(|/|/*)' profile debian +# chpwd_profiles +# +# For details see the `grmlzshrc.5' manual page. +function chpwd_profiles() { + local profile context + local -i reexecute + + context=":chpwd:profiles:$PWD" + zstyle -s "$context" profile profile || profile='default' + zstyle -T "$context" re-execute && reexecute=1 || reexecute=0 + + if (( ${+parameters[CHPWD_PROFILE]} == 0 )); then + typeset -g CHPWD_PROFILE + local CHPWD_PROFILES_INIT=1 + (( ${+functions[chpwd_profiles_init]} )) && chpwd_profiles_init + elif [[ $profile != $CHPWD_PROFILE ]]; then + (( ${+functions[chpwd_leave_profile_$CHPWD_PROFILE]} )) \ + && chpwd_leave_profile_${CHPWD_PROFILE} + fi + if (( reexecute )) || [[ $profile != $CHPWD_PROFILE ]]; then + (( ${+functions[chpwd_profile_$profile]} )) && chpwd_profile_${profile} + fi + + CHPWD_PROFILE="${profile}" + return 0 +} + +chpwd_functions=( ${chpwd_functions} chpwd_profiles ) + +fi # is433 + +# Prompt setup for grml: + +# set colors for use in prompts (modern zshs allow for the use of %F{red}foo%f +# in prompts to get a red "foo" embedded, but it's good to keep these for +# backwards compatibility). +if zrcautoload colors && colors 2>/dev/null ; then + BLUE="%{${fg[blue]}%}" + RED="%{${fg_bold[red]}%}" + GREEN="%{${fg[green]}%}" + CYAN="%{${fg[cyan]}%}" + MAGENTA="%{${fg[magenta]}%}" + YELLOW="%{${fg[yellow]}%}" + WHITE="%{${fg[white]}%}" + NO_COLOR="%{${reset_color}%}" +else + BLUE=$'%{\e[1;34m%}' + RED=$'%{\e[1;31m%}' + GREEN=$'%{\e[1;32m%}' + CYAN=$'%{\e[1;36m%}' + WHITE=$'%{\e[1;37m%}' + MAGENTA=$'%{\e[1;35m%}' + YELLOW=$'%{\e[1;33m%}' + NO_COLOR=$'%{\e[0m%}' +fi + +# First, the easy ones: PS2..4: + +# secondary prompt, printed when the shell needs more information to complete a +# command. +PS2='\`%_> ' +# selection prompt used within a select loop. +PS3='?# ' +# the execution trace prompt (setopt xtrace). default: '+%N:%i>' +PS4='+%N:%i:%_> ' + +# Some additional features to use with our prompt: +# +# - battery status +# - debian_chroot +# - vcs_info setup and version specific fixes + +# display battery status on right side of prompt via running 'BATTERY=1 zsh' +if [[ $BATTERY -gt 0 ]] ; then + if ! check_com -c acpi ; then + BATTERY=0 + fi +fi + +battery() { +if [[ $BATTERY -gt 0 ]] ; then + PERCENT="${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]#Battery <->: [^0-9]##, (<->)%*/${match[1]}}" + if [[ -z "$PERCENT" ]] ; then + PERCENT='acpi not present' + else + if [[ "$PERCENT" -lt 20 ]] ; then + PERCENT="warning: ${PERCENT}%%" + else + PERCENT="${PERCENT}%%" + fi + fi +fi +} + +# set variable debian_chroot if running in a chroot with /etc/debian_chroot +if [[ -z "$debian_chroot" ]] && [[ -r /etc/debian_chroot ]] ; then + debian_chroot=$( ]] ; then + function VCS_INFO_realpath () { + setopt localoptions NO_shwordsplit chaselinks + ( builtin cd -q $1 2> /dev/null && pwd; ) + } + fi + + zstyle ':vcs_info:*' max-exports 2 + + if [[ -o restricted ]]; then + zstyle ':vcs_info:*' enable NONE + fi +fi + +# Change vcs_info formats for the grml prompt. The 2nd format sets up +# $vcs_info_msg_1_ to contain "zsh: repo-name" used to set our screen title. +# TODO: The included vcs_info() version still uses $VCS_INFO_message_N_. +# That needs to be the use of $VCS_INFO_message_N_ needs to be changed +# to $vcs_info_msg_N_ as soon as we use the included version. +if [[ "$TERM" == dumb ]] ; then + zstyle ':vcs_info:*' actionformats "(%s%)-[%b|%a] " "zsh: %r" + zstyle ':vcs_info:*' formats "(%s%)-[%b] " "zsh: %r" +else + # these are the same, just with a lot of colors: + zstyle ':vcs_info:*' actionformats "${MAGENTA}(${NO_COLOR}%s${MAGENTA})${YELLOW}-${MAGENTA}[${GREEN}%b${YELLOW}|${RED}%a${MAGENTA}]${NO_COLOR} " \ + "zsh: %r" + zstyle ':vcs_info:*' formats "${MAGENTA}(${NO_COLOR}%s${MAGENTA})${YELLOW}-${MAGENTA}[${GREEN}%b${MAGENTA}]${NO_COLOR}%} " \ + "zsh: %r" + zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b${RED}:${YELLOW}%r" +fi + +# Now for the fun part: The grml prompt themes in `promptsys' mode of operation + +# This actually defines three prompts: +# +# - grml +# - grml-large +# - grml-chroot +# +# They all share the same code and only differ with respect to which items they +# contain. The main source of documentation is the `prompt_grml_help' function +# below, which gets called when the user does this: prompt -h grml + +function prompt_grml_help () { + cat <<__EOF0__ + prompt grml + + This is the prompt as used by the grml-live system . It is + a rather simple one-line prompt, that by default looks something like this: + + @ [ ]% + + The prompt itself integrates with zsh's prompt themes system (as you are + witnessing right now) and is configurable to a certain degree. In + particular, these aspects are customisable: + + - The items used in the prompt (e.g. you can remove \`user' from + the list of activated items, which will cause the user name to + be omitted from the prompt string). + + - The attributes used with the items are customisable via strings + used before and after the actual item. + + The available items are: at, battery, change-root, date, grml-chroot, + history, host, jobs, newline, path, percent, rc, rc-always, sad-smiley, + shell-level, time, user, vcs + + The actual configuration is done via zsh's \`zstyle' mechanism. The + context, that is used while looking up styles is: + + ':prompt:grml::' + + Here is either \`left' or \`right', signifying whether the + style should affect the left or the right prompt. is either + \`setup' or 'items:', where \`' is one of the available items. + + The styles: + + - use-rprompt (boolean): If \`true' (the default), print a sad smiley + in $RPROMPT if the last command a returned non-successful error code. + (This in only valid if is "right"; ignored otherwise) + + - items (list): The list of items used in the prompt. If \`vcs' is + present in the list, the theme's code invokes \`vcs_info' + accordingly. Default (left): rc change-root user at host path vcs + percent; Default (right): sad-smiley + + Available styles in 'items:' are: pre, post. These are strings that + are inserted before (pre) and after (post) the item in question. Thus, the + following would cause the user name to be printed in red instead of the + default blue: + + zstyle ':prompt:grml:*:items:user' pre '%F{red}' + + Note, that the \`post' style may remain at its default value, because its + default value is '%f', which turns the foreground text attribute off (which + is exactly, what is still required with the new \`pre' value). +__EOF0__ +} + +function prompt_grml-chroot_help () { + cat <<__EOF0__ + prompt grml-chroot + + This is a variation of the grml prompt, see: prompt -h grml + + The main difference is the default value of the \`items' style. The rest + behaves exactly the same. Here are the defaults for \`grml-chroot': + + - left: grml-chroot user at host path percent + - right: (empty list) +__EOF0__ +} + +function prompt_grml-large_help () { + cat <<__EOF0__ + prompt grml-large + + This is a variation of the grml prompt, see: prompt -h grml + + The main difference is the default value of the \`items' style. In + particular, this theme uses _two_ lines instead of one with the plain + \`grml' theme. The rest behaves exactly the same. Here are the defaults + for \`grml-large': + + - left: rc jobs history shell-level change-root time date newline user + at host path vcs percent + - right: sad-smiley +__EOF0__ +} + +function grml_prompt_setup () { + emulate -L zsh + autoload -Uz vcs_info + autoload -Uz add-zsh-hook + add-zsh-hook precmd prompt_$1_precmd +} + +function prompt_grml_setup () { + grml_prompt_setup grml +} + +function prompt_grml-chroot_setup () { + grml_prompt_setup grml-chroot +} + +function prompt_grml-large_setup () { + grml_prompt_setup grml-large +} + +# These maps define default tokens and pre-/post-decoration for items to be +# used within the themes. All defaults may be customised in a context sensitive +# matter by using zsh's `zstyle' mechanism. +typeset -gA grml_prompt_pre_default \ + grml_prompt_post_default \ + grml_prompt_token_default \ + grml_prompt_token_function + +grml_prompt_pre_default=( + at '' + battery ' ' + change-root '' + date '%F{blue}' + grml-chroot '%F{red}' + history '%F{green}' + host '' + jobs '%F{cyan}' + newline '' + path '%B' + percent '' + rc '%B%F{red}' + rc-always '' + sad-smiley '' + shell-level '%F{red}' + time '%F{blue}' + user '%B%F{blue}' + vcs '' +) + +grml_prompt_post_default=( + at '' + battery '' + change-root '' + date '%f' + grml-chroot '%f ' + history '%f' + host '' + jobs '%f' + newline '' + path '%b' + percent '' + rc '%f%b' + rc-always '' + sad-smiley '' + shell-level '%f' + time '%f' + user '%f%b' + vcs '' +) + +grml_prompt_token_default=( + at '@' + battery 'PERCENT' + change-root 'debian_chroot' + date '%D{%Y-%m-%d}' + grml-chroot 'GRML_CHROOT' + history '{history#%!} ' + host '%m ' + jobs '[%j running job(s)] ' + newline $'\n' + path '%40<..<%~%<< ' + percent '%# ' + rc '%(?..%? )' + rc-always '%?' + sad-smiley '%(?..:()' + shell-level '%(3L.+ .)' + time '%D{%H:%M:%S} ' + user '%n' + vcs '0' +) + +function grml_theme_has_token () { + if (( ARGC != 1 )); then + printf 'usage: grml_theme_has_token \n' + return 1 + fi + (( ${+grml_prompt_token_default[$1]} )) +} + +function GRML_theme_add_token_usage () { + cat <<__EOF__ + Usage: grml_theme_add_token [-f|-i] [
 ]
+
+     is the name for the newly added token. If the \`-f' or \`-i' options
+    are used,  is the name of the function (see below for
+    details). Otherwise it is the literal token string to be used. 
 and
+     are optional.
+
+  Options:
+
+    -f    Use a function named \`' each time the token
+                    is to be expanded.
+
+    -i    Use a function named \`' to initialise the
+                    value of the token _once_ at runtime.
+
+    The functions are called with one argument: the token's new name. The
+    return value is expected in the \$REPLY parameter. The use of these
+    options is mutually exclusive.
+
+    There is a utility function \`grml_theme_has_token', which you can use
+    to test if a token exists before trying to add it. This can be a guard
+    for situations in which a \`grml_theme_add_token' call may happen more
+    than once.
+
+  Example:
+
+    To add a new token \`day' that expands to the current weekday in the
+    current locale in green foreground colour, use this:
+
+      grml_theme_add_token day '%D{%A}' '%F{green}' '%f'
+
+    Another example would be support for \$VIRTUAL_ENV:
+
+      function virtual_env_prompt () {
+        REPLY=\${VIRTUAL_ENV+\${VIRTUAL_ENV:t} }
+      }
+      grml_theme_add_token virtual-env -f virtual_env_prompt
+
+    After that, you will be able to use a changed \`items' style to
+    assemble your prompt.
+__EOF__
+}
+
+function grml_theme_add_token () {
+    emulate -L zsh
+    local name token pre post
+    local -i init funcall
+
+    if (( ARGC == 0 )); then
+        GRML_theme_add_token_usage
+        return 0
+    fi
+
+    init=0
+    funcall=0
+    pre=''
+    post=''
+    name=$1
+    shift
+    if [[ $1 == '-f' ]]; then
+        funcall=1
+        shift
+    elif [[ $1 == '-i' ]]; then
+        init=1
+        shift
+    fi
+
+    if (( ARGC == 0 )); then
+        printf '
+grml_theme_add_token: No token-string/function-name provided!\n\n'
+        GRML_theme_add_token_usage
+        return 1
+    fi
+    token=$1
+    shift
+    if (( ARGC != 0 && ARGC != 2 )); then
+        printf '
+grml_theme_add_token: 
 and  need to by specified _both_!\n\n'
+        GRML_theme_add_token_usage
+        return 1
+    fi
+    if (( ARGC )); then
+        pre=$1
+        post=$2
+        shift 2
+    fi
+
+    if grml_theme_has_token $name; then
+        printf '
+grml_theme_add_token: Token `%s'\'' exists! Giving up!\n\n' $name
+        GRML_theme_add_token_usage
+        return 2
+    fi
+    if (( init )); then
+        $token $name
+        token=$REPLY
+    fi
+    grml_prompt_pre_default[$name]=$pre
+    grml_prompt_post_default[$name]=$post
+    if (( funcall )); then
+        grml_prompt_token_function[$name]=$token
+        grml_prompt_token_default[$name]=23
+    else
+        grml_prompt_token_default[$name]=$token
+    fi
+}
+
+function grml_typeset_and_wrap () {
+    emulate -L zsh
+    local target="$1"
+    local new="$2"
+    local left="$3"
+    local right="$4"
+
+    if (( ${+parameters[$new]} )); then
+        typeset -g "${target}=${(P)target}${left}${(P)new}${right}"
+    fi
+}
+
+function grml_prompt_addto () {
+    emulate -L zsh
+    local target="$1"
+    local lr it apre apost new v
+    local -a items
+    shift
+
+    [[ $target == PS1 ]] && lr=left || lr=right
+    zstyle -a ":prompt:${grmltheme}:${lr}:setup" items items || items=( "$@" )
+    typeset -g "${target}="
+    for it in "${items[@]}"; do
+        zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" pre apre \
+            || apre=${grml_prompt_pre_default[$it]}
+        zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" post apost \
+            || apost=${grml_prompt_post_default[$it]}
+        zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" token new \
+            || new=${grml_prompt_token_default[$it]}
+        typeset -g "${target}=${(P)target}${apre}"
+        if (( ${+grml_prompt_token_function[$it]} )); then
+            ${grml_prompt_token_function[$it]} $it
+            typeset -g "${target}=${(P)target}${REPLY}"
+        else
+            case $it in
+            battery)
+                grml_typeset_and_wrap $target $new '' ''
+                ;;
+            change-root)
+                grml_typeset_and_wrap $target $new '(' ')'
+                ;;
+            grml-chroot)
+                if [[ -n ${(P)new} ]]; then
+                    typeset -g "${target}=${(P)target}(CHROOT)"
+                fi
+                ;;
+            vcs)
+                v="vcs_info_msg_${new}_"
+                if (( ! vcscalled )); then
+                    vcs_info
+                    vcscalled=1
+                fi
+                if (( ${+parameters[$v]} )) && [[ -n "${(P)v}" ]]; then
+                    typeset -g "${target}=${(P)target}${(P)v}"
+                fi
+                ;;
+            *) typeset -g "${target}=${(P)target}${new}" ;;
+            esac
+        fi
+        typeset -g "${target}=${(P)target}${apost}"
+    done
+}
+
+function prompt_grml_precmd () {
+    emulate -L zsh
+    local grmltheme=grml
+    local -a left_items right_items
+    left_items=(rc change-root user at host path vcs percent)
+    right_items=(sad-smiley)
+
+    prompt_grml_precmd_worker
+}
+
+function prompt_grml-chroot_precmd () {
+    emulate -L zsh
+    local grmltheme=grml-chroot
+    local -a left_items right_items
+    left_items=(grml-chroot user at host path percent)
+    right_items=()
+
+    prompt_grml_precmd_worker
+}
+
+function prompt_grml-large_precmd () {
+    emulate -L zsh
+    local grmltheme=grml-large
+    local -a left_items right_items
+    left_items=(rc jobs history shell-level change-root time date newline
+                user at host path vcs percent)
+    right_items=(sad-smiley)
+
+    prompt_grml_precmd_worker
+}
+
+function prompt_grml_precmd_worker () {
+    emulate -L zsh
+    local -i vcscalled=0
+
+    grml_prompt_addto PS1 "${left_items[@]}"
+    if zstyle -T ":prompt:${grmltheme}:right:setup" use-rprompt; then
+        grml_prompt_addto RPS1 "${right_items[@]}"
+    fi
+}
+
+grml_prompt_fallback() {
+    setopt prompt_subst
+    precmd() {
+        (( ${+functions[vcs_info]} )) && vcs_info
+    }
+
+    p0="${RED}%(?..%? )${WHITE}${debian_chroot:+($debian_chroot)}"
+    p1="${BLUE}%n${NO_COLOR}@%m %40<...<%B%~%b%<< "'${vcs_info_msg_0_}'"%# "
+    if (( EUID == 0 )); then
+        PROMPT="${BLUE}${p0}${RED}${p1}"
+    else
+        PROMPT="${RED}${p0}${BLUE}${p1}"
+    fi
+    unset p0 p1
+}
+
+if zrcautoload promptinit && promptinit 2>/dev/null ; then
+    # Since we define the required functions in here and not in files in
+    # $fpath, we need to stick the theme's name into `$prompt_themes'
+    # ourselves, since promptinit does not pick them up otherwise.
+    prompt_themes+=( grml grml-chroot grml-large )
+    # Also, keep the array sorted...
+    prompt_themes=( "${(@on)prompt_themes}" )
+else
+    print 'Notice: no promptinit available :('
+    grml_prompt_fallback
+fi
+
+if is437; then
+    # The prompt themes use modern features of zsh, that require at least
+    # version 4.3.7 of the shell. Use the fallback otherwise.
+    if [[ $BATTERY -gt 0 ]]; then
+        zstyle ':prompt:grml:right:setup' items sad-smiley battery
+        add-zsh-hook precmd battery
+    fi
+    if [[ "$TERM" == dumb ]] ; then
+        zstyle ":prompt:grml(|-large|-chroot):*:items:grml-chroot" pre ''
+        zstyle ":prompt:grml(|-large|-chroot):*:items:grml-chroot" post ' '
+        for i in rc user path jobs history date time shell-level; do
+            zstyle ":prompt:grml(|-large|-chroot):*:items:$i" pre ''
+            zstyle ":prompt:grml(|-large|-chroot):*:items:$i" post ''
+        done
+        unset i
+        zstyle ':prompt:grml(|-large|-chroot):right:setup' use-rprompt false
+    elif (( EUID == 0 )); then
+        zstyle ':prompt:grml(|-large|-chroot):*:items:user' pre '%B%F{red}'
+    fi
+
+    # Finally enable one of the prompts.
+    if [[ -n $GRML_CHROOT ]]; then
+        prompt grml-chroot
+    elif [[ $GRMLPROMPT -gt 0 ]]; then
+        prompt grml-large
+    else
+        prompt grml
+    fi
+else
+    grml_prompt_fallback
+fi
+
+# Terminal-title wizardry
+
+function ESC_print () {
+    info_print $'\ek' $'\e\\' "$@"
+}
+function set_title () {
+    info_print  $'\e]0;' $'\a' "$@"
+}
+
+function info_print () {
+    local esc_begin esc_end
+    esc_begin="$1"
+    esc_end="$2"
+    shift 2
+    printf '%s' ${esc_begin}
+    printf '%s' "$*"
+    printf '%s' "${esc_end}"
+}
+
+function grml_reset_screen_title () {
+    # adjust title of xterm
+    # see http://www.faqs.org/docs/Linux-mini/Xterm-Title.html
+    [[ ${NOTITLE:-} -gt 0 ]] && return 0
+    case $TERM in
+        (xterm*|rxvt*)
+            set_title ${(%):-"%n@%m: %~"}
+            ;;
+    esac
+}
+
+function grml_vcs_to_screen_title () {
+    if [[ $TERM == screen* ]] ; then
+        if [[ -n ${vcs_info_msg_1_} ]] ; then
+            ESC_print ${vcs_info_msg_1_}
+        else
+            ESC_print "zsh"
+        fi
+    fi
+}
+
+function grml_maintain_name () {
+    # set hostname if not running on host with name 'grml'
+    if [[ -n "$HOSTNAME" ]] && [[ "$HOSTNAME" != $(hostname) ]] ; then
+       NAME="@$HOSTNAME"
+    fi
+}
+
+function grml_cmd_to_screen_title () {
+    # get the name of the program currently running and hostname of local
+    # machine set screen window title if running in a screen
+    if [[ "$TERM" == screen* ]] ; then
+        local CMD="${1[(wr)^(*=*|sudo|ssh|-*)]}$NAME"
+        ESC_print ${CMD}
+    fi
+}
+
+function grml_control_xterm_title () {
+    case $TERM in
+        (xterm*|rxvt*)
+            set_title "${(%):-"%n@%m:"}" "$1"
+            ;;
+    esac
+}
+
+zrcautoload add-zsh-hook || add-zsh-hook () { :; }
+if [[ $NOPRECMD -eq 0 ]]; then
+    add-zsh-hook precmd grml_reset_screen_title
+    add-zsh-hook precmd grml_vcs_to_screen_title
+    add-zsh-hook preexec grml_maintain_name
+    add-zsh-hook preexec grml_cmd_to_screen_title
+    if [[ $NOTITLE -eq 0 ]]; then
+        add-zsh-hook preexec grml_control_xterm_title
+    fi
+fi
+
+# 'hash' some often used directories
+#d# start
+hash -d deb=/var/cache/apt/archives
+hash -d doc=/usr/share/doc
+hash -d linux=/lib/modules/$(command uname -r)/build/
+hash -d log=/var/log
+hash -d slog=/var/log/syslog
+hash -d src=/usr/src
+hash -d templ=/usr/share/doc/grml-templates
+hash -d tt=/usr/share/doc/texttools-doc
+hash -d www=/var/www
+#d# end
+
+# some aliases
+if check_com -c screen ; then
+    if [[ $UID -eq 0 ]] ; then
+        if [[ -r /etc/grml/screenrc ]]; then
+            alias screen="${commands[screen]} -c /etc/grml/screenrc"
+        fi
+    elif [[ -r $HOME/.screenrc ]] ; then
+        alias screen="${commands[screen]} -c $HOME/.screenrc"
+    else
+        if [[ -r /etc/grml/screenrc_grml ]]; then
+            alias screen="${commands[screen]} -c /etc/grml/screenrc_grml"
+        else
+            if [[ -r /etc/grml/screenrc ]]; then
+                alias screen="${commands[screen]} -c /etc/grml/screenrc"
+            fi
+        fi
+    fi
+fi
+
+# do we have GNU ls with color-support?
+if [[ "$TERM" != dumb ]]; then
+    #a1# List files with colors (\kbd{ls -b -CF \ldots})
+    alias ls='ls -b -CF '${ls_options:+"${ls_options[*]}"}
+    #a1# List all files, with colors (\kbd{ls -la \ldots})
+    alias la='ls -la '${ls_options:+"${ls_options[*]}"}
+    #a1# List files with long colored list, without dotfiles (\kbd{ls -l \ldots})
+    alias ll='ls -l '${ls_options:+"${ls_options[*]}"}
+    #a1# List files with long colored list, human readable sizes (\kbd{ls -hAl \ldots})
+    alias lh='ls -hAl '${ls_options:+"${ls_options[*]}"}
+    #a1# List files with long colored list, append qualifier to filenames (\kbd{ls -lF \ldots})\\&\quad(\kbd{/} for directories, \kbd{@} for symlinks ...)
+    alias l='ls -lF '${ls_options:+"${ls_options[*]}"}
+else
+    alias ls='ls -b -CF'
+    alias la='ls -la'
+    alias ll='ls -l'
+    alias lh='ls -hAl'
+    alias l='ls -lF'
+fi
+
+alias mdstat='cat /proc/mdstat'
+alias ...='cd ../../'
+
+# generate alias named "$KERNELVERSION-reboot" so you can use boot with kexec:
+if [[ -x /sbin/kexec ]] && [[ -r /proc/cmdline ]] ; then
+    alias "$(uname -r)-reboot"="kexec -l --initrd=/boot/initrd.img-"$(uname -r)" --command-line=\"$(cat /proc/cmdline)\" /boot/vmlinuz-"$(uname -r)""
+fi
+
+# see http://www.cl.cam.ac.uk/~mgk25/unicode.html#term for details
+alias term2iso="echo 'Setting terminal to iso mode' ; print -n '\e%@'"
+alias term2utf="echo 'Setting terminal to utf-8 mode'; print -n '\e%G'"
+
+# make sure it is not assigned yet
+[[ -n ${aliases[utf2iso]} ]] && unalias utf2iso
+utf2iso() {
+    if isutfenv ; then
+        for ENV in $(env | command grep -i '.utf') ; do
+            eval export "$(echo $ENV | sed 's/UTF-8/iso885915/ ; s/utf8/iso885915/')"
+        done
+    fi
+}
+
+# make sure it is not assigned yet
+[[ -n ${aliases[iso2utf]} ]] && unalias iso2utf
+iso2utf() {
+    if ! isutfenv ; then
+        for ENV in $(env | command grep -i '\.iso') ; do
+            eval export "$(echo $ENV | sed 's/iso.*/UTF-8/ ; s/ISO.*/UTF-8/')"
+        done
+    fi
+}
+
+# especially for roadwarriors using GNU screen and ssh:
+if ! check_com asc &>/dev/null ; then
+  asc() { autossh -t "$@" 'screen -RdU' }
+  compdef asc=ssh
+fi
+
+#f1# Hints for the use of zsh on grml
+zsh-help() {
+    print "$bg[white]$fg[black]
+zsh-help - hints for use of zsh on grml
+=======================================$reset_color"
+
+    print '
+Main configuration of zsh happens in /etc/zsh/zshrc.
+That file is part of the package grml-etc-core, if you want to
+use them on a non-grml-system just get the tar.gz from
+http://deb.grml.org/ or (preferably) get it from the git repository:
+
+  http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
+
+This version of grml'\''s zsh setup does not use skel/.zshrc anymore.
+The file is still there, but it is empty for backwards compatibility.
+
+For your own changes use these two files:
+    $HOME/.zshrc.pre
+    $HOME/.zshrc.local
+
+The former is sourced very early in our zshrc, the latter is sourced
+very lately.
+
+System wide configuration without touching configuration files of grml
+can take place in /etc/zsh/zshrc.local.
+
+For information regarding zsh start at http://grml.org/zsh/
+
+Take a look at grml'\''s zsh refcard:
+% xpdf =(zcat /usr/share/doc/grml-docs/zsh/grml-zsh-refcard.pdf.gz)
+
+Check out the main zsh refcard:
+% '$BROWSER' http://www.bash2zsh.com/zsh_refcard/refcard.pdf
+
+And of course visit the zsh-lovers:
+% man zsh-lovers
+
+You can adjust some options through environment variables when
+invoking zsh without having to edit configuration files.
+Basically meant for bash users who are not used to the power of
+the zsh yet. :)
+
+  "NOCOR=1    zsh" => deactivate automatic correction
+  "NOMENU=1   zsh" => do not use auto menu completion
+                      (note: use ctrl-d for completion instead!)
+  "NOPRECMD=1 zsh" => disable the precmd + preexec commands (set GNU screen title)
+  "NOTITLE=1  zsh" => disable setting the title of xterms without disabling
+                      preexec() and precmd() completely
+  "BATTERY=1  zsh" => activate battery status (via acpi) on right side of prompt
+  "COMMAND_NOT_FOUND=1 zsh"
+                   => Enable a handler if an external command was not found
+                      The command called in the handler can be altered by setting
+                      the GRML_ZSH_CNF_HANDLER variable, the default is:
+                      "/usr/share/command-not-found/command-not-found"
+
+A value greater than 0 is enables a feature; a value equal to zero
+disables it. If you like one or the other of these settings, you can
+add them to ~/.zshrc.pre to ensure they are set when sourcing grml'\''s
+zshrc.'
+
+    print "
+$bg[white]$fg[black]
+Please report wishes + bugs to the grml-team: http://grml.org/bugs/
+Enjoy your grml system with the zsh!$reset_color"
+}
+
+# debian stuff
+if [[ -r /etc/debian_version ]] ; then
+    #a3# Execute \kbd{apt-cache search}
+    alias acs='apt-cache search'
+    #a3# Execute \kbd{apt-cache show}
+    alias acsh='apt-cache show'
+    #a3# Execute \kbd{apt-cache policy}
+    alias acp='apt-cache policy'
+    #a3# Execute \kbd{apt-get dist-upgrade}
+    salias adg="apt-get dist-upgrade"
+    #a3# Execute \kbd{apt-get install}
+    salias agi="apt-get install"
+    #a3# Execute \kbd{aptitude install}
+    salias ati="aptitude install"
+    #a3# Execute \kbd{apt-get upgrade}
+    salias ag="apt-get upgrade"
+    #a3# Execute \kbd{apt-get update}
+    salias au="apt-get update"
+    #a3# Execute \kbd{aptitude update ; aptitude safe-upgrade}
+    salias -a up="aptitude update ; aptitude safe-upgrade"
+    #a3# Execute \kbd{dpkg-buildpackage}
+    alias dbp='dpkg-buildpackage'
+    #a3# Execute \kbd{grep-excuses}
+    alias ge='grep-excuses'
+
+    # get a root shell as normal user in live-cd mode:
+    if isgrmlcd && [[ $UID -ne 0 ]] ; then
+       alias su="sudo su"
+     fi
+
+    #a1# Take a look at the syslog: \kbd{\$PAGER /var/log/syslog}
+    salias llog="$PAGER /var/log/syslog"     # take a look at the syslog
+    #a1# Take a look at the syslog: \kbd{tail -f /var/log/syslog}
+    salias tlog="tail -f /var/log/syslog"    # follow the syslog
+fi
+
+# sort installed Debian-packages by size
+if check_com -c dpkg-query ; then
+    #a3# List installed Debian-packages sorted by size
+    alias debs-by-size="dpkg-query -Wf 'x \${Installed-Size} \${Package} \${Status}\n' | sed -ne '/^x  /d' -e '/^x \(.*\) install ok installed$/s//\1/p' | sort -nr"
+fi
+
+# if cdrecord is a symlink (to wodim) or isn't present at all warn:
+if [[ -L /usr/bin/cdrecord ]] || ! check_com -c cdrecord; then
+    if check_com -c wodim; then
+        cdrecord() {
+            cat <\n' "$0" && return 1
+    for file in "$@" ; do
+        while [[ -h "$file" ]] ; do
+            ls -l $file
+            file=$(readlink "$file")
+        done
+    done
+}
+
+# TODO: Is it supported to use pager settings like this?
+#   PAGER='less -Mr' - If so, the use of $PAGER here needs fixing
+# with respect to wordsplitting. (ie. ${=PAGER})
+if check_com -c $PAGER ; then
+    #f3# View Debian's changelog of a given package
+    dchange() {
+        emulate -L zsh
+        if [[ -r /usr/share/doc/$1/changelog.Debian.gz ]] ; then
+            $PAGER /usr/share/doc/$1/changelog.Debian.gz
+        elif [[ -r /usr/share/doc/$1/changelog.gz ]] ; then
+            $PAGER /usr/share/doc/$1/changelog.gz
+        else
+            if check_com -c aptitude ; then
+                echo "No changelog for package $1 found, using aptitude to retrieve it."
+                if isgrml ; then
+                    aptitude -t unstable changelog $1
+                else
+                    aptitude changelog $1
+                fi
+            else
+                echo "No changelog for package $1 found, sorry."
+                return 1
+            fi
+        fi
+    }
+    _dchange() { _files -W /usr/share/doc -/ }
+    compdef _dchange dchange
+
+    #f3# View Debian's NEWS of a given package
+    dnews() {
+        emulate -L zsh
+        if [[ -r /usr/share/doc/$1/NEWS.Debian.gz ]] ; then
+            $PAGER /usr/share/doc/$1/NEWS.Debian.gz
+        else
+            if [[ -r /usr/share/doc/$1/NEWS.gz ]] ; then
+                $PAGER /usr/share/doc/$1/NEWS.gz
+            else
+                echo "No NEWS file for package $1 found, sorry."
+                return 1
+            fi
+        fi
+    }
+    _dnews() { _files -W /usr/share/doc -/ }
+    compdef _dnews dnews
+
+    #f3# View Debian's copyright of a given package
+    dcopyright() {
+        emulate -L zsh
+        if [[ -r /usr/share/doc/$1/copyright ]] ; then
+            $PAGER /usr/share/doc/$1/copyright
+        else
+            echo "No copyright file for package $1 found, sorry."
+            return 1
+        fi
+    }
+    _dcopyright() { _files -W /usr/share/doc -/ }
+    compdef _dcopyright dcopyright
+
+    #f3# View upstream's changelog of a given package
+    uchange() {
+        emulate -L zsh
+        if [[ -r /usr/share/doc/$1/changelog.gz ]] ; then
+            $PAGER /usr/share/doc/$1/changelog.gz
+        else
+            echo "No changelog for package $1 found, sorry."
+            return 1
+        fi
+    }
+    _uchange() { _files -W /usr/share/doc -/ }
+    compdef _uchange uchange
+fi
+
+# zsh profiling
+profile() {
+    ZSH_PROFILE_RC=1 $SHELL "$@"
+}
+
+#f1# Edit an alias via zle
+edalias() {
+    [[ -z "$1" ]] && { echo "Usage: edalias " ; return 1 } || vared aliases'[$1]' ;
+}
+compdef _aliases edalias
+
+#f1# Edit a function via zle
+edfunc() {
+    [[ -z "$1" ]] && { echo "Usage: edfunc " ; return 1 } || zed -f "$1" ;
+}
+compdef _functions edfunc
+
+# use it e.g. via 'Restart apache2'
+#m# f6 Start() \kbd{/etc/init.d/\em{process}}\quad\kbd{start}
+#m# f6 Restart() \kbd{/etc/init.d/\em{process}}\quad\kbd{restart}
+#m# f6 Stop() \kbd{/etc/init.d/\em{process}}\quad\kbd{stop}
+#m# f6 Reload() \kbd{/etc/init.d/\em{process}}\quad\kbd{reload}
+#m# f6 Force-Reload() \kbd{/etc/init.d/\em{process}}\quad\kbd{force-reload}
+#m# f6 Status() \kbd{/etc/init.d/\em{process}}\quad\kbd{status}
+if [[ -d /etc/init.d || -d /etc/service ]] ; then
+    __start_stop() {
+        local action_="${1:l}"  # e.g Start/Stop/Restart
+        local service_="$2"
+        local param_="$3"
+
+        local service_target_="$(readlink /etc/init.d/$service_)"
+        if [[ $service_target_ == "/usr/bin/sv" ]]; then
+            # runit
+            case "${action_}" in
+                start) if [[ ! -e /etc/service/$service_ ]]; then
+                           $SUDO ln -s "/etc/sv/$service_" "/etc/service/"
+                       else
+                           $SUDO "/etc/init.d/$service_" "${action_}" "$param_"
+                       fi ;;
+                # there is no reload in runits sysv emulation
+                reload) $SUDO "/etc/init.d/$service_" "force-reload" "$param_" ;;
+                *) $SUDO "/etc/init.d/$service_" "${action_}" "$param_" ;;
+            esac
+        else
+            # sysvinit
+            $SUDO "/etc/init.d/$service_" "${action_}" "$param_"
+        fi
+    }
+
+    _grmlinitd() {
+        local -a scripts
+        scripts=( /etc/init.d/*(x:t) )
+        _describe "service startup script" scripts
+    }
+
+    for i in Start Restart Stop Force-Reload Reload Status ; do
+        eval "$i() { __start_stop $i \"\$1\" \"\$2\" ; }"
+        compdef _grmlinitd $i
+    done
+fi
+
+#f1# Provides useful information on globbing
+H-Glob() {
+    echo -e "
+    /      directories
+    .      plain files
+    @      symbolic links
+    =      sockets
+    p      named pipes (FIFOs)
+    *      executable plain files (0100)
+    %      device files (character or block special)
+    %b     block special files
+    %c     character special files
+    r      owner-readable files (0400)
+    w      owner-writable files (0200)
+    x      owner-executable files (0100)
+    A      group-readable files (0040)
+    I      group-writable files (0020)
+    E      group-executable files (0010)
+    R      world-readable files (0004)
+    W      world-writable files (0002)
+    X      world-executable files (0001)
+    s      setuid files (04000)
+    S      setgid files (02000)
+    t      files with the sticky bit (01000)
+
+  print *(m-1)          # Files modified up to a day ago
+  print *(a1)           # Files accessed a day ago
+  print *(@)            # Just symlinks
+  print *(Lk+50)        # Files bigger than 50 kilobytes
+  print *(Lk-50)        # Files smaller than 50 kilobytes
+  print **/*.c          # All *.c files recursively starting in \$PWD
+  print **/*.c~file.c   # Same as above, but excluding 'file.c'
+  print (foo|bar).*     # Files starting with 'foo' or 'bar'
+  print *~*.*           # All Files that do not contain a dot
+  chmod 644 *(.^x)      # make all plain non-executable files publically readable
+  print -l *(.c|.h)     # Lists *.c and *.h
+  print **/*(g:users:)  # Recursively match all files that are owned by group 'users'
+  echo /proc/*/cwd(:h:t:s/self//) # Analogous to >ps ax | awk '{print $1}'<"
+}
+alias help-zshglob=H-Glob
+
+# grep for running process, like: 'any vim'
+any() {
+    emulate -L zsh
+    unsetopt KSH_ARRAYS
+    if [[ -z "$1" ]] ; then
+        echo "any - grep for process(es) by keyword" >&2
+        echo "Usage: any " >&2 ; return 1
+    else
+        ps xauwww | grep -i "${grep_options[@]}" "[${1[1]}]${1[2,-1]}"
+    fi
+}
+
+
+# After resuming from suspend, system is paging heavily, leading to very bad interactivity.
+# taken from $LINUX-KERNELSOURCE/Documentation/power/swsusp.txt
+[[ -r /proc/1/maps ]] && \
+deswap() {
+    print 'Reading /proc/[0-9]*/maps and sending output to /dev/null, this might take a while.'
+    cat $(sed -ne 's:.* /:/:p' /proc/[0-9]*/maps | sort -u | grep -v '^/dev/')  > /dev/null
+    print 'Finished, running "swapoff -a; swapon -a" may also be useful.'
+}
+
+# a wrapper for vim, that deals with title setting
+#   VIM_OPTIONS
+#       set this array to a set of options to vim you always want
+#       to have set when calling vim (in .zshrc.local), like:
+#           VIM_OPTIONS=( -p )
+#       This will cause vim to send every file given on the
+#       commandline to be send to it's own tab (needs vim7).
+if check_com vim; then
+    vim() {
+        VIM_PLEASE_SET_TITLE='yes' command vim ${VIM_OPTIONS} "$@"
+    }
+fi
+
+# make a backup of a file
+bk() {
+    cp -a "$1" "${1}_$(date --iso-8601=seconds)"
+}
+
+ssl_hashes=( sha512 sha256 sha1 md5 )
+
+for sh in ${ssl_hashes}; do
+    eval 'ssl-cert-'${sh}'() {
+        emulate -L zsh
+        if [[ -z $1 ]] ; then
+            printf '\''usage: %s \n'\'' "ssh-cert-'${sh}'"
+            return 1
+        fi
+        openssl x509 -noout -fingerprint -'${sh}' -in $1
+    }'
+done; unset sh
+
+ssl-cert-fingerprints() {
+    emulate -L zsh
+    local i
+    if [[ -z $1 ]] ; then
+        printf 'usage: ssl-cert-fingerprints \n'
+        return 1
+    fi
+    for i in ${ssl_hashes}
+        do ssl-cert-$i $1;
+    done
+}
+
+ssl-cert-info() {
+    emulate -L zsh
+    if [[ -z $1 ]] ; then
+        printf 'usage: ssl-cert-info \n'
+        return 1
+    fi
+    openssl x509 -noout -text -in $1
+    ssl-cert-fingerprints $1
+}
+
+# make sure our environment is clean regarding colors
+for color in BLUE RED GREEN CYAN YELLOW MAGENTA WHITE ; unset $color
+
+# "persistent history"
+# just write important commands you always need to ~/.important_commands
+if [[ -r ~/.important_commands ]] ; then
+    fc -R ~/.important_commands
+fi
+
+# load the lookup subsystem if it's available on the system
+zrcautoload lookupinit && lookupinit
+
+# variables
+
+# set terminal property (used e.g. by msgid-chooser)
+export COLORTERM="yes"
+
+# aliases
+
+# general
+#a2# Execute \kbd{du -sch}
+alias da='du -sch'
+#a2# Execute \kbd{jobs -l}
+alias j='jobs -l'
+
+# listing stuff
+#a2# Execute \kbd{ls -lSrah}
+alias dir="ls -lSrah"
+#a2# Only show dot-directories
+alias lad='ls -d .*(/)'
+#a2# Only show dot-files
+alias lsa='ls -a .*(.)'
+#a2# Only files with setgid/setuid/sticky flag
+alias lss='ls -l *(s,S,t)'
+#a2# Only show symlinks
+alias lsl='ls -l *(@)'
+#a2# Display only executables
+alias lsx='ls -l *(*)'
+#a2# Display world-{readable,writable,executable} files
+alias lsw='ls -ld *(R,W,X.^ND/)'
+#a2# Display the ten biggest files
+alias lsbig="ls -flh *(.OL[1,10])"
+#a2# Only show directories
+alias lsd='ls -d *(/)'
+#a2# Only show empty directories
+alias lse='ls -d *(/^F)'
+#a2# Display the ten newest files
+alias lsnew="ls -rtlh *(D.om[1,10])"
+#a2# Display the ten oldest files
+alias lsold="ls -rtlh *(D.Om[1,10])"
+#a2# Display the ten smallest files
+alias lssmall="ls -Srl *(.oL[1,10])"
+#a2# Display the ten newest directories and ten newest .directories
+alias lsnewdir="ls -rthdl *(/om[1,10]) .*(D/om[1,10])"
+#a2# Display the ten oldest directories and ten oldest .directories
+alias lsolddir="ls -rthdl *(/Om[1,10]) .*(D/Om[1,10])"
+
+# some useful aliases
+#a2# Remove current empty directory. Execute \kbd{cd ..; rmdir \$OLDCWD}
+alias rmcdir='cd ..; rmdir $OLDPWD || cd $OLDPWD'
+
+#a2# ssh with StrictHostKeyChecking=no \\&\quad and UserKnownHostsFile unset
+alias insecssh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
+#a2# scp with StrictHostKeyChecking=no \\&\quad and UserKnownHostsFile unset
+alias insecscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"'
+
+# work around non utf8 capable software in utf environment via $LANG and luit
+if check_com isutfenv && check_com luit ; then
+    if check_com -c mrxvt ; then
+        isutfenv && [[ -n "$LANG" ]] && \
+            alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit mrxvt"
+    fi
+
+    if check_com -c aterm ; then
+        isutfenv && [[ -n "$LANG" ]] && \
+            alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit aterm"
+    fi
+
+    if check_com -c centericq ; then
+        isutfenv && [[ -n "$LANG" ]] && \
+            alias centericq="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} luit centericq"
+    fi
+fi
+
+# useful functions
+
+#f5# Backup \kbd{file {\rm to} file\_timestamp}
+bk() {
+    emulate -L zsh
+    cp -b $1 $1_`date --iso-8601=m`
+}
+
+#f5# cd to directoy and list files
+cl() {
+    emulate -L zsh
+    cd $1 && ls -a
+}
+
+# smart cd function, allows switching to /etc when running 'cd /etc/fstab'
+cd() {
+    if (( ${#argv} == 1 )) && [[ -f ${1} ]]; then
+        [[ ! -e ${1:h} ]] && return 1
+        print "Correcting ${1} to ${1:h}"
+        builtin cd ${1:h}
+    else
+        builtin cd "$@"
+    fi
+}
+
+#f5# Create Directoy and \kbd{cd} to it
+mkcd() {
+    if (( ARGC != 1 )); then
+        printf 'usage: mkcd \n'
+        return 1;
+    fi
+    if [[ ! -d "$1" ]]; then
+        command mkdir -p "$1"
+    else
+        printf '`%s'\'' already exists: cd-ing.\n' "$1"
+    fi
+    builtin cd "$1"
+}
+
+#f5# Create temporary directory and \kbd{cd} to it
+cdt() {
+    local t
+    t=$(mktemp -d)
+    echo "$t"
+    builtin cd "$t"
+}
+
+#f5# List files which have been accessed within the last {\it n} days, {\it n} defaults to 1
+accessed() {
+    emulate -L zsh
+    print -l -- *(a-${1:-1})
+}
+
+#f5# List files which have been changed within the last {\it n} days, {\it n} defaults to 1
+changed() {
+    emulate -L zsh
+    print -l -- *(c-${1:-1})
+}
+
+#f5# List files which have been modified within the last {\it n} days, {\it n} defaults to 1
+modified() {
+    emulate -L zsh
+    print -l -- *(m-${1:-1})
+}
+# modified() was named new() in earlier versions, add an alias for backwards compatibility
+check_com new || alias new=modified
+
+# use colors when GNU grep with color-support
+#a2# Execute \kbd{grep -{}-color=auto}
+(( $#grep_options > 0 )) && alias grep='grep '${grep_options:+"${grep_options[*]}"}
+
+# Translate DE<=>EN
+# 'translate' looks up fot a word in a file with language-to-language
+# translations (field separator should be " : "). A typical wordlist looks
+# like at follows:
+#  | english-word : german-transmission
+# It's also only possible to translate english to german but not reciprocal.
+# Use the following oneliner to turn back the sort order:
+#  $ awk -F ':' '{ print $2" : "$1" "$3 }' \
+#    /usr/local/lib/words/en-de.ISO-8859-1.vok > ~/.translate/de-en.ISO-8859-1.vok
+#f5# Translates a word
+trans() {
+    emulate -L zsh
+    case "$1" in
+        -[dD]*)
+            translate -l de-en $2
+            ;;
+        -[eE]*)
+            translate -l en-de $2
+            ;;
+        *)
+            echo "Usage: $0 { -D | -E }"
+            echo "         -D == German to English"
+            echo "         -E == English to German"
+    esac
+}
+
+# Usage: simple-extract 
+# Using option -d deletes the original archive file.
+#f5# Smart archive extractor
+simple-extract() {
+    emulate -L zsh
+    setopt extended_glob noclobber
+    local DELETE_ORIGINAL DECOMP_CMD USES_STDIN USES_STDOUT GZTARGET WGET_CMD
+    local RC=0
+    zparseopts -D -E "d=DELETE_ORIGINAL"
+    for ARCHIVE in "${@}"; do
+        case $ARCHIVE in
+            *(tar.bz2|tbz2|tbz))
+                DECOMP_CMD="tar -xvjf -"
+                USES_STDIN=true
+                USES_STDOUT=false
+                ;;
+            *(tar.gz|tgz))
+                DECOMP_CMD="tar -xvzf -"
+                USES_STDIN=true
+                USES_STDOUT=false
+                ;;
+            *(tar.xz|txz|tar.lzma))
+                DECOMP_CMD="tar -xvJf -"
+                USES_STDIN=true
+                USES_STDOUT=false
+                ;;
+            *tar)
+                DECOMP_CMD="tar -xvf -"
+                USES_STDIN=true
+                USES_STDOUT=false
+                ;;
+            *rar)
+                DECOMP_CMD="unrar x"
+                USES_STDIN=false
+                USES_STDOUT=false
+                ;;
+            *lzh)
+                DECOMP_CMD="lha x"
+                USES_STDIN=false
+                USES_STDOUT=false
+                ;;
+            *7z)
+                DECOMP_CMD="7z x"
+                USES_STDIN=false
+                USES_STDOUT=false
+                ;;
+            *(zip|jar))
+                DECOMP_CMD="unzip"
+                USES_STDIN=false
+                USES_STDOUT=false
+                ;;
+            *deb)
+                DECOMP_CMD="ar -x"
+                USES_STDIN=false
+                USES_STDOUT=false
+                ;;
+            *bz2)
+                DECOMP_CMD="bzip2 -d -c -"
+                USES_STDIN=true
+                USES_STDOUT=true
+                ;;
+            *(gz|Z))
+                DECOMP_CMD="gzip -d -c -"
+                USES_STDIN=true
+                USES_STDOUT=true
+                ;;
+            *(xz|lzma))
+                DECOMP_CMD="xz -d -c -"
+                USES_STDIN=true
+                USES_STDOUT=true
+                ;;
+            *)
+                print "ERROR: '$ARCHIVE' has unrecognized archive type." >&2
+                RC=$((RC+1))
+                continue
+                ;;
+        esac
+
+        if ! check_com ${DECOMP_CMD[(w)1]}; then
+            echo "ERROR: ${DECOMP_CMD[(w)1]} not installed." >&2
+            RC=$((RC+2))
+            continue
+        fi
+
+        GZTARGET="${ARCHIVE:t:r}"
+        if [[ -f $ARCHIVE ]] ; then
+
+            print "Extracting '$ARCHIVE' ..."
+            if $USES_STDIN; then
+                if $USES_STDOUT; then
+                    ${=DECOMP_CMD} < "$ARCHIVE" > $GZTARGET
+                else
+                    ${=DECOMP_CMD} < "$ARCHIVE"
+                fi
+            else
+                if $USES_STDOUT; then
+                    ${=DECOMP_CMD} "$ARCHIVE" > $GZTARGET
+                else
+                    ${=DECOMP_CMD} "$ARCHIVE"
+                fi
+            fi
+            [[ $? -eq 0 && -n "$DELETE_ORIGINAL" ]] && rm -f "$ARCHIVE"
+
+        elif [[ "$ARCHIVE" == (#s)(https|http|ftp)://* ]] ; then
+            if check_com curl; then
+                WGET_CMD="curl -L -k -s -o -"
+            elif check_com wget; then
+                WGET_CMD="wget -q -O - --no-check-certificate"
+            else
+                print "ERROR: neither wget nor curl is installed" >&2
+                RC=$((RC+4))
+                continue
+            fi
+            print "Downloading and Extracting '$ARCHIVE' ..."
+            if $USES_STDIN; then
+                if $USES_STDOUT; then
+                    ${=WGET_CMD} "$ARCHIVE" | ${=DECOMP_CMD} > $GZTARGET
+                    RC=$((RC+$?))
+                else
+                    ${=WGET_CMD} "$ARCHIVE" | ${=DECOMP_CMD}
+                    RC=$((RC+$?))
+                fi
+            else
+                if $USES_STDOUT; then
+                    ${=DECOMP_CMD} =(${=WGET_CMD} "$ARCHIVE") > $GZTARGET
+                else
+                    ${=DECOMP_CMD} =(${=WGET_CMD} "$ARCHIVE")
+                fi
+            fi
+
+        else
+            print "ERROR: '$ARCHIVE' is neither a valid file nor a supported URI." >&2
+            RC=$((RC+8))
+        fi
+    done
+    return $RC
+}
+
+__archive_or_uri()
+{
+    _alternative \
+        'files:Archives:_files -g "*.(#l)(tar.bz2|tbz2|tbz|tar.gz|tgz|tar.xz|txz|tar.lzma|tar|rar|lzh|7z|zip|jar|deb|bz2|gz|Z|xz|lzma)"' \
+        '_urls:Remote Archives:_urls'
+}
+
+_simple_extract()
+{
+    _arguments \
+        '-d[delete original archivefile after extraction]' \
+        '*:Archive Or Uri:__archive_or_uri'
+}
+compdef _simple_extract simple-extract
+alias se=simple-extract
+
+#f5# Set all ulimit parameters to \kbd{unlimited}
+allulimit() {
+    ulimit -c unlimited
+    ulimit -d unlimited
+    ulimit -f unlimited
+    ulimit -l unlimited
+    ulimit -n unlimited
+    ulimit -s unlimited
+    ulimit -t unlimited
+}
+
+#f5# Change the xterm title from within GNU-screen
+xtrename() {
+    emulate -L zsh
+    if [[ $1 != "-f" ]] ; then
+        if [[ -z ${DISPLAY} ]] ; then
+            printf 'xtrename only makes sense in X11.\n'
+            return 1
+        fi
+    else
+        shift
+    fi
+    if [[ -z $1 ]] ; then
+        printf 'usage: xtrename [-f] "title for xterm"\n'
+        printf '  renames the title of xterm from _within_ screen.\n'
+        printf '  also works without screen.\n'
+        printf '  will not work if DISPLAY is unset, use -f to override.\n'
+        return 0
+    fi
+    print -n "\eP\e]0;${1}\C-G\e\\"
+    return 0
+}
+
+# Create small urls via http://goo.gl using curl(1).
+# API reference: https://code.google.com/apis/urlshortener/
+function zurl() {
+    emulate -L zsh
+    setopt extended_glob
+
+    if [[ -z $1 ]]; then
+        print "USAGE: zurl "
+        return 1
+    fi
+
+    local PN url prog api json contenttype item
+    local -a data
+    PN=$0
+    url=$1
+
+    # Prepend 'http://' to given URL where necessary for later output.
+    if [[ ${url} != http(s|)://* ]]; then
+        url='http://'${url}
+    fi
+
+    if check_com -c curl; then
+        prog=curl
+    else
+        print "curl is not available, but mandatory for ${PN}. Aborting."
+        return 1
+    fi
+    api='https://www.googleapis.com/urlshortener/v1/url'
+    contenttype="Content-Type: application/json"
+    json="{\"longUrl\": \"${url}\"}"
+    data=(${(f)"$($prog --silent -H ${contenttype} -d ${json} $api)"})
+    # Parse the response
+    for item in "${data[@]}"; do
+        case "$item" in
+            ' '#'"id":'*)
+                item=${item#*: \"}
+                item=${item%\",*}
+                printf '%s\n' "$item"
+                return 0
+                ;;
+        esac
+    done
+    return 1
+}
+
+#f2# Find history events by search pattern and list them by date.
+whatwhen()  {
+    emulate -L zsh
+    local usage help ident format_l format_s first_char remain first last
+    usage='USAGE: whatwhen [options]  '
+    help='Use `whatwhen -h'\'' for further explanations.'
+    ident=${(l,${#${:-Usage: }},, ,)}
+    format_l="${ident}%s\t\t\t%s\n"
+    format_s="${format_l//(\\t)##/\\t}"
+    # Make the first char of the word to search for case
+    # insensitive; e.g. [aA]
+    first_char=[${(L)1[1]}${(U)1[1]}]
+    remain=${1[2,-1]}
+    # Default search range is `-100'.
+    first=${2:-\-100}
+    # Optional, just used for ` ' given.
+    last=$3
+    case $1 in
+        ("")
+            printf '%s\n\n' 'ERROR: No search string specified. Aborting.'
+            printf '%s\n%s\n\n' ${usage} ${help} && return 1
+        ;;
+        (-h)
+            printf '%s\n\n' ${usage}
+            print 'OPTIONS:'
+            printf $format_l '-h' 'show help text'
+            print '\f'
+            print 'SEARCH RANGE:'
+            printf $format_l "'0'" 'the whole history,'
+            printf $format_l '-' 'offset to the current history number; (default: -100)'
+            printf $format_s '<[-]first> []' 'just searching within a give range'
+            printf '\n%s\n' 'EXAMPLES:'
+            printf ${format_l/(\\t)/} 'whatwhen grml' '# Range is set to -100 by default.'
+            printf $format_l 'whatwhen zsh -250'
+            printf $format_l 'whatwhen foo 1 99'
+        ;;
+        (\?)
+            printf '%s\n%s\n\n' ${usage} ${help} && return 1
+        ;;
+        (*)
+            # -l list results on stout rather than invoking $EDITOR.
+            # -i Print dates as in YYYY-MM-DD.
+            # -m Search for a - quoted - pattern within the history.
+            fc -li -m "*${first_char}${remain}*" $first $last
+        ;;
+    esac
+}
+
+# mercurial related stuff
+if check_com -c hg ; then
+    # gnu like diff for mercurial
+    # http://www.selenic.com/mercurial/wiki/index.cgi/TipsAndTricks
+    #f5# GNU like diff for mercurial
+    hgdi() {
+        emulate -L zsh
+        for i in $(hg status -marn "$@") ; diff -ubwd <(hg cat "$i") "$i"
+    }
+
+    # build debian package
+    #a2# Alias for \kbd{hg-buildpackage}
+    alias hbp='hg-buildpackage'
+
+    # execute commands on the versioned patch-queue from the current repos
+    alias mq='hg -R $(readlink -f $(hg root)/.hg/patches)'
+
+    # diffstat for specific version of a mercurial repository
+    #   hgstat      => display diffstat between last revision and tip
+    #   hgstat 1234 => display diffstat between revision 1234 and tip
+    #f5# Diffstat for specific version of a mercurial repos
+    hgstat() {
+        emulate -L zsh
+        [[ -n "$1" ]] && hg diff -r $1 -r tip | diffstat || hg export tip | diffstat
+    }
+
+fi # end of check whether we have the 'hg'-executable
+
+# grml-small cleanups
+
+# The following is used to remove zsh-config-items that do not work
+# in grml-small by default.
+# If you do not want these adjustments (for whatever reason), set
+# $GRMLSMALL_SPECIFIC to 0 in your .zshrc.pre file (which this configuration
+# sources if it is there).
+
+if (( GRMLSMALL_SPECIFIC > 0 )) && isgrmlsmall ; then
+
+    unset abk[V]
+    unalias    'V'      &> /dev/null
+    unfunction vman     &> /dev/null
+    unfunction viless   &> /dev/null
+    unfunction 2html    &> /dev/null
+
+    # manpages are not in grmlsmall
+    unfunction manzsh   &> /dev/null
+    unfunction man2     &> /dev/null
+
+fi
+
+zrclocal
+
+## genrefcard.pl settings
+
+### doc strings for external functions from files
+#m# f5 grml-wallpaper() Sets a wallpaper (try completion for possible values)
+
+### example: split functions-search 8,16,24,32
+#@# split functions-search 8
+
+## END OF FILE #################################################################
+# vim:filetype=zsh foldmethod=marker autoindent expandtab shiftwidth=4
+# Local variables:
+# mode: sh
+# End:
+
+if [ -f ~/.zsh_aliases ]; then
+        . ~/.zsh_aliases
+fi
+
+if [ -f ~/.zsh_dirstack ]; then
+	. ~/.zsh_dirstack
+fi
diff --git a/zsh/.zshrc_orig b/zsh/.zshrc_orig
new file mode 100644
index 0000000..55be3ab
--- /dev/null
+++ b/zsh/.zshrc_orig
@@ -0,0 +1,37 @@
+# Set up the prompt
+
+autoload -Uz promptinit
+promptinit
+prompt adam1
+
+setopt histignorealldups sharehistory
+
+# Use emacs keybindings even if our EDITOR is set to vi
+bindkey -e
+
+# Keep 1000 lines of history within the shell and save it to ~/.zsh_history:
+HISTSIZE=1000
+SAVEHIST=1000
+HISTFILE=~/.zsh_history
+
+# Use modern completion system
+autoload -Uz compinit
+compinit
+
+zstyle ':completion:*' auto-description 'specify: %d'
+zstyle ':completion:*' completer _expand _complete _correct _approximate
+zstyle ':completion:*' format 'Completing %d'
+zstyle ':completion:*' group-name ''
+zstyle ':completion:*' menu select=2
+eval "$(dircolors -b)"
+zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
+zstyle ':completion:*' list-colors ''
+zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
+zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*'
+zstyle ':completion:*' menu select=long
+zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
+zstyle ':completion:*' use-compctl false
+zstyle ':completion:*' verbose true
+
+zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
+zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'
diff --git a/zsh_aliases b/zsh_aliases
deleted file mode 100644
index ba2299b..0000000
--- a/zsh_aliases
+++ /dev/null
@@ -1,17 +0,0 @@
-alias q=exit
-alias -g H=' | head'
-alias -g T=' | tail'
-alias -g A=' \[ '
-alias -g G=' | grep'
-alias mv='mv -vi'
-alias cp='cp -vi'
-alias 'cd..'='cd ..'
-alias 'cd.'='cd'
-alias rm='rm -vi'
-alias k='l'
-alias ö='l'
-alias ks='ls'
-alias ös='ls'
-alias nano='nano -wc'
-alias du='du -h'
-alias down='sudo shutdown -hP now'
diff --git a/zsh_dirstack b/zsh_dirstack
deleted file mode 100644
index 88e6fe7..0000000
--- a/zsh_dirstack
+++ /dev/null
@@ -1,20 +0,0 @@
-alias 1='cd $dirstack[1]'
-alias 2='cd $dirstack[2]'
-alias 3='cd $dirstack[3]'
-alias 4='cd $dirstack[4]'
-alias 5='cd $dirstack[5]'
-alias 6='cd $dirstack[6]'
-alias 7='cd $dirstack[7]'
-alias 8='cd $dirstack[8]'
-alias 9='cd $dirstack[9]'
-alias 10='cd $dirstack[10]'
-alias 11='cd $dirstack[11]'
-alias 12='cd $dirstack[12]'
-alias 13='cd $dirstack[13]'
-alias 14='cd $dirstack[14]'
-alias 15='cd $dirstack[15]'
-alias 16='cd $dirstack[16]'
-alias 17='cd $dirstack[17]'
-alias 18='cd $dirstack[18]'
-alias 19='cd $dirstack[19]'
-alias dirhist='. ~/bin/dirhistory.sh'
-- 
cgit v1.2.3