Author Topic: Conky Support, Codes and Screenshots  (Read 266522 times)

Sector11

  • Posts: 870
    • View Profile
Re: v9000 weather - a default template
« Reply #300 on: March 11, 2013, 06:18:59 PM »
@ jedi

OK, second time ... I had started this ... and Iceweasel locked up!  Very very ODD!

Yea, if it can be said that a font can be sexy, then monofur is the sexiest font of the mono fonts.   8)


Yes, it's a trade secret and it will cost you €36,000,000.00
WOW!  That was fast, and in my Numberd Swiss Account too!  ???

OK since you paid up front it's an old pipmenu I found on the ARCH forums years ago.

/home/sector11/.config/openbox/scripts/yweather.py
Code: [Select]
#!/usr/bin/python

import urllib
from xml.etree.cElementTree import parse
from datetime import datetime, timedelta
import os
from os.path import join
from sys import argv
try:
    import cPickle as pickle
except ImportError:
    import pickle

#Usage: yweather.py AYXX0001 Celsius

if len(argv) != 3:
    raise Exception('Usage: yweather.py zip_code units. zip_code is your city code in Yahoo Weather, units can be Celsius or Fahrenheit.')
else:
    zip_code = argv[1]
    if argv[2] == 'Fahrenheit' or argv[2] == 'fahrenheit':
        units = 'f'
    else:
        units = 'c'



CACHE_HOURS = 1

#http://weather.yahooapis.com/forecastrss
WEATHER_URL = 'http://xml.weather.yahoo.com/forecastrss?p=%s&u=%s'
WEATHER_NS = 'http://xml.weather.yahoo.com/ns/rss/1.0'

def weather_for_zip(zip_code, units):
    url = WEATHER_URL % (zip_code, units)
    rss = parse(urllib.urlopen(url)).getroot()
    forecasts = []
    for element in rss.findall('channel/item/{%s}forecast' % WEATHER_NS):
        forecasts.append(dict(element.items()))
    ycondition = rss.find('channel/item/{%s}condition' % WEATHER_NS)
    return {
        'current_condition': dict(ycondition.items()),
        'forecasts': forecasts,
        'title': rss.findtext('channel/title'),
        'pubDate': rss.findtext('channel/item/pubDate'), #rss.findtext('channel/lastBuildDate'),
        'location': dict(rss.find('channel/{%s}location' % WEATHER_NS).items()),
        'wind': dict(rss.find('channel/{%s}wind' % WEATHER_NS).items()),
        'atmosphere': dict(rss.find('channel/{%s}atmosphere' % WEATHER_NS).items()),
        'astronomy': dict(rss.find('channel/{%s}astronomy' % WEATHER_NS).items()),
        'units': dict(rss.find('channel/{%s}units' % WEATHER_NS).items())
    }

def print_openbox_pipe_menu(weather):
    print '<openbox_pipe_menu>'
    print '<separator label="%s %s" />' % (weather['location']['city'],weather['pubDate'])
    print '<separator label="Current conditions" />'
    print '<item label="Weather: %s" />' % weather['current_condition']['text']
    print '<item label="Temperature: %s %s" />' % ( weather['current_condition']['temp'],
                                          weather['units']['temperature'] )
    print '<item label="Humidity: %s%%" />' % weather['atmosphere']['humidity']
    print '<item label="Visibility: %s %s" />' % ( weather['atmosphere']['visibility'],
                                          weather['units']['distance'] )
   
    #pressure: steady (0), rising (1), or falling (2)
    if weather['atmosphere']['rising'] == 0:
        pressure_state = 'steady'
    elif weather['atmosphere']['rising'] == 1:
        pressure_state = 'rising'
    else:
        pressure_state = 'falling'
    print '<item label="Pressure: %s %s (%s)" />' % ( weather['atmosphere']['pressure'],
                                          weather['units']['pressure'], pressure_state )
    print '<item label="Wind chill: %s %s" />' % ( weather['wind']['chill'],
                                          weather['units']['temperature'] )
    print '<item label="Wind direction: %s degrees" />' % weather['wind']['direction']
    print '<item label="Wind speed: %s %s" />' % ( weather['wind']['speed'],
                                          weather['units']['speed'] )
    print '<item label="Sunrise: %s" />' % weather['astronomy']['sunrise']
    print '<item label="Sunset: %s" />' % weather['astronomy']['sunset']
    for forecast in weather['forecasts']:
        print '<separator label="Forecast: %s" />' % forecast['day']
        print '<item label="Weather: %s" />' % forecast['text']
        print '<item label="Min temperature: %s %s" />' % ( forecast['low'],
                                                weather['units']['temperature'] )
        print '<item label="Max temperature: %s %s" />' % ( forecast['high'],
                                                weather['units']['temperature'] )
    print '</openbox_pipe_menu>'

cache_file = join(os.getenv("HOME"), '.yweather.cache')

try:
    f = open(cache_file,'rb')
    cache = pickle.load(f)
    f.close()
except IOError:
    cache = None

if cache == None or (zip_code, units) not in cache or (
        cache[(zip_code, units)]['date'] + timedelta(hours=CACHE_HOURS) < datetime.utcnow()):
    # The cache is outdated
    weather = weather_for_zip(zip_code, units)
    if cache == None:
        cache = dict()
    cache[(zip_code, units)] = {'date': datetime.utcnow(), 'weather': weather}
   
    #Save the data in the cache
    try:
        f = open(cache_file, 'wb')
        cache = pickle.dump(cache, f, -1)
        f.close()
    except IOError:
        raise
else:
    weather = cache[(zip_code, units)]['weather']

print_openbox_pipe_menu(weather)

You have to edit the "menu.xml" in a text editor, the graphical app doesn't do it.

Each entry also need a unique "id=" so the script can tell the difference.

Two for BuenosAires:
Code: [Select]
<menu execute="python ~/.config/openbox/scripts/yweather.py ARDF0127 Celsius" id="pipe-weather-bsas1" label="Buenos Aires"/>
<menu execute="python ~/.config/openbox/scripts/yweather.py ARBA0009 Celsius" id="pipe-weather-bsas2" label="Ezeiza"/>

The codes: ARDF0127 & ARBA0009 are the same you'd find at weather.com for your city of choice.
Notice the distince "id=" codes.

Santa's House is really in Alert, Nunavut, the worlds most northerly populated point year round.


Been there, Done that
Wore out the tee-shirt
So I can't prove it!

Any questions just ask.

Stay Home

sevensage

  • Posts: 6
    • View Profile
Re: Battery Monitor
« Reply #301 on: March 12, 2013, 08:01:20 PM »
Well after a couple of weeks of wondering where I went wrong somewhere along the way I created a bash script pointing to pm-suspend (no idea why) the original was calling the command directly
Code: [Select]
exec /usr/sbin/pm-suspend
so the whole thing  looks like so
Code: [Select]
BAT ${if_existing /sys/class/power_supply/AC0/online 0}${if_match ${battery_percent BAT1} <= 20}${if_match ${battery_percent BAT1} <= 17}${if_match ${battery_percent BAT1} <= 15}${color red}${exec /usr/sbin/pm-suspend}$else${color red}${execi 60 /home/mini/.scripts/criticalbat.py}$endif$else${color

feeling sheepish, thanks

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: v9000 weather - a default template
« Reply #302 on: March 16, 2013, 08:28:11 AM »
Funny - and thanks ... from S12 too.

She smiled a big one!


 ;D

And thanks for those, Im a little low and just getting to it  ::)
Don't Be A Dick!

VastOne

  •      v-ger
  • Posts: 4226
    • View Profile
    • VSIDO Community
Single line Conky with Gmail support
« Reply #303 on: March 18, 2013, 07:04:58 PM »
Since Google made the lame decision to end Google Reader, I had no need for 2 conky's anymore and set out on a quest to create a Gmail space on the single line top conky

Here is the .conkyrc - Take note to change both YOURGMAILUSERNAME and YOURPASSWORD

