Snippets

Idoenk . Heri Purnomo Conkyrc Builder

Created by Idoenk . Heri Purnomo
#Advance network detection to perfection scan all interfaces:
ls /sys/class/net/ > /tmp/ifaces.txt
if test -f /tmp/ifaces.txt
then
echo 'Network interfaces detected:'
echo '============================'
cat /tmp/ifaces.txt
echo '============================'
echo 'Scanning for active...'
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 'Active Network: '$ACTIVE
  fi
done
else
echo 'No Active network.'
fi
if test -f /tmp/tmpo.txt
then
ACTIVE=$(cat /tmp/tmpo.txt)
else
ACTIVE='No Inet'
fi
echo -n 'Active Monitoring Connection: '
echo $ACTIVE
echo '============================'
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
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
#!/bin/bash
#written via TheeMahn
VERSION='1.07'
# Changelog:
# 1.0 - initial public release
# 1.1 - internal release
# 1.2 - internal release
# 1.3 - internal release
# 1.4 - Added distro 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 res?
#       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 inet means do not propigate - includes wireless.
#	The same across the board when I am done and hopefully will not
#	require a cron job.
# 1.07	Initiated realtime information, across issues I have set forth.
#	Set CPU Temp to display info realtime 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.

#	Am I done?  No, dynamic screen resources then becomes an issue.  I am going
#	to take the information I / users view as important and make sure you recieve
#	that info until you run out of "screen resources".

#	I am going to try and explain.  I have a monitor that is 1920 X 1200 resolution
#	1200 is the number I am currently paying attention to.  1200 pixels is a ton of
#	info, however 800 X 600.  Well I guess half of what I can see.  The CPU once
#	again steps into the mix, typically go hand in hand.  The script is smart enough
#	to see the difference.  I do not want to rob your CPU of needed cycles,
#	if you do not know what I refer to please do not run it ;)

#	I have looked into generating weather reports as per your IP to resolve where you
#	live & have shyed away on the thought.  Proxy's etc. provide false reports.
#	Something I could fix?  Sure.  Conky builder, when I am done please understand.
#
#	Everything I do is in the best interests of the user & the Ultimate Edition
#	community. Do I care if ubuntu, mint, etc. picks it up? Nope, they will
# 	pay me in the end ;)  Progression, is my means.  Let's have a bash session:

echo "Ultimate Edition Conky builder version "$VERSION
echo "Please report errors / issues to TheeMahn <TheeMahn@ultimateedition.info>"
echo "========================================================================="
OS='Ultimate Edition'

#Detect codebase
CODEBASE=`cat /etc/lsb-release | grep 'DISTRIB_CODENAME=' | sed 's/DISTRIB_CODENAME=//g'`

echo "Codebase detected: "$CODEBASE

# 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: "
case "$CODEBASE" in
natty)
   if [[ $EVENODD != "" ]]; then
  OS=$OS" 3.1"
   else
  OS=$OS" 3.0"
   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.4"
   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.
GRAPHWIDTH=320 #size of box in pixels
FONTSIZE=12

echo "Detected current resolution:" $res

case "$res" in
1920x1200)
   AHW=75
   AARTY=101
   GRAPHWIDTH=400
   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)
   GRAPHWIDTH=300
   FONTSIZE=12
   echo "Setting Font size to 12 and graph width to 300" ;;
1152x864)
   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 <theemahn@ultimateedition.info>" ;;
esac

#set Base, hilight color & header please adjust colors in hex and font to your liking
BASE='${color #ffffff}${font Liberation Liberation:style=normal:pixelsize='$FONTSIZE'}'
HILIGHT='${color #00ff00}${font Liberation Liberation:style=normal:pixelsize='$FONTSIZE'}'
HEADER='${color #aaaaaa}${font Liberation:style=Bold:pixelsize='$FONTSIZE'}'
BAR='${color #ffff00}'

############### 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
PROC=`cat /proc/cpuinfo | grep 'model name' | sed -e 's/.*: //' | uniq`
echo "Detected Processor:" $PROC

#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" | wc -l`
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 'Network interfaces detected:'
echo '============================'
cat /tmp/ifaces.txt
echo '============================'
echo 'Scanning for active...'
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 'Active Network: '$ACTIVE
  fi
done
else
echo 'No Active network.'
fi
if test -f /tmp/tmpo.txt
then
ACTIVE=$(cat /tmp/tmpo.txt)
else
ACTIVE='No Inet'
fi
echo -n 'Active Monitoring Connection: '
echo $ACTIVE
echo '============================'
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

#Create conky skelaton
echo '#Use XFT?
use_xft yes
xftfont Liberation Sans:size=10
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 2

# 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

