Jump to content


  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About 0.zer0

  • Rank
  1. 0.zer0

    [SOLVED] Adding Conky to Enlightenment Desktop

    I have a conky that I've been using in the GNOME version of Ubuntu 10.04 for a while now. It's pretty basic, but uses a lua script to add a transparent shade to a transparent conky. I had been getting a glitch when I first invoked it to where the conky would draw on the right-hand side, as it's supposed to, but a blank area was also being drawn on the left-hand side as well. I got that fixed by changing the own_window_type from override to normal. Despite this small victory I'm still not able to get it running like I have it on my Ubuntu install. Picture included is this conky as seen with a white desktop wallpaper. Here are my scripts: .conkyrc # CONKY # Create own window instead of using desktop (required in nautilus) own_window yes own_window_type normal own_window_transparent yes own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager # Use double buffering (reduces flicker, may not work for everyone) double_buffer yes # fiddle with window use_spacer yes use_xft yes xftfont Dejavu Sans Mono:size=9 # Update interval in seconds update_interval 1.0 # Minimum size of text area minimum_size 300 5 maximum_width 300 # Draw shades? draw_shades no # Text stuff draw_outline no # amplifies text if yes draw_borders no # font arial uppercase no # set to yes if you want all text to be in uppercase # Stippled borders? stippled_borders 3 # border margins border_margin 9 # border width border_width 10 # Default colors and also border colors, grey90 == #e5e5e5 default_color white own_window_colour brown own_window_transparent yes # Text alignment, other possible values are commented #alignment top_left alignment top_right #alignment bottom_left #alignment bottom_right # Gap between borders of screen and text gap_x 10 gap_y 10 lua_load /home/zer0/.draw_bg.lua lua_draw_hook_pre draw_bg # stuff after 'TEXT' will be formatted on screen TEXT $color ${color 97979C}SYSTEM ${hr 2}$color Bodhi Linux (10.04) $nodename $sysname $kernel on $machine Uptime: ${uptime} ${color 97979C}CPU ${hr 2}$color ${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'} ${freq}MHz Load: ${loadavg} $cpu % $cpubar ${cpugraph} NAME PID CPU% MEM% ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} ${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} ${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} ${color 97979C}MEMORY ${hr 2}$color Used: $mem of $memmax RAM: $memperc% ${membar 6}$color Swap: $swapperc% ${swapbar 6}$color ${color 97979C}DISKS ${hr 2}$color /: Used ${fs_used /} of ${fs_size /} ${alignr}${fs_free_perc /}% ${fs_bar 6 /}$color /home: Used ${fs_used /home} of ${fs_size /home} ${alignr}${fs_free_perc /home}% ${fs_bar 6 /home/zer0} ${if_mounted /media/sdcrzr4gb}sdcrzr4gb: Used ${fs_used /media/sdcrzr4gb} of ${fs_size /media/sdcrzr4gb} ${alignr}${fs_free_perc /media/sdcrzr4gb}% ${fs_bar 6 /media/sdcrzr4gb}$color$endif ${color 97979C}NETWORK ${hr 2}$color EXTERNAL IP: ${execi 3600 wget -O - http://www.whatismyip.com/automation/n09230945.asp} LAN IP: (${addr eth0}) Down: $color${downspeed eth0} kb/s ${alignr}Up: ${upspeed eth0} kb/s ${downspeedgraph eth0 25,140} ${alignr}${upspeedgraph eth0 25,140}$color Total: ${totaldown eth0} ${alignr}Total: ${totalup eth0} Inbound: ${tcp_portmon 1 32767 count} Outbound: ${tcp_portmon 32768 61000 count}${alignr}Total: ${tcp_portmon 1 65535 count} .draw_bg.lua --[[ 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.50 local bg_colour = 0x222222 local bg_alpha = 0.35 -- 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 = 0 ---------------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) end