Code: [Select]
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on #!
 
# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_type normal
#own_window_transparent no
#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 right

# Use Xft?
use_xft yes
xftfont Liberation Sans:size=16
xftalpha 0.9
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
#minimum_size 1024 0
#maximum_width 1024

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
own_window_argb_visual no
own_window_type panel
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky

# Stippled borders?
stippled_borders 0

# border margins
# border_margin 0

# border width
border_width 1

# Default colors and also border colors
#default_color grey
#color2=white
#color3=grey
#default_shade_color black
#default_outline_color grey
own_window_colour 000000

# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 5
minimum_size 1700 29
maximum_width 1700
# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

imlib_cache_size 0 

# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

#lua_load ~/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
TEXT
${image /home/vastone/images/vsidoorb.png -s 31x31 -p 1,-1}       ${color 7D8C93}Kernel${color 55688A} $kernel ${color 7D8C93} Uptime ${color lime green}${uptime_short} ${color 7D8C93} CPU ${color 55688A}${cpu cpu0}%  ${color 7D8C93}MEM ${color 55688A}${memperc}% ${mem} / ${memmax} ${color 7D8C93} CPU ${color 55688A}${platform it87.552 temp 2}° ${color 7D8C93} MB ${color 55688A}${platform it87.552 temp 1}° ${color 7D8C93}GPU ${color 55688A}${nvidia temp}° ${color 7D8C93}HD${color 55688A} ${execi 5 hddtemp -n /dev/sda}° ${color 7D8C93}NET${color 55688A}  ${voffset 3}${downspeedgraph eth0 14,100 000000 ff0000}  ${upspeedgraph eth0 14,100 000000 00ff00} ${voffset -11} ${color 55688A} ${time %I:%M}${time %P}  ${color 7D8C93}Gmail ${color lime green} ${execi 60 ~/.scripts/gmail.sh YOURGMAILUSERNAME YOURPASSWORD} ${offset -192} ${voffset 18}  ${color 55688A} ${time %a %b %d %Y}

Here is the bash file needed to run it ... in my conkyrc I run it from ~/.scripts  ... Wherever you save it to, make the change to the path in the .conkyrc and also make the file executable

gmail.sh

Code: [Select]
#!/bin/bash

wget -q -O - [url]https://mail.google.com/mail/feed/atom[/url] --http-user="$1"@gmail.com --http-password="$2" - | grep fullcount | sed 's/[^0-9]//g'

exit

Screenshot



Here is the same setup with the default .conkyrc from a VSIDO install - Take note to change both YOURGMAILUSERNAME and YOURPASSWORD

Code: [Select]
# .conkyrc - Edited from various examples across the 'net
# Used by VastOne on #!
 
# Create own window instead of using desktop (required in nautilus)
#own_window yes
#own_window_type normal
#own_window_transparent no
#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 right

# Use Xft?
use_xft yes
xftfont liberation sans:size=13
xftalpha 0.9
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
#minimum_size 1024 0
#maximum_width 1024

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
own_window_argb_visual yes
own_window_type panel
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi

# Stippled borders?
stippled_borders 0

# border margins
# border_margin 0

# border width
border_width 1

# Default colors and also border colors
#default_color grey
#color2=white
#color3=grey
#default_shade_color black
#default_outline_color grey
own_window_colour 000000

# Text alignment, other possible values are commented
#alignment top_middle
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 0
gap_y 5
minimum_size 1700 29
maximum_width 1700
# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

# lua_load ~/Conky/LUA/draw-bg.lua
# lua_draw_hook_pre draw_bg 10 0 0 0 0 0x000000 0.3
#
TEXT
${image $HOME/images/vsidoorb.png -s 34x34 -p 1,-1}       ${color 73AEB4}Kernel${color 7D8C93} $kernel ${color 73AEB4} Uptime ${color lime green}${uptime_short} ${color 73AEB4} CPU ${color 7D8C93}${cpu cpu0}%  ${color 73AEB4}MEM ${color 7D8C93}${memperc}% ${mem} / ${memmax} ${color 73AEB4} HD ${color 7D8C93} ${execi 5 hddtemp -n /dev/sda}° ${color 73AEB4}NET${color 7D8C93}  ${voffset 1}${downspeedgraph eth0 12,70 000000 ff0000}  ${upspeedgraph eth0 12,70 000000 00ff00} ${color 7D8C93} Gmail ${color lime green} ${execi 10 ~/.scripts/gmail.sh YOURGMAILUSERNAME YOURPASSWORD}

Screenshot

VSIDO      VSIDO FB       

    I dev VSIDO

Sector11

  • Posts: 870
    • View Profile
Re: Battery Monitor
« Reply #304 on: March 19, 2013, 12:57:40 PM »
I just saw this ... however not having a "battery" means I couldn't have helped anyway.

BUT ... just wanted you to know I wasn't ignoring ya - I would have at least used Google to try to help.
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: Conky Codes and Images
« Reply #305 on: March 22, 2013, 06:31:26 AM »
Heres the config for my new one



conky_system
Code: [Select]
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 275 1000
maximum_width 275
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment tl
gap_x 15
gap_y 45
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes

### LUA Load ###
lua_load /home/luke/Conky/allcombined_2.lua

## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}

TEXT
${image /home/luke/Conky/CPU.png -s 150x75 -p 65,5}${lua draw_bg {25,0,0,0,0,0x000000,0.3}}




