Index du Forum

communauté marocaine des utilisateurs de backtrack
 
 Index du ForumFAQRechercherS’enregistrerConnexion
:: screenfetch-bt ::

 
Poster un nouveau sujet   Répondre au sujet     Index du Forum -> Outils, codes et astuces -> Codes et scripts
Sujet précédent :: Sujet suivant  
Auteur Message
Alien
Administrateur

Hors ligne

Inscrit le: 10 Mai 2012
Messages: 173

MessagePosté le: Lun 13 Aoû - 20:35 (2012)    Sujet du message: screenfetch-bt Répondre en citant

une modification de screenfetch pour backtrack.

Code:
#!/bin/bash
#
# screenFetch
#
# Script to fetch system and theme settings for screenshots in most mainstream
# Linux distributions.
#
# This script is released under the General Public License (GPL). Though it's open
# source and you are free to do with it as you please, I would appreciate if you would
# send any code modifications/additions upstream to me so that I can include them in
# the official release. Please do not claim this code as your own as I have worked
# very hard on this and am quite proud to call this script my own.
#
# 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/meowz
# to put forth suggestions/ideas. Thank you.
#

scriptVersion="2.5.0"

######################
# Settings for fetcher
######################

# This setting controls what ASCII logo is displayed. Available: Backtrack Dragon
# 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="host distro kernel uptime shell res de wm wmtheme gtk icons font background"
display=( host distro kernel uptime pkgs shell res de wm wmtheme gtk cpu 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 xmonad musca i3 ratpoison scrotwm spectrwm wmfs wmii beryl subtle e16 enlightenment sawfish emerald monsterwm dminiwm compiz Finder"
denames="gnome-session xfce-mcs-manage xfce4-session xfconfd ksmserver lxsession gnome-settings-daemon mate-session mate-settings-daemon Finder"

# Export theme settings
# screenFetch has the capability (on some WM's and GTK) to export your GTK and WM settings to an archive. Specify Yes if you want this and No if you do not.
exportTheme=

# 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=$(echo "screenFetch-`date +'%Y-%m-%d_%H-%M-%S'`.png")

# Verbose Setting - Set to 1 for verbose output.
verbosity=

function verboseOut () {
   echo -e "\033[1;31m:: \033[0m$1"
}

function errorOut () {
   echo -e "\033[1;37m[[ \033[1;31m! \033[1;37m]] \033[0m$1"
}

#############################################
#### CODE No need to edit past here CODE ####
#############################################

####################
# Static Variables
####################
c0="\033[0m" # Reset Text
bold="\033[1m" # Bold Text
underline="\033[4m" # Underline Text
display_index=0



####################
#  Color Defines
####################

detectColors() {
   my_lcolor=$(echo -n "$OPTARG" 2>/dev/null | awk -F',' '{ print $1 }')
   case $my_lcolor in
      0)  export my_lcolor='\033[30m';;
      1)  export my_lcolor='\033[31m';;
      2)  export my_lcolor='\033[32m';;
      3)  export my_lcolor='\033[33m';;
      4)  export my_lcolor='\033[34m';;
      5)  export my_lcolor='\033[35m';;
      6)  export my_lcolor='\033[36m';;
      7)  export my_lcolor='\033[37m';;
      8)  export my_lcolor='\033[1;30m';;
      9)  export my_lcolor='\033[1;31m';;
      10) export my_lcolor='\033[1;32m';;
      11) export my_lcolor='\033[1;33m';;
      12) export my_lcolor='\033[1;34m';;
      13) export my_lcolor='\033[1;35m';;
      14) export my_lcolor='\033[1;36m';;
      15) export my_lcolor='\033[1;37m';;
      *) unset my_lcolor; continue ;;
   esac
   my_hcolor=$(echo -n "$OPTARG" 2>/dev/null | awk -F',' '{ print $2 }')
   case $my_hcolor in
      0)  export my_hcolor='\033[30m';;
      1)  export my_hcolor='\033[31m';;
      2)  export my_hcolor='\033[32m';;
      3)  export my_hcolor='\033[33m';;
      4)  export my_hcolor='\033[34m';;
      5)  export my_hcolor='\033[35m';;
      6)  export my_hcolor='\033[36m';;
      7)  export my_hcolor='\033[37m';;
      8)  export my_hcolor='\033[1;30m';;
      9)  export my_hcolor='\033[1;31m';;
      10) export my_hcolor='\033[1;32m';;
      11) export my_hcolor='\033[1;33m';;
      12) export my_hcolor='\033[1;34m';;
      13) export my_hcolor='\033[1;35m';;
      14) export my_hcolor='\033[1;36m';;
      15) export my_hcolor='\033[1;37m';;
      *) unset my_hcolor; continue ;;
   esac
}


#####################
# Begin Flags Phase
#####################

