guest@dotshare [~/groups/info/conky] $ ls conky/ | cat

conky (scrot)

webdarek Sep 21, 2013 (info/conky)

weather_cconky(raw, dl)

SCROT

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
# Use Xft?
use_xft yes
xftfont Open Sans Light:size=8
xftalpha 0.8
text_buffer_size 2048
uppercase yes

# 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

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type dock
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_argb_visual yes
#own_window_argb_value 255

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

minimum_size 282

# Draw shades?
draw_shades no
default_shade_color 292421
# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
#border_inner_margin 30
#border_outer_margin 0
draw_graph_borders no
# border width
border_width 0

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

# Gap between borders of screen and text
# same thing as passing -x at command line
#gap_x 1400
#gap_y 240


alignment tl
gap_x 1320
gap_y 280




#alignment top_right
#gap_x 101
#gap_y 600

#	Distric-Thin			fonts
#	Blue Highway
#	Raleway
#	Zekton
#	Calibri
#	Engebrechtre
#	Opeln2001
#	Open Sans Light
#	Open Sans Light


imlib_cache_size 0

color1 424242
color2 424242
color3 000000
color4 6b6b6b
color5 6db9d5
color6 000000
color7 000000

TEXT
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=497163&u=c" -o ~/.cache/weather.xml}





${color2}${font Nimbus Sans Light:pixelsize=9}${alignr 10}NOW:  ${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}

${font Nimbus Sans Light:pixelsize=9}${execi 300 cp -f ~/.conky-weather-icons/60x60/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather.png}${image ~/.cache/weather.png -p 8,56 -s 60x60}${color2}
   Currently:${color2}${alignc}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color2}
   Wind:${alignc}${color2}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color2}
   Humidity:${color2}${alignc}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}%

${color2}${goto 24}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${execi 300 cp -f ~/.conky-weather-icons/32x32/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 14,190 -s 32x32}${goto 128}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${execi 300 cp -f ~/.conky-weather-icons/32x32/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 120,190 -s 32x32}${goto 224}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${execi 300 cp -f ~/.conky-weather-icons/32x32/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 224,190 -s 32x32}


${color2}${goto 60}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${goto 164}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${alignr 10}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°
${color2}${font Nimbus Sans Light:pixelsize=12}${goto 22}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${goto 126}${color1}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${goto 232}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${font}

CLICK TO VIEW

x

photo_conky(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -- Conky settings -- #
background no
update_interval 3

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

# -- Window specifications -- #

own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 300 240
maximum_width 300


alignment tl
gap_x 1610
gap_y 460
#gap_x 1305
#gap_y 330

# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# -- Text settings -- #
use_xft yes
xftfont London Between:size=24
xftalpha 0.8

uppercase no

default_color FFFFFF

# -- Lua Load -- #
lua_load ~/.conky/photo_album.lua
lua_draw_hook_pre photo_album

TEXT
 

x

photo_album.lua(raw, dl)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
--[[
Photo Album by londonali1010 (2009)

This script draws a photo album of the files in a specified directory.  Files will be displayed in order; there is currently no option to randomise.

To call this script in Conky (assuming that you have saved it as ~/scripts/photo_album.lua), use the following before TEXT:
    lua_load ~/scripts/photo_album.lua
    lua_draw_hook_pre photo_album
    
Changelog:
+ v1.0 -- Original release (03.11.2009)
]]

require 'cairo'
require 'imlib2'

-- OPTIONS
-- "album_dir" is the directory containing the images for your photo album; please note that the path must be absolute (e.g. no "~")
album_dir = "/home/darek/Dropbox/walls/"
-- "xc" and "yc" are the coordinates of the centre of the photo album, relative to the top left corner of the Conky window, in pixels
xc, yc = 150, 120
-- "w_max" and "h_max" are the maximum dimensions, in pixels, that you want the widget to be.  The script will ensure that the photo album fits inside the box bounded by w_max and h_max
w_max, h_max = 300, 240
-- "t" is the thickness of the frame, in pixels
t = 2
-- "update_interval" is the number of Conky updates between refreshes
update_interval = 30

function get_file_to_use()
    num_files = tonumber(conky_parse("${exec ls -A " .. album_dir .. " | wc -l}"))
    if num_files == nil then num_files = 0 end
    if num_files == 0 then return "none" end
    
    updates = tonumber(conky_parse("${updates}"))
    whole = math.ceil(updates/update_interval)
    
    if whole <= num_files
    then
        num_file_to_show = whole
    else
        whole = whole % num_files
        num_file_to_show = whole
    end
    
    return conky_parse("${exec ls " .. album_dir .. " | sed -n " .. num_file_to_show .. "p}")
end

function init_drawing_surface()
    imlib_set_cache_size(4096 * 1024)
    imlib_context_set_dither(1)
end

function draw_frame()
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual,  conky_window.width, conky_window.height)
    
    cr = cairo_create(cs)
    
    cairo_rectangle(cr, xc - width/2 - t, yc - height/2 - t, width + 2*t, height + 2*t)
    cairo_set_source_rgba(cr, 1, 1, 1, 0.8)
    cairo_fill(cr)   
    
    cairo_destroy(cr)
end

function draw_image()
    init_drawing_surface()
    
    image = imlib_load_image(album_dir .. filename)
    if image == nil then return end
    imlib_context_set_image(image)
	
	w_img, h_img = imlib_image_get_width(), imlib_image_get_height()
	if w_img >= h_img
	then
	    width = w_max - 2*t
	    height = width * (h_img/w_img)
	else
	    height = h_max - 2*t
	    width = height * (w_img/h_img)
	end
	
	draw_frame()
	
	buffer = imlib_create_image(width, height)
	imlib_context_set_image(buffer)
	
	imlib_blend_image_onto_image(image, 0, 0, 0, w_img, h_img, 0, 0, width, height)
	imlib_context_set_image(image)
	imlib_free_image()
	
	imlib_context_set_image(buffer)
	imlib_render_image_on_drawable(xc - width/2, yc - height/2)
	imlib_free_image()
end


function conky_photo_album()
    if conky_window == nil then return end
    filename = get_file_to_use()
    if filename == "none"
    then
        print(album_dir .. ": No files found")
    else
        draw_image()
    end
end
 

x