Friday, July 29, 2011

Conky: Tool for Help Monitoring System (Update 02-17-12)



This is my conky, that help me very much to know about informations from the system. To get it, just install with:

$ sudo apt-get install conky feh

Now, create a file .conkyrc in ~/.conkyrc and fill in with codes which you like. By the way, we can save the code in other place and call it with "conky -c your-file-conky".

For documentations about conky, check this first, http://conky.sourceforge.net/screenshots.html and you won't be disappointed to use it. Hopefully..

So, my .conkyrc's code is:

# set to yes if you want Conky to be forked in the background
background no

cpu_avg_samples 2
net_avg_samples 2

out_to_console no

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8

own_window_transparent yes
own_window_colour hotpink
# Text alpha when using Xft
xftalpha 0.8

# mail spool
mail_spool $MAIL

# Update interval in seconds
update_interval 1
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_hints sundecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 5 5
maximum_width 330

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 10

# border width
border_width 1

# Default colors and also border colors
default_color lightgrey
default_shade_color white
default_outline_color white

# Text alignment, other possible values are commented
#alignment top_left
#minimum_size 10 10
gap_x 4
gap_y 2
alignment top_right
#alignment bottom_right

# Subtract file system buffers from used memory?
no_buffers no

# set to yes if you want all text to be in uppercase
uppercase no

