1280x800)
GRAPHWIDTH=270
FONTSIZE=11
echo "Setting Font size to 11 and graph width to 270" ;;
theemahn@JackHammer:~$ ./conky-builder.sh
Ultimate Edition Conky builder version 1.17
Please report errors / issues to TheeMahn <[email protected]>
=========================================================================
Codebase detected: precise
Release debugging info:
Ultimate_Edition
3.5.1
Ultimate Edition 3.5.1 LTS
=======================
Kubuntu base: detected - odd number release
Distro detected: Ultimate_Edition 3.5.1
Detected current resolution: 1920x1200
Setting Font size to 14 and graph width to 480
Detected Processor: AMD FX(TheeMahn)-8150 Eight-Core Processor resonating at 4515.425 Mhz
64 Bit O/S detected.
8 Cpu core(s) Detected.
Update interval: 1
MemTotal: 16434464 kB
Network interfaces detected
eth0
lo
Scanning for active
Interface eth0: up
Active Network: eth0
Interface lo: unknown
Active Monitoring Connection: eth0
Scanning for sensors.
OBJECT SENSOR
CPU 122.0°F
FANSPEED 2700RPM
GPU 136.4°F
MAIN-BOARD 82.4°F
DEVICE MOUNTPOINT HDTEMP
/dev/sda1 UE35 86°F
/dev/sdb1 Root 86°F
/dev/sdc1 3TB_Backup 86°F
/dev/sdd1 Winderz 80°F
/dev/sdd2 Storage 80°F
/dev/sde Speed 78°F
/dev/sdf1 1TBUSB3 N/A°F
/dev/sdh1 Ultimate Edition N/A°F
/dev/sdi1 AE6D-56E7 N/A°F
/media/NAS NAS N/A°F
/media/NAS1 NAS1 N/A°F
theemahn@JackHammer:~$
#!/bin/bash
# title :conky-builder.sh
# description :Builds a conky skeleton based on hardware detected.
# author :Glenn Cady <[email protected]>
# date :12/07/2012
# version :1.17
# usage :./conky-builder.sh
# notes :See change-log below for further information.
# bash_version :4.2.8(1)-release
# ============================================================================
# Change-log:
# 1.0 initial public release
# 1.1 internal release
# 1.2 internal release
# 1.3 internal release
# 1.4 Added distribution detection, added resolution detection to set fonts and sizes.
# 1.05 Added version compliance for deb based releases
# Added better networking detection / wireless support.
# Added memory output to compare against pae based kernels.
# Added 800 X 600 support, how did I miss this resolution?
# Added initial support for Ultimate Player (dynamically)
# Added support for all network interface detection / Active.
# Never have I seen this implementation. I try to think outside of
# the box please report issues.
# Added support for Ultimate Edition 2.6.4 and 3.1 detection
# Added dynamic Wireless support.
# Added CPU Temp / Fan speeds also dynamic.
# 1.06 Added Radio tray to the mix
# Initiated the anti-cron job mode of thinking, execi can be executed
# w/o the need for a cron job. Let's base this on the end users CPU.
# Added no Internet means do not propagate - includes wireless.
# The same across the board when I am done and hopefully will not
# require a cron job.
# 1.07 Initiated real-time information, across issues I have set forth.
# Set CPU Temp to display info real-time based on end users processor. A
# single core CPU will not be updated as fast as a quad for example
# please see timeslices in my code.
# Set fan speed accordingly as above.
# 1.08 Split the conky builder for Ultimate Player info
# May integrate the info as a function later.
# Added progress bar for current playing track.
# All info for Ultimate Player is now real-time.
# 1.09 First initial deb based release
# 1.10 Internal release for Ultimate Edition 3.01
# Fixed improper spacing when closing Ultimate Player.
# 1.11 Fixed improper CPU detection on some Intel based processors.
#
# Began writing weather location / detection via users IP address."
# the above will be a fairly difficult procedure... A query to a API driven
# Geo-positioning map to obtain location based on zip code, once obtained
# a query to another API driven site noaa.gov. Will require no user
# interaction.
# 1.12 Added support for 12.04 precise (Ultimate Edition 3.4 & 3.5) based releases.
# 1.13 Corrected colors to be only 1 color for now, easier reading on most wallpapers.
# Will eventually write it to detect theme and set colors appropriately.
# 1.14 Added GPU and Main-board temp detection routines.
# Added initial dual monitor detection / setup routine.
# Added ppp0 network detection to the mix, thanks Seedo Eldho Paul
# Added Hard-disk temperature detection, this was a rough one to sift
# though and match with the drives.
# 1.15 Internal release to Ultimate Edition 3.5
# Fixed Garbling of GPU / CPU Temp
# Adjusted Colors to coincide with Ultimate Edition 3.5 Theme
# Removed Lua usage. Thanks Mr. Breeg and Goliath for testing
# 1.16 Set colors in CLI so errors etc. Stand out.
# Added additional distribution detection routines (debugging currently)
# No sense in having to re-write conky builder every-time I build a new OS.
# Display album art if Ultimate Player is Jamming.
# Major code clean up, I am a slob ;)
# Updated distribution logo
# Mass updates to resolution detection routine. Simple once again becomes
# complex thanks to addition of the artwork.
# 1.17 Adjusted output of information to comply with screen width.
# Detection of USB drives
# Detection of NAS drives
# Added 1280 X 800 resolution; thanks, tanmay.01
# Adjusted Temp detection routines let's not waste space Dual monitors now
# display @0 pixels
# Took debugging into my own hands on temps.
# =============== End Change-log ===================== #
#
# Set Base, hi-light & header color. Feel free to adjust colors in hex and font
# to your liking.
# Please Note: Graphwidth and fontsize are based on detected screen resolution.
GRAPHWIDTH=180
FONTSIZE=6
BASE='${color #ffffff}${font Liberation:style=normal:pixelsize='$FONTSIZE'}'
HILIGHT='${color #ffffff}${font Liberation:style=normal:pixelsize='$FONTSIZE'}'
HEADER='${color #ffffff}${font Liberation:style=Bold:pixelsize='$FONTSIZE'}'
BAR='${color #ffffff}'
############### You Should not have to edit anything below #############
#Set hard-coded variables
VERSION='1.17'
UPSCRIPT='~.config/Ultimate-Player/UP.sh'
declare -i Dual
# Set ASCII Esc sequences so terminal colors stand out
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
bldblk='\e[1;30m' # Black - Bold
bldred='\e[1;31m' # Red
bldgrn='\e[1;32m' # Green
bldylw='\e[1;33m' # Yellow
bldblu='\e[1;34m' # Blue
bldpur='\e[1;35m' # Purple
bldcyn='\e[1;36m' # Cyan
bldwht='\e[1;37m' # White
unkblk='\e[4;30m' # Black - Underline
undred='\e[4;31m' # Red
undgrn='\e[4;32m' # Green
undylw='\e[4;33m' # Yellow
undblu='\e[4;34m' # Blue
undpur='\e[4;35m' # Purple
undcyn='\e[4;36m' # Cyan
undwht='\e[4;37m' # White
bakblk='\e[40m' # Black - Background
bakred='\e[41m' # Red
badgrn='\e[42m' # Green
bakylw='\e[43m' # Yellow
bakblu='\e[44m' # Blue
bakpur='\e[45m' # Purple
bakcyn='\e[46m' # Cyan
bakwht='\e[47m' # White
txtrst='\e[0m' # Text Reset
# drop headers
echo -e "${bldwht}Ultimate Edition Conky builder version "$VERSION
echo "Please report errors / issues to TheeMahn <[email protected]>"
echo -e "=========================================================================${txtwht}"
# Set default Operating System in case of failure
OS='Ultimate Edition'
#Detect codebase / Distro
OS=$(lsb_release -i | sed -n 's/^Distributor ID:[ \t]*\(.*\)/\1/p')
DISTREL=$(lsb_release -r | sed -n 's/^Release:[ \t]*\(.*\)/\1/p')
DISTDESC=$(lsb_release -d | sed -n 's/^Description:[ \t]*\(.*\)/\1/p')
CODEBASE=`cat /etc/lsb-release | grep 'DISTRIB_CODENAME=' | sed 's/DISTRIB_CODENAME=//g'`
echo "Codebase detected: "$CODEBASE
echo -e "${undgrn}Release debugging info:${txtrst}${bldred}"
echo $OS
echo $DISTREL
echo $DISTDESC
echo -e "${bldgrn}=======================${txtrst}"
# detect if release is odd or even.
EVENODD=`dpkg -l | grep kubuntu-desktop`
if [[ $EVENODD != "" ]]; then
echo "Kubuntu base: detected - odd number release"
else
echo "Kubuntu base not detected - even number release"
fi
echo -n "Distro detected: "
#TESTING ABOVE
DISTRO=$OS" "$DISTREL
OS=$DISTRO
echo $DISTRO
#case "$CODEBASE" in
#precise)
# if [[ $EVENODD != "" ]]; then
# OS=$OS" 3.5"
# else
# OS=$OS" 3.4"
# fi
# echo $OS ;;
#oneiric)
# if [[ $EVENODD != "" ]]; then
# OS=$OS" 3.3"
# else
# OS=$OS" 3.2"
# fi
# echo $OS ;;
#natty)
# if [[ $EVENODD != "" ]]; then
# OS=$OS" 3.1"
# else
# OS=$OS" 3.01"
# fi
# echo $OS ;;
#maverick)
# if [[ $EVENODD != "" ]]; then
# OS=$OS" 2.9"
# else
# OS=$OS" 2.8"
# fi
# echo $OS ;;
#lucid)
# if [[ $EVENODD != "" ]]; then
# OS=$OS" 2.7"
# else
# OS=$OS" 2.6.6"
# fi
# echo $OS ;;
#
#*) echo "Unknown O/S using $CODEBASE"
#esac
# Attempt to advance the script. No sense having the user edit this script if we can obtain the information.
res=`xrandr -q | grep 'current' | cut -d"," -f2 | sed 's/current//g' | sed 's/ //g'`
# set default in case user has an unknown resolution. Better too small then too
# large
GRAPHWIDTH=320 #size of box in pixels
FONTSIZE=8 #default fontsize
echo "Detected current resolution:" $res
case "$res" in
3840x1200)
# Tested known good
Dual=1
AHW=88
AARTY=115
GRAPHWIDTH=640
FONTSIZE=16
echo "Dual monitors detected. Taking full advantage of extra screen resources."
echo "Setting Font size to 16 and graph width to 640" ;;
3840x1080)
Dual=1
AHW=75
AARTY=101
GRAPHWIDTH=640
FONTSIZE=16
echo "Dual monitors detected. Taking advantage of extra screen resources."
echo "Setting Font size to 16 and graph width to 640" ;;
1920x1200)
# tested; known Good.
AHW=84
AARTY=96
GRAPHWIDTH=600
FONTSIZE=14
echo "Setting Font size to 14 and graph width to 480" ;;
1920X1080)
AHW=75
AARTY=101
GRAPHWIDTH=400
FONTSIZE=14
echo "Setting Font size to 14 and graph width to 480" ;;
1680x1050)
AHW=75
AARTY=101
GRAPHWIDTH=400
FONTSIZE=14
echo "Setting Font size to 14 and graph width to 480" ;;
1440x900)
GRAPHWIDTH=310
FONTSIZE=12
echo "Setting Font size to 12 and graph width to 310" ;;
1400x1050)
AHW=75
AARTY=102
GRAPHWIDTH=310
FONTSIZE=14
echo "Setting Font size to 12 and graph width to 280" ;;
1280x1024)
AHW=75
AARTY=104
GRAPHWIDTH=310
FONTSIZE=13
echo "Setting Font size to 13 and graph width to 310" ;;
1280x960)
AHW=75
AARTY=102
GRAPHWIDTH=300
FONTSIZE=12
echo "Setting Font size to 12 and graph width to 300" ;;
1280x800)
AHW=75
AARTY=102
GRAPHWIDTH=300
FONTSIZE=11
echo "Setting Font size to 11 and graph width to 300" ;;
1152x864)
AHW=75
AARTY=102
GRAPHWIDTH=240
FONTSIZE=9
echo "Setting Font size to 9 and graph width to 240" ;;
1024x768)
AARTY=81
AHW=65
GRAPHWIDTH=240
FONTSIZE=9
echo "Setting Font size to 9 and graph width to 240" ;;
800x600)
GRAPHWIDTH=220
FONTSIZE=8
echo "Setting Font size to 8 and graph width to 220" ;;
832x624)
GRAPHWIDTH=220
FONTSIZE=8
echo "Setting Font size to 8 and graph width to 220" ;;
720x400)
GRAPHWIDTH=180
FONTSIZE=6
echo "Setting Font size to 6 and graph width to 180" ;;
640x480)
GRAPHWIDTH=180
FONTSIZE=6
echo "Setting Font size to 6 and graph width to 180" ;;
*)
GRAPHWIDTH=320
FONTSIZE=12
echo "Resolution unprogramed defaulting, please report detected resolution above to <[email protected]>" ;;
esac
#set Base, hilight color & header please adjust colors in hex and font to your liking
BASE='${color #ffffff}${font Liberation:style=normal:pixelsize='$FONTSIZE'}'
HILIGHT='${color #ffffff}${font Liberation:style=normal:pixelsize='$FONTSIZE'}'
HEADER='${color #ffffff}${font Liberation:style=Bold:pixelsize='$FONTSIZE'}'
BAR='${color #ffffff}'
############### You Should not have to edit anything below #############
#Calculate v offset based on Fonts / pixelsize
VOFF=$((FONTSIZE+6))
ALEFT=$((FONTSIZE/4))
INDENT=$((FONTSIZE/2))
BARZ=$((GRAPHWIDTH/2))
BOFFSET=$((FONTSIZE/3))
TICON=$((FONTSIZE/5))
BPER=$((GRAPHWIDTH/100*75))
SBAR=$((GRAPHWIDTH/100*20))
LOGO=$((FONTSIZE*4))
BPER=`expr $BPER - 10`
AARTX=`expr $GRAPHWIDTH - $AHW`
#Get CPU model
RESONATION=`cat /proc/cpuinfo | grep 'cpu MHz' | sed -e 's/.*: //' | uniq`
PROC=`cat /proc/cpuinfo | grep 'model name' | sed -e 's/.*: //' | uniq`
echo "Detected Processor:" $PROC "resonating at $RESONATION Mhz"
#check Architecture set 32 bit default
ARCHITECTURE='32 Bit'
#
# Check for x86_64 (Test 1) - some O/S's use the -i switch
#
if [ "`uname -i|grep x86_64`" == "x86_64" ]; then
ARCHITECTURE='64 Bit'
fi
#
# Check for x86_64 (Test 2) - some OSs (ie. Gentoo) return Processor manufacturer
#rather than architecture with "uname -i"
#
if [ "`uname -a|grep x86_64`" != "" ]; then
ARCHITECTURE='64 Bit'
fi
echo $ARCHITECTURE 'O/S detected.'
#Count number of processor cores
CORES=1
CORES=`cat /proc/cpuinfo | grep "processor" | sed '/model/d' | wc -l`
#Lets's not choke the end users cpu if they have limited resources.
TIMESLICES=`expr 12 / $CORES`
echo $CORES "Cpu core(s) Detected."
echo 'Update interval: '$TIMESLICES
cat /proc/meminfo | grep 'MemTotal'
#Advance network detection to perfection scan all interfaces:
ls /sys/class/net/ > /tmp/ifaces.txt
if test -f /tmp/ifaces.txt
then
echo -e "${undgrn}Network interfaces detected${txtrst}"
cat /tmp/ifaces.txt
echo -e "${undgrn}Scanning for active${txtrst}"
cat /tmp/ifaces.txt | while read FILE
do
target=$(echo "$FILE" | sed -e "s/ /_/")
echo -n "Interface $FILE: "
ACT=$(cat /sys/class/net/$FILE/operstate)
echo $ACT
if [[ $ACT == 'up' ]]; then
ACTIVE=$FILE
echo $FILE > /tmp/tmpo.txt
echo -e "${undgrn}Active Network${txtrst}: "$ACTIVE
fi
done
#Current Seedo work... If the folder exists most likely it is the
#active connection set it as such. Point to Point Protocol evidently
#does not do states. up / down etc.
if [[ -d "/sys/class/net/ppp0/" && $ACTIVE == "" ]]; then
ACTIVE="ppp0"
fi
else
echo 'No Active network.'
fi
if test -f /tmp/tmpo.txt
then
ACTIVE=$(cat /tmp/tmpo.txt)
else
ACTIVE='No Inet'
fi
echo -en "${undgrn}Active Monitoring Connection${txtrst}: "
echo $ACTIVE
if test -f /tmp/tmpo.txt
then
WIRELESS=$(cat /tmp/tmpo.txt|grep 'wlan')
fi
if [[ $WIRELESS != '' ]]
then
wlan='up'
fi
#Clean up.
if test -f /tmp/ifaces.txt
then
rm /tmp/ifaces.txt
fi
if test -f /tmp/tmpo.txt
then
rm /tmp/tmpo.txt
fi
#Detect "Active" network and propigate Network Xfer bar
#ACTIVE=`ifconfig | grep -B 1 inet | head -1 | awk '{print $1}'`
#Wireless?
#wlan=$(cat /sys/class/net/wlan0/operstate)
#enet=$(cat /sys/class/net/eth0/operstate)
#Hardline?
#if [[ $enet == 'up' ]]; then
#$ACTIVE='eth0'
#fi
#Wireless
#if [[ $wlan == 'up' ]]; then
#ACTIVE='wlan0'
#fi
#Dual monitors?
if [[ $Dual == 0 ]]; then
GAPX=15
GAPY=45
else
GAPX=15
GAPY=0
fi
#Create conky skelaton
echo '#Use XFT?
use_xft yes
xftfont Liberation:style=normal:pixelsize='$FONTSIZE'
xftalpha 0.8
text_buffer_size 2048
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type override
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area -adjust if you would like to user smaller fonts etc.
minimum_size '$GRAPHWIDTH' 0
maximum_width '$GRAPHWIDTH'
max_specials 1024
max_user_text 16384
default_bar_size '$BPER' 5
# Draw shades?
draw_shades no
default_color ffffff #000000
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 0
# border width
border_width 1
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x '$GAPX'
gap_y '$GAPY'
#Default weather to fahrenheit, please change the below if you prefer celcius.
temperature_unit fahrenheit
# -- Lua Load -- #
#lua_load ~/.draw_bg.lua
#lua_draw_hook_pre draw_bg
# -- Album art fix -- #
imlib_cache_size 0
' > ~/.conkyrc
echo 'TEXT
${goto '$INDENT'}${image /usr/share/ultimate_edition/logo.png -p '$BARZ','$LOGO' -s 32x32}'$HEADER'SYSTEM ${hr 2 }
'$HILIGHT'${alignr}'$OS' - ${alignr}$kernel '$ARCHITECTURE'
'$HILIGHT'${alignr}'$USER'@$nodename
${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}k${font}${voffset -'$ALEFT'}${goto '$VOFF'}${font}Processes: ${alignr}'$HILIGHT'$processes ($running_processes running)
${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}q${font}${voffset -'$ALEFT'}${goto '$VOFF'}${font}Uptime: '$HILIGHT'${alignr}${uptime}' >> ~/.conkyrc
#Jamming?
echo '${if_running ultimate-player}'$HEADER'ULTIMATE PLAYER ${hr 2 }${image ~/.config/Ultimate-Player/Current.art -p '$AARTX','$AARTY' -s '$AHW'x'$AHW'}' >> ~/.conkyrc
#echo '${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}Art: '$HILIGHT'${image ~/.config/Ultimate-Player/Current.art -p '$AARTX','$AARTY' -s '$AHW'x'$AHW'}' >> ~/.conkyrc
echo '${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}Artist: '$HILIGHT'${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh artist}' >> ~/.conkyrc
echo '${font}${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}Title: '$HILIGHT'${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh title}' >> ~/.conkyrc
echo '${font}${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}Album: '$HILIGHT'${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh album}' >> ~/.conkyrc
#echo '${if_running ultimate-player}'
echo '${execibar '$TIMESLICES' .config/Ultimate-Player/UP.sh progress}${else}${endif}' >> ~/.conkyrc
#echo '${if_running ultimate-player}${goto 7}${execi$ '$TIMESLICES' .config/Ultimate-Player/UP.sh art}
#echo -n '${image ${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh art} -p '$AARTX','$AARTY' -s '$AHW'x'$AHW}'${else}${endif}' >> ~/.conkyrc
JCHK=''
JCHK=`qdbus | grep 'net.sourceforge.radiotray'`
if [[ $JCHK != '' ]]
then
RPLAYER=`qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData`
STATION=`qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio`
fi
if [[ $RPLAYER == '' || $STATION == '' ]]; then
echo '${if_running radiotray}'$HEADER'RADIO TRAY ${hr 2 }' >> ~/.conkyrc
echo '${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${goto '$VOFF'}${voffset -'$ALEFT'}${font}Playing: '$HILIGHT '${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh rplay}' >> ~/.conkyrc
echo '${font StyleBats:pixelsize='$FONTSIZE'}q${font}${voffset -'$ALEFT'}${goto '$VOFF'}${voffset -'$ALEFT'}${font}Station: '$HILIGHT '${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh rstation}${else}${voffset -23}${endif}' >> ~/.conkyrc
else
echo 'Radio Tray Running: Yes'
echo 'Artist - Song: '$RPLAYER
echo '${if_running radiotray}'$HEADER'RADIO TRAY ${hr 2 }' >> ~/.conkyrc
echo '${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${goto '$VOFF'}${voffset -'$ALEFT'}${font}Playing: '$HILIGHT '${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh rplay}' >> ~/.conkyrc
echo '${font StyleBats:pixelsize='$FONTSIZE'}q${voffset -'$ALEFT'}${goto '$VOFF'}${voffset -'$ALEFT'}${font}Station: '$HILIGHT '${execi '$TIMESLICES' .config/Ultimate-Player/UP.sh rstation}${else}${voffset -23}${endif}' >> ~/.conkyrc
fi
#Core(s) info
echo $HEADER'CPU${hr 1 }${font}
${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}${font}${goto '$VOFF'}'$PROC'
${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${voffset -'$ALEFT'}${goto '$VOFF'}${font}CPU Usage: '$HILIGHT' ${freq}MHz X '$CORES'${alignr}${cpu cpu0}% '$BAR' ${cpubar cpu0 '$INDENT','$SBAR'}' >> ~/.conkyrc
# Hit sensors to see if temperature(s) are reported.
echo -e "${bldgrn}Scanning for sensors.${txtrst}"
echo -e "${undgrn}OBJECT\t\t\t\t\tSENSOR${txtrst}"
CPUTEMP=$(sensors -f|grep "CPU Temperature"|cut -d: -f2|sed "s/ //g"|sed "s/+//g" | cut -d"(" -f1)
GPUTEMP=$(sensors -f|grep -m 1 "temp1" | cut -d: -f2| sed "s/ //g" | sed "s/+//g" | cut -d"(" -f1)
MBTEMP=$(sensors -f|grep -m 1 "MB Temp" | cut -d: -f2| sed "s/ //g" | sed "s/+//g" | cut -d"(" -f1)
FANSPEED=$(sensors -f|grep "CPU Fan Speed"|cut -d: -f2|sed "s/ //g"|sed "s/+//g" | cut -d"(" -f1)
#CPUTEMP="" #set for debugging purposes - we pray this is detected the below code will fail
if [[ $CPUTEMP != '' ]]
then
echo -n '${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${voffset -'$ALEFT'}${goto '$VOFF'}${font}CPU Temp: '$HILIGHT >> ~/.conkyrc
echo -n '${execi '$TIMESLICES' sensors -f|grep "CPU Temperature"|cut -d: -f2|sed "s/ //g"|sed "s/+//g" | cut -d"(" -f1}${alignr}' >> ~/.conkyrc
TDETECTED=1
#echo -n '${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${voffset -'$ALEFT'}${goto '$VOFF'}${font}CPU Fan Speed: '$HILIGHT >> ~/.conkyrc
#echo '${execi '$TIMESLICES' sensors -f |grep "CPU Fan Speed" |awk '{print $4}'RPM' >> ~/.conkyrc
#echo '${execi '$TIMESLICES' sensors -f |grep "CPU Fan Speed" |awk "'"{print '$4'}"'"RPM' >> ~/.conkyrc
echo -e "CPU\t\t\t\t\t$CPUTEMP"
#echo 'CPU Temp sensor detected at: '$CPUTEMP
else
echo -e "${bldred}CPU\t\t\t\t\tNOT DETECTED${txtrst}"
fi
#FANSPEED="" #set for debugging purposes
if [[ $FANSPEED != '' ]]; then
echo -e "FANSPEED\t\t\t\t$FANSPEED"
echo -n '${font}${alignr}Fan Speed: '$HILIGHT >> ~/.conkyrc
echo '${execi '$TIMESLICES' sensors -f|grep "CPU Fan Speed"|cut -d: -f2|sed "s/ //g"|sed "s/+//g" | cut -d"(" -f1}' >> ~/.conkyrc
TDETECTED=`expr $TDETECTED + 1`
else
echo -n '${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${voffset -'$ALEFT'}${goto '$VOFF'}${font}CPU Temp: '$HILIGHT >> ~/.conkyrc
echo -n '${execi '$TIMESLICES' sensors -f|grep "CPU Temperature"|cut -d: -f2|sed "s/ //g"|sed "s/+//g" | cut -d"(" -f1}${alignr}' >> ~/.conkyrc
echo -e "${bldred}FANSPEED\t\t\t\t NOT DETECTED${txtrst}"
fi
#GPUTEMP="" #set for debugging purposes
#GPU TEMP?
if [[ $GPUTEMP != '' ]]
then
TDETECTED=`expr $TDETECTED + 1`
if [[ $TDETECTED != "3" ]]; then
echo -n '${font}GPU Temp: '$HILIGHT >> ~/.conkyrc
echo '${execi '$TIMESLICES' sensors -f | grep -m 1 "temp1" | cut -d: -f2| sed "s/ //g" | sed "s/+//g" | cut -d"(" -f1}' >> ~/.conkyrc
echo -e "GPU\t\t\t\t\t$GPUTEMP"
else
echo -n '${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${voffset -'$ALEFT'}${goto '$VOFF'}${font}GPU Temp: '$HILIGHT >> ~/.conkyrc
echo '${execi '$TIMESLICES' sensors -f | grep -m 1 "temp1" | cut -d: -f2| sed "s/ //g" | sed "s/+//g" | cut -d"(" -f1}' >> ~/.conkyrc
echo -e "GPU\t\t\t\t\t$GPUTEMP"
fi
else
echo -e "${bldred}GPU\t\t\t\t\tSENSOR NOT DETECTED${txtrst}"
fi
#Main-board Temp?
if [[ $MBTEMP != '' ]]
then
TDETECTED=`expr $TDETECTED + 1`
if [[ $TDETECTED != "4" ]]; then
echo -n '${font}${alignr}MB Temp: '$HILIGHT >> ~/.conkyrc
echo '${execi '$TIMESLICES' sensors -f|grep -m 1 "MB Temp" | cut -d: -f2| sed "s/ //g" | sed "s/+//g" | cut -d"(" -f1}' >> ~/.conkyrc
echo -e "MAIN-BOARD\t\t\t\t$MBTEMP"
else
echo '${execi '$TIMESLICES' sensors -f|grep -m 1 "MB Temp" | cut -d: -f2| sed "s/ //g" | sed "s/+//g" | cut -d"(" -f1}' >> ~/.conkyrc
echo -e "MAIN-BOARD\t\t\t\t$MBTEMP"
fi
else
echo -e "${bldred}MAIN-BOARD\t\t\t\tSENSOR NOT DETECTED${txtrst}"
fi
#Create a cpubar for each core
COUNTER=0
while [ $COUNTER != $CORES ]; do
let COUNTER=COUNTER+1
echo '${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}${font}Core '$COUNTER':' $HILIGHT'${cpu cpu'$COUNTER'}% '$BAR'${alignr}${cpubar cpu'$COUNTER' '$INDENT','$BPER'}${font}' >> ~/.conkyrc
done
#Output disk I/O bar top processes memory useage etc.
echo $HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}g${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}RAM${hr 1 }'$BASE'
'$BASE'${voffset 2}${font VariShapes Solid:pixelsize='$FONTSIZE'}N'$BASE'Useage: '$HILIGHT'$mem / $memmax ${alignr}'$HILIGHT'$memperc% '$BAR'${membar '$INDENT','$SBAR'}'$BASE'
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}j${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Swap: '$HILIGHT'$swap/$swapmax${alignr}$swapperc% '$BAR'${swapbar '$INDENT','$SBAR'}
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}a${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'${goto '$VOFF'}Highest: ${alignr}CPU RAM
${goto '$VOFF'}${voffset -5.5}${hr 1}
'$HILIGHT'${voffset -1}${goto '$VOFF'}${top name 1}${alignr}${top cpu 1} ${top mem 1}
${goto '$VOFF'}${top name 2}${alignr}${top cpu 2} ${top mem 2}
${goto '$VOFF'}${top name 3}${alignr}${top cpu 3} ${top mem 3}
${goto '$VOFF'}${top name 4}${alignr}${top cpu 4} ${top mem 4}
'$HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}FILESYSTEM${hr 1 }'$BASE'
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}Y${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Disk I/O: '$HILIGHT'${diskio}${alignr}'$BAR'${diskiograph 20,'$BARZ'}
'>> ~/.conkyrc
#Detect hard disks & create a bar for each mount point provide info to end user
#Step one mount points
echo -en "${undgrn}"
printf '%-15s %-24s %s\n' \
DEVICE MOUNTPOINT HDTEMP
echo -en "${txtrst}"
awk '/dev\/sd/ {print $1}' /etc/mtab | sort | while read line ; do
MOUNTPOINT=$(df $line | awk '{print $6}' | sed '1d')
STRIPPED=$(echo $MOUNTPOINT | sed 's/\/media\///g')
if [ $STRIPPED = "/" ]; then
STRIPPED="Root"
fi
#echo "Hard Drive / USB / Partition: $line set as $STRIPPED. Will set temp readings if acculabel."
HDDTMP=$(echo $line | sed 's/[0-9]*//g')
HDTEMP=$(hddtemp $line --unit=f --numeric)
SMART=$(echo $HDTEMP | grep -v "S.M.A.R.T. not available")
SENSOR=$(echo $HDTEMP | grep -v "have a temperature sensor")
if [[ $SMART != "" && $SENSOR != "" ]]; then
printf '%-15s %-24s %s\n' \
"$line" "$STRIPPED" "$HDTEMP°F"
echo $BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE$STRIPPED' ('$line'): '$HILIGHT'${fs_free '$MOUNTPOINT'} / ${fs_size '$MOUNTPOINT'}${alignr}${hddtemp '$HDDTMP'}°F | ${fs_used_perc '$MOUNTPOINT'}% '$BAR'${fs_bar '$INDENT','$SBAR' '$MOUNTPOINT'}'$BASE >> ~/.conkyrc
else
printf '%-15s %-24s %s\n' \
"$line" "$STRIPPED" N/A°F
echo $BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE$STRIPPED' ('$line'): '$HILIGHT'${fs_free '$MOUNTPOINT'} / ${fs_size '$MOUNTPOINT'}${alignr}${fs_used_perc '$MOUNTPOINT'}% '$BAR'${fs_bar '$INDENT','$SBAR' '$MOUNTPOINT'}'$BASE >> ~/.conkyrc
fi
#if [ `nc localhost 7634 | grep '$HDDTMP'` ]; then
#echo $BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE$STRIPPED' ('$line'): '$HILIGHT'${fs_free '$MOUNTPOINT'} / ${fs_size '$MOUNTPOINT'}${alignr} | ${hddtemp '$HDDTMP'}°F | ${fs_used_perc '$MOUNTPOINT'}% '$BAR'${fs_bar '$INDENT','$SBAR' '$MOUNTPOINT'}'$BASE >> ~/.conkyrc
#else
#echo "No temp settings for this drive"
#fi
done;
# Step 2 Devices -reapproach this step later code above is reusable
# Write a function?
#Step 3 Burners
awk '/dev\/sr/ {print $1}' /etc/mtab | sort | while read line ; do
MOUNTPOINT=$(df $line | awk '{print $6}' | sed '1d')
STRIPPED=$(echo $MOUNTPOINT | sed 's/\/media\///g')
if [ $STRIPPED = "/" ]; then
STRIPPED="Root"
fi
echo "Burners: $line set as $STRIPPED."
HDDTMP=$(echo $line | sed 's/[0-9]*//g')
echo $BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE$STRIPPED' ('$line'): '$HILIGHT'${fs_free '$MOUNTPOINT'} / ${fs_size '$MOUNTPOINT'}${alignr}${fs_used_perc '$MOUNTPOINT'}% '$BAR'${fs_bar '$INDENT','$SBAR' '$MOUNTPOINT'}'$BASE >> ~/.conkyrc
done;
#Step 4 - Why stop there snatch up NAS(s) drives.
awk '/\/\// {print $2}' /etc/mtab | sort | while read line ; do
MOUNTPOINT=$(df $line | awk '{print $8}' | sed '1d')
STRIPPED=$(echo $MOUNTPOINT | sed 's/\/media\///g')
if [ $STRIPPED = "/" ]; then
STRIPPED="Root"
fi
printf '%-15s %-24s %s\n' \
"$line" "$STRIPPED" N/A°F
#No temp detection via network do not populate TEMP.
echo $BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE$STRIPPED' ('$line'): '$HILIGHT'${fs_free '$MOUNTPOINT'} / ${fs_size '$MOUNTPOINT'}${alignr}${fs_used_perc '$MOUNTPOINT'}% '$BAR'${fs_bar '$INDENT','$SBAR' '$MOUNTPOINT'}'$BASE >> ~/.conkyrc
done;
#Network re-visit...
if [[ $ACTIVE != 'No Inet' ]]
then
echo $HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}5${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}ACTIVE NETWORK: '$ACTIVE'${hr 1}' >> ~/.conkyrc
#Propigate networking information based on active connection
echo '${font}${voffset 2}${font VariShapes Solid:pixelsize='$FONTSIZE'}q${goto '$VOFF'}${voffset -'$ALEFT'}${font}Up: ${upspeed '$ACTIVE'} '$BAR'${alignr}${upspeedgraph '$ACTIVE' 20,'$BARZ' ${font} '$BAR' }
${font}${voffset -24}${goto '$VOFF'}Total: ${totalup '$ACTIVE'}
${voffset -'$ALEFT'}${font VariShapes Solid:pixelsize='$FONTSIZE'}Q${goto '$VOFF'}${voffset -'$ALEFT'}${font}Down: ${downspeed '$ACTIVE'} '$BAR'${alignr}${downspeedgraph '$ACTIVE' 20,'$BARZ' ${font} '$BAR'}
${font}${voffset -24}${goto '$VOFF'}Total: ${totaldown '$ACTIVE'}' >> ~/.conkyrc
#Provide wireless info if user is using wireless actively.
if [[ $wlan == 'up' ]]; then
#Wireless header
echo '${font}Wireless: ${hr 1 }' >> ~/.conkyrc
#ACCESS POINT
echo '${font}${voffset 2}${font VariShapes Solid:pixelsize='$FONTSIZE'}-${goto '$VOFF'}${voffset -'$ALEFT'}${font}Wireless Access Point: '$HILIGHT'${alignr}${wireless_essid '$ACTIVE'}' >> ~/.conkyrc
#Connection strength / signal
echo '${font}${voffset 2}${font Stylebats:pixelsize='$FONTSIZE'}Z${goto '$VOFF'}${voffset -'$ALEFT'}${font}Connection strength: '$HILIGHT'${alignr}${wireless_link_qual_perc '$ACTIVE'}%' >> ~/.conkyrc
#Connection speed
echo '${font}${voffset 2}${font Stylebats:pixelsize='$FONTSIZE'}C${goto '$VOFF'}${voffset -'$ALEFT'}${font}Connection max throughput: '$HILIGHT'${alignr}${wireless_bitrate '$ACTIVE'}' >> ~/.conkyrc
fi
echo $HEADER'${voffset -'$ALEFT'}${hr 2}' >> ~/.conkyrc
# Provide general connection info
echo '${font}${voffset -'$ALEFT'}${font Poky:pixelsize='$FONTSIZE'}w${goto '$VOFF'}${voffset -'$ALEFT'}${font}Local IP: '$HILIGHT'${alignr}${addr '$ACTIVE'}' >> ~/.conkyrc
echo '${font}${voffset 2}${font Stylebats:pixelsize='$FONTSIZE'}M${font}TCP Connections: '$HILIGHT'${tcp_portmon 1 65535 count}' >> ~/.conkyrc
fi
#close out with a thin line at the bottom
echo $HEADER'${voffset -'$ALEFT'}${hr 2}
'$HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}d${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}${alignc}${time %H:%M}, ${time %A %d %B}' >> ~/.conkyrc
echo $HEADER'${voffset -'$ALEFT'}${hr 2}' >> ~/.conkyrc
echo $HEADER'${voffset -'$ALEFT'}${hr 2}' >> ~/.conkyrc
theemahn@JackHammer:~$ ./conky-builder.sh
Ultimate Edition Conky builder version 1.17
Please report errors / issues to TheeMahn <[email protected]>
=========================================================================
Codebase detected: precise
Release debugging info:
Ultimate_Edition
3.5.1
Ultimate Edition 3.5.1 LTS
=======================
Kubuntu base: detected - odd number release
Distro detected: Ultimate_Edition 3.5.1
Detected current resolution: 3840x1200
Dual monitors detected. Taking full advantage of extra screen resources.
Setting Font size to 16 and graph width to 640
Detected Processor: AMD FX(TheeMahn)-8150 Eight-Core Processor resonating at 4515.425 Mhz
64 Bit O/S detected.
8 Cpu core(s) Detected.
Update interval: 1
MemTotal: 16434464 kB
Network interfaces detected
eth0
lo
Scanning for active
Interface eth0: up
Active Network: eth0
Interface lo: unknown
Active Monitoring Connection: eth0
Scanning for sensors.
OBJECT SENSOR
CPU 120.2°F
FANSPEED NOT DETECTED
GPU 139.1°F
MAIN-BOARD 82.4°F
DEVICE MOUNTPOINT HDTEMP
/dev/sda1 UE35 86°F
/dev/sdb1 Root 86°F
/dev/sdc1 3TB_Backup 87°F
/dev/sdd1 Winderz 80°F
/dev/sdd2 Storage 80°F
/dev/sde Speed 78°F
/dev/sdf1 1TBUSB3 N/A°F
/dev/sdg1 DROID N/A°F
/dev/sdh1 Ultimate Edition N/A°F
/dev/sdi1 AE6D-56E7 N/A°F
/media/NAS NAS N/A°F
/media/NAS1 NAS1 N/A°F
theemahn@JackHammer:~$
TheeMahn wrote:JOHNNYG wrote:Works fine for me !!![]()
Thanks, brother... Sorry for the delay in debbing it, but I had a laptop over here this Friday & found flaws. I am a stickler and an error!!! Not on my watchWhile most ppl do not care this is a script that fires up on bootup sure if it fails exits graciously. Let's say this script hangs as does when using an intel 1.5 ghz single core processor & firing up conky. Something as what may seem simple improperly detecting it as a dual core deter-mental & caused it to hang. My end user experience working on that laptop was nothing short of enjoyment. Resolving issues on a large scale #1 point of interest.
Brother I have missed chewing the fat with you, I believe last time I tried to call you could not get ahold of u.
tanmay.01 wrote:Conky Builder v1.11
My old laptop resolution was not there in the conky script.
So i tried adding it :
- Code: Select all
1280x800)
GRAPHWIDTH=270
FONTSIZE=11
echo "Setting Font size to 11 and graph width to 270" ;;
But it looks like this
And there is a bug about cdrom marked with a star.
Then i tried pasting the code of v1.14 from TheeMahn's last post about resolving ppp..
It looks like this (without adding above res code) :
Users browsing this forum: No registered users and 1 guest