while getopts ":hsmevVntlS:D:o:Bc:" flags; do
   case $flags in
      h)
         echo -e "${underline}Usage${c0}:"
         echo -e "  screenFetch [OPTIONAL FLAGS]"
         echo ""
         echo "screenFetch - a CLI Bash script to show system/theme info in screenshots."
         echo ""
         echo -e "${underline}Supported Distributions${c0}:      Arch Linux (Old and Current Logos), Linux Mint,"
         echo -e "               LMDE, Ubuntu, Crunchbang, Debian, Gentoo, Fedora, SolusOS,"
         echo -e "               Mandrake/Mandriva, Slackware, Frugalware, openSUSE, Mageia,"
         echo -e "               Peppermint, ParabolaGNU, Viperr, LinuxDeepin, Chakra, and BSD"
         echo -e "${underline}Supported Desktop Managers${c0}:   KDE, GNOME, XFCE, and LXDE, and Not Present"
         echo -e "${underline}Supported Window Managers${c0}:    PekWM, OpenBox, FluxBox, BlackBox, Xfwm4,"
         echo -e "               Metacity, StumpWM, KWin, IceWM, FVWM,"
         echo -e "               DWM, Awesome, XMonad, Musca, i3, WindowMaker,"
         echo -e "               Ratpoison, wmii, WMFS, ScrotWM, SpectrWM,"
         echo -e "               subtle, Emerald, E17 and Beryl."
         echo ""
         echo -e "${underline}Options${c0}:"
         echo -e "   ${bold}-v${c0}                 Verbose output."
         echo -e "   ${bold}-o 'OPTIONS'${c0}       Allows for setting script variables on the"
         echo -e "            command line. Must be in the following format..."
         echo -e "            'OPTION1=\"OPTIONARG1\";OPTION2=\"OPTIONARG2\"'"
         #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, Shell, Resolution, DE, WM,"
         #echo -e "            Win_theme, Theme, Icons, Font, ASCII, Background."
         echo -e "   ${bold}-n${c0}                 Do no display ASCII distribution logo."
         echo -e "   ${bold}-t${c0}                 Truncate output based on terminal width (Experimental!)."
         echo -e "   ${bold}-s(m)${c0}              Using this flag tells the script that you want it"
         echo -e "            to take a screenshot. Use the -m flag if you would like"
         echo -e "            to move it to a new location afterwards."
         echo -e "   ${bold}-B${c0}                 Enable background detection."
         echo -e "   ${bold}-e${c0}                 When this flag is specified, screenFetch will attempt"
         echo -e "            to export all of your theme settings and archive them"
         echo -e "            up for uploading."
         echo -e "   ${bold}-l${c0}                 Specify that you have a light background. This turns"
         echo -e "            all white text into dark gray text (in ascii logos and"
         echo -e "            in information output)."
         echo -e "   ${bold}-S 'COMMAND'${c0}       Here you can specify a custom screenshot command for"
         echo -e "            the script to execute. Surrounding quotes are required."
         echo -e "   ${bold}-D 'DISTRO'${c0}        Here you can specify your distribution for the script"
         echo -e "            to use. Surrounding quotes are required."
         echo -e "   ${bold}-V${c0}                 Display current script version."
         echo -e "   ${bold}-h${c0}                 Display this help."
         exit
      ;;
      s) screenshot=1; continue;;
      S) screenCommand=$OPTARG; continue;;
      m) hostshot=1; continue;;
      e) exportTheme=1; continue;;
      v) verbosity=1; continue;;
      V)
         echo -e $underline"screenFetch"$c0" - Version $scriptVersion"
         echo "Created by and licensed to Brett Bohnenkamper (kittykatt@silverirc.com)"
         echo "OS X porting done almost solely by shrx (http://shrx.github.com/)"
         echo ""
         echo "This is free software; see the source for copying conditions.  There is NO warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
         exit
      ;;
      D) distro=$OPTARG; continue;;
      t) truncateSet="Yes";;
      n) display_type="Text";;
      o) overrideOpts=$OPTARG; continue;;
      # c) my_color=$(echo "$OPTARG" | awk -F',' '{ print $1 }'); my_bgcolor=$(echo "$OPTARG" | awk -F',' '{ print $2 }'); continue;;
      c) detectColors "$OPTARGS"; continue;;
      # d) overrideDisplay=$OPTARG; continue;;
      # l) c1="\033[1;30m";;
      # B) background_detect="1"; continue;;
      :) 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
#if [[ "$overrideDisplay" ]]; then
#   [[ "$verbosity" -eq "1" ]] && verboseOut "Found 'd' flag in syntax. Overriding some display options..."
#   display="$overrideDisplay"
#fi


#########################
# Begin Detection Phase
#########################


# Host and User detection - Begin
detecthost () {
   myUser=$(echo "$USER")
   # net-tools is becoming deprecated
   # myHost=$(hostname)
   # myHost=$(cat /proc/sys/kernel/hostname)
   myHost=$(uname -n)
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding hostname and user...found as '$myUser@$myHost'"
}

# Distro Detection - Begin
detectdistro () {
   if [[ -z $distro ]]; then
      distro="Unknown"
      # LSB Release Check
      if which lsb_release >/dev/null 2>&1; then
         distro_detect=$(lsb_release -i | sed -e 's/Distributor ID://' -e 's/\t//g')
         if [ "$distro_detect" == "Ubuntu" ]; then distro="Ubuntu"; fi
         fi
         if [[ $(lsb_release -r | sed -e 's/Release://' -e 's/\t//g') != "n/a" ]] && [[ ! $distro_release ]]; then distro_release=$(lsb_release -r | sed -e 's/Release://' -e 's/\t//g') && distro_more="$distro $distro_release"; fi
         if [[ $(lsb_release -c | sed -e 's/Codename://' -e 's/\t//g') != "n/a" ]] && [[ ! $distro_codename ]]; then distro_codename=$(lsb_release -c | sed -e 's/Codename://' -e 's/\t//g') && distro_more="$distro $distro_codename"; fi
      fi
      # Existing File Check
      if [ "$distro" == "Unknown" ]; then
         #if [ $(uname -o 2>/dev/null) ]; then
         #   if [ `uname -o` == "Cygwin" ]; then fake_distro="$distro"; distro="Cygwin"; fi
         #fi
         if [ -f /etc/os-release ]; then
            distrib_id=$(awk -F'=' '/^ID/{print $2}' /etc/os-release 2>/dev/null)
            if [ "$distrib_id" == "frugalware" ]; then distro="Frugalware"; fi
         fi
         if [ -f /etc/debian_version ]; then distro="Debian"; fi
         if [ -f /etc/lsb-release ]; then
            if [ grep -i ubuntu /etc/lsb-release >/dev/null 2>&1 ]; then distro="Ubuntu";
         fi
      fi
   else
      declare -l lcase
      lcase=$distro
      case $lcase in
         ubuntu) distro="Ubuntu" ;;
      esac
   fi   
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding distro...found as '$distro $distro_release'"
}
# Distro Detection - End