# Draw shades?
draw_shades no
default_color 00ff00 #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 15
gap_y 45

# -- Lua Load -- #
lua_load ~/.draw_bg.lua
lua_draw_hook_pre draw_bg

' > ~/.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
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}k${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Processes: ${alignr}'$HILIGHT'$processes ($running_processes running)
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font StyleBats:pixelsize='$FONTSIZE'}q${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Uptime: '$HILIGHT'${alignr}${uptime}' >> ~/.conkyrc
#Jamming?
echo 'Jamming Check:'
echo '=============='
#Ultimate Player Cranking?
JCHK=`qdbus | grep 'org.mpris.clementine'`
if [[ $JCHK != '' ]]
then
UPLAYER=`qdbus org.mpris.MediaPlayer2.clementine /Player GetMetadata`
fi
if [[ $UPLAYER == '' ]]; then
echo 'Ultimate Player Running: No'
else 
echo 'Ultimate Player Running: Yes'
ARTIST=$(echo $UPLAYER | grep "artist" | cut -c9- | cut -d: -f1 | sed 's/arturl//')
ARTIST=`qdbus org.mpris.MediaPlayer2.clementine /Player GetMetadata | grep artist | cut -c9-`
TITLE=$(echo $UPLAYER | grep title | cut -d: -f10 | sed 's/ //1')
TITLE=`qdbus org.mpris.MediaPlayer2.clementine /Player GetMetadata | grep title | cut -c8-`
cover="$(qdbus org.mpris.MediaPlayer2.clementine /Player GetMetadata | grep arturl)"
ART=$(echo $UPLAYER | grep "arturl" | cut -d: -f4 | sed 's/ audio-bitrate//g' | sed "s/\/\///1")
ART=$(echo $cover | cut -c16- | sed "s/%20/\\\ /g")



#ART=$cover
#echo $BASE'${voffset 2}${font VariShapes Solid:pixelsize='$FONTSIZE'}q${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Artist: '$HILIGHT'${alignr}'$ARTIST >> ~/.conkyrc
#echo ${goto '$INDENT'}${image '$ART' '$BARZ','$LOGO' -s 32x32}'$HEADER'SYSTEM ${hr 2 }' >> ~/.conkyrc
echo '${goto '$INDENT'}${image /usr/share/ultimate_edition/logo.png -p '$BARZ','$LOGO' -s 32x32}'$HEADER'ULTIMATE PLAYER ${hr 2 }' >> ~/.conkyrc
echo $BASE'${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Playing: '$HILIGHT $ARTIST' - '$TITLE'

' >> ~/.conkyrc
echo 'Artist: '$ARTIST
echo 'Title: '$TITLE
echo 'Album art: '$ART
echo '${goto 7}${image '$ART' -p '$AARTX','$AARTY' -s '$AHW'x'$AHW}'' >> ~/.conkyrc
fi
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 == '' ]]; then
echo 'Radio Tray Running: No'
else 
echo 'Radio Tray Running: Yes'
echo 'Artist - Song: '$RPLAYER
echo $HEADER'RADIO TRAY ${hr 2 }' >> ~/.conkyrc
echo $BASE'${voffset 2}${font Poky:pixelsize='$FONTSIZE'}k${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Playing: '$HILIGHT $RPLAYER >> ~/.conkyrc
echo $BASE'${font StyleBats:pixelsize='$FONTSIZE'}q${font}${voffset -'$ALEFT'}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Station: '$HILIGHT $STATION >> ~/.conkyrc
fi


#Core(s) info
echo $HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}CPU${hr 1 }
'$HILIGHT'${alignr}'$PROC'
${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Usage: '$HILIGHT' ${freq}MHz X '$CORES'${alignr}${cpu cpu0}% '$BAR' ${cpubar cpu0 '$INDENT','$SBAR'}' >> ~/.conkyrc
CPUTEMP=$(sensors -f |grep 'CPU Temp' |awk '{print $3}'|cut -b2,3,4,4)
if [[ $CPUTEMP != '' ]]
then
echo -n '${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'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}' >> ~/.conkyrc
#echo -n '${goto '$INDENT'}${font StyleBats:pixelsize='$FONTSIZE'}A${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'CPU Fan Speed: '$HILIGHT >> ~/.conkyrc
#echo '${execi '$TIMESLICES' sensors -f |grep "CPU Fan Speed" |awk '{print $4}'RPM' >> ~/.conkyrc
echo -n $BASE'${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
#echo '${execi '$TIMESLICES' sensors -f |grep "CPU Fan Speed" |awk "'"{print '$4'}"'"RPM' >> ~/.conkyrc
echo 'CPU Temp detected as: '$CPUTEMP
else
echo 'CPU Temp not detected / reported.'
fi
echo $BASE'Cores: ${hr 1 }' >> ~/.conkyrc

