Small yet Functional Conky


Written by

Here’s my small but functional conky config (conkyrc).

It displays:

  • Battery
  • CPU Utilisation
  • RAM Utilisation
  • SWAP Utilisation
  • Hard Drive Usage
  • eth0 and wlan0 stats
  • Public IP
  • Wireless Info
  • Clock

Some bits you might want to change according to your distro.

######################
# - Conky settings - #
######################
update_interval 2
total_run_times 0
net_avg_samples 1
cpu_avg_samples 2

imlib_cache_size 0
double_buffer yes
no_buffers yes

format_human_readable

#####################
# - Text settings - #
#####################
use_xft yes
xftfont Droid Sans:size=8
override_utf8_locale yes
text_buffer_size 2048

#############################
# - Window specifications - #
#############################
own_window_class Conky
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

alignment top_right
gap_y 40
gap_x 20
border_inner_margin 8

minimum_size 180 300
maximum_width 180
maximum_height 460

default_bar_size 92 6

#########################
# - Graphics settings - #
#########################
draw_shades no
default_shade_color 000000
default_color FFFFFF

TEXT
${font Droid Sans:style=Bold:size=8}DEBIAN LINUX $hr${font}
##############
# -   OS       - #
##############
${voffset 5}${font OpenLogos:size=35}J${font}${goto 45}${voffset -30}Name:  ${alignr}${nodename}
${goto 45}OS: ${alignr}Debian Wheezy
${goto 45}Kernel: ${alignr}${kernel}
${goto 45}Uptime: ${alignr}${uptime}
${voffset 8}${font Droid Sans:style=Bold:size=8}SYSTEM $hr${font}
##############
# - SYSTEM - #
##############
# |--SWAP
${voffset 5}${font Droid Sans:style=Bold:size=8}BATT${font}${goto 45}Rem: ${font Droid Sans:style=Bold:size=8}${battery_percent BAT0}%${font} ${alignr}${battery_bar 7,70 BAT0}
${goto 45}Status: ${font Droid Sans:style=Bold:size=8}${battery BAT0}${font}
# |--CPU
${voffset 6}${font Droid Sans:style=Bold:size=8}CPU${font}${offset -20}${goto 45}Core 1: ${font Droid Sans:style=Bold:size=8}${cpu cpu1}%${font} ${alignr}${cpubar cpu2 7,70 EEEEEE}
${goto 45}Core 2: ${font Droid Sans:style=Bold:size=8}${cpu cpu2}%${font} ${alignr}${cpubar cpu2 7,70 EEEEEE}
# |--MEM
${voffset 6}${font Droid Sans:style=Bold:size=8}RAM${font}${goto 45}RAM: ${font Droid Sans:style=Bold:size=8}$memperc%${font} ${alignr}${membar 7,70}
${goto 45}Free: ${font Droid Sans:style=Bold:size=8}${memeasyfree}${font} ${goto 115}Used: ${font Droid Sans:style=Bold:size=8}${mem}${font}
# |--HDD
${voffset 6}${font Droid Sans:style=Bold:size=8}HDD${font}${goto 45}/: ${font Droid Sans:style=Bold:size=8}${fs_used_perc /}%${font} ${alignr}${fs_bar 7,70 /}
${goto 45}Free: ${font Droid Sans:style=Bold:size=8}${fs_free /}${font} ${goto 115}Used: ${font Droid Sans:style=Bold:size=8}${fs_used /}${font}
# |--SWAP
${voffset 5}${font Droid Sans:style=Bold:size=8}SWAP${font}${goto 45}Swap: ${font Droid Sans:style=Bold:size=8}${swapperc}%${font} ${alignr}${swapbar 7,70}
${goto 45}Free: ${font Droid Sans:style=Bold:size=8}$swapmax${font} ${goto 115}Used: ${font Droid Sans:style=Bold:size=8}$swap${font}
###############
# - NETWORK - #
###############
${voffset 8}${font Droid Sans:style=Bold:size=8}NETWORK $hr${font}
${voffset 5}${font Droid Sans:style=Bold:size=8}Public${font}${goto 45}Addr:${goto 85}${font Droid Sans:style=Bold:size=8}${execi 240 curl http://automation.whatismyip.com/n09230945.asp}${font}
${if_existing /proc/net/route wlan0}${voffset 5}${font Droid Sans:style=Bold:size=8}waln0${font}${goto 45}Addr:${goto 85}${font Droid Sans:style=Bold:size=8}${addr wlan0}${font}
${goto 45}Down:${goto 85}${font Droid Sans:style=Bold:size=8}${downspeed wlan0}${font}${alignr}${downspeedgraph wlan0 8,50 EEEEEE}
${goto 45}Up:${goto 85}${font Droid Sans:style=Bold:size=8}${upspeed wlan0}${font}${alignr}${upspeedgraph wlan0 8,50 EEEEEE}
${goto 45}Total:${goto 85}${font Droid Sans:style=Bold:size=8}${totaldown wlan0}${font} / ${font Droid Sans:style=Bold:size=8}${totalup wlan0}${font}${else}${font Droid Sans:style=Bold:size=8}wlan0${font}${goto 45}Not Conencted${endif}
${if_existing /proc/net/route eth0}${voffset 5}${font Droid Sans:style=Bold:size=8}eth0${font}${goto 45}Addr:${goto 85}${font Droid Sans:style=Bold:size=8}${addr eth0}${font}
${goto 45}Down:${goto 85}${font Droid Sans:style=Bold:size=8}${downspeed eth0}${font}${alignr}${downspeedgraph eth0 8,50 EEEEEE}
${goto 45}Up:${goto 85}${font Droid Sans:style=Bold:size=8}${upspeed eth0}${font}${alignr}${upspeedgraph eth0 8,50 EEEEEE}
${goto 45}Total:${goto 85}${font Droid Sans:style=Bold:size=8}${totaldown eth0}${font} / ${font Droid Sans:style=Bold:size=8}${totalup eth0}${font}${else}${font Droid Sans:style=Bold:size=8}eth0${font}${goto 45}Not Connected${endif}
${if_existing /proc/net/route wlan0}${voffset 8}${font Droid Sans:style=Bold:size=8}WIRELESS $hr${font}
${voffset 5}${goto 45}Int:${goto 85}${font Droid Sans:style=Bold:size=8}wlan0${font}
${goto 45}SSID:${goto 85}${font Droid Sans:style=Bold:size=8}${wireless_essid wlan0}${font}
${goto 45}Speed:${goto 85}${font Droid Sans:style=Bold:size=8}${wireless_bitrate wlan0}${font}
${goto 45}Signal:${goto 85}${font Droid Sans:style=Bold:size=8}${wireless_link_qual_perc wlan0}%${font}${alignr}${wireless_link_bar 7,70 wlan0}${endif}
#############
# - CLOCK - #
#############
${voffset 8}${font Droid Sans:style=Bold:size=8}CLOCK $hr${font}
${font Droid Sans:size=20}${alignc}${time %l:%M %p}${font}
${alignc}${time %d %B %Y}

It requires openlogos font too for the debian/distro logo and curl for the public ip. The initial script isn’t mine; it’s just oen I found and them modified.

Updates and Newness…


Written by

So this afternoon, I decided to upload and release my latest function mailattch. This function takes php’s mail to a whole new level, allowing files to be attached!

There are currently limitations to it and it isn’t highly tested but everyone is welcome to use it and is release under GPL v3.

I have also pushed a little update to ldir. It’s nothing big, just a shameless link back to here; if you really don’t like it then you’re free to remove it from the function source or you can hide is with CSS via display: none; on the class .ldir_link.

That’s all for now.

ldir 1.7.10 Released


Written by

After reading through ldir’s latest release I found a few bugs which have now been fixed in ldir 1.7.10.

I’ve also rewritten the icon file type check, so we assume some common file types are available and then add any new ones to the array on that call, so if that type is found again in that folder, the icon is already known. All in all resulting in a considerably faster speed for listing the same file types or common files.

There are more extensions supported than listed but I chose not to include them all but you can if you wish.

I will also be looking at overhauling the icons and providing them as a pack allowing you to self host which at the moment isn’t possible due to licesning issue.

Version 1.7.10

  • Speed optimisations
  • Rewrote icon checking
  • Added supported common icons list
  • Suppressed header() / ob_flush() calls
  • Fixed ‘parent folder’ link not working

Another ldir Update!


Written by

Yes, I know… No updates for nearly 12 months and then two come along in the same week!

ldir version 1.7.9 is now 10% smaller than 1.7.8! As well as saving minimal disk space, it’s also had some speed increaces.

The only downside is that we had to remove error code 3 from the function in order to speed it up; there are more speed increases to be had if I could reliably detect the file type icons with a fail over if there isn’t a type without utilising cURL.

If you want to customise ldir to not do those checks and just ignore unknown file type icons then the following code alterations will make a significant speed increase.

Change: (approx line 160)

$img = "unknown.png";
$type = "Unknown File";
//Remove this check to speed things up.
if(ldir_url_exists($ldir['im'].strtolower($ext).".png",$ldir['v'])) {
    $img = strtolower($ext).".png";
    $type = strtoupper($ext)." File";
}

To:

$img = strtolower($ext).".png";
$type = strtoupper($ext)." File";

ldir update


Written by

It’s been nearly a year since any update to ldir; mainly because it’s working quite well without any bugs etc but this update is only minor.

Here’s the Change Log

Version 1.7.8

  • Added better support for styling – Removed inline width CSS & Added CSS styles for each column
  • Removed some linebreaks.
  • Removed/Condensed some code (upto 7% smaller)
  • Custom UserAgent in CURL Opts.

So in simple terms, I’ve made it tell dropbox (the icon host) that it’s a web app, removed clutter around the code, condensed a few lines and added selectors rather than inline css so styling it (and making it responsive) should be much easier.