# Find Number of Running Processes
# processnum="$(( $( ps aux | wc -l ) - 1 ))"

# Kernel Version Detection - Begin
detectkernel () {
   kernelArch=`uname -m`
   kernel=`echo $kernelArch $(uname -sr)`
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding kernel version...found as '$kernel'"
}
# Kernel Version Detection - End


# Uptime Detection - Begin
detectuptime () {
   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))
   else
      uptime=`awk -F. '{print $1}' /proc/uptime`
   fi
   secs=$((${uptime}%60))
   mins=$((${uptime}/60%60))
   hours=$((${uptime}/3600%24))
   days=$((${uptime}/86400))
   uptime="${mins}m"
   if [ "${hours}" -ne "0" ]; then
      uptime="${hours}h ${uptime}"
   fi
   if [ "${days}" -ne "0" ]; then
      uptime="${days}d ${uptime}"
   fi
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding current uptime...found as '$uptime'"
}
# Uptime Detection - End


# Package Count - Begin
detectpkgs () {
   pkgs="Unknown"
   case $distro in
      'Fuduntu'|'Ubuntu'|'Mint'|'SolusOS'|'Debian'|'LMDE'|'CrunchBang'|'Peppermint'|'LinuxDeepin') pkgs=$(dpkg --get-selections | wc -l) ;;
      'Mac OS X')
         if [ -d "/usr/local/bin" ]; then loc_pkgs=$(echo $(ls /usr/local/bin | wc -w)); pkgs="$loc_pkgs"; fi
         if [ $(which port) ]; then
            port_pkgs=$(port installed | wc -l)
            pkgs=$((${pkgs} + (${port_pkgs} -1)))
         fi
         if [ $(which brew) ]; then
            brew_pkgs=$(brew list -1 | wc -l)
            pkgs=$((${pkgs} + ${brew_pkgs}))
         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 () {
   if [ "$distro" == "Mac OS X" ]; then cpu=$(echo $(sysctl -n machdep.cpu.brand_string))
   else cpu=$(awk -F':' '/model name/{ print $2 }' /proc/cpuinfo | head -n 1 | tr -s " " | sed 's/^ //'); fi
   # cpu_mhz=$(awk -F':' '/cpu MHz/{ print $2 }' /proc/cpuinfo | head -n 1)
   # cpu_ghz=$(echo "scale=2; ${cpu_mhz} / 1000" | bc )
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding current CPU...found as '$cpu'"
}
# CPU Detection - End



# Memory Detection - Begin
detectmem () {
   if [ "$distro" == "Mac OS X" ]; then
      totalmem=$(echo "$(sysctl -n hw.memsize)"/1024^2|bc)
      # usedmem=$(echo "$(sysctl -n hw.usermem)"/1024^2|bc)
      usedmem=$(echo "$(top -l 1 | awk '/PhysMem/' | grep -o \[0-9]\*M | tail -2 | head -1)B")
   else
      total_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
      totalmem=$((${total_mem}/1024))
      if free | grep -q '/cache'; then
         used_mem=$(free | awk '/cache:/ { print $3 }')
         usedmem=$((${used_mem}/1024))
      else
         free_mem=$(awk '/MemFree/ { print $2 }' /proc/meminfo)
         used_mem=$((${total_mem} - ${free_mem}))
         usedmem=$((${used_mem}/1024))
      fi
   fi
   mem="${usedmem}MB / ${totalmem}MB"
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding current RAM usage...found as '$mem'"
}
# Memory Detection - End


# Shell Detection - Begin
detectshell () {
   myShell=$(echo $SHELL | awk -F"/" '{print $NF}')
   # myShell=${SHELL##*/}
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding current shell...found as '$myShell'"
}
# Shell Detection - End


# Resolution Detection - Begin
detectres () {
   if [[ `ps aux` =~ "Finder" ]]; then
      res1=$(system_profiler SPDisplaysDataType| awk '/Resolution:/ {print $2}')
      res2=$(system_profiler SPDisplaysDataType| awk '/Resolution:/ {print $4}')
      xResolution=$(echo $res1"x"$res2)
   elif [[ -n $DISPLAY ]]; then
      xResolution=$(xdpyinfo | sed -n 's/.*dim.* \([0-9]*x[0-9]*\) .*/\1/pg' | sed ':a;N;$!ba;s/\n/ /g')
   # elif [[ "$distro" == "Cygwin" ]]; then
   #    xResolution="$(scrot --resolution)"
   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"
      for each in $denames; do
         if [[ `ps aux` =~ "$each" ]]; then
            if [[ "$each" == "gnome-session" ]] || [[ "$each" == "gnome-settings-daemon" ]]; then
               ps -ef | grep gnome-shell | grep -v grep > /dev/null 2>&1
               if [[ "$?" -eq "0" ]]; then
                  # FIXME - making a very liberal assumption on this ...
                  DEver=$(gnome-session-properties --version | awk '{ print $2 }')
               else
                  DEver=$(gnome-session --version | awk {'print $NF'})
               fi
               DE="GNOME"
            fi
            if [[ "$each" == "mate-session" ]] || [[ "$each" == "mate-settings-daemon" ]]; then
               DE="MATE"
               DEver=$(mate-session --version | awk {'print $NF'})
            fi
            if [[ "$each" == "xfce4-session" ]]; then
               DE="XFCE"
               DEver=$(xfce4-settings-manager --version | grep -m 1 "" | awk {'print $2'})
            fi
            if [[ "$each" == "ksmserver" ]] ; then
               DE="KDE"
               DEver=$(kwin --version | awk '/^Qt/ {data="Qt v" $2};/^KDE/ {data=$2 " (" data ")"};END{print data}')
            fi
            if [[ "$each" == "lxsession" ]]; then
               DE="LXDE"
               DEver=$(lxpanel -v)
            fi
            if [ "$each" == "Finder" ]; then DE="Aqua"; fi
            # if [  "$DE" == "Not Present" -a "$distro" == "Cygwin" ]; then
            #   winver="$(cmd /c wmic os get version | grep -o '^[0-9]')"
            #   if [ "$winver" == "6" ]; then
            #      DE="Aero"
            #   elif [ "$winver" == "5" ]; then
            #      DE="Luna"
            #    fi
            # fi
         fi
      done
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding desktop environment...found as '$DE'"
}
### DE Detection - End


