The Conky Blog The Official Blog for Conky, a Lightweight System Monitor

31Aug/090

Feature Feature: own_window_type panel

Conky 1.7.2 includes support for the panel window-type, which means that you can make your Conky behave like other panels. Here's what it looks like to replace a top panel with a Conky panel, so that system information is always on display, even over a maximised window:

own_window_type panel (Conky 1.7.2)

own_window_type panel (Conky 1.7.2)

own_window_type panel (Conky 1.7.2)

own_window_type panel (Conky 1.7.2)

To get Conky to behave like a panel, use the following window configuration before the TEXT in your .conkyrc:

own_window yes
own_window_transparent yes
own_window_type panel
own_window_hints undecorate,sticky,skip_taskbar,skip_pager # NB: normally, below is used here, but we don't want that for our panel

Additionally, if you want your panel to stretch all the way across like in the screenie, and flush against the side of the screen, you'll need:

border_inner_margin 0
border_outer_margin 0
minimum_size 1024 0 # replace 1024 with the horizontal resolution of your monitor, if applicable

A final word of warning: if you want your panel to be all on one line, like the screenie above, be sure to code your Conky all in one line, even if you use $goto and $voffset to control text placement. If your code is on three lines, for instance, the size of the Conky window will be big enough for three lines, even if what they output doesn't stretch down that far.

To get your panel to look just like the one in the screenie, there are a couple of finishing touches:

  1. Use a program like GIMP to create a small (e.g. 50x50 px) semi-transparent black square, and stretch it with the $image variable's -s (size) flag to the size of the panel you want.
  2. Normally, if you're using Compiz, you want to disable shadows around your Conky window, but for this one, the shadow is quite nice and makes our panel look even more panel-ish!

The .conkyrc for the screenies above is:

background no
update_interval 1
total_run_times 0
cpu_avg_samples 2
net_avg_samples 2
own_window yes
own_window_type panel
own_window_transparent yes
own_window_class Conky-Panel
own_window_hints undecorate,sticky,skip_taskbar,skip_pager
border_inner_margin 0
border_outer_margin 0
double_buffer yes
no_buffers yes
text_buffer_size 2048
imlib_cache_size 0
override_utf8_locale yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
use_spacer none
minimum_size 1024 0
alignment top_middle
gap_x 0
gap_y 0
uppercase no
top_name_width 7
use_xft yes
xftfont Sawasdee Bold:size=8
xftalpha 0.8
default_color ffffff

TEXT
${goto 5}${voffset 3}CPU ${cpu}%${goto 60}${voffset -1}${font saxMono:size=8}[${top name 1} (${top cpu 1})] [${top name 2} (${top cpu 2})] [${top name 3} (${top cpu 3})]${font}${goto 425}${voffset -1}MEM ${memperc}%${goto 485}${voffset -1}${font saxMono:size=8}[${top_mem name 1} (${top_mem mem 1})] [${top_mem name 2} (${top_mem mem 2})] [${top_mem name 3} (${top_mem mem 3})]${font}${voffset -2}${font Sawasdee Bold:size=10}${alignr 5}${time %a, %d %b %Y %H.%M}${image ~/Pictures/bk_semi_trans_sq.png -s 1024x18 -p 0,0}${if_match ${battery_percent BAT1} <= 14}${image ~/Pictures/Batteries/battery_1.png -s 16x16 -p 845,1}${else}${if_match ${battery_percent BAT1} <= 27}${image ~/Pictures/Batteries/battery_2.png -s 16x16 -p 845,1}${else}${if_match ${battery_percent BAT1} <= 41}${image ~/Pictures/Batteries/battery_3.png -s 16x16 -p 845,1}${else}${if_match ${battery_percent BAT1} <= 54}${image ~/Pictures/Batteries/battery_4.png -s 16x16 -p 845,1}${else}${if_match ${battery_percent BAT1} <= 68}${image ~/Pictures/Batteries/battery_5.png -s 16x16 -p 845,1}${else}${if_match ${battery_percent BAT1} <= 82}${image ~/Pictures/Batteries/battery_6.png -s 16x16 -p 845,1}${else}${if_match ${battery_percent BAT1} < 95}${image ~/Pictures/Batteries/battery_7.png -s 16x16 -p 845,1}${else}${image ~/Pictures/Batteries/battery_full.png -s 16x16 -p 845,1}${endif}${endif}${endif}${endif}${endif}${endif}${endif}

Special thanks go to *MrStylo for his superb battery icons, and to =mrcool256 for his devastatingly beautiful wallpaper image.

Filed under: Features No Comments
28Aug/090

Feature Feature: Built-in Lua Bindings for Cairo

Cairo Pie Screenshot

Cairo Pie Screenshot

As you may have read in the Conky 1.7.2 feature tour, one of the most exciting new features is the ability to draw directly to Conky's window, using Cairo and/or imlib2. As a demonstration, our own Brenden wrote a little Lua script to use Cairo to draw top information as a pie chart. I modified the script slightly to make it fit with my current desktop...et voila!

To reproduce the look above, I've packaged my .conkyrc, Brenden's original cairo-pie.lua and the cairo-pie.lua I modified, over on my gnome-look.org profile.

There are other examples of Lua scripts for Conky over at norsetto.890m.com and further samples of Cairo scripts at cairographics.org.

Enjoy!

Filed under: Features No Comments
26Aug/094

Conky 1.7.2 Released!

As of Monday, Conky 1.7.2 has been officially released!

You can get the files for this release in the usual spot, and there's a feature tour over on the Wiki.

Just a small taster of the new features:

  • Built in Lua bindings for Cairo and Imlib2, which allows you to draw directly to Conky's window using Cairo and/or Imlib2.
  • Added own_window_type panel.
  • $weather: download, parse and display METAR data.
  • $desktop, $desktop_number and $desktop_name: current desktop number and name, total number of available desktops.

Have a go and let us know what you think!

Filed under: Announcements 4 Comments
26Aug/090

Welcome to the new blog!

Welcome to the brand new Official Conky Blog. Stay tuned for the latest development updates, features, and sneak peeks!

For the time being, please use the links on this page to find all the Conky info you desire.

Filed under: Announcements No Comments
   

Essential Links

Categories

Archive Posts