Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

Performance :) #12

Merged
merged 3 commits into from
May 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions bin/archey
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
#!/bin/bash

# Gets the *default* ip address only.
function default_ip
{
/usr/bin/ruby -e '
require "socket"

Socket.do_not_reverse_lookup = true

UDPSocket.open { |s| s.connect("64.233.187.99", 1); puts s.addr.last }
'
}

# Detect the packager.
if [ -x /usr/local/bin/brew ]; then
packager=homebrew
Expand Down Expand Up @@ -56,12 +44,12 @@ done
# System Variables
user=$(whoami)
hostname=$(hostname | sed 's/.local//g')
ip=$(default_ip)
ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
distro="OS X $(sw_vers -productVersion)"
kernel=$(uname)
uptime=$(uptime | sed 's/.*up \([^,]*\), .*/\1/')
shell=$(dscl . -read /Users/$user UserShell | awk '{print $2}')
terminal="$TERM"
shell="$SHELL"
terminal="$TERM ${TERM_PROGRAM//_/ }"
cpu=$(sysctl -n machdep.cpu.brand_string)

# removes (R) and (TM) from the CPU name so it fits in a standard 80 window
Expand Down