# WM Detection - Begin
detectwm () {
   WM="Not Found"
   # if [ "$distro" == "Cygwin" ]; then
   #    WM="Explorer"
   # else
      userId="$(id -u ${USER})"
      for each in $wmnames; do
         PID="$(pgrep -U ${userId} $each)"
         if [ "$PID" ]; then
            case $each in
               'fluxbox') WM="FluxBox";;
               'openbox') WM="OpenBox";;
               'blackbox') WM="Blackbox";;
               'xfwm4') WM="Xfwm4";;
               'metacity') WM="Metacity";;
               'kwin') WM="KWin";;
               'icewm') WM="IceWM";;
               'pekwm') WM="PekWM";;
               'fvwm') WM="FVWM";;
               'dwm') WM="DWM";;
               'awesome') WM="Awesome";;
               'wmaker') WM="WindowMaker";;
               'stumpwm') WM="StumpWM";;
               'xmonad') WM="XMonad";;
               'musca') WM="Musca";;
               'i3') WM="i3";;
               'ratpoison') WM="Ratpoison";;
               'scrotwm') WM="ScrotWM";;
               'spectrwm') WM="SpectrWM";;
               'wmfs') WM="WMFS";;
               'wmii') WM="wmii";;
               'subtle') WM="subtle";;
               'e16') WM="E16";;
               'enlightenment') WM="E17";;
               'emerald') WM="Emerald";;
               'sawfish') WM="Sawfish";;
               'beryl') WM="Beryl";;
               'monsterwm') WM="monsterwm";;
               'dminiwm') WM="dminiwm";;
               'compiz') WM="Compiz";;
               'Finder') WM="Quartz Compositor";;
            esac
         fi
      done
   # 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
      'PekWM') if [ -f $HOME/.pekwm/config ]; then Win_theme="$(awk -F"/" '/Theme/ {gsub(/\"/,""); print $NF}' $HOME/.pekwm/config)"; fi;;
      'OpenBox')
         if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/openbox/rc.xml ]; then
            Win_theme="$(awk -F"[<,>]" '/<theme/ { getline; print $3 }' ${XDG_CONFIG_HOME:-${HOME}/.config}/openbox/rc.xml)";
         elif [[ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/openbox/lxde-rc.xml && $DE == "LXDE" ]]; then
            Win_theme="$(awk -F"[<,>]" '/<theme/ { getline; print $3 }' ${XDG_CONFIG_HOME:-${HOME}/.config}/openbox/lxde-rc.xml)";
         fi;;
      'FluxBox') if [ -f $HOME/.fluxbox/init ]; then Win_theme="$(awk -F"/" '/styleFile/ {print $NF}' $HOME/.fluxbox/init)"; fi;;
      'BlackBox') if [ -f $HOME/.blackboxrc ]; then Win_theme="$(awk -F"/" '/styleFile/ {print $NF}' $HOME/.blackboxrc)"; fi;;
      'Metacity') if [ "`gconftool-2 -g /apps/metacity/general/theme`" ]; then Win_theme="$(gconftool-2 -g /apps/metacity/general/theme)"; fi ;;
      'Xfwm4') if [ -f ${XDG_CONFIG_HOME:-${HOME}/.config}/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml ]; then Win_theme="$(xfconf-query -c xfwm4 -p /general/theme)"; fi;;
      'IceWM') if [ -f $HOME/.icewm/theme ]; then Win_theme="$(awk -F"[\",/]" '!/#/ {print $2}' $HOME/.icewm/theme)"; fi;;
      'KWin') if [ -f $HOME/.kde/share/config/plasmarc ]; then Win_theme="$(grep -F -A 1 \[Theme\] $HOME/.kde/share/config/plasmarc | awk -F"=" '/^name=/ { getline; print $2 }')"; if [ -z $Win_theme ]; then Win_theme="Air"; fi; else Win_theme="Not Present"; fi;;
      '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;;
      'FVWM') Win_theme="Not Present";;
      'DWM') Win_theme="Not Present";;
      '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)"; fi;;
      'WindowMaker') Win_theme="Not Present";;
      'XMonad') Win_theme="Not Present";;
      'Musca') Win_theme="Not Present";;
      'i3') Win_theme="Not Present";;
      'Ratpoison') Win_theme="Not Present";;
      'ScrotWM') Win_theme="Not Present";;
      'SpectrWM') Win_theme="Not Present";;
      'WMFS') Win_theme="Not Present";;
      'wmii') Win_theme="Not Present";;
      'subtle') Win_theme="Not Present";;
      'E16') Win_theme="$(awk -F"= " '/theme.name/ {print $2}' $HOME/.e16/e_config--0.0.cfg)";;
      #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};;
      'Sawfish') Win_theme="$(awk -F")" '/\(custom-set-typed-variable/{print $2}' $HOME/.sawfish/custom | sed 's/ (quote //')";;
      'Beryl') Win_theme="Not Present";;
      'monsterwm') Win_theme="Not Present";;
      'dminiwm') Win_theme="Not Present";;
      'Compiz') Win_theme="$(gsettings get org.gnome.desktop.wm.preferences theme | tr -d \"\'\")";;
      'Finder') Win_theme="not present";;
      'Explorer')
         ThemeFile="$(reg query 'HKCU\Software\Microsoft\Windows\CurrentVersion\Themes' /v 'CurrentTheme' | grep -o '[A-Z]:\\.*')"
         ThemeFile="$(cygpath -u $ThemeFile)"
         Win_theme="$(cat $ThemeFile | grep '^Path=.*$' | grep -o '[0-9A-z. ]*$' | grep -o '^[0-9A-z ]*')"
      ;;
   esac
   #if [ "$Win_theme" == "Not Found" -a "$distro" == "Cygwin" ]; then # we are in for a long ride.
   #   ThemeFile="$(reg query 'HKCU\Software\Microsoft\Windows\CurrentVersion\Themes' /v 'CurrentTheme' | grep -o '[A-Z]:\\.*')"
   #   ThemeFile="$(cygpath -u $ThemeFile)"
   #   Win_theme="$(cat $ThemeFile | grep '^Path=.*$' | grep -o '[0-9A-z. ]*$' | grep -o '^[0-9A-z ]*')"
   #fi
   [[ "$verbosity" -eq "1" ]] && verboseOut "Finding window manager theme...found as '$Win_theme'"
}
# WM Theme Detection - END