${goto 5}${font Pseudo APL:Bold:size=14} Core1${goto 90}${cpu cpu1}${font SansMono:Bold:size=11}%${goto 150}Core2${goto 235}${cpu cpu2}${font SansMono:Bold:size=11}%
${goto 5}${font Pseudo APL:Bold:size=14} Core3${goto 90}${cpu cpu3}${font SansMono:Bold:size=11}%${goto 150}Core4${goto 235}${cpu cpu4}${font SansMono:Bold:size=11}%
${goto 5}${font Pseudo APL:Bold:size=14} Core5${goto 90}${cpu cpu5}${font SansMono:Bold:size=11}%${goto 150}Core6${goto 235}${cpu cpu6}${font SansMono:Bold:size=11}%
#${goto 15}${cpubar cpu0 30,245}
${lua gradbar {15,143,"${cpu cpu0}",100,63,2,30,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}


${goto 20}${font Pseudo APL:Bold:size=12}${top name 1} ${goto 115}${top pid 1} ${goto 185}${top cpu 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 2} ${goto 115}${top pid 2} ${goto 185}${top cpu 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 3} ${goto 115}${top pid 3} ${goto 185}${top cpu 3}${font SansMono:Bold:size=11}%

${image /home/luke/Conky/memory.png -s 225x90 -p 30,215}


${goto 5}${font Pseudo APL:Bold:size=14} RAM ${goto 110}${mem}${goto 190}/${memmax}
#${goto 15}${membar 30,245}
${lua gradbar {15,321,"${memperc}",100,63,2,30,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}

${goto 5}${font Pseudo APL:Bold:size=14} SWAP ${goto 110}${swap}${goto 190}/${swapmax}
#${goto 15}${swapbar 30,245}
${lua gradbar {15,381,"${swapperc}",100,63,2,30,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}

${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 1} ${goto 115}${top_mem pid 1} ${goto 185}${top_mem mem 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 2} ${goto 115}${top_mem pid 2} ${goto 185}${top_mem mem 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 3} ${goto 115}${top_mem pid 3} ${goto 185}${top_mem mem 3}${font SansMono:Bold:size=11}%

${image /home/luke/Conky/Storage.png -s 225x90 -p 29,453}


${goto 5}${font Pseudo APL:Bold:size=14} / ${goto 120}${fs_used /}${goto 205}/15G
${lua gradbar {15,555,"${fs_used_perc /}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} /home ${goto 120}${fs_used /home}${goto 205}/37G
${lua gradbar {15,595,"${fs_used_perc /home}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Storage ${goto 120}${fs_used /media/storage}${goto 205}/${fs_size /media/storage}
${lua gradbar {15,635,"${fs_used_perc /media/storage}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Music ${goto 120}${fs_used /media/sde6}${goto 205}/${fs_size /media/sde6}
${lua gradbar {15,675,"${fs_used_perc /media/sde6}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} External ${goto 120}${fs_used /media/sde5}${goto 205}/${fs_size /media/sde5}
${lua gradbar {15,715,"${fs_used_perc /media/sde5}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Videos ${goto 120}${fs_used /media/sdc1}${goto 205}/${fs_size /media/sdc1}
${lua gradbar {15,755,"${fs_used_perc /media/sdc1}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Software ${goto 120}${fs_used /media/sdb1}${goto 205}/${fs_size /media/sdb1}
${lua gradbar {15,795,"${fs_used_perc /media/sdb1}",100,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}

${image /home/luke/Conky/temps.png -s 225x90 -p 23,798}

${goto 5}${font Pseudo APL:Bold:size=14} CPU ${goto 225}${platform it87.656 temp 1}F
${lua gradbar {15,893,"${platform it87.656 temp 1}",195,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} Motherboard ${goto 225}${platform it87.656 temp 2}F
${lua gradbar {15,935,"${platform it87.656 temp 2}",200,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}
${goto 5}${font Pseudo APL:Bold:size=14} GPU ${goto 225}${nvidia temp}F
${lua gradbar {15,975,"${platform it87.656 temp 2}",200,63,2,15,2,0x666666,.25,0x666666,1,0x000099,.75,0x000033,1}}

conky_weather
Code: [Select]
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 350 360
maximum_width 350
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_middle
gap_x 200
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
temperature_unit Fahrenheit

### LUA Load ###
lua_load /home/luke/Conky/allcombined_2.lua


## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
TEXT
${image /home/luke/Conky/weather.png -s 225x90 -p 75,5}${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
${image /home/luke/Conky/thermometer.png -s 50x50 -p 20,90}





${voffset 7}${goto 70}${font Pseudo APL:Bold:size=20}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F ${voffset -5}
${font Pseudo APL:Bold:size=14}${goto 10}Dawn ${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 185,90 -s 140x125}
${goto 10}Dusk ${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}

${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 140}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 260}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}

${font Pseudo APL:Bold:size=11}${goto 90}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 205}${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 320}${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${voffset 5}${font Pseudo APL:Bold:size=11}${goto 90}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 205}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 320}${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${image $HOME/Accuweather_Conky_USA_Images/7.png -p 10,225 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/12.png -p 128,225 -s 80x67}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 246,225 -s 80x67}${voffset -5}


${font Pseudo APL:Bold:size=50}${alignc}${time %I}:${time %M}${time %P}
${voffset -35}${font Pseudo APL:Bold:size=31}${alignc}${time %a} ${time %D}${voffset 35}
${image /home/luke/Conky/network.png -s 225x90 -p 75,405}${image /home/luke/Conky/up.png -s 30x30 -p 20,495}
${goto 70}${font Pseudo APL:Bold:size=16}${upspeed eth0} ${voffset -8}${goto 163}${upspeedgraph 23,165 666666 000066}${voffset 8}
${image /home/luke/Conky/down.png -s 30x30 -p 20,548}
${goto 70}${font Pseudo APL:Bold:size=16}${downspeed eth0} ${voffset -8}${goto 163}${downspeedgraph 23,165 666666 000066}${voffset 8}


allcombined_2.lua (by mrpeachy)
Code: [Select]
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'

function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end

function conky_gradbar(bartab)
if conky_window == nil then return end
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)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_draw_bg(bgtab)
if conky_window == nil then return end
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)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_fill (cr)
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_luacal(caltab)
if conky_window == nil then return end
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)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end     
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]="  "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]="  "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_luaimage(imtab)
if conky_window == nil then return end
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)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function

function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
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)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function

You can get all the images and weather script with my custom images here.
Don't Be A Dick!

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: Conky Codes and Images
« Reply #306 on: March 28, 2013, 06:20:19 PM »
My tribute to Jimi....



conky_system
Code: [Select]
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type override
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 275 1000
maximum_width 275
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment tl
gap_x 15
gap_y 30
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
short_units yes

### LUA Load ###
lua_load /home/luke/Conky/allcombined.lua

#lua_load /home/luke/Conky/draw_bg.lua

## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
#${lua draw_bg {25,0,0,0,0,0x333333,0.4}}
TEXT
#${image /home/luke/Conky/CPU.png -s 150x75 -p 65,5}
${lua tex_bg {30,2,1,281,1029,"/home/luke/Conky/brushed2.png"}}${lua draw_bg {30,0,0,285,1030,0x000000,.75,2,2}}

${goto 5}${font jimi:size=40}cpu ${lua gradbar {0,78,"${memperc}",100,100,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}
${voffset -22}${goto 5}${font jimi:size=15} Core1${goto 90}${font Pseudo APL:Bold:size=14}${cpu cpu1}${font SansMono:Bold:size=11}%${goto 150}${font jimi:size=15}Core2${goto 235}${font Pseudo APL:Bold:size=14}${cpu cpu2}${font SansMono:Bold:size=11}%
${goto 5}${font jimi:size=15} Core3${goto 90}${font Pseudo APL:Bold:size=14}${cpu cpu3}${font SansMono:Bold:size=11}%${goto 150}${font jimi:size=15}Core4${goto 235}${font Pseudo APL:Bold:size=14}${cpu cpu4}${font SansMono:Bold:size=11}%
${goto 5}${font jimi:size=15} Core5${goto 90}${font Pseudo APL:Bold:size=14}${cpu cpu5}${font SansMono:Bold:size=11}%${goto 150}${font jimi:size=15}Core6${goto 235}${font Pseudo APL:Bold:size=14}${cpu cpu6}${font SansMono:Bold:size=11}%${voffset 22}
${lua gradbar {11,155,"${cpu cpu0}",100,250,1,30,0,0xCCCCCC,.0,0x999999,1,0x333333,.5,0x000000,1}}
${goto 20}${font Pseudo APL:Bold:size=12}${top name 1} ${goto 115}${top pid 1} ${goto 185}${top cpu 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 2} ${goto 115}${top pid 2} ${goto 185}${top cpu 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top name 3} ${goto 115}${top pid 3} ${goto 185}${top cpu 3}${font SansMono:Bold:size=11}%
#${image /home/luke/Conky/memory.png -s 225x90 -p 30,215}

${goto 5}${font jimi:size=40}Memory${lua gradbar {-15,300,"${memperc}",100,235,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}
${voffset -25}${goto 5}${font jimi:size=15} RAM ${goto 110}${font Pseudo APL:Bold:size=14}${mem}${goto 190}/${memmax}${voffset 25}
${lua gradbar {11,329,"${memperc}",100,250,1,30,0,0x000000,.0,0x999999,1,0x333333,.5,0x000000,1}}

${voffset -25}${goto 5}${font jimi:size=15} SWAP ${goto 110}${font Pseudo APL:Bold:size=14}${swap}${goto 190}/${swapmax}${voffset 25}
${lua gradbar {11,389,"${swapperc}",100,250,1,30,0,0x000000,.0,0x999999,1,0x333333,.5,0x000000,1}}
${voffset -13}${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 1} ${goto 115}${top_mem pid 1} ${goto 185}${top_mem mem 1}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 2} ${goto 115}${top_mem pid 2} ${goto 185}${top_mem mem 2}${font SansMono:Bold:size=11}%
${goto 20}${font Pseudo APL:Bold:size=12}${top_mem name 3} ${goto 115}${top_mem pid 3} ${goto 185}${top_mem mem 3}${font SansMono:Bold:size=11}%${voffset 13}
#${image /home/luke/Conky/Storage.png -s 225x90 -p 29,453}
#
#
${color }${goto 5}${font jimi:size=40}Storage ${color}${lua gradbar {-17,529,"${memperc}",100,250,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}
${voffset -20}${goto 5}${font jimi:size=15} / ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /}${goto 205}/15G
${lua gradbar {11,557,"${fs_used_perc /}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} /home ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /home}${goto 205}/37G
${lua gradbar {11,597,"${fs_used_perc /home}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} storage ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/storage}${goto 205}/${fs_size /media/storage}
${lua gradbar {11,637,"${fs_used_perc /media/storage}",100,250,1,15,0,0x000000,0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} music ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/sde6}${goto 205}/${fs_size /media/sde6}
${lua gradbar {11,677,"${fs_used_perc /media/sde6}",100,250,1,15,0,0x000000,0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} external ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/sde5}${goto 205}/${fs_size /media/sde5}
${lua gradbar {11,717,"${fs_used_perc /media/sde5}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} videos ${font Pseudo APL:Bold:size=14} ${goto 120}${fs_used /media/sdc1}${goto 205}/${fs_size /media/sdc1}
${lua gradbar {11,757,"${fs_used_perc /media/sdc1}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} software ${font Pseudo APL:Bold:size=14}${goto 120}${fs_used /media/sdb1}${goto 205}/${fs_size /media/sdb1}${voffset 20}
${lua gradbar {11,797,"${fs_used_perc /media/sdb1}",100,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
#
#
${voffset -10}${color }${goto 5}${font jimi:size=40}Temps ${color}${lua gradbar {-4,874,"${memperc}",100,170,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}${voffset 10}
${voffset -25}${goto 5}${font jimi:size=15} cpu ${font Pseudo APL:Bold:size=14} ${goto 225}${platform it87.656 temp 1}F
${lua gradbar {15,907,"${platform it87.656 temp 1}",195,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} motherboard ${font Pseudo APL:Bold:size=14}  ${goto 225}${platform it87.656 temp 2}F
${lua gradbar {15,947,"${platform it87.656 temp 2}",200,250,1,15,0,0x000000,.01,0x999999,1,0x333333,.75,0x000000,1}}
${goto 5}${font jimi:size=15} gpu ${font Pseudo APL:Bold:size=14} ${goto 225}${nvidia temp}F${voffset 25}
${lua gradbar {15,987,"${platform it87.656 temp 2}",200,250,1,15,0,0x000000,.0,0x999999,1,0x333333,.5,0x000000,1}}

conky_weather
Code: [Select]
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual no
own_window_transparent yes
own_window_type desktop
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 350 700
maximum_width 350
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color black
default_outline_color white
alignment top_middle
gap_x 200
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 6
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit
# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2
format_human_readable yes
short_units yes
update_interval 1
imlib_cache_size 0

#   Maximum size of user text buffer, i.e. layout below TEXT line in config file
#  (default is 16384 bytes)
# max_user_text 16384

# Desired output unit of all objects displaying a temperature. Parameters are
# either "fahrenheit" or "celsius". The default unit is degree Celsius.
temperature_unit Fahrenheit

### LUA Load ###
lua_load /home/luke/Conky/allcombined.lua


## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha,draw_type,line_width,outline_color,outline_alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
# draw_type: 1=fill, 2=outline(must specify line_width), 3=outline and fill (must specify line_width, outline_color and outline_alpha)
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
#note for text: justify can be "r" = right, "c" = center, "l" = left
#${lua draw_bg {10,0,0,0,0,0x000000,0.3}}
${lua draw_bg {25,0,0,0,0,0x000000,0.3}}
TEXT
#${image /home/luke/Conky/weather.png -s 225x90 -p 75,5}${lua draw_bg {25,0,0,0,0,0xFFFFFF,0.05}}
${lua tex_bg {30,2,1,358,700,"/home/luke/Conky/brushed2.png"}}${lua draw_bg {30,0,0,360,702,0x000000,.75,2,2}}${image /home/luke/Conky/thermometer.png -s 50x50 -p 20,18}

${goto 70}${font Pseudo APL:Bold:size=20}${texeci 500 bash $HOME/1b1_accuweather_images/1b1}${execpi 600 sed -n '29p' $HOME/1b1_accuweather_images/curr_cond}°F
${font jimi:size=15}${goto 10}Dawn${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '39p' $HOME/1b1_accuweather_images/curr_cond}${image /home/luke/1b1_accuweather_images/cc.png -p 110,5 -s 260x180}
${font jimi:size=15}${goto 10}Dusk${font Pseudo APL:bold:size=14} ${execpi 600 sed -n '40p' $HOME/1b1_accuweather_images/curr_cond}
${font jimi:size=15}${goto 10}Rain${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '28p' $HOME/1b1_accuweather_images/first_days}
${font jimi:size=15}${goto 10}Clouds${font Pseudo APL:bold:size=14} ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '35p' $HOME/1b1_accuweather_images/curr_cond}
#${font Pseudo APL:Bold:size=14}${goto 10}Wind ${alignc 37}${font Sans:size=11}${execpi 600 sed -n '31p' $HOME/1b1_accuweather_images/curr_cond} ${execpi 600 sed -n '32p' $HOME/1b1_accuweather_images/curr_cond}

${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '5p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '10p' $HOME/1b1_accuweather_images/first_days}${goto 260}${execpi 600 sed -n '15p' $HOME/1b1_accuweather_images/first_days}



${image $HOME/1b1_accuweather_images/6.png -p 0,180 -s 115x79}${image $HOME/1b1_accuweather_images/11.png -p 122,180 -s 115x79}${image $HOME/1b1_accuweather_images/16.png -p 242,180 -s 115x79}
${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '8p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '13p' $HOME/1b1_accuweather_images/first_days}°F${goto 280}${execpi 600 sed -n '18p' $HOME/1b1_accuweather_images/first_days}°F${voffset -9}

${font Pseudo APL:Bold:size=12}${goto 25}${execpi 600 sed -n '20p' $HOME/1b1_accuweather_images/first_days}${goto 140}${execpi 600 sed -n '1p' $HOME/1b1_accuweather_images/last_days}${goto 260}${execpi 600 sed -n '6p' $HOME/1b1_accuweather_images/last_days}
${image $HOME/1b1_accuweather_images/21.png -p 0,300 -s 115x79}${image $HOME/1b1_accuweather_images/last_2.png -p 122,300 -s 115x79}${image $HOME/1b1_accuweather_images/last_7.png -p 242,300 -s 115x79}



${voffset 9}${font Pseudo APL:Bold:size=13}${goto 40}${execpi 600 sed -n '23p' $HOME/1b1_accuweather_images/first_days}°F${goto 160}${execpi 600 sed -n '4p' $HOME/1b1_accuweather_images/last_days}°F${goto 280}${execpi 600 sed -n '9p' $HOME/1b1_accuweather_images/last_days}°F${voffset -9}

${font Pseudo APL:bold:size=50}${alignc}${time %I}:${time %M}${time %P}
${voffset -35}${font Pseudo APL:Bold:size=31}${alignc}${time %a} ${time %D}${voffset 35}${color}
${voffset -25}${goto 5}${font jimi:size=40}Network${voffset 25}${lua gradbar {-15,572,"${memperc}",100,257,1,3,0,0xFFFFFF,1,0x999999,0,0x333333,0,0x000000,0}}${image /home/luke/Conky/up.png -s 30x30 -p 20,582}
${voffset -35}${goto 70}${font Pseudo APL:Bold:size=16}${upspeed eth0} ${voffset -8}${goto 163}${upspeedgraph 23,165 666666 000066}${voffset 8}
${image /home/luke/Conky/down.png -s 30x30 -p 20,630}
${goto 70}${font Pseudo APL:Bold:size=16}${downspeed eth0} ${voffset -8}${goto 163}${downspeedgraph 23,165 666666 000066}${voffset -75}

allcombined.lua
Code: [Select]
--[[ by mrpeachy -
combines background bar and calendar functions
]]
require 'cairo'
require 'imlib2'

function rgb_to_r_g_b(col_a)
return ((col_a[1] / 0x10000) % 0x100) / 255., ((col_a[1] / 0x100) % 0x100) / 255., (col_a[1] % 0x100) / 255., col_a[2]
end

function conky_gradbar(bartab)
if conky_window == nil then return end
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)
local updates=tonumber(conky_parse('${updates}'))
if updates>5 then
--#########################################################################################################
--convert to table
local bartab=loadstring("return" .. bartab)()
local bar_startx=bartab[1]
local bar_starty=bartab[2]
local number=bartab[3]
local number=conky_parse(number)
local number_max=bartab[4]
local divisions=bartab[5]
local div_width=bartab[6]
local div_height=bartab[7]
local div_gap=bartab[8]
local bg_col=bartab[9]
local bg_alpha=bartab[10]
local st_col=bartab[11]
local st_alpha=bartab[12]
local mid_col=bartab[13]
local mid_alpha=bartab[14]
local end_col=bartab[15]
local end_alpha=bartab[16]
--color conversion
local br,bg,bb,ba=rgb_to_r_g_b({bg_col,bg_alpha})
local sr,sg,sb,sa=rgb_to_r_g_b({st_col,st_alpha})
local mr,mg,mb,ma=rgb_to_r_g_b({mid_col,mid_alpha})
local er,eg,eb,ea=rgb_to_r_g_b({end_col,end_alpha})
if number==nil then number=0 end
local number_divs=(number/number_max)*divisions
cairo_set_line_width (cr,div_width)
--gradient calculations
for i=1,divisions do
if i<(divisions/2) and i<=number_divs then
colr=((mr-sr)*(i/(divisions/2)))+sr
colg=((mg-sg)*(i/(divisions/2)))+sg
colb=((mb-sb)*(i/(divisions/2)))+sb
cola=((ma-sa)*(i/(divisions/2)))+sa
elseif i>=(divisions/2) and i<=number_divs then
colr=((er-mr)*((i-(divisions/2))/(divisions/2)))+mr
colg=((eg-mg)*((i-(divisions/2))/(divisions/2)))+mg
colb=((eb-mb)*((i-(divisions/2))/(divisions/2)))+mb
cola=((ea-ma)*((i-(divisions/2))/(divisions/2)))+ma
else
colr=br
colg=bg
colb=bb
cola=ba
end
cairo_set_source_rgba (cr,colr,colg,colb,cola)
cairo_move_to (cr,bar_startx+((div_width+div_gap)*i-1),bar_starty)
cairo_rel_line_to (cr,0,div_height)
cairo_stroke (cr)
end
--#########################################################################################################
end-- if updates>5
bartab=nil
colr=nil
colg=nil
colb=nil
cola=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_draw_bg(bgtab)
if conky_window == nil then return end
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)
--#########################################################################################################
--convert to table
local bgtab=loadstring("return" .. bgtab)()
local r=bgtab[1]
local x=bgtab[2]
local y=bgtab[3]
local w=bgtab[4]
local h=bgtab[5]
local color=bgtab[6]
local alpha=bgtab[7]
local draw=bgtab[8]
local lwidth=bgtab[9]
local olcolor=bgtab[10]
local olalpha=bgtab[11]
if w==0 then
w=tonumber(conky_window.width)
end
if h==0 then
h=tonumber(conky_window.height)
end
cairo_set_source_rgba (cr,rgb_to_r_g_b({color,alpha}))
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
if draw==1 then
cairo_fill (cr)
elseif draw==2 then
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
elseif draw==3 then
cairo_fill_preserve (cr)
cairo_set_source_rgba (cr,rgb_to_r_g_b({olcolor,olalpha}))
cairo_set_line_width (cr,lwidth)
cairo_stroke (cr)
end
--#########################################################################################################
bgtab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_luacal(caltab)
if conky_window == nil then return end
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)
--####################################################################################################
local caltab=loadstring("return" .. caltab)()
local cal_x=caltab[1]
local cal_y=caltab[2]
local tfont=caltab[3]
local tfontsize=caltab[4]
local tc=caltab[5]
local ta=caltab[6]
local bfont=caltab[7]
local bfontsize=caltab[8]
local bc=caltab[9]
local ba=caltab[10]
local hfont=caltab[11]
local hfontsize=caltab[12]
local hc=caltab[13]
local ha=caltab[14]
local spacer=caltab[15]
local gaph=caltab[16]
local gapt=caltab[17]
local gapl=caltab[18]
local sday=caltab[19]
--convert colors
--local font=string.gsub(font,"_"," ")
local tred,tgreen,tblue,talpha=rgb_to_r_g_b({tc,ta})
--main body text color
local bred,bgreen,bblue,balpha=rgb_to_r_g_b({bc,ba})
--highlight text color
local hred,hgreen,hblue,halpha=rgb_to_r_g_b({hc,ha})
--###################################################
--calendar calcs
local year=os.date("%G")
local today=tonumber(os.date("%d"))
local t1 = os.time( {    year=year,month=03,day=01,hour=00,min=0,sec=0} );
local t2 = os.time( {    year=year,month=02,day=01,hour=00,min=0,sec=0} );
local feb=(os.difftime(t1,t2))/(24*60*60)
local monthdays={ 31, feb, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
local day=tonumber(os.date("%w"))+1-sday
local day_num = today
local remainder=day_num % 7
local start_day=day-(day_num % 7)
if start_day<0 then start_day=7+start_day end     
local month=os.date("%m")
local mdays=monthdays[tonumber(month)]
local x=mdays+start_day
local dnum={}
local dnumh={}
if mdays+start_day<36 then
dlen=35
plen=29
else
dlen=42
plen=36
end
for i=1,dlen do
if i<=start_day then
dnum[i]="  "
else
dn=i-start_day
if dn=="nil" then dn=0 end
if dn<=9 then dn=(spacer .. dn) end
if i>x then dn="" end
dnum[i]=dn
dnumh[i]=dn
if dn==(spacer .. today) or dn==today then
dnum[i]=""
end
if dn==(spacer .. today) or dn==today then
dnumh[i]=dn
place=i
else dnumh[i]="  "
end
end
end--for
cairo_select_font_face (cr, tfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, tfontsize);
cairo_set_source_rgba (cr,tred,tgreen,tblue,talpha)
if tonumber(sday)==0 then
dys={"SU","MO","TU","WE","TH","FR","SA"}
else
dys={"MO","TU","WE","TH","FR","SA","SU"}
end
--draw calendar titles
for i=1,7 do
cairo_move_to (cr, cal_x+(gaph*(i-1)), cal_y)
cairo_show_text (cr, dys[i])
cairo_stroke (cr)
end
--draw calendar body
cairo_select_font_face (cr, bfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, bfontsize);
cairo_set_source_rgba (cr,bred,bgreen,bblue,balpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnum[i])
cairo_stroke (cr)
end
end
--highlight
cairo_select_font_face (cr, hfont, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, hfontsize);
cairo_set_source_rgba (cr,hred,hgreen,hblue,halpha)
for i=1,plen,7 do
local fn=i
for i=fn,fn+6 do
cairo_move_to (cr, cal_x+(gaph*(i-fn)),cal_y+gapt+(gapl*((fn-1)/7)))
cairo_show_text (cr, dnumh[i])
cairo_stroke (cr)
end
end
--#########################################################################################################
caltab=nil
dlen=nil
plen=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_luaimage(imtab)
if conky_window == nil then return end
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)
--#########################################################################################################
local imtab=loadstring("return" .. imtab)()
local im_x=imtab[1]
local im_y=imtab[2]
local im_w=imtab[3]
local im_h=imtab[4]
local file=imtab[5]
local show = imlib_load_image(file)
if show == nil then return end
imlib_context_set_image(show)
if tonumber(im_w)==0 then
width=imlib_image_get_width()
else
width=tonumber(im_w)
end
if tonumber(im_h)==0 then
height=imlib_image_get_height()
else
height=tonumber(im_h)
end
imlib_context_set_image(show)
local scaled=imlib_create_cropped_scaled_image(0, 0, imlib_image_get_width(), imlib_image_get_height(), width, height)
imlib_free_image()
imlib_context_set_image(scaled)
imlib_render_image_on_drawable(im_x, im_y)
imlib_free_image()
show=nil
--#########################################################################################################
imtab=nil
height=nil
width=nil
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

function conky_tex_bg(textab)
local textab=loadstring("return" .. textab)()
local tex_file=textab[6]
local surface = cairo_image_surface_create_from_png(tostring(tex_file))
local cw,ch = conky_window.width, conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, cw,ch)
local cr=cairo_create(cs)
--#########################################################################################################
--convert to table
local r=textab[1]
local x=textab[2]
local y=textab[3]
local w=textab[4]
local h=textab[5]
if w=="0" then
w=cw
end
if h=="0" then
h=ch
end
--top left mid circle
local xtl=x+r
local ytl=y+r
--top right mid circle
local xtr=(x+r)+((w)-(2*r))
local ytr=y+r
--bottom right mid circle
local xbr=(x+r)+((w)-(2*r))
local ybr=(y+r)+((h)-(2*r))
--bottom right mid circle
local xbl=(x+r)
local ybl=(y+r)+((h)-(2*r))
--the drawing part---------------------------
cairo_move_to (cr,xtl,ytl-r)
cairo_line_to (cr,xtr,ytr-r)
cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
cairo_line_to (cr,xbr+r,ybr)
cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
cairo_line_to (cr,xbl,ybl+r)
cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
cairo_line_to (cr,xtl-r,ytl)
cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
cairo_close_path(cr)
cairo_clip (cr)
cairo_new_path (cr);
--image part
cairo_set_source_surface (cr, surface, 0, 0)
cairo_paint (cr)
--#########################################################################################################
textab=nil
w=nil
h=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)
cr=nil
return ""
end-- end main function

function conky_luatext(txttab)--x,y,c,a,f,fs,txt,j ##################################################
if conky_window == nil then return end
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)
--#########################################################################################################
--convert to table
local txttab=loadstring("return" .. txttab)()
local x=txttab[1]
local y=txttab[2]
local c=txttab[3]
local a=txttab[4]
local f=txttab[5]
local fs=txttab[6]
local j=txttab[7]
local txt=txttab[8]
cairo_select_font_face (cr, f, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fs)
local extents=cairo_text_extents_t:create()
cairo_text_extents(cr,txt,extents)
local wx=extents.x_advance
cairo_set_source_rgba (cr,rgb_to_r_g_b({c,a}))
if j=="l" then
cairo_move_to (cr,x,y)
elseif j=="c" then
cairo_move_to (cr,x-(wx/2),y)
elseif j=="r" then
cairo_move_to (cr,x-wx,y)
end
cairo_show_text (cr,txt)
cairo_stroke (cr)
--#########################################################################################################
txttab=nil
cairo_destroy(cr)
cairo_surface_destroy (cs)
cr=nil
return ""
end-- end main function

The weather script,images and font can be found here

Extract the 1b1_accuweather_images folder from the archive directly to your home folder and then extract the up,down and thermometer images wherever you want but you will have to change the path withing the conky_weather config to line up with where you put them.
Extract the font to ~/.fonts and then restart conky.

And finally the wallpaper




####allcombined.lua is by mrpeachy#####
####The accuweather script is by TeoBigusGeekus and the original scripts and images can be found here ####

The accuweather url will have to be changed within the accuweather script. Theres a read me pdf within that folder that will tell you how to do that if need be. The images provided in my archive are edited versions of Teo's images.
Don't Be A Dick!

dizzie

  • DEFCON 1
  • Posts: 731
  • Bastard Operator From Hell
    • View Profile
fkn flicker!
« Reply #307 on: March 31, 2013, 01:43:38 PM »
OH hai! *licks screen*
 
I have a problem that is driving me slightly insane....
Same OS, same conky same everything, On my main desktop, conky is behaving as it should be.
On my laptop however... not so much.
Conky is flickering/blinking like a fucking trafficlight, and YES i have the double buffer/own windiws etc etc, still...
Works perfekt on both my desktops, NOT on my laptop (Desktops has nvidia, laptop has Intel onboard crap) Only reason i have found to cause this :D
 
Any suggestions? Calling me an idiot isnt one  8)
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

Sector11

  • Posts: 870
    • View Profile
Re: fkn flicker!
« Reply #308 on: March 31, 2013, 02:29:48 PM »
Is callin' ya late for cake allowed?  lwfitz ate the last piece honest!   ::)

Screen res of smallest desktop (I can hear it now: 1920x1200) and lappy please.
Also ... no code ... no help.

inxi vid specs of desktop and lappy 'might' help as well.
Code: [Select]
31 Mar 13 | 11:27:47 ~
         $ vid
Graphics:  Card: NVIDIA GT218 [GeForce 210] bus-ID: 02:00.0 chip-ID: 10de:0a65
           X.Org: 1.12.4 driver: nvidia Resolution: 1920x1080@60.0hz
           GLX Renderer: GeForce 210/PCIe/SSE2 GLX Version: 3.3.0 NVIDIA 313.26 Direct Rendering: Yes
 
 31 Mar 13 | 11:28:02 ~
         $

1. Start the lappy conky in a terminal ... what errors do you get if any?
2. Barring that eliminate everything under TEXT on the lappy conky and re-add one line at a time until it starts blinking.
Stay Home

dizzie

  • DEFCON 1
  • Posts: 731
  • Bastard Operator From Hell
    • View Profile
Re: fkn flicker!
« Reply #309 on: March 31, 2013, 03:46:02 PM »

Works :
Code: [Select]
Graphics:  Card: NVIDIA GK107 [GeForce GT 640] X.Org: 1.12.4 driver: nvidia Resolution: 1920x1080@60.0hzWorks:
Code: [Select]
Graphics:  Card: NVIDIA G80 [GeForce 8800 GTS] X.org: 1.12.4 driver: nvidia tty size: 80x24 Advanced Data: N/A out of XDoesnt Work:
Code: [Select]
Graphics:  Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller  X.org: 1.12.4 driver: intel tty size: 80x24 Advanced Data: N/A out of X

Conky stuff (that works 2 of 3 lol )


conkyrc:
Quote



#==============================================================================
#  Conky thingamabob
#
#  Date    : 03/08/2011
#  author  : dizzie & original by xeNULL
#  version : v0.2
#  license : Distributed under the terms of GNU GPL version 2 or later
#
#==============================================================================


background yes
update_interval 1


cpu_avg_samples 2
net_avg_samples 2
temperature_unit celsius
short_units yes


double_buffer yes
no_buffers yes
text_buffer_size 2048


gap_x 25
gap_y 40


minimum_size 180 750
maximum_width 180
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
border_inner_margin 0
border_outer_margin 0
alignment tr


draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no


default_bar_size 150 20


override_utf8_locale yes
use_xft yes
xftfont Pragmata:9
xftalpha 0.5
uppercase no


default_color FFFFFF
color1 DDDDDD
color2 AAAAAA
color3 888888
color4 FFFFFF


lua_load ~/.config/conky/ConkyHXR.lua
lua_draw_hook_post main


TEXT
${voffset 25}${font Pragmata:size=9} /// S Y S T E M ///


${voffset 25}${color4}${offset 55}${cpugraph 20,115 999999 ffffff}${color}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}CPU${offset 65}
${offset 55}${font Pragmata:size=8,weight:normal}${color4}${top name 1}${alignr}${top cpu 1}%
${offset 55}${font Pragmata:size=8,weight:normal}${color1}${top name 2}${alignr}${top cpu 2}%
${offset 55}${font Pragmata:size=8,weight:normal}${color2}${top name 3}${alignr}${top cpu 3}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top name 4}${alignr}${top cpu 4}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top name 5}${alignr}${top cpu 5}%


${voffset 30}${color4}${offset 55}${memgraph 5,115  999999 ffffff -l}${color}
${voffset -15}${offset 45}${font Pragmata:size=9}${color}MEM
${offset 55}${font Pragmata:size=8,weight:normal}${color4}${top_mem name 1}${alignr}${top_mem mem 1}%
${offset 55}${font Pragmata:size=8,weight:normal}${color1}${top_mem name 2}${alignr}${top_mem mem 2}%
${offset 55}${font Pragmata:size=8,weight:normal}${color2}${top_mem name 3}${alignr}${top_mem mem 3}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top_mem name 4}${alignr}${top_mem mem 4}%
${offset 55}${font Pragmata:size=8,weight:normal}${color3}${top_mem name 4}${alignr}${top_mem mem 5}%


${voffset 25}${offset 55}${diskiograph 20,115 999999 ffffff}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}DISK
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}- ${fs_used /} -  ${fs_size /}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}~ ${fs_used /home} -  ${fs_size /home}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}@ ${fs_used /mnt/srv} -  ${fs_size /mnt/srv}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}¥ ${fs_used /mnt/backup} -  ${fs_size /mnt/backup}


${voffset 5}${color4}${offset 10}${upspeedgraph eth0 20,70 999999 ffffff}${alignr}${offset 0}${upspeedgraph wlan0 20,70 999999 ffffff}${color}
${color4}${offset 10}${downspeedgraph eth0 20,70 999999 ffffff}${alignr}${offset 0}${downspeedgraph wlan0 20,70 999999 ffffff}${color}
  ${voffset 8}${offset 10}${font Pragmata:size=9}${color}ETHERNET IP         ROUTER IP
  ${offset 10}${color2}${font Pragmata:size=8,weight:normal}${addr eth0}${alignr}${offset -10}${gw_ip}


${voffset 42}${offset 45}${font Pragmata:size=9}${color4}MUSIC${color}
${offset 55}${hr}
${font Pragmata:size=8}${offset 55}${color4}Song${color}
${offset 55}${color3}${exec mocp -Q %song}${color}
${offset 55}${color4}Artist${color}
${offset 55}${color3}${exec mocp -Q %artist}${color}
${offset 55}${color4}Album${color}
${offset 55}${color3}${exec mocp -Q %album}${color}
${offset 55}${hr}
${offset 55}${alignr}${color3}${exec mocp -Q %ct} - ${exec mocp -Q %tt}${color}
${voffset -12}${offset 55}${blink ${color4}${exec mocp -Q %state}${color}


${image ~/.config/conky/rin.png -p 70,655 -s 100x100}


ConkyHXR.lua
Quote

--==============================================================================
--  ConkyHXR.lua
--
--  Date    : 03/08/2011
--  Author  : xeNULL
--  Version : v0.1
--  License : Distributed under the terms of GNU GPL version 2 or later
--
--==============================================================================


require 'cairo'


--------------------------------------------------------------------------------
--                                                                    gauge DATA
gauge = {
{
    name='cpu',                    arg='cpu0',                  max_value=100,
    x=40,                          y=90,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='cpu',                    arg='cpu1',                  max_value=100,
    x=40,                          y=90,
    graph_radius=18,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='memperc',                arg='',                      max_value=100,
    x=40,                          y=210,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
{
    name='fs_used_perc',           arg='/',                     max_value=100,
    x=40,                          y=340,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='downspeedf',           arg='eth0',                     max_value=100,
    x=40,                          y=425,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Down',
    caption_weight=1,              caption_size=6.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='upspeedf',           arg='eth0',                     max_value=100,
    x=40,                          y=425,
    graph_radius=18,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Up',
    caption_weight=1,              caption_size=6.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='downspeedf',           arg='wlan0',                     max_value=100,
    x=135,                          y=425,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Down',
    caption_weight=1,              caption_size=6.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='upspeedf',           arg='wlan0',                     max_value=100,
    x=135,                          y=425,
    graph_radius=18,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=10,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=28,
    graduation_thickness=0,        graduation_mark_thickness=1,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.3,
    caption='Up',
    caption_weight=1,              caption_size=6.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.5,
},
{
    name='mixer',                arg='Master',                      max_value=100,
    x=40,                          y=542,
    graph_radius=24,
    graph_thickness=5,
    graph_start_angle=180,
    graph_unit_angle=2.7,          graph_unit_thickness=2.7,
    graph_bg_colour=0xffffff,      graph_bg_alpha=0.3,
    graph_fg_colour=0x111111,      graph_fg_alpha=0.5,
    hand_fg_colour=0xFFFFFF,       hand_fg_alpha=1.0,
    txt_radius=34,
    txt_weight=0,                  txt_size=8.0,
    txt_fg_colour=0xFFFFFF,        txt_fg_alpha=1.0,
    graduation_radius=23,
    graduation_thickness=0,        graduation_mark_thickness=2,
    graduation_unit_angle=27,
    graduation_fg_colour=0xFFFFFF, graduation_fg_alpha=0.5,
    caption='',
    caption_weight=1,              caption_size=8.0,
    caption_fg_colour=0xFFFFFF,    caption_fg_alpha=0.3,
},
}


-------------------------------------------------------------------------------
--                                                                 rgb_to_r_g_b
-- converts color in hexa to decimal
--
function rgb_to_r_g_b(colour, alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end


-------------------------------------------------------------------------------
--                                                            angle_to_position
-- convert degree to rad and rotate (0 degree is top/north)
--
function angle_to_position(start_angle, current_angle)
    local pos = current_angle + start_angle
    return ( ( pos * (2 * math.pi / 360) ) - (math.pi / 2) )
end




-------------------------------------------------------------------------------
--                                                              draw_gauge_ring
-- displays gauges
--
function draw_gauge_ring(display, data, value)
    local max_value = data['max_value']
    local x, y = data['x'], data['y']
    local graph_radius = data['graph_radius']
    local graph_thickness, graph_unit_thickness = data['graph_thickness'], data['graph_unit_thickness']
    local graph_start_angle = data['graph_start_angle']
    local graph_unit_angle = data['graph_unit_angle']
    local graph_bg_colour, graph_bg_alpha = data['graph_bg_colour'], data['graph_bg_alpha']
    local graph_fg_colour, graph_fg_alpha = data['graph_fg_colour'], data['graph_fg_alpha']
    local hand_fg_colour, hand_fg_alpha = data['hand_fg_colour'], data['hand_fg_alpha']
    local graph_end_angle = (max_value * graph_unit_angle) % 360


    -- background ring
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, 0), angle_to_position(graph_start_angle, graph_end_angle))
    cairo_set_source_rgba(display, rgb_to_r_g_b(graph_bg_colour, graph_bg_alpha))
    cairo_set_line_width(display, graph_thickness)
    cairo_stroke(display)


    -- arc of value
    local val = value % (max_value + 1)
    local start_arc = 0
    local stop_arc = 0
    local i = 1
    while i <= val do
        start_arc = (graph_unit_angle * i) - graph_unit_thickness
        stop_arc = (graph_unit_angle * i)
        cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
        cairo_set_source_rgba(display, rgb_to_r_g_b(graph_fg_colour, graph_fg_alpha))
        cairo_stroke(display)
        i = i + 1
    end
    local angle = start_arc


    -- hand
    start_arc = (graph_unit_angle * val) - (graph_unit_thickness * 2)
    stop_arc = (graph_unit_angle * val)
    cairo_arc(display, x, y, graph_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
    cairo_set_source_rgba(display, rgb_to_r_g_b(hand_fg_colour, hand_fg_alpha))
    cairo_stroke(display)


    -- graduations marks
    local graduation_radius = data['graduation_radius']
    local graduation_thickness, graduation_mark_thickness = data['graduation_thickness'], data['graduation_mark_thickness']
    local graduation_unit_angle = data['graduation_unit_angle']
    local graduation_fg_colour, graduation_fg_alpha = data['graduation_fg_colour'], data['graduation_fg_alpha']
    if graduation_radius > 0 and graduation_thickness > 0 and graduation_unit_angle > 0 then
        local nb_graduation = graph_end_angle / graduation_unit_angle
        local i = 0
        while i < nb_graduation do
            cairo_set_line_width(display, graduation_thickness)
            start_arc = (graduation_unit_angle * i) - (graduation_mark_thickness / 2)
            stop_arc = (graduation_unit_angle * i) + (graduation_mark_thickness / 2)
            cairo_arc(display, x, y, graduation_radius, angle_to_position(graph_start_angle, start_arc), angle_to_position(graph_start_angle, stop_arc))
            cairo_set_source_rgba(display,rgb_to_r_g_b(graduation_fg_colour,graduation_fg_alpha))
            cairo_stroke(display)
            cairo_set_line_width(display, graph_thickness)
            i = i + 1
        end
    end


    -- text
    local txt_radius = data['txt_radius']
    local txt_weight, txt_size = data['txt_weight'], data['txt_size']
    local txt_fg_colour, txt_fg_alpha = data['txt_fg_colour'], data['txt_fg_alpha']
    local movex = txt_radius * math.cos(angle_to_position(graph_start_angle, angle))
    local movey = txt_radius * math.sin(angle_to_position(graph_start_angle, angle))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, txt_weight)
    cairo_set_font_size (display, txt_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(txt_fg_colour, txt_fg_alpha))
    cairo_move_to (display, x + movex - (txt_size / 2), y + movey + 3)
    cairo_show_text (display, value)
    cairo_stroke (display)


    -- caption
    local caption = data['caption']
    local caption_weight, caption_size = data['caption_weight'], data['caption_size']
    local caption_fg_colour, caption_fg_alpha = data['caption_fg_colour'], data['caption_fg_alpha']
    local tox = graph_radius * (math.cos((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    local toy = graph_radius * (math.sin((graph_start_angle * 2 * math.pi / 360)-(math.pi/2)))
    cairo_select_font_face (display, "ubuntu", CAIRO_FONT_SLANT_NORMAL, caption_weight);
    cairo_set_font_size (display, caption_size)
    cairo_set_source_rgba (display, rgb_to_r_g_b(caption_fg_colour, caption_fg_alpha))
    cairo_move_to (display, x + tox + 5, y + toy + 1)
    -- bad hack but not enough time !
    if graph_start_angle < 105 then
        cairo_move_to (display, x + tox - 30, y + toy + 1)
    end
    cairo_show_text (display, caption)
    cairo_stroke (display)
end




-------------------------------------------------------------------------------
--                                                               go_gauge_rings
-- loads data and displays gauges
--
function go_gauge_rings(display)
    local function load_gauge_rings(display, data)
        local str, value = '', 0
        str = string.format('${%s %s}',data['name'], data['arg'])
        str = conky_parse(str)
        value = tonumber(str)
        draw_gauge_ring(display, data, value)
    end
   
    for i in pairs(gauge) do
        load_gauge_rings(display, gauge)
    end
end


-------------------------------------------------------------------------------
--                                                                         MAIN
function conky_main()
    if conky_window == nil then
        return
    end


    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local display = cairo_create(cs)
   
    local updates = conky_parse('${updates}')
    update_num = tonumber(updates)
   
    if update_num > 5 then
        go_gauge_rings(display)
    end


    cairo_surface_destroy(cs)
    cairo_destroy(display)


end
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

Sector11

  • Posts: 870
    • View Profile
Re: fkn flicker!
« Reply #310 on: March 31, 2013, 05:59:14 PM »
I'm going to guess that you did a copy/past thing with the lappy conky and or a bit of tweaking or it won't be working in the desktop either.

You have a few errors like this: start calling a font ---
${font Pragmata:size=8,weight:normal${alignr}}

and put the ${alignr} inside the closing font call in this section:
Code: [Select]
${voffset 25}${offset 55}${diskiograph 20,115 999999 ffffff}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}DISK
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}- ${fs_used /} -  ${fs_size /}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}~ ${fs_used /home} -  ${fs_size /home}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}@ ${fs_used /mnt/srv} -  ${fs_size /mnt/srv}
${offset 55}${font Pragmata:size=8,weight:normal${alignr}}${color}¥ ${fs_used /mnt/backup} -  ${fs_size /mnt/backup}

I found it with this error:
Code: [Select]
31 Mar 13 | 14:10:29 ~
         $ conky -c /media/5/conky/dizzie.conky &
[1] 868
 
 31 Mar 13 | 14:26:10 ~
         $ Conky: forked to background, pid is 873

Conky: desktop window (264) is root window
Conky: window type - desktop
Conky: drawing to created window (0x1800001)
Conky: drawing to double buffer
Conky: Oops...looks like something overflowed in add_font().

The corrected section:
Code: [Select]
${voffset 25}${offset 55}${diskiograph 20,115 999999 ffffff}
${voffset -20}${offset 45}${font Pragmata:size=9}${color}DISK
${offset 55}${font Pragmata:size=8}${alignr}${color}- ${fs_used /} -  ${fs_size /}
${offset 55}${alignr}${color}~ ${fs_used /home} -  ${fs_size /home}
${offset 55}${alignr}${color}@ ${fs_used /mnt/srv} -  ${fs_size /mnt/srv}
${offset 55}${alignr}${color}¥ ${fs_used /mnt/backup} -  ${fs_size /mnt/backup}

Note a couple of things:
  1. Once you call a font you do not need to call it again unless you change something.
  2. ",weight:normal" in a font does nothing.

Also try this on the lappy conky:

Code: [Select]
border_inner_margin 5
border_outer_margin 0
and change all ${alignr} to ${alignr 2} to move it off the edge of the conky
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: fkn flicker!
« Reply #311 on: March 31, 2013, 07:19:59 PM »
Great now I want F-ing cake.....

Ill look into this when I get home in just a bit. Minus what Sector told you I dont see any reason for it to flicker.
Don't Be A Dick!

jedi

  • DEFCON 1
  • Posts: 1642
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Temperatures
« Reply #312 on: April 05, 2013, 07:22:19 AM »
OK, so I'd like to display the little temp symbol next to the number representing the actual temp of the hw i'm displaying in conky.  On some of them the symbol is right next to the number, while on others, it has a space between the number and the temp symbol.  Any ideas or advice appreciated!
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

dizzie

  • DEFCON 1
  • Posts: 731
  • Bastard Operator From Hell
    • View Profile
Re: Temperatures
« Reply #313 on: April 05, 2013, 07:25:52 AM »
i had that too, i just went and used ${goto xx} sleesy, but it works for me :)
Reclaim your culture, it's within your reach!

My Blog | Facebook | Twitter | G+ | VSIDO |

Sector11

  • Posts: 870
    • View Profile
Font - Spacing help
« Reply #314 on: April 05, 2013, 01:08:01 PM »
@ dizzie

LCDmono or LCDmono2 maybe - they act strangely in calendars for some reason.  Like Digital-7 (non-mono) stopped working properly - the top gets cut off ... but ${font Digital\-7:size=14} works perfect.  Something changed in the "system", an opinion. It's happening with most distros.

Probably not the laptop, but the font you are using.  If alignment or spacing is your main priority - use a mono font!
Been pushing that one for a long time.

Also if you add two lines above TEXT:
Code: [Select]
format_human_readable
Quote
   If enabled, values which are in bytes will be printed in human readable format (i.e., KiB, MiB, etc). If disabled, the number of bytes is printed instead.
Mind you if you want bytes ... don't use that.

and
Code: [Select]
short_units
Quote
Shortens units to a single character (kiB->k, GiB->G, etc.). Default is off.

it will clean up your // Drives /// area - making use of ${goto xx} a lot easier.

RE The wallpaper;

I have that wall, it reminds me that to a quark I'm a whole universe ... to a universe I'm a quark.  Maybe our galaxy is a quark to another universe? Is that Rod Serling that just walked by?

Stay Home