#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'}'$BASE'Core '$COUNTER':' $HILIGHT'${cpu cpu'$COUNTER'}% '$BAR'${alignr}${cpubar cpu'$COUNTER' '$INDENT','$BPER'}'$BASE >> ~/.conkyrc
 done

#Output disk I/O bar top processes memory usage 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'Usage: '$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'}
'$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE'Root: '$HILIGHT'${fs_free /} / ${fs_size /} / ${execi 300 nc localhost 7634 | cut -c35-36;}C${alignr}${fs_used_perc /}% '$BAR'${fs_bar '$INDENT','$SBAR' /}'$BASE >> ~/.conkyrc

#Detect hard disks & create a bar for each mount point
echo "====================================="
echo "Internal / External storage detected:"
echo "====================================="
echo "/ - Root"
ls /media/ > /tmp/tmp.txt
cat /tmp/tmp.txt | while read FILE
do
target=$(echo "$FILE" | sed -e "s/ /_/")
echo ''$BASE'${goto '$INDENT'}${voffset '$TICON'}${font Poky:pixelsize='$FONTSIZE'}H${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$BASE$FILE': '$HILIGHT'${fs_free /media/'$FILE'} / ${fs_size /media/'$FILE'}${alignr}${fs_used_perc /media/'$FILE'}% '$BAR'${fs_bar '$INDENT','$SBAR' /media/'$FILE'}'$BASE >> ~/.conkyrc
echo $FILE
done
rm /tmp/tmp.txt
if [[ $ACTIVE != 'No Inet' ]]
then
echo $HILIGHT'${goto '$INDENT'}${voffset '$TICON'}${font Stylebats:pixelsize='$FONTSIZE'}5${font}${voffset -'$ALEFT'}${goto '$VOFF'}'$HEADER'${goto '$VOFF'}ACTIVE NETWORK: '$ACTIVE'${hr 1}' >> ~/.conkyrc


#Propigate networking information based on active connection
echo $BASE'${voffset 2}${font VariShapes Solid:pixelsize='$FONTSIZE'}q${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Up: ${upspeed '$ACTIVE'} '$BAR'${alignr}${upspeedgraph '$ACTIVE' 20,'$BARZ' '$BASE' '$BAR' }
'$BASE'${voffset -24}${goto '$VOFF'}Total: ${totalup '$ACTIVE'}
${voffset -'$ALEFT'}${font VariShapes Solid:pixelsize='$FONTSIZE'}Q${font}${goto '$VOFF'}${voffset -'$ALEFT'}'$BASE'Down: ${downspeed '$ACTIVE'}${font} '$BAR'${alignr}${downspeedgraph '$ACTIVE' 20,'$BARZ' '$BASE' '$BAR'}
'$BASE'${voffset -24}${goto '$VOFF'}Total: ${totaldown '$ACTIVE'}' >> ~/.conkyrc

#Provide wireless info if user is using wireless actively.
if [[ $wlan == 'up' ]]; then
#Wireless header
echo $BASE'Wireless: ${hr 1 }' >> ~/.conkyrc
#ACCESS POINT
echo $BASE'${voffset 2}${font VariShapes Solid:pixelsize='$FONTSIZE'}-${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Wireless Access Point: '$HILIGHT'${alignr}${wireless_essid '$ACTIVE'}' >> ~/.conkyrc
#Connection strength / signal
echo $BASE'${voffset 2}${font Stylebats:pixelsize='$FONTSIZE'}Z${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Connection strength: '$HILIGHT'${alignr}${wireless_link_qual_perc '$ACTIVE'}%' >> ~/.conkyrc
#Connection speed
echo $BASE'${voffset 2}${font Stylebats:pixelsize='$FONTSIZE'}C${font}${goto '$VOFF'}${voffset -'$ALEFT'}${font}'$BASE'Connection max throughput: '$HILIGHT'${alignr}${wireless_bitrate '$ACTIVE'}' >> ~/.conkyrc
fi

echo $HEADER'${voffset -'$ALEFT'}${hr 2}' >> ~/.conkyrc

# Provide general connection info
echo $BASE'${voffset -'$ALEFT'}${font Poky:pixelsize='$FONTSIZE'}w${font}${goto '$VOFF'}${voffset -'$ALEFT'}'$BASE'Local IP: '$HILIGHT'${alignr}${addr '$ACTIVE'}' >> ~/.conkyrc
echo $BASE'${voffset 2}${font Stylebats:pixelsize='$FONTSIZE'}M'$BASE'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${font}${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

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.