# GTK Theme\Icon\Font Detection - BEGIN
detectgtk () {
   gtk2Theme="Not Found"
   gtk3Theme="Not Found"
   gtkIcons="Not Found"
   gtkFont="Not Found"
   case $DE in
      'KDE')   # Desktop Environment found as "KDE"
         if [ -a $HOME/.kde/share/config/kdeglobals ]; then
            if grep -q "widgetStyle=" $HOME/.kde/share/config/kdeglobals; then
               gtk2Theme=$(awk -F"=" '/widgetStyle=/ {print $2}' $HOME/.kde/share/config/kdeglobals)
            elif grep -q "colorScheme=" $HOME/.kde/share/config/kdeglobals; then
               gtk2Theme=$(awk -F"=" '/colorScheme=/ {print $2}' $HOME/.kde/share/config/kdeglobals)
            fi

            if grep -q "Theme=" $HOME/.kde/share/config/kdeglobals; then
               gtkIcons=$(awk -F"=" '/Theme=/ {print $2}' $HOME/.kde/share/config/kdeglobals)
            fi

            if grep -q "Font=" $HOME/.kde/share/config/kdeglobals; then
               gtkFont=$(awk -F"=" '/font=/ {print $2}' $HOME/.kde/share/config/kdeglobals)
            fi
         fi
      ;;
      'GNOME'|'MATE') # Desktop Environment found as "GNOME"
         if which gconftool-2 >/dev/null 2>&1; then
            gtk2Theme=$(gconftool-2 -g /desktop/gnome/interface/gtk_theme)
         fi

         if which gconftool-2 >/dev/null 2>&1; then
            gtkIcons=$(gconftool-2 -g /desktop/gnome/interface/icon_theme)
         fi

         if which gconftool-2 >/dev/null 2>&1; then
            gtkFont=$(gconftool-2 -g /desktop/gnome/interface/font_name)
         fi
         if [ "$background_detect" == "1" ]; then
            if which gconftool-2 >/dev/null 2>&1; then
               gtkBackgroundFull=$(gconftool-2 -g /desktop/gnome/background/picture_filename)
               gtkBackground=$(echo "$gtkBackgroundFull" | awk -F"/" '{print $NF}')
            fi
         fi
      ;;
      'XFCE')   # Desktop Environment found as "XFCE"
         if which xfconf-query >/dev/null 2>&1; then
            gtk2Theme=$(xfconf-query -c xsettings -p /Net/ThemeName)
         fi

         if which xfconf-query >/dev/null 2>&1; then
            gtkIcons=$(xfconf-query -c xsettings -p /Net/IconThemeName)
         fi

         if which 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"
         else
            lxdeconf="/lxsession/LXDE/desktop.conf"
         fi
         # TODO: Clean me.
         if grep -q "sNet\/ThemeName" ${XDG_CONFIG_HOME:-${HOME}/.config}$lxdeconf; 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; 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; 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'"' '/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  && ! $gtk2Theme ]; 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  && ! $gtkIcons ]; 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

         # 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 [[ `ps aux` =~ "Finder" ]]; 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

         # 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


#######################
# End Detection Phase
#######################