TEXT
${font OpenLogos:size=16}J ${font}$nodename - $sysname $kernel on $machine
$stippled_hr 2
${color lightgrey}Uptime:$color $uptime ${color lightgrey}
${color lightgrey}Battery Usage:${color white} ${battery}
${color lightgrey}CPU Usage:${color #00FFF0} ${cpu}% ${cpubar}
${color #00FFF0}${cpugraph 000000 00FFF0}
${color lightgrey}RAM Usage:$color $mem/$memmax - $memperc% $membar
${color lightgrey}Swap Usage:$color $swap/$swapmax - $swapperc% ${swapbar}
${color lightgrey}Processes:$color $processes ${color grey}Running:$color $running_processes ${hwmon 0 temp 1}° ${hwmon 0 temp 2}°

${color lightgrey}Net: ppp0
Down:${color #22ccff} ${downspeed ppp0} KB/s ${color lightgrey}${alignr}Up:${color #22ccff} ${upspeed ppp0} KB/s
${color #00FFF0}${downspeedgraph ppp0 35,100 ff0000 0000ff}${color #00FFF0}${alignr}${upspeedgraph ppp0 35,100 0000ff ff0000}
${color lightgrey}Download:${color #5000a0} ${totaldown ppp0} ${color lightgrey}${alignr}Upload:${color #5000a0} ${totalup ppp0}

${color lightgrey}File systems:
/ $color${fs_size /} | ${fs_free /} | ${fs_free_perc /}% ${fs_bar /}
C $color${fs_size /c} | ${fs_free /c} | ${fs_free_perc /c}% ${fs_bar /c}
D $color${fs_size /d} | ${fs_free /d} | ${fs_free_perc /d}% ${fs_bar /d}
E $color${fs_size /e} | ${fs_free /e} | ${fs_free_perc /e}% ${fs_bar /e}
Sl $color${fs_size /slack} | ${fs_free /slack} | ${fs_free_perc /slack}% ${fs_bar /slack}
Ub $color${fs_size /ubuntu} | ${fs_free /ubuntu} | ${fs_free_perc /ubuntu}% ${fs_bar /ubuntu}

${color}Name PID CPU% MEM%
${color #22ccff} ${top name 1}${top pid 1} ${top cpu 1} ${top mem 1}
${color lightgrey} ${top name 2}${top pid 2} ${top cpu 2} ${top mem
2}
${color lightgrey} ${top name 3}${top pid 3} ${top cpu 3} ${top mem
3}
${color lightgrey} ${top name 4}${top pid 4} ${top cpu 4} ${top mem
4}
${color lightgrey} ${top name 5}${top pid 5} ${top cpu 5} ${top mem
5}
${color lightgrey} ${top name 6}${top pid 6} ${top cpu 6} ${top mem
6}
${color lightgrey} ${top name 7}${top pid 7} ${top cpu 7} ${top mem
7}
${color}Mem usage
${color #22ccff} ${top_mem name 1}${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color lightgrey} ${top_mem name 2}${top_mem pid 2} ${top_mem cpu
2} ${top_mem mem 2}
${color lightgrey} ${top_mem name 3}${top_mem pid 3} ${top_mem cpu
3} ${top_mem mem 3}

${font Liberation Sans:style=Bold:size=8}DATE ${hr 2}${font}
${voffset -4}${alignc 46}${font Arial Black:size=30}${time %H:%M}${font}
${voffset 10}${alignc}${time %A, %B %d %Y}


NOTE:
If you see these when run conky:
Conky: can't open '/sys/class/hwmon/hwmon0/temp2_input': No such file or directory
please check your device or remove this var from Conky
Segmentation fault

than i suggest that you must remove script conky from above which background yellow.


To get our conky transparent and automatically run from login, we used "feh" and create file *.sh (ex conky.sh) and give permission file with "chmod +x" at ~/.kde/Autostart/conky.sh (this is in my kde, maybe in your kde have different location about Autostart) with my example codes in conky.sh:

#!/bin/sh
# Set a variable to get the wallpaper path
WALLPAPER="/home/soft-green.jpg"

# Launch feh with the variable
feh --bg-scale $WALLPAPER &
sleep 5
conky &
sleep 5
sync; echo 3 > /proc/sys/vm/drop_caches


Don't forget to change your location "WALLPAPER" same as your current desktop wallpaper. Other interesting things about conky can we see below in:








Thanks for Dedik with 'conky sebaran' (spread conky), here is his codes:

#######################################################
background no

# font settings #######################################################
use_xft yes
#font monospace-8
xftfont Acknowledge TT BRK:size=8
#xftfont Edit Undo BRK:size=8
#xftfont Visitor TT2 BRK:size=10
uppercase yes
override_utf8_local yes

# update every 1 secs #################################################
update_interval 1

# stay running forever ################################################
total_run_times 0

# draw to root window #################################################
own_window no

# avoid flickering ####################################################
double_buffer yes

# size ################################################################
minimum_size 1270 800
maximum_width 1270

# position ############################################################
alignment top_left
#alignment top_middle
#alignment top_right
#alignment bottom_left
#alignment bottom_middle
#alignment bottom_right
#alignment middle_left
#alignment middle_right
gap_x 0
gap_y 0

# colors ##############################################################
default_color white
default_shade_color white
default_outline_color black
# custom colors #######################################################
color0 FFFFFF
color1 F5F5F5
color2 A2AEC6
color3 696969
color4 D3D3D3
color5 6495ED
color6 87CEFA
color7 5F9EA0
color8 BBBBBB
color9 262729

# borders #############################################################
draw_borders no
draw_graph_borders no
stippled_borders 8
border_margin 4
border_width 1

# shades ##############################################################
draw_shades no

# outline #############################################################
draw_outline no

# spacer ##############################################################
use_spacer no

# buffers (Substract (file system) buffers from used memory?)##########
no_buffers yes

# sampling ############################################################
cpu_avg_samples 2
net_avg_samples 2

# configuration #######################################################
TEXT
${voffset 10}${offset 10}$color8 /$color3 System$color8 /
${offset 10}$color2 $sysname$color9 -$color2 $machine
${offset 10}$color2 $kernel
${offset 10}$color2 Dedik$color9 on$color2 $nodename
${offset 10}$color6 ${time %A %d/%m/%y %kh%M}
${offset 10}$color2 Uptime :$color6 $uptime

${offset 10}$color8 /$color3 Mails$color8 /
${offset 15}$color2 arpbook : $color4${imap_unseen mail.mac.com “adresse mac” “mot de passe mac”}
${offset 15}$color2 larnel : $color4${imap_unseen mail.mac.com “adresse mac” “mot de passe mac”}

${voffset -100}${offset 1080}$color8 /$color3 Comments On Dedikification$color8 /
${offset 1085}$color2 >$color4${rss http://de-gaptek.co.cc/feed/rss/ 60 item_title 0}
${offset 1090}$color2 >$color4${rss http://de-gaptek.co.cc/feed/rss/ 60 item_title 1}
${offset 1095}$color2 >$color4${rss http://de-gaptek.co.cc/feed/rss/ 60 item_title 2}
${offset 1100}$color2 >$color4${rss http://de-gaptek.co.cc/feed/rss/ 60 item_title 3}
${offset 1105}$color2 >$color4${rss http://de-gaptek.co.cc/feed/rss/ 60 item_title 4}

${offset 1090}$color8 /$color3 FACEBOOK NOTIFICATIONS$color8 /
${offset 1095}$color2 >$color4${rss http://www.facebook.com/feeds/notifications.php?id=1829968649&viewer=1829968649&key=f8333e28e2&format=rss20 60 item_title 0}
${offset 1095}$color2 >$color4${rss http://www.facebook.com/feeds/notifications.php?id=1829968649&viewer=1829968649&key=f8333e28e2&format=rss20 60 item_title 1}
${offset 1095}$color2 >$color4${rss http://www.facebook.com/feeds/notifications.php?id=1829968649&viewer=1829968649&key=f8333e28e2&format=rss20 60 item_title 2}
${offset 1095}$color2 >$color4${rss http://www.facebook.com/feeds/notifications.php?id=1829968649&viewer=1829968649&key=f8333e28e2&format=rss20 60 item_title 3}
${offset 1095}$color2 >$color4${rss http://www.facebook.com/feeds/notifications.php?id=1829968649&viewer=1829968649&key=f8333e28e2&format=rss20 60 item_title 4}
${offset 1095}$color2 >$color4${rss http://www.facebook.com/feeds/notifications.php?id=1829968649&viewer=1829968649&key=f8333e28e2&format=rss20 60 item_title 5}
${offset 1095}$color2 >$color4${rss http://www.facebook.com/feeds/notifications.php?id=1829968649&viewer=1829968649&key=f8333e28e2&format=rss20 60 item_title 6}

${voffset -25}${offset 70}$color8 /$color3 CPU #01$color8 /
${offset 80}$color2 Temperature :$color4 ${execi 10 sensors | grep -A 2 ‘^coretemp-isa-0000′ | cut -c15-18 | grep ‘°’}C - $color2 Frequency : $color4${freq_dyn cpu1}$color2 MHz
${offset 80}$color2 Load: $color9 ${cpubar cpu1 6,220} $color4${cpu cpu1}$color2 %
${offset 80}$color4 ${cpugraph cpu1 15,255 262729 87CEFA}
${offset 70}$color8 /$color3 CPU #02$color8 /
${offset 80}$color2 Temperature :$color4 ${execi 10 sensors | grep -A 2 ‘^coretemp-isa-0001′ | cut -c15-18 | grep ‘°’}C - $color2 Frequency : $color4${freq_dyn cpu2}$color2 MHz
${offset 80}$color2 Load: $color9 ${cpubar cpu2 6,220} $color4${cpu cpu2}$color2 %
${offset 80}$color4 ${cpugraph cpu2 15,255 262729 87CEFA}

${voffset -80}${offset 1090}$color8 /$color3 UBUNTU $color8 /
${offset 1095}$color2 >$color4${rss http://www.canonical.com/rss.xml 60 item_title 0}
${offset 1095}$color2 >$color4${rss http://www.canonical.com/rss.xml 60 item_title 1}
${offset 1095}$color2 >$color4${rss http://www.canonical.com/rss.xml 60 item_title 2}

${voffset 50}${offset 20}$color8 /$color3 Wifi (ath0)$color8 /
${offset 35}$color2 essid : $color4${wireless_essid ath0}$color2 – MAC : $color4${wireless_ap ath0}
${offset 35}$color2 Wifi Level : $color4${wireless_link_qual ath0}$color2 /$color4 ${wireless_link_qual_max ath0}$color2 – Quality: $color4 ${wireless_link_qual_perc ath0}
${offset 35}$color2 IPv4 : $color4${addr ath0}$color2 -$color4 ${execi 1800 ~/.conky/ip.sh}
${offset 30}$color2 Down : $color4 ${downspeed ath0}$color2 kb/s
${offset 30}$color4 ${downspeedgraph ath0 15,250 262729 87CEFA}
${offset 30}$color2 Up : ${offset 6} $color4 ${upspeed ath0}$color2 kb/s
${offset 30}$color4 ${upspeedgraph ath0 15,250 262729 87CEFA}

${voffset -100}${offset 1160}$color8 /$color3 Power$color8 /
${offset 1155}$color2 $acpiacadapter$color4 $battery
${offset 1150}$color2 Time Left :$color4 $battery_time
${offset 1145}$color9 ${battery_bar 6,160}

${voffset 50}${offset 20}$color8 /$color3 Volumes$color8 /
${offset 35}$color2 #!-root : $color4 ${fs_used_perc /}% – ${fs_used /} + ${fs_free /} = ${fs_size /}
${offset 35}$color9 ${fs_bar 6,320 /}
${offset 50}$color2 #!-home : $color4 ${fs_used_perc /home}% – ${fs_used /home} + ${fs_free /home} = ${fs_size /home}
${offset 50}$color9 ${fs_bar 6,320 /home}
${offset 65}$color2 Documents : $color4 ${fs_used_perc /media/Documents}% – ${fs_used /media/Documents} + ${fs_free /media/Documents} = ${fs_size /media/Documents}
${offset 65}$color9 ${fs_bar 6,320 /media/Documents}
${offset 80}$color2 Multimedia : $color4 ${fs_used_perc /media/Multimedia}% – ${fs_used /media/Multimedia} + ${fs_free /media/Multimedia} = ${fs_size /media/Multimedia}
${offset 80}$color9 ${fs_bar 6,320 /media/Multimedia}
${offset 95}$color2 Softwares : $color4 ${fs_used_perc /media/Softwares}% – ${fs_used /media/Softwares} + ${fs_free /media/Softwares} = ${fs_size /media/Softwares}
${offset 95}$color9 ${fs_bar 6,320 /media/Softwares}

${voffset -90}${offset 600}$color8 /$color3 Memory$color8 /
${offset 605}$color2 RAM: ${offset 0} $color9 ${membar 6,200}$color4 $mem ($memperc%)
${offset 610}$color2 Swap: $color9 ${swapbar 6,200}$color4 $swap ($swapperc%)

${voffset -100}${offset 1110}$color8 /$color3 Activity$color8 /
${offset 1105}$color2 Hdd Temp:$color4 ${hddtemp /dev/sda}
${offset 1100}$color2 Read/Write: $color4 $diskio
${offset 1090}$color2 Process :$color4 $running_processes$color2 /$color4 $processes
${offset 1090}$color6 ${top name 1}$alignr$color4 ${top cpu 1}%
${offset 1090}$color5 ${top name 2}$alignr$color4 ${top cpu 2}%
${offset 1090}$color5 ${top name 3}$alignr$color4 ${top cpu 3}%
${offset 1090}$color5 ${top name 4}$alignr$color4 ${top cpu 4}%
${offset 1090}$color5 ${top name 5}$alignr$color4 ${top cpu 5}%
${offset 1090} ${diskiograph 15,180 262729 87CEFA}


References:
http://conky.sourceforge.net/config_settings.html
http://conky.sourceforge.net/variables.html


4 comments:

  1. mantaap gaan., nice share gaan.,
    sukses yaah buat agaan.,

    ReplyDelete
  2. Mantap...tapi masih bingung jadi transparant..

    ReplyDelete
    Replies
    1. kalau saya tidak (belum) bisa setting transparant di conkyrc nya, jadinya pakai aplikasi feh. kurang lebih bisa buat script "sh" di Autostart (jangan lupa nanti di chmod +x)
      terus isinya (minimal):

      WALLPAPER="/home/soft-green.jpg"

      # Launch feh with the variable
      feh --bg-scale $WALLPAPER &
      sleep 3
      conky &

      ket:
      WALLPAPERnya = lokasi file desktop current kita
      kemudian coba restart (logout)

      Delete