Thank you for help.
I just switched my window manager to kwin (no compiz), same effect, two-layered grey conky wirth round corners. Thus I know for sure it's not compiz that screws it.
EDIT:
After restoring:
own_window_argb_visual yes
own_window_type normal
semi-transparency regained (no black rectangle).
Still a problem remains: my cover (current playing album cover) is also semi-transparent, when it shouldn't. Is there a way to fix it without running another conky instance just for the cover?
Last edited by Abdus; May 23rd, 2011 at 05:08 PM.
And you keep changing it back? Things can go real funny at home...
dafont, here i come...
The original i found on wallbase and is here on my dropbox. As wallpaper, i only use gimped versions of those images, i darken the sides to the color of the theme and i change the brightness, the result i use is here on my dropbox again.
I got a lot more... Mostly from wallbase.
Enjoy...
El Belgicano
-----------------
Laptop: 5 years old Asus M6N (ATI9600/9700 graphics, 512Mb RAM, Intel Mobile 1.66GHz, 60Gb HDD) running 10.04-Lucid Lynx pretty nicely.
No experience with kde.
Don't know if this will solve your problem.
http://conky.pitstop.free.fr/wiki/index.php5?title=Conky_KDE_Transparency_(en)
Last edited by stinkeye; May 24th, 2011 at 02:11 AM.
It should since one must make original Conky window fully transparent to make LUA transparent background.
Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | My Conky Pitstop corner | One4All project
what is happening is that the lua background is being drawn ontop of the album art image being called in the conkyrc
this also happens when you call weather images (not fonts) and i assume any other images
there doesnt seem to be a fix other than
1. modifying the lua script to take over the image display function
2. dont use the lua background, use a transparent image as a background
3. a separate conkyrc might work
2 is a bit trickier if you want curved corners etc
but for a straight rectangle all you need is a single 1 by 1 pixel image of the right color and transparency... call it in conky and stretch it to fit using the image commands
(thanks to Sector11 for that idea)
for 1... try this in the bg lua file
paste the code in the main function indicated below
image drawing codeCode:cairo_fill(cr) ##PASTE IMAGE DRAWING CODE HERE### cairo_surface_destroy(cs) cairo_destroy(cr) endCode:-------------------------------------------------------------- --height and width of displayed image iheight=130 iwidth=130 --position iacross=70 idown=900 --location of image image="/home/abd/.quodlibet/current.cover" ----------------------------------------------------- show = imlib_load_image(image) if show == nil then return end imlib_context_set_image(show) w_img, h_img = imlib_image_get_width(), imlib_image_get_height() width=iheight height=iwidth buffer = imlib_create_image(width, height) imlib_context_set_image(buffer) imlib_blend_image_onto_image(show, 0, 0, 0, w_img, h_img, 0, 0, width, height) imlib_context_set_image(show) imlib_free_image() imlib_context_set_image(buffer) imlib_render_image_on_drawable(iacross, idown) imlib_free_image() --------------------------------------------------------------
Last edited by mrpeachy; May 23rd, 2011 at 08:23 PM.
oj tam, oj tam
my test suite
conkyrc
Code:# ~/.conkyrc-test38 #-----Conky settings background no no_buffers yes # out_to_console yes top_cpu_separate no # cpu_avg_samples 10 # net_avg_samples 10 # max_port_monitor_connections 10 update_interval 1 total_run_times 0 #-----Text setings use_xft yes xftfont Bitstream Vera Sans Mono:size=13 xftalpha 0.8 # uppercase no # override_utf8_locale yes # format_human_readable no # short_units # max_user_text 64 # text_buffer_size 256 #-----Window settings own_window yes own_window_type override # own_window_argb_visual yes # own_window_argb_value 255 own_window_transparent yes own_window_colour black own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager own_window_class Conky own_window_title ConkyMRClock #----Layout settings minimum_size 645 770 # maximum_width 100 alignment top_left use_spacer right gap_x 100 gap_y 75 #-----Graphics settings draw_shades no draw_outline no draw_borders no draw_graph_borders yes stippled_borders 0 # border_inner_margin 16 border_width 1 double_buffer yes # max_specials 64 # imlib_cache_size 0 #-----Color settings default_color white default_shade_color black default_outline_color black #-----LUA load lua_load ~/.conky/lua/BGtest.lua # lua_draw_hook_pre conky_draw_bg TEXT ${lua conky_draw_bg}${image ~/.conky/images/BGtest-pic.jpg -p 100,100}
LUA
Code:--[[ Background by londonali1010 (2009) VinDSL Background Hack (2010-2011) 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 draw_bg Changelog: + v3.0 VinDSL Hack (01.28.2011) Killed memory leak. + v2.4 VinDSL Hack (01.25.2011) Declared all variables in local. + v2.3 VinDSL Hack (12.31.2010) Added shading example(s). + v2.2 VinDSL Hack (12.30.2010) Cleaned up the code a bit. + v2.1 VinDSL Hack (12.24.2010) Added cairo destroy function(s). + v2.0 VinDSL Hack (12.21.2010) Added height adjustment variable. + v1.0 Original release (07.10.2009) ]] --------------START OF PARAMETERS ------------ -- 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. local corner_r = 50 -- Set the colour and transparency (alpha) of your background (0.00 - 0.99). -- (Light Shading Example) -- local bg_colour = 0x4d4d4d -- local bg_alpha = 0.50 -- (Medium Shading Example) -- local bg_colour = 0x222222 -- local bg_alpha = 0.50 -- (Dark Shading Example) local bg_colour = 0x000000 local bg_alpha = 0.40 -- local bg_colour = 0x908C80 -- local bg_alpha = 0.2 -- Tweaks the height of your background, in pixels. If you don't need to adjust the height, use 0. -- (Default Setting) local vindsl_hack_height = 0 -- local vindsl_hack_height = -228 ---------------END OF PARAMETERS ------------- require 'cairo' local cs, cr = nil local 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 if cs == nil then cairo_surface_destroy(cs) end if cr == nil then cairo_destroy(cr) end local w = conky_window.width local h = conky_window.height local v = vindsl_hack_height local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) local 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+v-corner_r) cairo_curve_to(cr,w,h+v,w,h+v,w-corner_r,h+v) cairo_line_to(cr,corner_r,h+v) cairo_curve_to(cr,0,h+v,0,h+v,0,h+v-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) cairo_surface_destroy(cs) cairo_destroy(cr) return "" end
As you couldn't guess, "own_window_argb_visual yes" not only makes background of Conky transparent... it makes all Conky with any object inside opaque, and as so it is useless. And "own_window_transparent yes" makes pseudo transparency by copying system main window background to the Conky window, hence no icon is visible under.
Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | My Conky Pitstop corner | One4All project
interesting!
ive been playing around with conky settings
it is possible to get the lua background, have good images and have real transparency
but you need to call images in lua for it to work
(although i have to say the whole things seems a little hit or miss!)
the parts of interest
andCode:own_window yes own_window_type normal own_window_argb_visual yes ##own_window_argb_value 0 own_window_transparent yes ##own_window_type override own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
sorry, my test pic isnt as nice as your dk75Code:lua_load /home/mcdowall/lua/pictest.lua #lua_draw_hook_pre draw_bg TEXT TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST ${lua conky_draw_bg} ${image /home/mcdowall/Desktop/moviestill2.jpg -p 100,600 -s 130x130}
the top inage is from lua
the bottom through using the image object in conkyrc
you can see my icons underneath the test text
for some reason i couldnt call the same image in both the lua script and the conkyrc... otherwise both images appeared overbright and washed out
doing it the above way the bottom image gets washed out
doing it this way
you get the lua bg being drawn ontop of the conkyrc imageCode:lua_load /home/mcdowall/lua/pictest.lua lua_draw_hook_pre draw_bg TEXT TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST #${lua conky_draw_bg} ${image /home/mcdowall/Desktop/moviestill2.jpg -p 100,600 -s 130x130}
here is the bg and image script i used
you can copy and paste the image drawing code for as many images as you likeCode:--[[ Background by londonali1010 (2009) VinDSL Background Hack (2010-2011) Added ability to display images mrpeachy 2011 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 draw_bg Changelog: + v3.0 VinDSL Hack (01.28.2011) Killed memory leak. + v2.4 VinDSL Hack (01.25.2011) Declared all variables in local. + v2.3 VinDSL Hack (12.31.2010) Added shading example(s). + v2.2 VinDSL Hack (12.30.2010) Cleaned up the code a bit. + v2.1 VinDSL Hack (12.24.2010) Added cairo destroy function(s). + v2.0 VinDSL Hack (12.21.2010) Added height adjustment variable. + v1.0 Original release (07.10.2009) ]] --------------START OF PARAMETERS ------------ -- 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. local corner_r = 50 -- Set the colour and transparency (alpha) of your background (0.00 - 0.99). -- (Light Shading Example) -- local bg_colour = 0x4d4d4d -- local bg_alpha = 0.50 -- (Medium Shading Example) -- local bg_colour = 0x222222 -- local bg_alpha = 0.50 -- (Dark Shading Example) local bg_colour = 0x000000 local bg_alpha = 0.5 -- local bg_colour = 0x908C80 -- local bg_alpha = 0.2 -- Tweaks the height of your background, in pixels. If you don't need to adjust the height, use 0. -- (Default Setting) local vindsl_hack_height = 0 -- local vindsl_hack_height = -228 ---------------END OF PARAMETERS ------------- require 'cairo' require 'imlib2' local cs, cr = nil local 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 if cs == nil then cairo_surface_destroy(cs) end if cr == nil then cairo_destroy(cr) end local w = conky_window.width local h = conky_window.height local v = vindsl_hack_height local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) local 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+v-corner_r) cairo_curve_to(cr,w,h+v,w,h+v,w-corner_r,h+v) cairo_line_to(cr,corner_r,h+v) cairo_curve_to(cr,0,h+v,0,h+v,0,h+v-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) -------------------------------------------------------------- --height and width of displayed image (number scales original image 1=full size, 2 = half size) iheight=130 iwidth=130 --position iacross=105 idown=200 --location of image image="/home/mcdowall/Desktop/moviestill.jpg" ----------------------------------------------------- show = imlib_load_image(image) if show == nil then return end imlib_context_set_image(show) w_img, h_img = imlib_image_get_width(), imlib_image_get_height() width=iheight height=iwidth buffer = imlib_create_image(width, height) imlib_context_set_image(buffer) imlib_blend_image_onto_image(show, 0, 0, 0, w_img, h_img, 0, 0, width, height) imlib_context_set_image(show) imlib_free_image() imlib_context_set_image(buffer) imlib_render_image_on_drawable(iacross, idown) imlib_free_image() -------------------------------------------------------------- cairo_surface_destroy(cs) cairo_destroy(cr) return "" end
but that image code only works for images that contain no transparency so no good for weather images
QUESTION
is it possible to make a function in a lua script, for example
function image(filename,height,width)
code to draw the image
end
and then call that function in the conkyrc which supplies the variables?
TEXT
${lua image(/images/pic.jpg,200,200)}
Last edited by mrpeachy; May 23rd, 2011 at 11:18 PM.
Wow, thank you guys. I'm already getting a bit lost with all this code.
I used feh, and also mrpeachy's additional piece of code pasting image through lua. The image is being pasted, it is no more semi-transparent (that's progress!), but it's still being covered by lua's semi-transparent background, so colors are not so vivid as on the original. This also lets me skip using
own_window_argb_visual yes
whih used to be necessary to get any kind of semi-transparency.
Also my conky reports constantly:
Conky: llua_do_call: function conky_draw_bg execution failed: /home/abd/scripts/draw-bg.lua:95: attempt to call global 'imlib_load_image' (a nil value)
EDIT:
That's how it looks now:
Last edited by Abdus; May 24th, 2011 at 08:55 AM.
nothing can be
own_window_argb_visual yes overrides own_window_transparent yes so later is irrelevant
test that
Code:own_window yes own_window_type normal own_window_argb_visual yes ###own_window_argb_value 0 ###own_window_transparent yes
does this answers your question?
conkyrc
LUACode:# ~/.conkyrc-test38 #-----Conky settings background no no_buffers yes # out_to_console yes top_cpu_separate no # cpu_avg_samples 10 # net_avg_samples 10 # max_port_monitor_connections 10 update_interval 1 total_run_times 0 #-----Text setings use_xft yes xftfont Bitstream Vera Sans Mono:size=13 xftalpha 0.8 # uppercase no # override_utf8_locale yes # format_human_readable no # short_units # max_user_text 64 # text_buffer_size 256 #-----Window settings own_window yes own_window_type normal own_window_argb_visual yes own_window_argb_value 0 # own_window_transparent yes own_window_colour black own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager own_window_class Conky own_window_title ConkyMRClock #----Layout settings minimum_size 645 770 # maximum_width 100 alignment top_left use_spacer right gap_x 100 gap_y 75 #-----Graphics settings draw_shades no draw_outline no draw_borders no draw_graph_borders yes stippled_borders 0 # border_inner_margin 16 border_width 1 double_buffer yes # max_specials 64 # imlib_cache_size 0 #-----Color settings default_color white default_shade_color black default_outline_color black #-----LUA load lua_load ~/.conky/lua/BGtest.lua TEXT ${lua conky_draw_bg} ${lua conky_image_load /home/kitsune/.conky/images/BGtest-pic.jpg 75 75 2 2} ${lua conky_image_load /home/kitsune/.conky/images/BGtest-pic2.jpg 400 75 2 2} ${lua conky_image_load /home/kitsune/.conky/images/BGtest-pic2.jpg 75 425 2 2} ${lua conky_image_load /home/kitsune/.conky/images/BGtest-pic.jpg 375 425 2 2}
Code:--[[ Background by londonali1010 (2009) VinDSL Background Hack (2010-2011) Added ability to display images mrpeachy 2011 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 draw_bg Changelog: + v3.0 VinDSL Hack (01.28.2011) Killed memory leak. + v2.4 VinDSL Hack (01.25.2011) Declared all variables in local. + v2.3 VinDSL Hack (12.31.2010) Added shading example(s). + v2.2 VinDSL Hack (12.30.2010) Cleaned up the code a bit. + v2.1 VinDSL Hack (12.24.2010) Added cairo destroy function(s). + v2.0 VinDSL Hack (12.21.2010) Added height adjustment variable. + v1.0 Original release (07.10.2009) ]] --------------START OF PARAMETERS ------------ -- 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. local corner_r = 50 -- Set the colour and transparency (alpha) of your background (0.00 - 0.99). -- (Light Shading Example) -- local bg_colour = 0x4d4d4d -- local bg_alpha = 0.50 -- (Medium Shading Example) -- local bg_colour = 0x222222 -- local bg_alpha = 0.50 -- (Dark Shading Example) local bg_colour = 0x000000 local bg_alpha = 0.5 -- local bg_colour = 0x908C80 -- local bg_alpha = 0.2 -- Tweaks the height of your background, in pixels. If you don't need to adjust the height, use 0. -- (Default Setting) local vindsl_hack_height = 0 -- local vindsl_hack_height = -228 ---------------END OF PARAMETERS ------------- require 'cairo' require 'imlib2' local cs, cr = nil local 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 if cs == nil then cairo_surface_destroy(cs) end if cr == nil then cairo_destroy(cr) end local w = conky_window.width local h = conky_window.height local v = vindsl_hack_height local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height) local 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+v-corner_r) cairo_curve_to(cr,w,h+v,w,h+v,w-corner_r,h+v) cairo_line_to(cr,corner_r,h+v) cairo_curve_to(cr,0,h+v,0,h+v,0,h+v-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) cairo_surface_destroy(cs) cairo_destroy(cr) return "" end function conky_image_load(image, iacross, idown, width, height) -------------------------------------------------------------- if image == nil then print("Error: no image selected"); return "" end --height and width of displayed image (number scales original image 1=full size, 2 = half size) width = tonumber(width); if width == nil then width = 1 end height = tonumber(height); if height == nil then height = 1 end --position iacross = tonumber(iacross); if iacross == nil then iacross = 0 end idown = tonumber(idown); if idown == nil then idown = 0 end ----------------------------------------------------- show = imlib_load_image(image) if show == nil then print("Error: can't load image"); return "" end imlib_context_set_image(show) w_img, h_img = imlib_image_get_width(), imlib_image_get_height() if w_img == nil or h_img == nil then return "" end if width == 1 then width = w_img elseif width == 2 then width = w_img / 2 end if height == 1 then height = h_img elseif height == 2 then height = h_img / 2 end buffer = imlib_create_image(width, height) imlib_context_set_image(buffer) imlib_blend_image_onto_image(show, 0, 0, 0, w_img, h_img, 0, 0, width, height) imlib_context_set_image(show) imlib_free_image() imlib_context_set_image(buffer) imlib_render_image_on_drawable(iacross, idown) imlib_free_image() -------------------------------------------------------------- return "" end
Last edited by dk75; May 24th, 2011 at 04:53 PM.
Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | My Conky Pitstop corner | One4All project
Bookmarks