takeShot () {
   if [[ -z $screenCommand ]]; then
      if [[ "$hostshot" == "1" ]]; then
         if [ "$distro" == "Mac OS X" ]; then screencapture -xT 3 "${shotfile}"
         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 screencapture -xT 3 "${shotfile}"
         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
   case $distro in
      "Ubuntu")
         c1="\033[1;37m" # White
         c2="\033[1;31m" # Light Red
         c3="\033[1;33m" # Bold Yellow
         if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
         startline="1"
         fulloutput=("$c2                          "

"$c1  ..:-::::_____.                                  %s"     
"$c1         . ---~+|=_,                             %s"     
"$c1                   -\"<|,                         %s"     
"$c1                       ~<_                       %s"     
"$c1               ..________=:                      %s"     
"$c1       .__a|||""""^^^^^^+::                          %s"     
"$c1  __>~\"^-.            .._.;                      %s"     
"$c1  -               _=||++~-=                      %s"     
"$c1               _=>^-      :;                     %s"     
"$c1            ._>~           <=,.                  %s"     
"$c1          .=~              =||++=;.  .           %s"     
"$c1        _:-               =i+----:==.. .         %s"   
"$c1      .:                 =i-        :;. .        %s"   
"$c1                        :i;           -:.        %s" 
"$c1                        |>              :.       %s"
"$c1                       .i;              -..      %s"
"$c1                                           ")
      ;;
   esac

   # Truncate lines based on terminal width.
   if [ "$truncateSet" == "Yes" ]; then
      n=${#fulloutput[*]}
      for ((i=0;i<n;i++)); do
         targetPercent=100
         termWidth=$(tput cols)
         # stringReal=$(echo "${fulloutput[i]}" | sed -e 's/\x1b\[[0-9];[0-9]*m\?//g')
         stringReal=$(echo "${fulloutput[i]}" | sed -e 's/\\e\[[0-9];[0-9]*m//g' -e 's/\\e\[[0-9]*m//g')
         stringLength=${#stringReal}
         targetLength="$((termWidth*targetPercent/100))"
         if [ "$stringLength" -le "$targetLength" ]; then
            echo -e "${fulloutput[i]}"$c0
         elif [ "$stringLength" -gt "$targetLength" ]; then
             echo "${fulloutput[i]:0:$targetLength}..."$c0
         fi
         # Debugging widths
         # echo "Term Width: $termWidth"
         # echo "String Length: $stringLength"
      done
   else
      n=${#fulloutput[*]}
      for ((i=0;i<n;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.
   case $distro in
      "Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake"|"Chakra") labelcolor="\e[1;34m";;
      "Arch Linux"|"Frugalware"|"Mageia") labelcolor="\e[1;36m";;
      "Mint"|"LMDE"|"openSUSE"|"LinuxDeepin") labelcolor="\e[1;32m";;
      "Ubuntu"|"Debian"|"BSD"|"Red Hat Linux"|"Peppermint"|"Cygwin"|"Fuduntu") labelcolor="\e[1;31m";;
      "CrunchBang"|"SolusOS"|"Viperr") labelcolor="\e[1;30m";;
      "Gentoo"|"ParabolaGNU/Linux-libre") labelcolor="\e[1;35m";;
      "Slackware") labelcolor="\e[1;34m";;
      "Mac OS X") labelcolor="\033[1;34m";;
      *) labelcolor="\e[1;33m";;
   esac
   [[ "$my_lcolor" ]] && labelcolor="${my_lcolor}"
   # 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 [[ "${display[@]}" =~ "host" ]]; then myinfo=$(echo -e "${labelcolor}${myUser}$textcolor$bold@${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
      #   if [[ -n "$fake_distro" ]]; then
      #      distro_more="$fake_distro"
      #   else
      #      distro_more=$(wmic os get caption | grep Microsoft | sed 's/[ \t]*$//')
      #   fi
      #   sysArch=$(wmic os get OSArchitecture | grep ^[0-9] | sed 's/[ \t]*$//')
      else
         sysArch=`uname -m`
         if [ -n "$distro_more" ]; then mydistro=$(echo -e "$labelcolor OS:$textcolor $distro_more $sysArch")
         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 [[ "${display[@]}" =~ "res" ]]; then myres=$(echo -e "$labelcolor Resolution:${textcolor} $xResolution"); out_array=( "${out_array[@]}" "$myres" ); ((display_index++)); fi
   if [[ "${display[@]}" =~ "de" ]]; then myde=$(echo -e "$labelcolor DE:$textcolor $DE"); out_array=( "${out_array[@]}" "$myde" ); ((display_index++)); fi
   if [[ "${display[@]}" =~ "wm" ]]; then mywm=$(echo -e "$labelcolor WM:$textcolor $WM"); out_array=( "${out_array[@]}" "$mywm" ); ((display_index++)); fi
   if [[ "${display[@]}" =~ "wmtheme" ]]; then mywmtheme=$(echo -e "$labelcolor WM Theme:$textcolor $Win_theme"); out_array=( "${out_array[@]}" "$mywmtheme" ); ((display_index++)); fi
   if [[ "${display[@]}" =~ "gtk" ]]; then
      if [ "$distro" == "Mac OS X" ]; then
         myicons=$(echo -e "$labelcolor Icon Theme:$textcolor $gtkIcons"); out_array=( "${out_array[@]}" "$myicons" ); ((display_index++))
         myfont=$(echo -e "$labelcolor Font:$textcolor $gtkFont"); out_array=( "${out_array[@]}" "$myfont" ); ((display_index++))
      else
         mygtk2=$(echo -e "$labelcolor GTK2 Theme:$textcolor $gtk2Theme"); out_array=( "${out_array[@]}" "$mygtk2" ); ((display_index++))
         mygtk3=$(echo -e "$labelcolor GTK3 Theme:$textcolor $gtk3Theme"); out_array=( "${out_array[@]}" "$mygtk3" ); ((display_index++))
         myicons=$(echo -e "$labelcolor Icon Theme:$textcolor $gtkIcons"); out_array=( "${out_array[@]}" "$myicons" ); ((display_index++))
         myfont=$(echo -e "$labelcolor Font:$textcolor $gtkFont"); out_array=( "${out_array[@]}" "$myfont" ); ((display_index++))
         # [ "$gtkBackground" ] && mybg=$(echo -e "$labelcolor BG:$textcolor $gtkBackground"); out_array=( "${out_array[@]}" "$mybg" ); ((display_index++))
      fi
   fi
   if [[ "${display[@]}" =~ "cpu" ]]; then mycpu=$(echo -e "$labelcolor CPU:$textcolor $cpu"); out_array=( "${out_array[@]}" "$mycpu" ); ((display_index++)); fi
   if [[ "${display[@]}" =~ "mem" ]]; then mymem=$(echo -e "$labelcolor RAM:$textcolor $mem"); out_array=( "${out_array[@]}" "$mymem" ); ((display_index++)); fi
   if [[ "$display_type" == "ASCII" ]]; then
      asciiText
   else
      echo -e "$mydistro"
      echo -e "$mykernel"
      echo -e "$myuptime"
      echo -e "$myshell"
      echo -e "$myres"
      echo -e "$myde"
      echo -e "$mywm"
      echo -e "$mywmtheme"
      echo -e "$mygtk2"
      echo -e "$mygtk3"
      echo -e "$myicons"
      echo -e "$myfont"
      echo -e "$mycpu"
      echo -e "$myram"
   fi
}

########
# Theme Exporting (Experimental!)
########
themeExport () {
   WM=$(echo "$mywm" | awk '{print $NF}')
   if [[ ! -d /tmp/screenfetch-export ]]; then mkdir -p "/tmp/screenfetch-export/Icons" & mkdir -p "/tmp/screenfetch-export/GTK-Theme" & mkdir -p "/tmp/screenfetch-export/WM-${WM}" ; fi
   if [[ "$WM" ]]; then
      if [[ "$WM" =~ "Openbox" ]]; then
         if [[ "$Win_theme" != "Not Found" ]]; then
            if [[ -d "$HOME/.themes/$Win_theme" ]]; then
               cp -r "$HOME/.themes/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            fi
         fi
      elif [[ "$WM" =~ "Fluxbox" ]]; then
         if [[ "$Win_theme" != "Not Found" ]]; then
            if [[ -d "$HOME/.fluxbox/styles/$Win_theme" ]]; then
               cp -r "$HOME/.fluxbox/styles/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            fi
         fi
      elif [[ "$WM" =~ "Blackbox" ]]; then
         if [[ "$Win_theme" != "Not Found" ]]; then
            if [[ -d "$HOME/.blackbox/styles/$Win_theme" ]]; then
               cp -r "$HOME/.blackbox/styles/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            elif [[ -d "/usr/share/blackbox/styles/$Win_theme" ]]; then
               cp -r "/usr/share/blackbox/styles/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            fi
         fi
      elif [[ "$WM" =~ "PekWM" ]]; then
         if [[ "$Win_theme" != "Not Found" ]]; then
            if [[ -d "$HOME/.pekwm/themes/$Win_theme" ]]; then
               cp -r "$HOME/.pekwm/themes/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            fi
         fi
      elif [[ "$WM" =~ "Metacity" ]]; then
         if [[ "$Win_theme" != "Not Found" ]]; then
            if [[ -d "$HOME/.themes/$Win_theme" ]]; then
               cp -r "$HOME/.themes/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            elif [[ -d "/usr/share/themes/$Win_theme" ]]; then
               cp -r "/usr/share/themes/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            fi
         fi
      elif [[ "$WM" =~ "Xfwm4" ]]; then
         if [[ "$Win_theme" != "Not Found" ]]; then
            WM_theme=$(echo "$Win_theme" | awk '{print $NF}')
            if [[ -d "$HOME/.themes/$Win_theme" ]]; then
               cp -r "$HOME/.themes/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            elif [[ -d "/usr/share/themes/$Win_theme" ]]; then
               cp -r "/usr/share/themes/$Win_theme" "/tmp/screenfetch-export/WM-${WM}/$Win_theme" &>/dev/null
               [[ "$verbosity" -eq "1" ]] && verboseOut "Found WM theme folder. Transferring to /tmp/screenfetch-export/..."
            fi
         fi
      fi
   fi
   if [[ "$gtkBackgroundFull" ]]; then
      cp "$gtkBackgroundFull" /tmp/screenfetch-export/
      [[ "$verbosity" -eq "1" ]] && verboseOut "Found BG file. Transferring to /tmp/screenfetch-export/..."
   fi
   if [[ "$mygtk" ]]; then
      GTK_theme=$(echo "$mygtk" | awk '{print $NF}')
      if [ -d "/usr/share/themes/$GTK_theme" ]; then
         cp -r "/usr/share/themes/$GTK_theme" "/tmp/screenfetch-export/GTK/Theme/$GTK_theme" &>/dev/null
         [[ "$verbosity" -eq "1" ]] && verboseOut "Found GTK theme folder. Transferring to /tmp/screenfetch-export/..."
      fi
   fi
   if [[ "$myicons" ]]; then
      GTK_icons=$(echo "$myicons" | awk '{print $NF}')
      if [ -d "/usr/share/icons/$GTK_icons" ]; then
         cp -r "/usr/share/icons/$GTK_icons" "/tmp/screenfetch-export/GTK/Icons/$GTK_icons" &>/dev/null
         [[ "$verbosity" -eq "1" ]] && verboseOut "Found GTK icons theme folder. Transferring to /tmp/screenfetch-export/..."
      fi
      if [ -d "$HOME/.icons/$GTK_icons" ]; then
         cp -r "$HOME/.icons/$GTK_icons" "/tmp/screenfetch-export/GTK/Icons/$GTK_icons" &>/dev/null
         [[ "$verbosity" -eq "1" ]] && verboseOut "Found GTK icons theme folder. Transferring to /tmp/screenfetch-export/..."
      fi
   fi
   if [[ "$myfont" ]]; then
      GTK_font=$(echo "$myfont" | awk '{print $NF}')
      if [ -d "/usr/share/fonts/$GTK_font" ]; then
         cp -r "/usr/share/fonts/$GTK_font" "/tmp/screenfetch-export/GTK/$GTK_font" &>/dev/null
         [[ "$verbosity" -eq "1" ]] && verboseOut "Found GTK font. Transferring to /tmp/screenfetch-export/..."
      elif [ -d "$HOME/.fonts/$GTK_font" ]; then
         cp -r "$HOME/.fonts/$GTK_font" "/tmp/screenfetch-export/GTK/$GTK_font" &>/dev/null
         [[ "$verbosity" -eq "1" ]] && verboseOut "Found GTK font. Transferring to /tmp/screenfetch-export/..."
      fi
   fi
   if [ "$screenshot" == "1" ]; then
      if [ -f "${shotfile}" ]; then
         cp "${shotfile}" "/tmp/screenfetch-export/"
         [[ "$verbosity" -eq "1" ]] && verboseOut "Found screenshot. Transferring to /tmp/screenfetch-export/..."
      fi
   fi
   cd /tmp/screenfetch-export/
   [[ "$verbosity" -eq "1" ]] && verboseOut "Creating screenfetch-export.tar.gz archive in /tmp/screenfetch-export/...."
   tar -czf screenfetch-export.tar.gz ../screenfetch-export &>/dev/null
   mv /tmp/screenfetch-export/screenfetch-export.tar.gz $HOME/
   echo -e "${bold}==>${c0} Archive created in /tmp/ and moved to $HOME. Removing /tmp/screenfetch-export/..."
   rm -rf /tmp/screenfetch-export/
}


##################
# Let's Do This!
##################

for i in "${display[@]}"; do

   if [[ $i =~ wm ]]; then
       ! [[ $WM  ]] && detectwm;
       ! [[ $Win_theme ]] && detectwmtheme;
   else   
      [[ "${display[*]}" =~ "$i" ]] && detect${i}
   fi
done

if [[ -f "$HOME/.screenfetchOR" ]]; then
    vars=("$(cat $HOME/.screenfetchOR | grep '^.*=.*$')")
    for v in "${vars[@]}"; do #=$(echo $v | sed -e 's/^.*=//')"
        varname="$(echo $v | sed -e 's/=.*$//')"
        eval $varname="\"$(echo $v | sed -e 's/^.*=//')\""
    done
fi

infoDisplay
[ "$screenshot" == "1" ] && takeShot
[ "$exportTheme" == "1" ] && themeExport

exit 0
Les membres suivants remercient Alien pour ce message :
Inf3rnus (10/09/12)


Revenir en haut
Publicité






MessagePosté le: Lun 13 Aoû - 20:35 (2012)    Sujet du message: Publicité

PublicitéSupprimer les publicités ?
Revenir en haut
Inf3rnus


Hors ligne

Inscrit le: 10 Mai 2012
Messages: 49

MessagePosté le: Lun 10 Sep - 13:01 (2012)    Sujet du message: screenfetch-bt Répondre en citant

Thanks Alien Okay mais un petit spoiler peut être serai un plus dans la prez du messsage ..... Rolling Eyes have a nice day Okay
_________________


Revenir en haut
Alien
Administrateur

Hors ligne

Inscrit le: 10 Mai 2012
Messages: 173

MessagePosté le: Lun 10 Sep - 19:16 (2012)    Sujet du message: screenfetch-bt Répondre en citant

Je devrais également en faire une capture.

Revenir en haut
Inf3rnus


Hors ligne

Inscrit le: 10 Mai 2012
Messages: 49

MessagePosté le: Mer 12 Sep - 00:24 (2012)    Sujet du message: screenfetch-bt Répondre en citant

Pourquoi pas car pour etre honnete suis po sur de ce a quoi ca sert :/
_________________


Revenir en haut
ZeRo-AbSoLu


Hors ligne

Inscrit le: 30 Aoû 2012
Messages: 74
Localisation: Dans le Deep

MessagePosté le: Mer 12 Sep - 17:00 (2012)    Sujet du message: screenfetch-bt Répondre en citant

A quoi ça sert ? ( desole je debute) 
_________________
Mess like the bests Die like the rest


Revenir en haut
Skype
Alien
Administrateur

Hors ligne

Inscrit le: 10 Mai 2012
Messages: 173

MessagePosté le: Mer 12 Sep - 20:24 (2012)    Sujet du message: screenfetch-bt Répondre en citant

à afficher le logo de backtrack en art ascii avec les info de ton pc

Revenir en haut
ZeRo-AbSoLu


Hors ligne

Inscrit le: 30 Aoû 2012
Messages: 74
Localisation: Dans le Deep

MessagePosté le: Jeu 13 Sep - 08:13 (2012)    Sujet du message: screenfetch-bt Répondre en citant

Le code est aussi long que ça ..?
_________________
Mess like the bests Die like the rest


Revenir en haut
Skype
Alien
Administrateur

Hors ligne

Inscrit le: 10 Mai 2012
Messages: 173

MessagePosté le: Lun 17 Sep - 22:00 (2012)    Sujet du message: screenfetch-bt Répondre en citant

voilà pour la capture



Revenir en haut
Inf3rnus


Hors ligne

Inscrit le: 10 Mai 2012
Messages: 49

MessagePosté le: Mer 26 Sep - 17:50 (2012)    Sujet du message: screenfetch-bt Répondre en citant

aussi bon qu'un  conky !!!! Okay Merçi Alien
_________________


Revenir en haut
Contenu Sponsorisé






MessagePosté le: Aujourd’hui à 18:46 (2017)    Sujet du message: screenfetch-bt

Revenir en haut
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet     Index du Forum -> Outils, codes et astuces -> Codes et scripts Toutes les heures sont au format GMT + 2 Heures
Page 1 sur 1

 
Sauter vers:  

Index | Panneau d’administration | forum gratuit | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation

© Alien 2012