- Home
- Welcome
- Bienvenido
- Benvenuto
- Bienvenue
- Gallery
- 2009
- By: Bruce
- By: Uncertain
- By: steelcap
- By: Crinos512
- By: Jameshardy88
- By: Delvien
- By: londonali1010
- By: dmillerct
- By: Scarf
- By: Craig Watson
- By: AoSteve
- By: micheal.h4lios
- By: deegan
- By: arpinux
- By: Sarai the Geek
- By: puma303
- By: LostDakota
- BY: aymara
- By: searchOne
- By: 5BallJuggler
- By: proxess
- By: Hanna
- By: Proto
- By: mrpeachy
- By: miegiel
- 2010
- 2009
You can draw a really simple background for your Conky using Lua/Cairo, like so:
I’ve written a quick little script, in which you can specify the colour and alpha of the background, and the radius of the rounded corners, if you so wish (draw_bg.lua.tar.gz):
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 | --[[ Background by londonali1010 (2009) This script draws a background to the Conky window. It covers the whole of the Conky window, but you can specify rounded corners, if you wish. To call this script in Conky, use (assuming you have saved this script to ~/scripts/): lua_load ~/scripts/draw_bg.lua lua_draw_hook_pre Changelog: + v1.0 -- Original release (07.10.2009) ]] -- Change these settings to affect your background. -- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0. corner_r=15 -- Set the colour and transparency (alpha) of your background. bg_colour=0xffffff bg_alpha=0.5 require 'cairo' function rgb_to_r_g_b(colour,alpha) return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha end function conky_draw_bg() if conky_window==nil then return end local w=conky_window.width local h=conky_window.height local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h) cr=cairo_create(cs) cairo_move_to(cr,corner_r,0) cairo_line_to(cr,w-corner_r,0) cairo_curve_to(cr,w,0,w,0,w,corner_r) cairo_line_to(cr,w,h-corner_r) cairo_curve_to(cr,w,h,w,h,w-corner_r,h) cairo_line_to(cr,corner_r,h) cairo_curve_to(cr,0,h,0,h,0,h-corner_r) cairo_line_to(cr,0,corner_r) cairo_curve_to(cr,0,0,0,0,corner_r,0) cairo_close_path(cr) cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg_alpha)) cairo_fill(cr) end |
The wallpaper in the screenie above is from fiftyfootshadows.net.
Happy Conkying!
Author: londonali1010
Distro: Crunchbang 9.04
Conky Version: 1.7.2-all