PDA

View Full Version : Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.



Pages : [1] 2

Bruce M.
December 18th, 2009, 02:21 PM
OK, the mega thread Post your .conkyrc files w/ screenshots (http://ubuntuforums.org/showthread.php?t=281865&page=1106) has been hijacked by Conky Calendars, to the point that people asking for help with other aspects of conky are having their requests for help buried in an avalanche.

So today I though why not a Conky "Script" Support Thread? Obviously if you are showing your Conky screenshot and the files that did it the scripts will accompany it on the other thread (http://ubuntuforums.org/showthread.php?t=281865&page=1106).

But if you see a "script", bash, python, perl - who cares, that you can "touch up" copy it here and have at it with various other "script junkies" (meant in a good way), after all we all win! Or if you have a NEW script for conky you are working on bring it here. :)

I ask that each post here has a link to Post your .conkyrc files w/ screenshots (http://ubuntuforums.org/showthread.php?t=281865&page=1106) if the script came from there or when the "CCCC" script writers agree that it's done as best it can be, a post on the mega thread explaining what the script does with a screenie and a link to the post here to get the script.

What do you think?
Have a nice day.
Bruce

dk75
December 18th, 2009, 08:44 PM
There could be a BASH script yes?

Bruce M.
December 18th, 2009, 09:50 PM
There could be a BASH script yes?

Absolutely for example:


${execpi 8 hddtemp /dev/sda | cut --characters 34-37 | xargs ~/Conky/scripts/ColorTempHDD.sh}

calls the bash script: ColorTempHDD.sh a modified version of Crinos'512's colorize.sh (http://conky.linux-hardcore.com/?page_id=747);


#!/bin/bash
# colorize.sh
# by: Crinos512

COOL=45
WARM=56

if [[ $1 < $COOL ]]
then echo "\${color7}"$1 # COOL
elif [[ $1 > $WARM ]]
then echo "\${color9}"$1 # HOT
else echo "\${color8}"$1 # WARM
fi

exit 0

CHIMO!
Bruce

guriinii
December 18th, 2009, 10:01 PM
What a fantastic idea! Bruce you legend.

Right... curl and rss feeds, can somebody give some me some guides, tips or help?

Thanks in advance

dk75
December 18th, 2009, 10:45 PM
why... did it need to be curl?


sudo apt-get install python-feedparser

there is web page with all available commands: Universal Feedparser (http://www.feedparser.org/)

and there is my example code


#! /usr/bin/env python
# -*- coding: utf-8 -*-
################################################## ############
# parse RSS feed
# RSS.py rss.url no._of_entry_to_parse
################################################## ############

import sys
import feedparser
d = feedparser.parse(sys.argv[1])
print
print d.entries[int(sys.argv[2])].title.replace('<br />' , '\n').replace('<p>' , '\n\t').replace('</p>' , '\n')
print
print d.entries[int(sys.argv[2])].description.replace('<br />' , '\n').replace('<p>' , '\n\t').replace('</p>' , '\n')
print
e = d.entries[int(sys.argv[2])]
print ('Link: '),e.link
print
print d.entries[int(sys.argv[2])].category
print
print d.entries[int(sys.argv[2])].status
print
quit()

mobilediesel
December 18th, 2009, 10:58 PM
Excellent idea! I wish I'd thought of it!
as a reply to one of your posts (http://ubuntuforums.org/showpost.php?p=8520172&postcount=11069) in the conky mega-thread (http://ubuntuforums.org/showthread.php?t=281865):

BASH Beginner's Guide (http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html)
and
Writing Shell Scripts (http://linuxcommand.org/writing_shell_scripts.php)

and this script I'll post here isn't even mine:
conky-rss.sh (http://dl.dropbox.com/u/1055489/scripts/conky-rss.sh)

#!/bin/bash
# RSS Display Script by Bill Woodford (admin@sdesign.us) v1.0
#
#RSS Setup - Don't change unless you want these values hard-coded!
uri=$1 #URI of RSS Feed
lines=$2 #Number of headlines
titlenum=$3 #Number of extra titles
#Script start
#Require a uri, as a minimum
if [[ "$uri" == "" ]]; then
echo "No URI specified, cannot continue!" >&2
echo "Please read script for more information" >&2
else
#Set defaults if none specified
if [[ $lines == "" ]]; then lines=25 ; fi
if [[ $titlenum == "" ]]; then titlenum=2 ; fi

#The actual work
curl -A "Mozilla/5.0" -s --connect-timeout 30 $uri |\
grep -io "<title>[^<]*"|\
sed -e 's/<[^>]*>//'|\
head -n $(($lines + $titlenum)) |\
tail -n $(($lines))
fi

Bruce M.
December 18th, 2009, 11:08 PM
Excellent idea! I wish I'd thought of it!

OK you though of it, no biggie.

THANK YOU for the links. :)

CHIMO!
Bruce

guriinii
December 18th, 2009, 11:12 PM
why... did it need to be curl?



It doesn't, that is all I knew really.
I'll give it a go
Cheers.

mobilediesel
December 20th, 2009, 10:31 PM
Here's a fairly simple script to display a normal calendar with conky. It shows the last few days of the previous month as well as the first few days of the next month.

You can have the month/year line a different color and the days of the week line a different color.


#!/bin/bash
date=$(date '+%F')
DAY=${date:8:2}
DAY=${DAY/#0/}
cal=$(cal)
prev=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1)
next=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1)
if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next"
else next="\${color9} $next"
fi
if [ ${#prev} == 20 ]; then prev="$prev"$'\n '
else prev="$prev "
fi
echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${colo r9}$prev\${color}$(echo "${cal:42}" | sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' -e /" $DAY "/s/" $DAY "/" "'${color3}'"$DAY"'${color}'" "/ -e 's/^ //' -e 's/ *$//')$next"
140669

I did it this way to limit the number of calls to cal as I was calling it a few times. Now it's just 3. :)

guriinii
December 23rd, 2009, 12:00 PM
can I put an image on my conky from an RSS feed? For example: http://xkcd.com/

WorldTripping
December 23rd, 2009, 12:08 PM
OK, here is mine.

It determines whether or not there is a wi-fi connection present.

If there is it loads '.conkyLeftScreenWIFI.rc', if not it loads '.conkyLeftScreenNOFI.rc'.

Difference between the two conky files is one of layout and the variables they call (eg '.conkyLeftScreenNOFI.rc' does not look for the wireless address).



#!/bin/bash
sleep 15
if ifconfig wlan0 | grep "inet addr"
then
conky -d -c /home/simon/.conkyLeftScreenWIFI.rc
sleep 5
else
conky -d -c /home/simon/.conkyLeftScreenNOFI.rc
sleep 5
fi
conky -d -c /home/simon/.conkyBottomScreen.rc
sleep 5
conky -d -c /home/simon/.conkyRightScreen.rc
sleep 5
exit


Maybe someone can use this sometime.

WorldTripping.

mobilediesel
December 23rd, 2009, 12:34 PM
can I put an image on my conky from an RSS feed? For example: http://xkcd.com/

Not neatly but this is functional:

${execi 7200 wget --quiet $(curl --silent 'http://xkcd.com/rss.xml'|grep -o 'src="[^"]*'|sed 's/src="//'|head -1) -O ~/conky/xkcd.png}
${image ~/conky/xkcd.png}

This isn't exactly elegant, someone please help make this purty!

dk75
December 25th, 2009, 05:35 PM
can I put an image on my conky from an RSS feed? For example: http://xkcd.com/

conkyrc


background no
update_interval 14400
total_run_times 0
own_window yes
own_window_type override
own_window_transparent yes
own_window_colour black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 637 205
maximum_width 637
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
stippled_borders 0
#border_inner_margin 0
#border_outer_margin 0
#border_width 0
default_color white
default_shade_color black
default_outline_color black
alignment bottom_left
gap_x 100
gap_y 100
no_buffers yes
uppercase no
override_utf8_locale yes
use_spacer right
max_port_monitor_connections 10
max_specials 64
max_user_text 64
imlib_cache_size 0
lua_load ~/.conky/lua/xkcd-rss.lua
lua_draw_hook_pre conky_main
TEXT



xkcd.lua


do
require 'cairo'
local http = require('socket.http')
local url = 'http://xkcd.com/rss.xml'
local comicW, comicH = 0, 0
local CONKYRC = "/home/kitsune/.conky/.conkyrc-test19"

function conky_cairo_window_hook()
if conky_window == nil then return end
if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
if cs then cairo_surface_destroy(cs) end
cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
end
if cr then cairo_destroy(cr) end
cr = cairo_create(cs)
end

function conky_main()
conky_cairo_window_hook()
if conky_window == nil then return end
local w, h = conky_window.width, conky_window.height
if w == nil or h == nil then return end

local rss = http.request(url)
rss = rss:gsub("><", ">\n<")
for line in rss:gmatch("[^\r\n]+")
do
if line:match("^<description>.+img src+") then rss = line:gsub(".+src=\"", ""):gsub("\" title=.+", ""); break end
end
local img_tmp = http.request(rss)
local out = assert(io.open("/tmp/comic_strip.png", "wb"))
out:write(img_tmp)
assert(out:close())

local comic_strip = cairo_image_surface_create_from_png("/tmp/comic_strip.png")
--[[comicW = cairo_image_surface_get_width(comic_strip)
comicH = cairo_image_surface_get_height(comic_strip)

if comicW ~= conky_window.width or comicH ~= conky_window.height then
local tmp3 = ""
local tmp = assert(io.open(CONKYRC, "r"))
local tmp2 = tmp:read("*a")
assert(tmp:close())
for line in tmp2:gmatch("[^\r\n]+")
do
if line:match("^minimum_size") then tmp3 = tmp3 .. "minimum_size " .. comicW .. " " .. comicH .. "\n"
elseif line:match("^maximum_width") then tmp3 = tmp3 .. "maximum_width " .. comicW .. "\n"
else tmp3 = tmp3 .. line .. "\n" end
end
local tmp = assert(io.open(CONKYRC, "w"))
tmp:write(tmp3)
assert(tmp:close())
end
]]
cairo_set_source_surface(cr, comic_strip, 0, 0)
cairo_paint(cr)
end
end

as you can see there is a code to resize Conky window and it actually works except for that it makes my conky window black for another Conky window update ( 4 hour at this conkyrc ) ](*,)

guriinii
December 28th, 2009, 12:59 PM
Thank you so very much dk75 for making this for me, really impressed, not that I understand much of it. Now how do I get it to work?

I think I need them in separated files? I don't know how to use lua. Also is cairo a program I need. I'm out of my depth here, but I really want to learn this.

guriinii
December 28th, 2009, 01:31 PM
Not neatly but this is functional:

${execi 7200 wget --quiet $(curl --silent 'http://xkcd.com/rss.xml'|grep -o 'src="[^"]*'|sed 's/src="//'|head -1) -O ~/conky/xkcd.png}
${image ~/conky/xkcd.png}This isn't exactly elegant, someone please help make this purty!

This didn't work, I got this in terminal


richard@richard-desktop:/$ conky -c ~/Conky/conkyquote
Conky: forked to background, pid is 14615

richard@richard-desktop:/$ Conky: desktop window (18000aa) is subwindow of root window (f1)
Conky: window type - normal
Conky: drawing to created window (0x4200001)
Conky: drawing to double buffer
/home/richard/conky/xkcd.png: No such file or directory
Conky: not implemented obj type 44
Conky: not implemented obj type 44

slakkie
December 28th, 2009, 01:45 PM
OK, here is mine.

It determines whether or not there is a wi-fi connection present.

If there is it loads '.conkyLeftScreenWIFI.rc', if not it loads '.conkyLeftScreenNOFI.rc'.

Difference between the two conky files is one of layout and the variables they call (eg '.conkyLeftScreenNOFI.rc' does not look for the wireless address).



#!/bin/bash
sleep 15
if ifconfig wlan0 | grep "inet addr"
then
conky -d -c /home/simon/.conkyLeftScreenWIFI.rc
sleep 5
else
conky -d -c /home/simon/.conkyLeftScreenNOFI.rc
sleep 5
fi
conky -d -c /home/simon/.conkyBottomScreen.rc
sleep 5
conky -d -c /home/simon/.conkyRightScreen.rc
sleep 5
exit


Maybe someone can use this sometime.

WorldTripping.

I have something similar:



# In my lua script
function conky_show_net(int, desc, is_wlan)
net_is = sprintf("${if_up %s}%s ", int, int);
net_ip = sprintf("$alignr ${addrs %s}", int);
net_not = sprintf("${else}%s [%s] is not configured $endif", int, desc);
net_graph="14,185";

net_up_icon = "${font PizzaDude Bullets:size=6}N${font}${voffset -2} ";
net_up = sprintf("${totalup %s}/${upspeed %s} $alignr ${upspeedgraph %s %s}", int, int, int, net_graph);
net_up = net_up_icon .. net_up;

net_down_icon = "${font PizzaDude Bullets:size=6}T${font}${voffset -2} ";
net_down = sprintf("${totaldown %s}/${downspeed %s} $alignr ${downspeedgraph %s %s }", int, int, int, net_graph);
net_down = net_down_icon .. net_down;

if is_wlan == '1' then
wifi_info = sprintf("${wireless_ap %s} $alignr ${wireless_bitrate %s}", int, int);
wifi_ssid = sprintf("[${wireless_mode %s}] ${wireless_essid %s}", int, int);
wifi_link = sprintf("${wireless_link_qual %s}/${wireless_link_qual_max %s}", int, int);
wifi_perc = sprintf("${wireless_link_qual_perc %s}", int);
wifi_bar = sprintf("${wireless_link_bar %s}", int);

net_info = sprintf("${alignc} %s $alignr %s\n%s ${alignr}%s %s%%\n%s\n",
wifi_ssid, net_ip, wifi_info, wifi_link, wifi_perc, wifi_bar);
else
net_info = sprintf("%s $alignr %s\n", desc, net_ip);
end
return net_is .. net_info .. net_up .. "\n" .. net_down .. net_not;
end




# Conkyrc
${font Poky:size=12}w${font}${voffset -5} NETWORK ${hr 2}
${lua_parse show_net eth0 LAN 0}
${lua_parse show_net wlan0 WLAN 1}
${lua_parse show_net tun0 VPN 0}


And then this is the output:

http://opperschaap.net/~wesleys/ubuntu/conky-nw.png

I have a similar function for disk mounts, which shows disk info or tells me something is not mounted.

mobilediesel
December 28th, 2009, 01:46 PM
This didn't work, I got this in terminal


richard@richard-desktop:/$ conky -c ~/Conky/conkyquote
Conky: forked to background, pid is 14615

richard@richard-desktop:/$ Conky: desktop window (18000aa) is subwindow of root window (f1)
Conky: window type - normal
Conky: drawing to created window (0x4200001)
Conky: drawing to double buffer
/home/richard/conky/xkcd.png: No such file or directory
Conky: not implemented obj type 44
Conky: not implemented obj type 44


It looks like it tried to show the picture before it was downloaded.

Try running this from a terminal before running conky:

curl --silent 'http://xkcd.com/rss.xml'|grep -o 'src="[^"]*'|sed 's/src="//'|head -1) -O ~/conky/xkcd.png
so it grabs a copy of the image first. Then there will be something for the ${image ~/conky/xkcd.png} to display.

guriinii
December 28th, 2009, 01:59 PM
Try running this from a terminal before running conky:

curl --silent 'http://xkcd.com/rss.xml'|grep -o 'src="[^"]*'|sed 's/src="//'|head -1) -O ~/conky/xkcd.png

Didn't work, I ran it and got this:


bash: syntax error near unexpected token `)'


Cheers for the very quick reply

mobilediesel
December 28th, 2009, 02:06 PM
Didn't work, I ran it and got this:


bash: syntax error near unexpected token `)'


Cheers for the very quick reply

Yeah I screwed up the copy and paste, try this:

wget --quiet $(curl --silent 'http://xkcd.com/rss.xml'|grep -o 'src="[^"]*'|sed 's/src="//'|head -1) -O ~/conky/xkcd.png

Now it will download the latest picture so that conky has something to display.

guriinii
December 28th, 2009, 02:15 PM
Right, its downloaded the image and now its giving me this over and over until I kill conky:



Conky: not implemented obj type 44

mobilediesel
December 28th, 2009, 02:38 PM
Right, its downloaded the image and now its giving me this over and over until I kill conky:



Conky: not implemented obj type 44


Ah, what version of conky are you using? Run this in the terminal:

conky -V
You should see Imlib2 in the output somewhere near the end. If not, you'll have to install a newer version of conky.

guriinii
December 28th, 2009, 03:21 PM
I'm going to put my conky learning on hold for now. I need to do a fresh install of Jaunty, Karmic is p*ss*ng me off. I'll be back at some point.

Bruce M.
December 28th, 2009, 03:36 PM
I'm going to put my conky learning on hold for now. I need to do a fresh install of Jaunty, Karmic is p*ss*ng me off. I'll be back at some point.

Oh I know that feeling, I went from JJ to KK to #!.

#! at the moment (unless something happened in the last 8 days without Internet) is based on JJ v9.04.01 and OpenBox and is soooooooo slick! What can I say.

Have a nice day.
Bruce

guriinii
December 28th, 2009, 03:43 PM
Oh I know that feeling, I went from JJ to KK to #!.

#! at the moment (unless something happened in the last 8 days without Internet) is based on JJ v9.04.01 and OpenBox and is soooooooo slick! What can I say.

Have a nice day.
Bruce

What is #!

Enlighten me

dmillerct
December 28th, 2009, 04:05 PM
What is #!

Enlighten me

Crunch Bang Linux http://crunchbanglinux.org/

I gave it a shot but did not care for it too much. Others swear by it.

mobilediesel
December 28th, 2009, 04:14 PM
Crunch Bang Linux http://crunchbanglinux.org/

I gave it a shot but did not care for it too much. Others swear by it.

Some swear by it, others swear AT it. :D

I've never tried it myself but I'll probably try that or Arch when I get another hard drive.

dmillerct
December 28th, 2009, 04:18 PM
Some swear by it, others swear AT it. :D

I've never tried it myself but I'll probably try that or Arch when I get another hard drive.

I know its off topic but you could use virtual box and try it without any regret.

mobilediesel
December 28th, 2009, 05:51 PM
I know its off topic but you could use virtual box and try it without any regret.

I forgot about virtual box. I ran FreeDOS that way before just to mess with it. It ought to handle Crunchbang or Arch well enough.

and back on topic, the calendar script (http://ubuntuforums.org/showpost.php?p=8532568&postcount=9) I posted before can now highlight holidays and birthdays!
141491

date=$(date '+%F')
DAY=${date:8:2}
DAY=${DAY/#0/}
cal=$(cal)
prev=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1)
next=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1)
if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next"
else next="\${color9} $next"
fi
if [ ${#prev} == 20 ]; then prev="$prev"$'\n '
else prev="$prev "
fi
dates=$(remind -s|cut -d ' ' -f1|uniq|cut -d '/' -f3|sed "/$DAY/d")
current=$(echo "${cal:42}"|sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' )
for i in $dates; do
current=$(echo "$current"|sed -e /" ${i/#0/} "/s/" ${i/#0/} "/" "'${color green}'"${i/#0/}"'${color}'" "/)
done
current=$(echo "$current"|sed -e /" $DAY "/s/" $DAY "/" "'${color3}'"$DAY"'${color}'" "/ -e 's/^ //' -e 's/ *$//')
echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${colo r9}$prev\${color}$current$next"

|sed "/$DAY/d" was added so that the current day will still get colored white.

to get the dates for holidays, I use remind (http://wiki.43folders.com/index.php/Remind) along with a file I found here (http://wiki.43folders.com/index.php/User:JamesRifkin/defs.rem) that has the U.S. holidays as well as Jewish holidays.

If you use this script to win the Conky of the Month (http://blog.conky.be/2009/12/16/the-lines-are-now-closed/) be sure to mention me! The theme for this one is calendars! This script should be useful.

You can also go to http://dl.dropbox.com/u/1055489/mobilediesel/index.html
to see various scripts I use with conky. That's only a list of scripts. They're each small enough that they should be easy enough to see what they do. I'll have to get a proper description of them all on there and here.

I also wrote a small script that keeps http://dl.dropbox.com/u/1055489/mobilediesel/index.html up to date with whatever code I come up with for conky.

markp1989
December 28th, 2009, 09:33 PM
Excellent idea! I wish I'd thought of it!
as a reply to one of your posts (http://ubuntuforums.org/showpost.php?p=8520172&postcount=11069) in the conky mega-thread (http://ubuntuforums.org/showthread.php?t=281865):

BASH Beginner's Guide (http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html)
and
Writing Shell Scripts (http://linuxcommand.org/writing_shell_scripts.php)

and this script I'll post here isn't even mine:
conky-rss.sh (http://dl.dropbox.com/u/1055489/scripts/conky-rss.sh)

#!/bin/bash
# RSS Display Script by Bill Woodford (admin@sdesign.us) v1.0
#
#RSS Setup - Don't change unless you want these values hard-coded!
uri=$1 #URI of RSS Feed
lines=$2 #Number of headlines
titlenum=$3 #Number of extra titles
#Script start
#Require a uri, as a minimum
if [[ "$uri" == "" ]]; then
echo "No URI specified, cannot continue!" >&2
echo "Please read script for more information" >&2
else
#Set defaults if none specified
if [[ $lines == "" ]]; then lines=25 ; fi
if [[ $titlenum == "" ]]; then titlenum=2 ; fi

#The actual work
curl -A "Mozilla/5.0" -s --connect-timeout 30 $uri |\
grep -io "<title>[^<]*"|\
sed -e 's/<[^>]*>//'|\
head -n $(($lines + $titlenum)) |\
tail -n $(($lines))
fi

thanks , i took parts of your script and threw this together to work with dzen2 , hope you dont mind.





#!/bin/bash
FG='#ffffff'
BG='#000000'
#FONT='-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*'
while true ; do
url=http://www.harrowtimes.co.uk/news/rss/ #URl of RSS Feed
lines=4 #Number of headlines
titlenum=2
newsrss=`curl -A "Mozilla/5.0" -s --connect-timeout 30 $url | grep -io "<title>[^<]*"| sed -e 's/<[^>]*>//'| head -n $(($lines + $titlenum)) | tail -n $(($lines))|tr '\n' ':'`

printf "%s\n" "$newsrss"
sleep 20
done | dzen2 -e '' -y '885' -h '15' -sa 'r' -ta c -fg $FG -bg $BG -fn $FONT


the y value will have to be changed depending on the size of your screen (mine is set to go across the bottom of a screen 900px high)

mobilediesel
December 29th, 2009, 04:42 AM
thanks , i took parts of your script and threw this together to work with dzen2 , hope you dont mind.

the y value will have to be changed depending on the size of your screen (mine is set to go across the bottom of a screen 900px high)

I don't mind at all! I haven't heard of dzen2. That'll be neat to play with.

WorldTripping
December 29th, 2009, 05:51 AM
Oh I know that feeling, I went from JJ to KK to #!.

#! at the moment (unless something happened in the last 8 days without Internet) is based on JJ v9.04.01 and OpenBox and is soooooooo slick! What can I say.

Have a nice day.
Bruce

Hey Bruce,

Many Happy Returns !

I'm afraid that I'm in the same boat.

Went from ubuntu kk back to #! jj.

kk would not recognise my USB GSM dongle or my USB GPS and it was easier to revert than figure it out (my problem I know) !

Started with a minimal install (just terminal apps that I used for a week or two) before I started to add all of the X apps that I needed.

(Must say that I got quite use to using elinks as a web browser.)

The only thing that I don't like about #! is the lack of an encrypted lvm as I always used to install via the 'alternate CD' and opt for that. Guess that I'll have to investigate how to do that using LUKS etc. post install.

Gotta say though that #! with all its simplicity and speed; combined with the ability to configure openbox ad infinitum, with all of the Ubuntu repos is the the happiest that I've felt with a distro for a while.

Obligatory screenshot attached.

WorldTripping
December 29th, 2009, 06:00 AM
Crunch Bang Linux http://crunchbanglinux.org/

I gave it a shot but did not care for it too much. Others swear by it.

Having spent a week with it I guess that I fall into that camp.

Must admit though that I like tinkering and the thought of a completely (terminal apps only) install that I then add to, with the backing of all the repos that I'm used to appeals to me.

But hey, I've not stopped messing with conky for the last few years so why would I stop being a distro *****. :)

(loving #! tho !)

Bruce M.
December 29th, 2009, 05:11 PM
Off Topic

What is #!

Enlighten me

Ok, by now you've seen dmillerct's comment, below. See my desktop below as well. :)


Crunch Bang Linux http://crunchbanglinux.org/

I gave it a shot but did not care for it too much. Others swear by it.

I'm one of them, but I don't use bad words, just good words to describe #!. One has to like OpenBox to like Crunchbang. And I really do like it.


Some swear by it, others swear AT it. :D

Bite your tongue. :lolflag:

On Topic!
Now to continue:

On Conky Hardcore! there is a script by TeoBigusGeekus to get weather from Weather Underground (http://conky.linux-hardcore.com/?page_id=2381) - and I'm playing with it. It looks like it's set up for 5, 7 or 9 days. and uses "fake" files to determine what one downloads.

Anyway the script is: wunderground-script.sh (so I call it):

#!/bin/bash
wget -O ~/conky_wunderground/ics1 http://ical.wunderground.com/auto/ical/global/stations/87582.ics?units=metric
sed 's/\./\n/g' ~/conky_wunderground/ics1 > ~/conky_wunderground/ics
egrep -i 'description|monday|tuesday|wednesday|thursday|fri day|saturday|sunday|high|low|wind' ~/conky_wunderground/ics >~/conky_wunderground/messages.wun
sed -i 's/DESCRIPTION://g' ~/conky_wunderground/messages.wun
sed -i 's/\\n/\n/g' ~/conky_wunderground/messages.wun
sed -i 's/ - /\n/g' ~/conky_wunderground/messages.wun
sed -i 's/High/\nHigh/g' ~/conky_wunderground/messages.wun
sed -i 's/Low/\nLow/g' ~/conky_wunderground/messages.wun
cp ~/conky_wunderground/messages.wun ~/conky_wunderground/temp1.wun
sed -i 's/Wind /\n/g' ~/conky_wunderground/messages.wun
sed -i '/^ /d' ~/conky_wunderground/messages.wun
sed -i '/^$/d' ~/conky_wunderground/messages.wun
sed -i 's/Wind/\nWind/g' ~/conky_wunderground/temp1.wun
sed -i 's/\./\n/g' ~/conky_wunderground/temp1.wun
grep -i Wind ~/conky_wunderground/temp1.wun>~/conky_wunderground/wind-icons-messages.wun
sed -i 's/Wind //g' ~/conky_wunderground/wind-icons-messages.wun
sed -i 's/ km\/h//g' ~/conky_wunderground/wind-icons-messages.wun
cut -c1-3 ~/conky_wunderground/wind-icons-messages.wun >~/conky_wunderground/icons.wun
rm ~/conky_wunderground/14
rm ~/conky_wunderground/13
rm ~/conky_wunderground/12
a=`sed -n '$=' ~/conky_wunderground/wind-icons-messages.wun`
if [ $a -eq "13" ];
then sed -i '1s/^/Today\n -\n - \n - \n/' ~/conky_wunderground/messages.wun
sed -i '1s/^/\n/' ~/conky_wunderground/icons.wun
echo $a>~/conky_wunderground/13
elif [ $a -eq "12" ];
then sed -i '12s/$/\n\n/' ~/conky_wunderground/icons.wun
sed -i '48s/$/\n\n -\n - \n - \n\n -\n - \n - \n/' ~/conky_wunderground/messages.wun
echo $a>~/conky_wunderground/12
elif [ $a -eq "14" ];
then echo $a>~/conky_wunderground/14
fi;
a=`sed -n '2p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '14s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '14s/$/\nh/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '14s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '14s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '14s/$/\nq/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '14s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '14s/$/\nm/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '14s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '14s/$/\nd/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '14s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '14s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '14s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '14s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '14s/$/\nb/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '14s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '14s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '14s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '14s/$/\ni/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '14s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '14s/$/\nr/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '14s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '14s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '14s/$/\ne/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '14s/$/\nb/' ~/conky_wunderground/icons.wun
else sed -i '14s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '6p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '15s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '15s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '15s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '15s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '15s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '15s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '15s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '15s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '15s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '15s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '15s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '15s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '15s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '15s/$/\nB/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '15s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '15s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '15s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '15s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '15s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '15s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '15s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '15s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '15s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '15s/$/\nB/' ~/conky_wunderground/icons.wun
else sed -i '15s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '10p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '16s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '16s/$/\nh/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '16s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '16s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '16s/$/\nq/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '16s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '16s/$/\nm/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '16s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '16s/$/\nd/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '16s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '16s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '16s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '16s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '16s/$/\nb/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '16s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '16s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '16s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '16s/$/\ni/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '16s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '16s/$/\nr/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '16s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '16s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '16s/$/\ne/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '16s/$/\nb/' ~/conky_wunderground/icons.wun
else sed -i '16s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '14p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '17s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '17s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '17s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '17s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '17s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '17s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '17s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '17s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '17s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '17s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '17s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '17s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '17s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '17s/$/\nB/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '17s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '17s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '17s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '17s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '17s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '17s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '17s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '17s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '17s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '17s/$/\nB/' ~/conky_wunderground/icons.wun
else sed -i '17s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '18p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '18s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '18s/$/\nh/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '18s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '18s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '18s/$/\nq/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '18s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '18s/$/\nm/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '18s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '18s/$/\nd/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '18s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '18s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '18s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '18s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '18s/$/\nb/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '18s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '18s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '18s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '18s/$/\ni/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '18s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '18s/$/\nr/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '18s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '18s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '18s/$/\ne/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '18s/$/\nb/' ~/conky_wunderground/icons.wun
else sed -i '18s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '22p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '19s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '19s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '19s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '19s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '19s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '19s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '19s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '19s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '19s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '19s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '19s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '19s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '19s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '19s/$/\nB/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '19s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '19s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '19s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '19s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '19s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '19s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '19s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '19s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '19s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '19s/$/\nB/' ~/conky_wunderground/icons.wun
else sed -i '19s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '26p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '20s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '20s/$/\nh/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '20s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '20s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '20s/$/\nq/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '20s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '20s/$/\nm/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '20s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '20s/$/\nd/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '20s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '20s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '20s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '20s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '20s/$/\nb/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '20s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '20s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '20s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '20s/$/\ni/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '20s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '20s/$/\nr/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '20s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '20s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '20s/$/\ne/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '20s/$/\nb/' ~/conky_wunderground/icons.wun
else sed -i '20s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '30p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '21s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '21s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '21s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '21s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '21s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '21s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '21s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '21s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '21s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '21s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '21s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '21s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '21s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '21s/$/\nB/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '21s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '21s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '21s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '21s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '21s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '21s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '21s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '21s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '21s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '21s/$/\nB/' ~/conky_wunderground/icons.wun
else sed -i '21s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '34p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '22s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '22s/$/\nh/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '22s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '22s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '22s/$/\nq/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '22s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '22s/$/\nm/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '22s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '22s/$/\nd/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '22s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '22s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '22s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '22s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '22s/$/\nb/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '22s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '22s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '22s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '22s/$/\ni/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '22s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '22s/$/\nr/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '22s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '22s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '22s/$/\ne/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '22s/$/\nb/' ~/conky_wunderground/icons.wun
else sed -i '22s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '38p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '23s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '23s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '23s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '23s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '23s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '23s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '23s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '23s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '23s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '23s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '23s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '23s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '23s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '23s/$/\nB/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '23s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '23s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '23s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '23s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '23s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '23s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '23s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '23s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '23s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '23s/$/\nB/' ~/conky_wunderground/icons.wun
else sed -i '23s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '42p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '24s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '24s/$/\nh/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '24s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '24s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '24s/$/\nq/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '24s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '24s/$/\nm/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '24s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '24s/$/\nd/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '24s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '24s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '24s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '24s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '24s/$/\nb/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '24s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '24s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '24s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '24s/$/\ni/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '24s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '24s/$/\nr/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '24s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '24s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '24s/$/\ne/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '24s/$/\nb/' ~/conky_wunderground/icons.wun
else sed -i '24s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '46p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '25s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '25s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '25s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '25s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '25s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '25s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '25s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '25s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '25s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '25s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '25s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '25s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '25s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '25s/$/\nB/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '25s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '25s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '25s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '25s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '25s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '25s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '25s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '25s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '25s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '25s/$/\nB/' ~/conky_wunderground/icons.wun
else sed -i '25s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '50p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '26s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '26s/$/\nh/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '26s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '26s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '26s/$/\nq/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '26s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '26s/$/\nm/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '26s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '26s/$/\nd/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '26s/$/\np/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '26s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '26s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '26s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '26s/$/\nb/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '26s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '26s/$/\nc/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '26s/$/\nv/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '26s/$/\ni/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '26s/$/\nw/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '26s/$/\nr/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '26s/$/\na/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '26s/$/\nn/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '26s/$/\ne/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '26s/$/\nb/' ~/conky_wunderground/icons.wun
else sed -i '26s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '54p' ~/conky_wunderground/messages.wun`
if test "$a" = "Chance of Flurries"
then sed -i '27s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Rain"
then sed -i '27s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Freezing Rain"
then sed -i '27s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Sleet"
then sed -i '27s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Snow"
then sed -i '27s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of Thunderstorms"
then sed -i '27s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Chance of a Thunderstorm"
then sed -i '27s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Clear"
then sed -i '27s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Cloudy"
then sed -i '27s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Flurries"
then sed -i '27s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Fog"
then sed -i '27s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Hazy"
then sed -i '27s/$/\n0/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Cloudy"
then sed -i '27s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Mostly Sunny"
then sed -i '27s/$/\nB/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Cloudy"
then sed -i '27s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Partly Sunny"
then sed -i '27s/$/\nC/' ~/conky_wunderground/icons.wun
elif test "$a" = "Freezing Rain"
then sed -i '27s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Rain"
then sed -i '27s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sleet"
then sed -i '27s/$/\nG/' ~/conky_wunderground/icons.wun
elif test "$a" = "Snow"
then sed -i '27s/$/\nO/' ~/conky_wunderground/icons.wun
elif test "$a" = "Sunny"
then sed -i '27s/$/\nA/' ~/conky_wunderground/icons.wun
elif test "$a" = "Thunderstorms" || test "$a" = "Thunderstorm"
then sed -i '27s/$/\nK/' ~/conky_wunderground/icons.wun
elif test "$a" = "Overcast"
then sed -i '27s/$/\nD/' ~/conky_wunderground/icons.wun
elif test "$a" = "Scattered Clouds"
then sed -i '27s/$/\nB/' ~/conky_wunderground/icons.wun
else sed -i '27s/$/\n-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '4p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '1s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '1s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '1s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '1s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '1s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '1s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '1s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '1s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '1s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '1s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '1s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '1s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '1s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '1s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '1s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '1s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '1s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '8p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '2s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '2s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '2s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '2s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '2s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '2s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '2s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '2s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '2s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '2s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '2s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '2s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '2s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '2s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '2s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '2s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '2s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '12p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '3s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '3s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '3s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '3s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '3s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '3s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '3s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '3s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '3s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '3s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '3s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '3s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '3s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '3s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '3s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '3s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '3s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '16p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '4s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '4s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '4s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '4s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '4s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '4s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '4s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '4s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '4s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '4s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '4s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '4s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '4s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '4s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '4s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '4s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '4s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '20p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '5s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '5s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '5s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '5s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '5s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '5s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '5s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '5s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '5s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '5s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '5s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '5s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '5s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '5s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '5s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '5s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '5s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '24p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '6s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '6s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '6s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '6s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '6s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '6s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '6s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '6s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '6s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '6s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '6s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '6s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '6s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '6s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '6s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '6s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '6s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '28p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '7s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '7s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '7s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '7s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '7s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '7s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '7s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '7s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '7s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '7s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '7s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '7s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '7s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '7s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '7s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '7s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '7s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '32p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '8s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '8s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '8s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '8s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '8s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '8s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '8s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '8s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '8s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '8s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '8s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '8s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '8s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '8s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '8s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '8s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '8s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '36p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '9s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '9s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '9s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '9s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '9s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '9s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '9s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '9s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '9s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '9s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '9s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '9s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '9s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '9s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '9s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '9s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '9s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '40p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '10s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '10s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '10s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '10s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '10s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '10s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '10s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '10s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '10s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '10s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '10s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '10s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '10s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '10s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '10s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '10s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '10s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '44p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '11s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '11s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '11s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '11s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '11s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '11s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '11s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '11s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '11s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '11s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '11s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '11s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '11s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '11s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '11s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '11s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '11s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '48p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '12s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '12s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '12s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '12s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '12s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '12s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '12s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '12s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '12s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '12s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '12s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '12s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '12s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '12s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '12s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '12s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '12s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '52p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '13s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '13s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '13s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '13s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '13s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '13s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '13s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '13s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '13s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '13s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '13s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '13s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '13s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '13s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '13s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '13s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '13s/$/-/' ~/conky_wunderground/icons.wun
fi;
a=`sed -n '56p' ~/conky_wunderground/messages.wun|cut -c1-3 `
if test "$a" = "Sou"
then sed -i '14s/Sou/1/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSW"
then sed -i '14s/SSW/2/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SW "
then sed -i '14s/SW /3/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WSW"
then sed -i '14s/WSW/4/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Wes"
then sed -i '14s/Wes/5/g' ~/conky_wunderground/icons.wun
elif test "$a" = "WNW"
then sed -i '14s/WNW/6/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NW "
then sed -i '14s/NW /7/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNW"
then sed -i '14s/NNW/8/g' ~/conky_wunderground/icons.wun
elif test "$a" = "Nor"
then sed -i '14s/Nor/9/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NNE"
then sed -i '14s/NNE/:/g' ~/conky_wunderground/icons.wun
elif test "$a" = "NE "
then sed -i '14s/NE /;/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ENE"
then sed -i '14s/ENE/</g' ~/conky_wunderground/icons.wun
elif test "$a" = "Eas"
then sed -i '14s/Eas/=/g' ~/conky_wunderground/icons.wun
elif test "$a" = "ESE"
then sed -i '14s/ESE/>/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SE "
then sed -i '14s/SE /?/g' ~/conky_wunderground/icons.wun
elif test "$a" = "SSE"
then sed -i '14s/SSE/@/g' ~/conky_wunderground/icons.wun
else sed -i '14s/$/-/' ~/conky_wunderground/icons.wun
fi;
The part I'm concerned with is:

rm ~/conky_wunderground/14
rm ~/conky_wunderground/13
rm ~/conky_wunderground/12
that creates and error in terminal if the files do not exist.


0 bruloo@bruloo: ~
Tue Dec 29, 12:45 $ conky -c ~/Conky/OB_Wunder
Conky: desktop window (1a7) is root window
Conky: window type - normal
Conky: drawing to created window (0x1800001)
Conky: drawing to double buffer
--2009-12-29 12:45:30-- http://ical.wunderground.com/auto/ical/global/stations/87582.ics?units=metric
Resolving ical.wunderground.com... 38.102.136.104
Connecting to ical.wunderground.com|38.102.136.104|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/calendar]
Saving to: `/home/bruloo/Conky/Wunderground/ics1'

[ <=> ] 4,228 16.1K/s in 0.3s

2009-12-29 12:45:31 (16.1 KB/s) - `/home/bruloo/Conky/Wunderground/ics1' saved [4228]

rm: cannot remove `/home/bruloo/Conky/Wunderground/13': No such file or directory
rm: cannot remove `/home/bruloo/Conky/Wunderground/12': No such file or directory

Is there a "if exist" command that can be applied in a bash script? I checked "man rm" and didn't see anything.

{thinking out loud ... errrr typing -. template for that would be nice}

On boot-up in the morning I see all my conkys:

http://conky.linux-hardcore.com/wp-content/uploads/2009/12/All_Conky-300x240.png (http://conky.linux-hardcore.com/wp-content/uploads/2009/12/All_Conky.png)
That Spanish Calendar near the bottom is just nostalgia. :)

Have a nice day.
Bruce

mobilediesel
December 29th, 2009, 05:40 PM
Off Topic

Bite your tongue. :lolflag:

On Topic!
heh. :D

Now to continue:
...
The part I'm concerned with is:

rm ~/conky_wunderground/14
rm ~/conky_wunderground/13
rm ~/conky_wunderground/12
that creates and error in terminal if the files do not exist.
...

Have a nice day.
Bruce


[ -e ~/conky_wunderground/14 ] && rm ~/conky_wunderground/14
[ -e ~/conky_wunderground/13 ] && rm ~/conky_wunderground/13
[ -e ~/conky_wunderground/12 ] && rm ~/conky_wunderground/12

it will only try to delete when the files exist. Then you don't have to try to tell rm to force it and possibly delete more than you want.

Bruce M.
December 29th, 2009, 09:35 PM
heh. :D

Did it hurt? :lolflag:



[ -e ~/conky_wunderground/14 ] && rm ~/conky_wunderground/14
[ -e ~/conky_wunderground/13 ] && rm ~/conky_wunderground/13
[ -e ~/conky_wunderground/12 ] && rm ~/conky_wunderground/12

it will only try to delete when the files exist. Then you don't have to try to tell rm to force it and possibly delete more than you want.

Did not work:

rm: cannot remove `/home/bruloo/Conky/Wunderground/13': No such file or directory
rm: cannot remove `/home/bruloo/Conky/Wunderground/12': No such file or directory

so I did a man bash (DUH!!) and tried -a

[ -a ~/conky_wunderground/14 ] && rm ~/conky_wunderground/14
[ -a ~/conky_wunderground/13 ] && rm ~/conky_wunderground/13
[ -a ~/conky_wunderground/12 ] && rm ~/conky_wunderground/12
and that didn't work either - same results.

Both look like they should work.

:(
C H I M O!!
Bruce

mobilediesel
December 29th, 2009, 10:01 PM
Did it hurt? :lolflag:



Did not work:

rm: cannot remove `/home/bruloo/Conky/Wunderground/13': No such file or directory
rm: cannot remove `/home/bruloo/Conky/Wunderground/12': No such file or directory

so I did a man bash (DUH!!) and tried -a

[ -a ~/conky_wunderground/14 ] && rm ~/conky_wunderground/14
[ -a ~/conky_wunderground/13 ] && rm ~/conky_wunderground/13
[ -a ~/conky_wunderground/12 ] && rm ~/conky_wunderground/12
and that didn't work either - same results.

Both look like they should work.

:(
C H I M O!!
Bruce

It seems to work on mine. I've had trouble using the "~" character in .conkyrc files before. Change them all to "$HOME" and see if it still gives the error.

The Real Dave
December 29th, 2009, 11:33 PM
Here's my little contribution, a little script that pings an IP address, and returns a statement. I'm using it to monitor what computers on my LAN are currently on or off. The full explanation and script is here (http://linuxexpresso.wordpress.com/2009/12/20/conky-ip-monitor/), in reality, its extremely simple :) Here's a screenshot so you know what I'm talking about :)

http://linuxexpresso.files.wordpress.com/2009/12/20-dec-2009-1.png

The Real Dave
December 29th, 2009, 11:35 PM
Some swear by it, others swear AT it. :D

I've never tried it myself but I'll probably try that or Arch when I get another hard drive.

Apologies for the double post, but I love #!. Most of the benefits of a minimal OpenBox desktop, with very little effort :)

dmillerct
December 30th, 2009, 12:36 AM
Here's my little contribution, a little script that pings an IP address, and returns a statement. I'm using it to monitor what computers on my LAN are currently on or off. The full explanation and script is here (http://linuxexpresso.wordpress.com/2009/12/20/conky-ip-monitor/), in reality, its extremely simple :) Here's a screenshot so you know what I'm talking about :)

http://linuxexpresso.files.wordpress.com/2009/12/20-dec-2009-1.png

Love it, gonna use it. Thanks.

The Real Dave
December 30th, 2009, 12:42 AM
Love it, gonna use it. Thanks.

Enjoy :) I was hoping someone would find it useful :)

dmillerct
December 30th, 2009, 03:58 PM
Enjoy :) I was hoping someone would find it useful :)

It would be great if someone could figure out how to "colorize" the script so that if the connection was down it displayed the echo in a different color.

I tried the following but that obviously did not work:


#!/bin/bash

if ping -c 1 -W 2 $1 > /dev/null; then
echo UP
else
echo ${color3}DOWN${color}
fi

mobilediesel
December 30th, 2009, 05:32 PM
It would be great if someone could figure out how to "colorize" the script so that if the connection was down it displayed the echo in a different color.

I tried the following but that obviously did not work:


#!/bin/bash

if ping -c 1 -W 2 $1 > /dev/null; then
echo UP
else
echo ${color3}DOWN${color}
fi

You have to escape the $:

#!/bin/bash

if ping -c 1 -W 2 $1 > /dev/null; then
echo UP
else
echo "\${color3}DOWN\${color}"
fi

dmillerct
December 30th, 2009, 06:07 PM
You have to escape the $:

#!/bin/bash

if ping -c 1 -W 2 $1 > /dev/null; then
echo UP
else
echo "\${color3}DOWN\${color}"
fi

It is sill returning ${color3}DOWN${color} in the conky. I think this is because of execi.

mobilediesel
December 30th, 2009, 06:51 PM
It is sill returning ${color3}DOWN${color} in the conky. I think this is because of execi.

Yeah, you have to use execpi, the p makes it interpret the color codes.

dmillerct
December 30th, 2009, 07:15 PM
Yeah, you have to use execpi, the p makes it interpret the color codes.

Yup that did it. :P

mobilediesel
January 1st, 2010, 03:56 PM
Quite cool. You should post this in Bruce's thread here: http://ubuntuforums.org/showthread.php?p=8582781
I meant to. :D

Three simple calendar scripts that have been tweaked a bit since I last posted them.

This one shows the current day with the three previous and three following days with current day highlighted:

#!/bin/bash

font=("\${font vera:size=8}" "\${voffset -4}\${font vera:size=12}" "\${voffset -5}\${font vera:size=18}" "\${voffset -8}\${font vera:size=27}\${color ffffff}" "\${font vera:size=18}" "\${font vera:size=12}" "\${font vera:size=8}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo -n "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${offset 3}"
done

142011

This one just shows the current week with current day highlighted:

#!/bin/bash

#m=-1 # uncomment this line for starting the week on Monday instead of Sunday.
DAY=$(date +%_d)
bow=$(date -d "-$[$(date +%u)$m] days")
week="$(date '+%_d' -d "$bow")"
for i in $(seq 1 6); do
week="$week $(date +%_d -d "$bow $i days")"
done
echo "$week"|sed "s/$DAY/\${color ffffff}&\${color}/"
142012

This is the normal calendar that highlights the current day plus holidays and birthdays depending on what the remind command has:

date=$(date '+%F')
DAY=${date:8:2}
# m="-m" # uncomment this line for starting the week on Monday instead of Sunday.
cal=$(cal $m)
prev=$(cal $m $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1)
next=$(cal $m $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1)
if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next"
else next="\${color9} $next"
fi
if [ ${#prev} == 20 ]; then prev="$prev"$'\n '
else prev="$prev "
fi
dates=$(remind -s|cut -d ' ' -f1|uniq|cut -d '/' -f3|sed "/$DAY/d")
current=$(echo "${cal:42}"|sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' )
for i in $dates; do
current=$(echo "$current"|sed -e /" ${i/#0/} "/s/" ${i/#0/} "/" "'${color green}'"${i/#0/}"'${color}'" "/)
done
current=$(echo "$current"|sed -e /" ${DAY/#0/} "/s/" ${DAY/#0/} "/" "'${color3}'"${DAY/#0/}"'${color}'" "/ -e 's/^ //' -e 's/ *$//')
echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${colo r9}$prev\${color}$current$next"
142013

and here's another one from here (http://ubuntuforums.org/showthread.php?p=8519422#post8519422)

#! /bin/bash
COLORTODAY="red"
COLORNUMBER="orange"

DAY="Su Mo Tu We Th Fr Sa"
NUM_FIRST="0 1 2 3"
NUM_SECOND="0 1 2 3 4 5 6 7 8 9"
DATE=$(date '+%a%d')

echo ${DAY/${DATE:0:2}/\$\{color $COLORTODAY\}${DATE:0:2}\$\{color\}}
echo ${NUM_FIRST/${DATE:3:1}/\$\{color $COLORNUMBER\}${DATE:3:1}\$\{color\}}
echo ${NUM_SECOND/${DATE:4:1}/\$\{color $COLORNUMBER\}${DATE:4:1}\$\{color\}}
142016

markp1989
January 1st, 2010, 04:19 PM
I meant to. :D

Three simple calendar scripts that have been tweaked a bit since I last posted them.

This one shows the current day with the three previous and three following days with current day highlighted:

#!/bin/bash

font=("\${font vera:size=8}" "\${voffset -4}\${font vera:size=12}" "\${voffset -5}\${font vera:size=18}" "\${voffset -8}\${font vera:size=27}\${color ffffff}" "\${font vera:size=18}" "\${font vera:size=12}" "\${font vera:size=8}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo -n "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${offset 3}"
done

142011




this one looks cool, one of the most minimal calendar scripts i have seen in a while

mobilediesel
January 1st, 2010, 08:10 PM
this one looks cool, one of the most minimal calendar scripts i have seen in a while

I like having the full calendar myself but I also have that particular script on my desktop. Sometimes minimalist just plain looks good. I think that's actually the one calendar script I came up with myself. The others were edits of other people's work.

Actually someone came up with a mock-up for that calendar so the idea was still not mine. I just figured out how to do it. :D

Bruce M.
January 2nd, 2010, 06:43 PM
This is the normal calendar that highlights the current day plus holidays and birthdays depending on what the remind command has:


remind command? Can you show a sample?

Will it accept 20 or 30 birthdays?

Are the "holidays" flexible - not every country has the same holidays.

ie: Thanksgiving is celebrated on the fourth Thursday of November in the United States and on the second Monday of October in Canada. Does this calendar accept dates like:

fourth Thursday of November
second Monday of October

Easter will be a tough one. :)

I can hear ya now: get off my case Bruce!!!! :lolflag:

Have a GREAT 2010
Bruce

Bruce M.
January 2nd, 2010, 07:04 PM
ummmmmmmmm Oops! HELP!

Here we go again with another round of:


Fix that calendar!

The code in question:

#!/bin/bash
cd $(dirname $0)
# horizontal calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names
DOW=("Lu" "Ma" "Mi" "Ju" "Vi" "Sá" "Do")
if [ -f lang ]; then
. lang
fi
COLOROLD="778899" #LightSlateGrey
COLORTODAY="FF8C00" #Darkorange
COLORREST="778899" #LightSlateGrey
COLORNEXT="445566" #MidSlateGrey
COLORSATURDAY="FFFF00"
COLORSUNDAY="FF8C00"
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND=("" "" "" "" "" "\${color}" "\${color}")

TODAY=$(date +%-d)
LASTDAY=$(date -d "-$TODAY days +1 month" +%d)
FIRSTDAY=$(date -d "-$[$TODAY-1] days" +%u)

# Build $TOPLINE
k=$FIRSTDAY
for j in $(seq 31); do
x=$[j+LASTDAY/j]
case $j in
${j/#$x}) TOPLINE="$TOPLINE ${COLOR[$[k-1]]}${DOW[$[k-1]]}${COLOREND[$[k-1]]}";;
$[LASTDAY+1]) TOPLINE="$TOPLINE \${color $COLORNEXT}${DOW[$[k-1]]}";;
*) TOPLINE="$TOPLINE ${DOW[$[k-1]]}";;
esac
k=$[${k/#7/0}+1]
done


BOTTOM=" \${color $COLOROLD}$(seq -w -s ' ' $LASTDAY|sed "s/.$TODAY \?/\${color $COLORTODAY}&\${color $COLORREST}/") \${color $COLORNEXT}$(seq -w -s ' ' 0$[31-$LASTDAY])"

echo "\${goto 240}$TOPLINE\${tab 20}"
echo "\${goto 240}$BOTTOM\${color}\${tab 20}"
and attached is the 6 - "Oops!"

That 6 isn't suppose to be there

Have a nice day,
Bruce

PS: I gotta learn #! - crunchbang - shebang - bash scripting - whatever! :lolflag:

mobilediesel
January 2nd, 2010, 07:18 PM
remind command? Can you show a sample?

Will it accept 20 or 30 birthdays?

Are the "holidays" flexible - not every country has the same holidays.

ie: Thanksgiving is celebrated on the fourth Thursday of November in the United States and on the second Monday of October in Canada. Does this calendar accept dates like:

fourth Thursday of November
second Monday of October

Easter will be a tough one. :)

I can hear ya now: get off my case Bruce!!!! :lolflag:

Have a GREAT 2010
Bruce

remind will handle pretty much any and all of that! It can be complicated to set up but you can do some tricky math with dates to figure out Easter and any other dates that change.

A few examples can be found at http://wiki.43folders.com/index.php/Remind_Include_Files
and http://wiki.43folders.com/index.php/User:JamesRifkin/defs.rem
There's even a section in there for all the Jewish holidays.
remind reads the .reminders file in your home directory. To keep holidays, birthdays and reminders separate you can keep them in separate files and include them in .reminders
~/.reminders:

include /home/mobilediesel/.remind/reminders.txt
include /home/mobilediesel/.remind/birthdays.txt
include /home/mobilediesel/.remind/holidays.txt

That points to a separate directory so I can easily synchronize them with my other computer.
holidays.txt:

SET Week_1 1
SET Week_2 8
SET Week_3 15
SET Week_4 22
FSET _last(mo) "1 " + MON((mo%12)+1)+" --7"
FSET _trig() TRIGGER(TRIGDATE())
FSET _back(days) TRIGGER(TODAY()-days)
SET SaveTrig $NumTrig
SET easter EASTERDATE(YEAR(TODAY()))
REM Jan 1 +5 MSG New Years Day %b
REM Mon Jan [Week_3] +5 MSG Martin Luther King - Day %b
REM Feb 2 +5 MSG Ground hog day %b
REM Feb 14 +5 MSG Valentines Day %b
REM mon feb [Week_3] +5 MSG Presidents Day %b
REM Mar 17 +5 MSG St Patricks Day %b
REM Sun Mar 8 ++5 MSG Daylight Saving Time starts %b
REM [TRIGGER(easter)] MSG Easter Sunday %b
REM Apr 1 +5 MSG April Fools Day %b
REM Apr 22 +14 MSG Earth Day %b
REM 5 may +5 MSG Cinco De Mayo %b
REM Sun May [Week_2] +7 MSG Mother's Day %b
REM mon Jun 1 -7 +5 MSG Memorial Day %b
REM Jun 14 +5 MSG Flag Day %b
REM Sun Jun [Week_3] +7 MSG Father's Day %b
REM Jul 4 +7 MSG Independence Day %b
REM Mon sep [Week_1] +5 MSG Labor Day %b
REM Mon Oct [Week_2] +5 MSG %"Columbus Day%" %b
REM Oct 31 +7 MSG Halloween %b
REM SUN Nov 1 ++5 MSG Daylight Saving Time ends %b
REM thu nov [Week_4] +7 MSG Thanksgiving Day %b
REM Nov 11 +5 MSG Veterans Day %b
REM Dec 24 MSG Christmas Eve %b
REM Dec 25 +25 MSG Christmas %b
REM Dec 31 MSG New Year's Eve %b
That list isn't complete yet.

reminders.txt can be set up with whatever reminders in the same way as the holidays.
birthdays.txt:

FSET _yr_num(yr) ORD(YEAR(TRIGDATE()) - yr)
REM Jan 2 MSG Taye Diggs' [_yr_num(1971)] birthday
Taye Diggs was put there as an example because he was the first to pop up on IMDB.com. Using that bit of extra code with the date, it will tell you how old the person is when it tells you about their birthday!

Damn right I make the computer remember stuff so I don't have to... :D

mobilediesel
January 2nd, 2010, 07:22 PM
ummmmmmmmm Oops! HELP!

Here we go again with another round of:


Fix that calendar!

The code in question:
...
and attached is the 6 - "Oops!"

That 6 isn't suppose to be there

Have a nice day,
Bruce

PS: I gotta learn #! - crunchbang - shebang - bash scripting - whatever! :lolflag:

That 6 doesn't show up when I run that calendar. I copied/pasted the version from your post here, too. Now you'll have to show us the .conkyrc since I now believe that is the location of the errant 6. :D

na12
January 2nd, 2010, 08:06 PM
I meant to. :D

Three simple calendar scripts that have been tweaked a bit since I last posted them.

This one shows the current day with the three previous and three following days with current day highlighted:

#!/bin/bash

font=("\${font vera:size=8}" "\${voffset -4}\${font vera:size=12}" "\${voffset -5}\${font vera:size=18}" "\${voffset -8}\${font vera:size=27}\${color ffffff}" "\${font vera:size=18}" "\${font vera:size=12}" "\${font vera:size=8}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo -n "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${offset 3}"
done

142011


Can you make vertical version?

mobilediesel
January 2nd, 2010, 08:22 PM
Can you make vertical version?

With a bit less tweaking than I thought:

#!/bin/bash

font=("\${font vera:size=8}" "\${font vera:size=12}" "\${font vera:size=18}" "\${font vera:size=27}\${color ffffff}" "\${font vera:size=18}" "\${font vera:size=12}" "\${font vera:size=8}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${font}"
done

Bruce M.
January 2nd, 2010, 08:33 PM
That 6 doesn't show up when I run that calendar. I copied/pasted the version from your post here, too. Now you'll have to show us the .conkyrc since I now believe that is the location of the errant 6. :D

:( This isn't good! Not only does that colour NOT exist in my conky, I cannot find the six anywhere. It has to be in the script somewhere.


background no
own_window no
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
use_xft yes
xftfont DejaVu Sans Mono:bold:size=8
xftalpha 1.0 #0.2
override_utf8_locale yes
update_interval 1
total_run_times 0
double_buffer yes
no_buffers yes
cpu_avg_samples 2
net_avg_samples 2
use_spacer none
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
alignment tm
uppercase no
imlib_cache_size 0
# minimum_size 1280 1024 # minimum_size width & height
gap_x 0 # left-right
gap_y 20 # up-down
border_inner_margin 0
border_outer_margin 0
border_width 0

# Colors
default_color DCDCDC #Gainsboro
color0 FFD700 #Gold
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
# colours below used by colorize script
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red
text_buffer_size 512 # Default
short_units yes
pad_percents 2
imlib_cache_size 0

TEXT
${goto 100}The Calendar:${color}${font DejaVu Sans Mono:Bold:size=10}${execpi 3600 /home/bruloo/Conky/scripts/conky_calhoriz.sh}${color}



${voffset -32}${goto 100}Mo & Yr:${goto 180}${font LCDMono:bold:size=24}${color6}${time %b}${goto 1000}${color3}${time %y}${font}${color}


${goto 100}My conky colors:${goto 240}${color}Default ${color0}0 ${color1}1 ${color2}2 ${color3}3 ${color4}4 ${color5}5 ${color6}6 ${color7}7 ${color8}8 ${color9}9 ${color}Default - Notice that color does NOT exist in my conky!

${goto 100}Default font:${execpi 3600 /home/bruloo/Conky/scripts/conky_calhoriz.sh} <<--- the SIX${color}

${goto 100}Default font:${execpi 3600 /home/bruloo/Conky/scripts/conky_calhoriz.sh}${color} <<--- the SIX


and /home/bruloo/Conky/scripts/conky_calhoriz.sh one more time:


#!/bin/bash
cd $(dirname $0)
# horizontal calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names
DOW=("Lu" "Ma" "Mi" "Ju" "Vi" "Sá" "Do")
if [ -f lang ]; then
. lang
fi
COLOROLD="778899" #LightSlateGrey
COLORTODAY="FF8C00" #Darkorange
COLORREST="778899" #LightSlateGrey
COLORNEXT="445566" #MidSlateGrey
COLORSATURDAY="FFFF00"
COLORSUNDAY="FF8C00"
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND=("" "" "" "" "" "\${color}" "\${color}")

TODAY=$(date +%-d)
LASTDAY=$(date -d "-$TODAY days +1 month" +%d)
FIRSTDAY=$(date -d "-$[$TODAY-1] days" +%u)

# Build $TOPLINE
k=$FIRSTDAY
for j in $(seq 31); do
x=$[j+LASTDAY/j]
case $j in
${j/#$x}) TOPLINE="$TOPLINE ${COLOR[$[k-1]]}${DOW[$[k-1]]}${COLOREND[$[k-1]]}";;
$[LASTDAY+1]) TOPLINE="$TOPLINE \${color $COLORNEXT}${DOW[$[k-1]]}";;
*) TOPLINE="$TOPLINE ${DOW[$[k-1]]}";;
esac
k=$[${k/#7/0}+1]
done


BOTTOM=" \${color $COLOROLD}$(seq -w -s ' ' $LASTDAY|sed "s/.$TODAY \?/\${color $COLORTODAY}&\${color $COLORREST}/") \${color $COLORNEXT}$(seq -w -s ' ' 0$[31-$LASTDAY])"

echo "\${goto 240}$TOPLINE\${tab 20}"
echo "\${goto 240}$BOTTOM\${color}\${tab 20}"

Have a nice day.
Bruce

mobilediesel
January 2nd, 2010, 08:55 PM
:( This isn't good! Not only does that colour NOT exist in my conky, I cannot find the six anywhere. It has to be in the script somewhere.


and /home/bruloo/Conky/scripts/conky_calhoriz.sh one more time:


Have a nice day.
Bruce

I can't get it to do that without actually typing a 6 myself. Maybe one of the others that helped with the script can check it out.

Or try this one:

#!/bin/bash
cd $(dirname $0)
# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names
DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")
while getopts ":vl:" opts; do
case "$opts" in
l) lang=$OPTARG;;
v) orientation="$opts";;
esac
done
if [ -f lang ]; then
. lang
fi
COLOROLD="445566" #MidSlateGrey
COLORTODAY="FF8C00" #Darkorange
COLORREST="445566" #MidSlateGrey
COLORNEXT="778899" #LightSlateGrey
COLORSATURDAY="FFFF00"
COLORSUNDAY="FF8C00"
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND=("" "" "" "" "" "\${color}" "\${color}")

TODAY=$(date +%-d)
LASTDAY=$(date -d "-$TODAY days +1 month" +%d)
FIRSTDAY=$(date -d "-$[$TODAY-1] days" +%u)

# horizontal function
h () {
# Build $TOPLINE
k=$FIRSTDAY
for j in {1..31}; do
x=$[j+LASTDAY/j]
case $j in
${j/#$x}) TOPLINE="$TOPLINE ${COLOR[$[k-1]]}${DOW[$[k-1]]}${COLOREND[$[k-1]]}";;
$[LASTDAY+1]) TOPLINE="$TOPLINE \${color $COLORNEXT}${DOW[$[k-1]]}";;
*) TOPLINE="$TOPLINE ${DOW[$[k-1]]}";;
esac
k=$[${k/#7/0}+1]
done

BOTTOM=" \${color $COLOROLD}$(seq -w -s ' ' $LASTDAY|sed "s/.$TODAY \?/\${color $COLORTODAY}&\${color $COLORREST}/") \${color $COLORNEXT}$(seq -w -s ' ' 0$[31-$LASTDAY])"

echo "\${goto 20}$TOPLINE\${tab 20}"
echo "\${goto 20}$BOTTOM\${color}\${tab 20}"
}

#vertical function
v () {
for i in $(seq 1 $[TODAY-1]); do
TODAYC[$i]="\${color $COLOROLD}"
done
TODAYC[$TODAY]="\${color $COLORTODAY}"
for i in $(seq $[TODAY+1] $LASTDAY); do
TODAYC[$i]="\${color $COLORREST}"
done

k=$FIRSTDAY
for j in $(seq $LASTDAY); do
echo "${COLOR[$[k-1]]}${DOW[$[k-1]]} ${TODAYC[$j]}$(printf "%02d" $j)\${color}"
k=$[${k/#7/0}+1]
done
}

# call function based on "$orientation"
${orientation:-h}

I named it conkycal.sh
call it with -l es for Spanish.

./conkycal.sh -l es
See if it does it with that version.

na12
January 2nd, 2010, 10:36 PM
With a bit less tweaking than I thought:

#!/bin/bash

font=("\${font vera:size=8}" "\${font vera:size=12}" "\${font vera:size=18}" "\${font vera:size=27}\${color ffffff}" "\${font vera:size=18}" "\${font vera:size=12}" "\${font vera:size=8}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${font}"
done

I think there is a problem with this script.

Bruce M.
January 2nd, 2010, 11:30 PM
See if it does it with that version.

No 6 but ...

drpjkurian
January 3rd, 2010, 07:31 AM
Hi everybody

I have been trying to figure out what is conky for the past few days.

I was able to understand that it stands for wonderful graphics for desktop which is powered by several lines of codes.

May I know where shall I paste those codes in my machine?
Is it in terminal?

Thanks in advance

Dr Kurian

dk75
January 3rd, 2010, 11:01 AM
All the scripts you must copy&paste to your text editor and save to a specific location.

Things with "own_window" and "TEXT" inside is configuration file for conky binnary itself.
You could save it whenever you like with any name but for convenience we save it in ~/conky or ~/.conky directory with names that tells us what for it is, like I have my config in file "~/.conky/.conkyrc-mrclock" since it is configuration file to run my MovingRingsCLOCK LUA script.

Character "~" is for your home directory and it is escape character for most Linux shells so if you type "cd ~" in your terminal it will brings you to your home directory. It's easier that way because it works for everyone (no need to explain why "/home/rosario/conky/myultrasuperduperconfig.txt" won't work with "antonio" user).

Then there are BASH scripts, usually with "#!/bin/sh" or "#!/bin/bash" at the beginning and these should be saved to files that is suggested in a post that contain it because config files depednds on it and have it's location hardcoded.

Personally I store all my conky BASH scripts in "~/.conky/conyparts" directory and I change every conky config file to point out bash script to that directory. But that is me.

There are PERL and PYTHON scripts also and again if they are used in conky configure file then there is hardcoded file path to them inside config file and thus it's better to save it in that specific location (unless you are experienced Linux and Conky user and you kow what are you doing when modificating others scripts/configuration).

And there are LUA script and again in conky config files posted here it have it's names and location where you must to save them.

After that you run

conky -c ~/conky/MyExtraLootOfWorkDoneConfig.hurray
to run Conky with that specified config file

mobilediesel
January 3rd, 2010, 11:33 AM
No 6 but ...

?!?

Are you running more than one conky? I can't think of why there is extra characters after the end of the calendar. a 6 with the other script and ${}c with this one.

Here's what it looks like here:
142250

and no I didn't just crop out extra characters. :D

mobilediesel
January 3rd, 2010, 11:41 AM
I think there is a problem with this script.

That's really weird. It doesn't look like that on my machine. I'm not sure why it would output the i instead of the date...

Here's what it looks like on mine:
142248

Bruce M.
January 3rd, 2010, 01:51 PM
Hi everybody

I have been trying to figure out what is conky for the past few days.

I was able to understand that it stands for wonderful graphics for desktop which is powered by several lines of codes.

May I know where shall I paste those codes in my machine?
Is it in terminal?

Thanks in advance

Dr Kurian
Start here at Conky Hardcore! (http://conky.linux-hardcore.com/) and check out the HowTo: A Beginners Guide to Setting up Conky (http://conky.linux-hardcore.com/?page_id=1289)

If you need more, just ask.
Bruce

Bruce M.
January 3rd, 2010, 02:01 PM
?!?

Are you running more than one conky? I can't think of why there is extra characters after the end of the calendar. a 6 with the other script and ${}c with this one.

Here's what it looks like here:
142250

and no I didn't just crop out extra characters. :D

Trust me, I believe you. I'm back to using calendar #6, for the sake of a name.

Yesterday I played with the Time/Date Manager quite a bit and it happens for the Month of January only - for any year! My computer is bewitched.

C H I M O!
Bruce

dmillerct
January 3rd, 2010, 02:13 PM
Trust me, I believe you. I'm back to using calendar #6, for the sake of a name.

Yesterday I played with the Time/Date Manager quite a bit and it happens for the Month of January only - for any year! My computer is bewitched.

C H I M O!
Bruce

The calendar configuration you are currently using is labeled #6? and the reason you are not using a different calender is because there is a rogue number 6 showing up? That sounds a bit too coincidental to me.

How about checking the script where you call these from, perhaps it is possible the #6 configuration slipped into a section of the file it shouldn't have?

Bruce M.
January 3rd, 2010, 04:37 PM
The calendar configuration you are currently using is labeled #6? and the reason you are not using a different calender is because there is a rogue number 6 showing up? That sounds a bit too coincidental to me.

How about checking the script where you call these from, perhaps it is possible the #6 configuration slipped into a section of the file it shouldn't have?

NO NO NO --- this is tooo funny. Tha calendar script I am using is located at and called: /home/bruloo/Conky/scripts/conky_calhoriz.sh

I said I'm using the "#6" calendar as it displays that 6 for any year during the month of January. I have others here I will try but this is one strange "Rod Sterling" type thing here.

Ummmm, I sent the script to mobilediesel, and he tried it and no 6 appeared, I posted my conky that uses it and the script in post: #55 (http://ubuntuforums.org/showpost.php?p=8598332&postcount=55). Have a look see.

The other script MD gave me left a group of characters: Post #58 (http://ubuntuforums.org/showpost.php?p=8599137&postcount=58)

I'm telling you: my computer it living in the Twilight Zone.

Have a nice day.
Bruce

mobilediesel
January 3rd, 2010, 08:27 PM
NO NO NO --- this is tooo funny. Tha calendar script I am using is located at and called: /home/bruloo/Conky/scripts/conky_calhoriz.sh

I said I'm using the "#6" calendar as it displays that 6 for any year during the month of January. I have others here I will try but this is one strange "Rod Sterling" type thing here.

Ummmm, I sent the script to mobilediesel, and he tried it and no 6 appeared, I posted my conky that uses it and the script in post: #55 (http://ubuntuforums.org/showpost.php?p=8598332&postcount=55). Have a look see.

The other script MD gave me left a group of characters: Post #58 (http://ubuntuforums.org/showpost.php?p=8599137&postcount=58)

I'm telling you: my computer it living in the Twilight Zone.

Have a nice day.
Bruce

Well, I fixed a calendar script that no one was complaining about. :lol:

#!/bin/bash

# uncomment the following line for starting the week on Monday instead of Sunday.
#t=u;m=-1
DAY=$(date +%_d)
bow=$(date -d "-$[$(date +%${t:-w})$m] days")
week="$(date '+%_d' -d "$bow")"
for i in $(seq 1 6); do
week="$week $(date +%_d -d "$bow $i days")"
done
echo "$week"|sed "s/$DAY\>/\${color ffffff}&\${color}/"
For week starting on Sunday:
142304
For week starting on Monday:
142305

Now if I can figure out what's wrong with the script you're trying to use... :D

You already gave the .conkyrc for it and that didn't make it display wrong on my system either. You're just a bit too far south to be near the Bermuda Triangle..

At the moment I'm out of ideas on that.

na12
January 3rd, 2010, 08:58 PM
That's really weird. It doesn't look like that on my machine. I'm not sure why it would output the i instead of the date...

Here's what it looks like on mine:
142248
Show up your conkyrc

mobilediesel
January 3rd, 2010, 09:06 PM
Show up your conkyrc


override_utf8_locale yes
own_window_title middle
use_xft yes
background yes
xftfont vera:size=10
alignment top_middle
xftalpha 1
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1
default_shade_color grey
default_outline_color black
use_spacer none
no_buffers yes
uppercase no
default_color 99ccff #Light Blue
color0 4040ff #Blue
color1 40ff40 #Green
color2 ff4040 #Red
color3 ffffff #White
color4 aa40aa #Purple
color5 c08040 #Brown
color6 ffff40 #Yellow
color7 aaaaaa #Gray
color8 808080 #Dark Gray
color9 4040aa #Dark Blue
text_buffer_size 4096
minimum_size 285
TEXT
${execpi 3600 $HOME/conky/week_vert.sh}

week_vert.sh:

#!/bin/bash

font=("\${font vera:size=8}" "\${font vera:size=12}" "\${font vera:size=18}" "\${font vera:size=27}\${color ffffff}" "\${font vera:size=18}" "\${font vera:size=12}" "\${font vera:size=8}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${font}"
done

Defiant Rat
January 3rd, 2010, 11:15 PM
Hi guys, I just started playing around with conky (its kind of addictive isnt it :D )And was wondering if anyone could help me get my CPU temp showing in conky.

This is the lm_sensors output:

atk0110-acpi-0
Adapter: ACPI interface
Vcore Voltage: +1.34 V (min = +0.85 V, max = +1.60 V)
+3.3 Voltage: +3.36 V (min = +2.97 V, max = +3.63 V)
+5 Voltage: +4.92 V (min = +4.50 V, max = +5.50 V)
+12 Voltage: +12.22 V (min = +10.20 V, max = +13.80 V)
CPU FAN Speed: 3125 RPM (min = 600 RPM)
CHASSIS FAN Speed:1201 RPM (min = 600 RPM)
POWER FAN Speed: 1315 RPM (min = 600 RPM)
CPU Temperature: +45.0°C (high = +60.0°C, crit = +95.0°C)
MB Temperature: +33.0°C (high = +45.0°C, crit = +75.0°C)

But how do i get that into conky?

If it makes a difference, im using lm_sensors 3.1.1

Cheers :)

dmillerct
January 3rd, 2010, 11:21 PM
Hi guys, I just started playing around with conky (its kind of addictive isnt it :D )And was wondering if anyone could help me get my CPU temp showing in conky.

This is the lm_sensors output:

atk0110-acpi-0
Adapter: ACPI interface
Vcore Voltage: +1.34 V (min = +0.85 V, max = +1.60 V)
+3.3 Voltage: +3.36 V (min = +2.97 V, max = +3.63 V)
+5 Voltage: +4.92 V (min = +4.50 V, max = +5.50 V)
+12 Voltage: +12.22 V (min = +10.20 V, max = +13.80 V)
CPU FAN Speed: 3125 RPM (min = 600 RPM)
CHASSIS FAN Speed:1201 RPM (min = 600 RPM)
POWER FAN Speed: 1315 RPM (min = 600 RPM)
CPU Temperature: +45.0°C (high = +60.0°C, crit = +95.0°C)
MB Temperature: +33.0°C (high = +45.0°C, crit = +75.0°C)

But how do i get that into conky?

If it makes a difference, im using lm_sensors 3.1.1

Cheers :)

Welcome. Conky Hardcore is probably the best place for you to get acquainted will all the wondrous things conky can do. Here is the section on using sensors:

http://conky.linux-hardcore.com/?page_id=393

na12
January 4th, 2010, 09:59 AM
override_utf8_locale yes
own_window_title middle
use_xft yes
background yes
xftfont vera:size=10
alignment top_middle
xftalpha 1
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
stippled_borders 10
border_margin 4
border_width 1
default_shade_color grey
default_outline_color black
use_spacer none
no_buffers yes
uppercase no
default_color 99ccff #Light Blue
color0 4040ff #Blue
color1 40ff40 #Green
color2 ff4040 #Red
color3 ffffff #White
color4 aa40aa #Purple
color5 c08040 #Brown
color6 ffff40 #Yellow
color7 aaaaaa #Gray
color8 808080 #Dark Gray
color9 4040aa #Dark Blue
text_buffer_size 4096
minimum_size 285
TEXT
${execpi 3600 $HOME/conky/week_vert.sh}

week_vert.sh:

#!/bin/bash

font=("\${font vera:size=8}" "\${font vera:size=12}" "\${font vera:size=18}" "\${font vera:size=27}\${color ffffff}" "\${font vera:size=18}" "\${font vera:size=12}" "\${font vera:size=8}")
color=("" "" "" "\${color}" "" "" "")

for i in $(seq -3 3); do
echo "${font[$[i+3]]}$(date '+%d' -d "$i days")${color[3]}\${font}"
done

Now is ok. I need to put "text_buffer_size 4096" in conkyrc.

djyoung4
January 4th, 2010, 10:39 AM
NO NO NO --- this is tooo funny. Tha calendar script I am using is located at and called: /home/bruloo/Conky/scripts/conky_calhoriz.sh

I said I'm using the "#6" calendar as it displays that 6 for any year during the month of January. I have others here I will try but this is one strange "Rod Sterling" type thing here.

Ummmm, I sent the script to mobilediesel, and he tried it and no 6 appeared, I posted my conky that uses it and the script in post: #55 (http://ubuntuforums.org/showpost.php?p=8598332&postcount=55). Have a look see.

The other script MD gave me left a group of characters: Post #58 (http://ubuntuforums.org/showpost.php?p=8599137&postcount=58)

I'm telling you: my computer it living in the Twilight Zone.

Have a nice day.
Bruce
all i have to say is wtf. I ran ur config on my comp and there was no 6. maybe you should get a witch doctor or something for your comp.

Bruce M.
January 4th, 2010, 08:48 PM
For week starting on Sunday:
142304
For week starting on Monday:
142305

But they don line up. Notice how the one with the days 3 to 9 ia a shorter image than the one with the days from 28 to three.

Needs a leading 0 in there.

Actutally coming from a "non" programmer that would be good for a "Get lost!" answer. {keeping in mind the family flavour of the forums} :)



Now if I can figure out what's wrong with the script you're trying to use... :D

You already gave the .conkyrc for it and that didn't make it display wrong on my system either. You're just a bit too far south to be near the Bermuda Triangle..

At the moment I'm out of ideas on that.

I told you: My Computer is either:


bewitched,
living in "The Twilight Zone",
came from "The Outer Limits", or
all of the above


It's not the script, if it was "everyone" would see the: 6.

CHIMO!
Bruce

mobilediesel
January 5th, 2010, 01:00 AM
But they don line up. Notice how the one with the days 3 to 9 ia a shorter image than the one with the days from 28 to three.

Needs a leading 0 in there.

Actutally coming from a "non" programmer that would be good for a "Get lost!" answer. {keeping in mind the family flavour of the forums} :)

This'll get the leading zeros in there:

#!/bin/bash

# uncomment the following line for starting the week on Monday instead of Sunday.
#t=u;m=-1
DAY=$(date +%d)
bow=$(date -d "-$[$(date +%${t:-w})$m] days")
week="$(date '+%d' -d "$bow")"
for i in $(seq 1 6); do
week="$week $(date +%d -d "$bow $i days")"
done
echo "$week"|sed "s/$DAY\>/\${color ffffff}&\${color}/"


I told you: My Computer is either:


bewitched,
living in "The Twilight Zone",
came from "The Outer Limits", or
all of the above


It's not the script, if it was "everyone" would see the: 6.

CHIMO!
Bruce

Bewitched in the Outer Limits of The Twilight Zone.
I've probably seen nearly all episodes of all three of those shows! :lol:

PuddingKnife
January 5th, 2010, 02:25 AM
I was thinking of trying Conky out..

I was wondering if it was possible to replicate this using Conky:

http://drewman702.files.wordpress.com/2009/03/rainmeter.jpg

?

Bruce M.
January 5th, 2010, 04:02 AM
Bewitched in the Outer Limits of The Twilight Zone.

Now that would be a show:

Bewitched in the Outer Limits of The Twilight Zone broadcasted live from the Bermuda Triangle!

Bruce M.
January 5th, 2010, 04:06 AM
I was thinking of trying Conky out..

I was wondering if it was possible to replicate this using Conky:

http://drewman702.files.wordpress.com/2009/03/rainmeter.jpg

?

For the stuff on the right and left - YES.

The stuff in the middle, id those folder are "interactive" NO. At least not yet. :)

Have a nice day.
Bruce

mobilediesel
January 5th, 2010, 09:12 AM
Now that would be a show:

Bewitched in the Outer Limits of The Twilight Zone broadcasted live from the Bermuda Triangle!

I would totally watch that!

PuddingKnife
January 5th, 2010, 03:04 PM
For the stuff on the right and left - YES.

The stuff in the middle, id those folder are "interactive" NO. At least not yet. :)

Have a nice day.
Bruce

Excellent. Conky appears to be quite complicated, so it'll probably be a few days for me to read up on it, but it looks really interesting.

I just kind of wish there a GUI to configure it.

mobilediesel
January 5th, 2010, 03:11 PM
Excellent. Conky appears to be quite complicated, so it'll probably be a few days for me to read up on it, but it looks really interesting.

I just kind of wish there a GUI to configure it.

http://sourceforge.net/projects/conkygui/

I haven't used that myself but it looks like a good place to start. Then you can look at the config file it puts out and learn how to tweak from there.

Bruce M.
January 5th, 2010, 06:05 PM
I would totally watch that!

And I'd be fighting with you for the :popcorn:

darco
January 5th, 2010, 06:33 PM
Is there anyway to stop outputs from shifting back and forth? For example, my cpu (quad core) outputs will update then it will shift my horizontal conky script back and forth.
Trying to make these readings more static like.

thxs

mobilediesel
January 5th, 2010, 06:47 PM
Is there anyway to stop outputs from shifting back and forth? For example, my cpu (quad core) outputs will update then it will shift my horizontal conky script back and forth.
Trying to make these readings more static like.

thxs

Use a mono-spaced font. add this in front:

${font monospace}
cuz that's the only one I could think of. That would keep things lined up better.

mobilediesel
January 5th, 2010, 06:57 PM
And I'd be fighting with you for the :popcorn:

Is conkycal_horiz.sh still showing a 6 or other weirdness after it? I've been messing with the script a bit and can't make it do that without typing a 6 in there myself.

I think I may have figured a way to make the script even a bit smaller. I don't know if it'll work yet. Good thing I keep working backups of things like that. :D

darco
January 5th, 2010, 07:04 PM
Use a mono-spaced font. add this in front:

${font monospace}
cuz that's the only one I could think of. That would keep things lined up better.

Ok I was hoping that using mono fonts wasnt the answer. Yes it does seem to work along with the user_spacer right but the fonts are super ugly!
Using the Bitstream Vera Sans Mono but before was using Liberation Sans. Any better looking mono fonts?

thxs

mobilediesel
January 5th, 2010, 07:14 PM
Ok I was hoping that using mono fonts wasnt the answer. Yes it does seem to work along with the user_spacer right but the fonts are super ugly!
Using the Bitstream Vera Sans Mono but before was using Liberation Sans. Any better looking mono fonts?

thxs

Most of the default mono spaced fonts do suck.
You could try http://www.1001fonts.com/fonts_overview.html?page=1&category_id=7
or http://www.urbanfonts.com/fonts/monospaced-fonts.htm
There's bound to be a couple you like.

Bruce M.
January 5th, 2010, 07:14 PM
Is conkycal_horiz.sh still showing a 6 or other weirdness after it? I've been messing with the script a bit and can't make it do that without typing a 6 in there myself.

I think I may have figured a way to make the script even a bit smaller. I don't know if it'll work yet. Good thing I keep working backups of things like that. :D

Yup, still showing the 6 - when I get around to ot I'll try an "eralier" version of it, I have most of them here - they were coming so fast and furious I thought it was a movie. have to do it before Feb though as it works well other than January (any year)

CHIMO!
Bruce

Bruce M.
January 5th, 2010, 07:25 PM
Ok I was hoping that using mono fonts wasnt the answer. Yes it does seem to work along with the user_spacer right but the fonts are super ugly!
Using the Bitstream Vera Sans Mono but before was using Liberation Sans. Any better looking mono fonts?

thxs

That are a LOT of nice looking mono fonts look at the bottom of the page: Spacing (http://conky.linux-hardcore.com/?page_id=87)

Also if it's what I think it is it may not be necessary. Put your old font back and take a couple of screenshots with the differences.

Ahhhh heck, maybe you can find the answer here (http://conky.linux-hardcore.com/?page_id=3651) using ${gotos} or ${offsets}

Have a nice day.
Bruce

PuddingKnife
January 5th, 2010, 07:52 PM
Just so I can be done hijacking this thread :)

http://ubuntuforums.org/showthread.php?t=1373211

The Real Dave
January 5th, 2010, 07:58 PM
For the stuff on the right and left - YES.

The stuff in the middle, id those folder are "interactive" NO. At least not yet. :)

Have a nice day.
Bruce

Wait, can I ask, in the link you were talking about, left hand side, how do you get the CPU and RAM details to look like that, the border?

And, the folders in the middle are from a dock such as AWN or Cario and are called stacks :)

darco
January 5th, 2010, 08:46 PM
That are a LOT of nice looking mono fonts look at the bottom of the page: Spacing (http://conky.linux-hardcore.com/?page_id=87)

Also if it's what I think it is it may not be necessary. Put your old font back and take a couple of screenshots with the differences.

Ahhhh heck, maybe you can find the answer here (http://conky.linux-hardcore.com/?page_id=3651) using ${gotos} or ${offsets}

Have a nice day.
Bruce

Well, I somewhat succeededin what I want my scrip to do. On my second line, the HDD activity no longer shifts to the right but the CPU next to it still shifts over. I tried adding the same line that is in front of the HDD but it didnt work.


#background yes
double_buffer yes
use_xft yes
xftalpha 0.8
xftfont Liberation Mono:style=Bold:size=9
update_interval 0.5
own_window_type normal
own_window_transparent yes
own_window yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
draw_shades no
draw_outline no
draw_borders no
border_inner_margin 0
border_outer_margin 3
border_width 1
default_color white
alignment top_middle
#no_buffers yes
use_spacer right
minimum_size 1680 1050
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 4

TEXT

${goto 30}${color #FFFFFF}Computer:${color #32CD32} ${nodename} ${color #FFFFFF}| Kernel:${color #32CD32} $kernel on $machine${color #FFFFFF} | Mem: ${color #32CD32}${font}${mem} ${color} ${color #06FF00} ${color #FFFFFF}| Local IP: ${color #32CD32}${addr eth0} ${color} | Up: ${color #32CD32}${font}${uptime_short}${color} | ${color} Net: ${color #32CD32}${font}${downspeed eth0}Kb/s ${color} ${totaldown eth0} down${color} | ${color} ${color #32CD32}${upspeed eth0}Kb/s ${color} ${totalup eth0} up${color} | Home: ${color #32CD32}${fs_free /home} ${color white}| GPU Temp: ${color green}${execi 60 nvidia-settings -query GPUCoreTemp | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'}°C$voffset ${color #FFFFFF}

${font monospace}${goto 600}${font Liberation Mono:bold:size=9} HDD Activity:${color #32CD32} ${diskio}${color #FFFFFF} | Q6600: ${color #FF0707}${cpu cpu1},${cpu cpu2},${cpu cpu3},${cpu cpu4} ${color} | ${exec sensors| grep 'Core 0'|cut -c1-20|sed '/^$/d'}

Bruce M.
January 5th, 2010, 09:47 PM
Well, since this thread is about "Supports Scripts" for Conky as the scripts were over running the "Post your .conkyrc files w/ screenshots (http://ubuntuforums.org/showthread.php?t=281865&page=1134)" I think I, for one anyway, will stop talking conky here and stop talking scripts over there to help keep things on topic.

NOTE: I talk conky in any conky thread in any distro (that I have found)

And my home Conky Support Thread can be found here: Conky Hardcore! Support Forum (http://linux-hardcore.com/index.php?board=80.0).

Have a nice day.
Bruce

londonali1010
January 5th, 2010, 09:49 PM
I've been playing around with Cairo text extents and the new ARGB feature (proper transparency!), and I've come up with this...Although I'm not entirely sure why you'd want to use Conky to do it; it's kind of like using a sledgehammer to crack a nut! Still, it *can* be done! Not an altogether elegant script, but it does the trick!

EDIT: I should mention that you will need at least v1.8.0_rc1 for these features to work!

--[[ SHINY CALENDAR PAGE WIDGET ]]
--[[ v1.0 by londonali1010 (2009) ]]
--[[ Options (xc, yc, size, bg_colour, fg_colour, alpha)
"xc" and "yc" are the x and y coordinates of the centre of the widget, in pixels, relative to the top left of the Conky window.
"size" is the width of the widget (which is square).
"bg_colour" is the colour, in format 0xRRGGBB, of the widget's background.
"fg_colour" is the colour of the widget's text.
"alpha" is the opacity (0.0 -> 1.0) of the widget. ]]

function calpage(xc, yc, size, bgc, fgc, alpha)
local function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

local function rrect()
cairo_move_to(cr, x0 + 0.1*size, y0)
cairo_line_to(cr, x0 + 0.9*size, y0)
cairo_curve_to(cr, x0 + size, y0, x0 + size, y0, x0 + size, y0 + 0.1*size)
cairo_line_to(cr, x0 + size, y0 + 0.9*size)
cairo_curve_to(cr, x0 + size, y0 + size, x0 + size, y0 + size, x0 + 0.9*size, y0 + size)
cairo_line_to(cr, x0 + 0.1*size, y0 + size)
cairo_curve_to(cr, x0, y0 + size, x0, y0 + size, x0, y0 + 0.9*size)
cairo_line_to(cr, x0, y0 + 0.1*size)
cairo_curve_to(cr, x0, y0, x0, y0, x0 + 0.1*size, y0)
cairo_close_path(cr)
end

local function background()
local r, g, b, a = rgb_to_r_g_b(bgc, alpha)
rrect()
cairo_set_source_rgba(cr, r, g, b, a)
cairo_fill_preserve(cr)

linpat = cairo_pattern_create_linear(xc, yc, xc, yc + size)
cairo_pattern_add_color_stop_rgba(linpat, 0, 1.0, 1.0, 1.0, 0.2*a)
cairo_pattern_add_color_stop_rgba(linpat, 1, 1.0, 1.0, 1.0, 0)
cairo_set_source(cr, linpat)
cairo_fill_preserve(cr)
cairo_clip(cr)

rrect()
cairo_set_source_rgba(cr, r, g, b, a)
cairo_set_line_width(cr, 0.05*size)
cairo_stroke_preserve(cr)

cairo_new_path(cr)
cairo_arc(cr, xc, yc - size, size, 0, 2*math.pi)

radpat = cairo_pattern_create_radial(xc, yc - size, 0, xc, yc - size, size)
cairo_pattern_add_color_stop_rgba(radpat, 0, 1.0, 1.0, 1.0, a)
cairo_pattern_add_color_stop_rgba(radpat, 1, 1.0, 1.0, 1.0, 0.2*a)
cairo_set_source(cr, radpat)
cairo_fill(cr)
end

local function set_font_sizes()
day_size = 1000.0
date_size = 1000.0
month_size = 1000.0

local extents = cairo_text_extents_t:create()
cairo_select_font_face(cr, "Petita Medium", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_font_size(cr, day_size)
cairo_text_extents(cr, day, extents)
local w = math.abs(extents.width)
local h = math.abs(extents.y_bearing)
local scale_w = 0.8*size / w
local scale_h = 0.1*size / h
local scale
if scale_w < scale_h then scale = scale_w else scale = scale_h end
day_size = scale * day_size

cairo_set_font_size(cr, date_size)
cairo_text_extents(cr, date, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.6*size / w
scale_h = 0.6*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
date_size = scale * date_size

cairo_set_font_size(cr, month_size)
cairo_text_extents(cr, month, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.8*size / w
scale_h = 0.1*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
month_size = scale * month_size

return day_size, date_size, month_size
end

local function draw_text()
local extents = cairo_text_extents_t:create()
cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, alpha))

cairo_set_font_size(cr, day_size)
cairo_text_extents(cr, day, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.2*size)
cairo_show_text(cr, day)

cairo_set_font_size(cr, date_size)
cairo_text_extents(cr, date, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.5*size - extents.y_bearing/2)
cairo_show_text(cr, date)

cairo_set_font_size(cr, month_size)
cairo_text_extents(cr, month, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.9*size)
cairo_show_text(cr, month)
end

x0, y0 = xc - size/2, yc - size/2
day = os.date("%A")
date = os.date("%d")
month = os.date("%B")

background()
day_size, date_size, month_size = set_font_sizes()
draw_text(day_size, date_size, month_size)
end

--[[ END SHINY CALENDAR WIDGET ]]
142594

dmillerct
January 5th, 2010, 09:57 PM
I've been playing around with Cairo text extents and the new ARGB feature (proper transparency!), and I've come up with this...Although I'm not entirely sure why you'd want to use Conky to do it; it's kind of like using a sledgehammer to crack a nut! Still, it *can* be done! Not an altogether elegant script, but it does the trick!

--[[ SHINY CALENDAR PAGE WIDGET ]]
--[[ v1.0 by londonali1010 (2009) ]]
--[[ Options (xc, yc, size, bg_colour, fg_colour, alpha)
"xc" and "yc" are the x and y coordinates of the centre of the widget, in pixels, relative to the top left of the Conky window.
"size" is the width of the widget (which is square).
"bg_colour" is the colour, in format 0xRRGGBB, of the widget's background.
"fg_colour" is the colour of the widget's text.
"alpha" is the opacity (0.0 -> 1.0) of the widget. ]]

function calpage(xc, yc, size, bgc, fgc, alpha)
local function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

local function rrect()
cairo_move_to(cr, x0 + 0.1*size, y0)
cairo_line_to(cr, x0 + 0.9*size, y0)
cairo_curve_to(cr, x0 + size, y0, x0 + size, y0, x0 + size, y0 + 0.1*size)
cairo_line_to(cr, x0 + size, y0 + 0.9*size)
cairo_curve_to(cr, x0 + size, y0 + size, x0 + size, y0 + size, x0 + 0.9*size, y0 + size)
cairo_line_to(cr, x0 + 0.1*size, y0 + size)
cairo_curve_to(cr, x0, y0 + size, x0, y0 + size, x0, y0 + 0.9*size)
cairo_line_to(cr, x0, y0 + 0.1*size)
cairo_curve_to(cr, x0, y0, x0, y0, x0 + 0.1*size, y0)
cairo_close_path(cr)
end

local function background()
local r, g, b, a = rgb_to_r_g_b(bgc, alpha)
rrect()
cairo_set_source_rgba(cr, r, g, b, a)
cairo_fill_preserve(cr)

linpat = cairo_pattern_create_linear(xc, yc, xc, yc + size)
cairo_pattern_add_color_stop_rgba(linpat, 0, 1.0, 1.0, 1.0, 0.2*a)
cairo_pattern_add_color_stop_rgba(linpat, 1, 1.0, 1.0, 1.0, 0)
cairo_set_source(cr, linpat)
cairo_fill_preserve(cr)
cairo_clip(cr)

rrect()
cairo_set_source_rgba(cr, r, g, b, a)
cairo_set_line_width(cr, 0.05*size)
cairo_stroke_preserve(cr)

cairo_new_path(cr)
cairo_arc(cr, xc, yc - size, size, 0, 2*math.pi)

radpat = cairo_pattern_create_radial(xc, yc - size, 0, xc, yc - size, size)
cairo_pattern_add_color_stop_rgba(radpat, 0, 1.0, 1.0, 1.0, a)
cairo_pattern_add_color_stop_rgba(radpat, 1, 1.0, 1.0, 1.0, 0.2*a)
cairo_set_source(cr, radpat)
cairo_fill(cr)
end

local function set_font_sizes()
day_size = 1000.0
date_size = 1000.0
month_size = 1000.0

local extents = cairo_text_extents_t:create()
cairo_select_font_face(cr, "Petita Medium", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_font_size(cr, day_size)
cairo_text_extents(cr, day, extents)
local w = math.abs(extents.width)
local h = math.abs(extents.y_bearing)
local scale_w = 0.8*size / w
local scale_h = 0.1*size / h
local scale
if scale_w < scale_h then scale = scale_w else scale = scale_h end
day_size = scale * day_size

cairo_set_font_size(cr, date_size)
cairo_text_extents(cr, date, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.6*size / w
scale_h = 0.6*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
date_size = scale * date_size

cairo_set_font_size(cr, month_size)
cairo_text_extents(cr, month, extents)
w = math.abs(extents.width)
h = math.abs(extents.y_bearing)
scale_w = 0.8*size / w
scale_h = 0.1*size / h
if scale_w < scale_h then scale = scale_w else scale = scale_h end
month_size = scale * month_size

return day_size, date_size, month_size
end

local function draw_text()
local extents = cairo_text_extents_t:create()
cairo_set_source_rgba(cr, rgb_to_r_g_b(fgc, alpha))

cairo_set_font_size(cr, day_size)
cairo_text_extents(cr, day, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.2*size)
cairo_show_text(cr, day)

cairo_set_font_size(cr, date_size)
cairo_text_extents(cr, date, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.5*size - extents.y_bearing/2)
cairo_show_text(cr, date)

cairo_set_font_size(cr, month_size)
cairo_text_extents(cr, month, extents)
cairo_move_to(cr, x0 + size/2 - extents.x_advance/2, y0 + 0.9*size)
cairo_show_text(cr, month)
end

x0, y0 = xc - size/2, yc - size/2
day = os.date("%A")
date = os.date("%d")
month = os.date("%B")

background()
day_size, date_size, month_size = set_font_sizes()
draw_text(day_size, date_size, month_size)
end

--[[ END SHINY CALENDAR WIDGET ]]
142594

Wow thats cool! Obviously requires 1.8 correct?

londonali1010
January 5th, 2010, 09:58 PM
Wow thats cool! Obviously requires 1.8 correct?

Ah, yes, should have mentioned that in my post...Will do so now!

Bruce M.
January 5th, 2010, 10:13 PM
Although I'm not entirely sure why you'd want to use Conky to do it; it's kind of like using a sledgehammer to crack a nut!

That is so good - powdered nuts. :)

I tried 1.8.0-rc1 with #! - http://conky.linux-hardcore.com/wp-content/uploads/2010/01/My_Custom.gif - back to 1.7.2

Have a GREAT day.
Bruce

mobilediesel
January 12th, 2010, 12:32 AM
I updated the horizontal/vertical calendar script a bit.
Just a bit of tweaking.
conkycal.sh (http://dl.dropbox.com/u/1055489/scripts/conkycal.sh):

#!/bin/bash
cd $(dirname $0)
# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names
DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")
while getopts ":vl:" opts; do
case "$opts" in
l) lang=$OPTARG;;
v) orientation="$opts";;
esac
done
if [ -f lang ]; then
. lang
fi
COLOROLD="445566" #MidSlateGrey
COLORTODAY="FF8C00" #Darkorange
COLORREST="445566" #MidSlateGrey
COLORNEXT="778899" #LightSlateGrey
COLORSATURDAY="FFFF00"
COLORSUNDAY="FF8C00"
COLOR=("" "" "" "" "" "\${color $COLORSATURDAY}" "\${color $COLORSUNDAY}")
COLOREND="\${color}"

TODAY=$(date +%-d)
LASTDAY=$(date -d "-$TODAY days +1 month" +%d)
FIRSTDAY=$(date -d "-$[$TODAY-1] days" +%u)

k=$FIRSTDAY
for j in $(seq 1 $LASTDAY); do
days[$j]="${COLOR[$[k-1]]}${DOW[$[k-1]]}"
k=$[${k/#7/0}+1]
done
for j in $(seq $[$LASTDAY+1] 31); do
days[$j]="${DOW[$[k-1]]}"
k=$[${k/#7/0}+1]
done

# horizontal function
h () {
for i in $(seq 1 $LASTDAY); do
echo -n "${days[$i]/${DOW[6]}/${DOW[6]}$COLOREND} "
done
echo -n "\${color $COLORREST}"
for i in $(seq $[$LASTDAY+1] 31); do
echo -n "${days[$i]} "
done
echo $'\n'"\${color $COLOROLD}$(seq -w -s ' ' $LASTDAY|sed "0,/[0-3]*$TODAY \?/s//\${color $COLORTODAY}&\${color $COLORREST}/") \${color $COLORNEXT}$(seq -w -s ' ' 0$[31-$LASTDAY])"
}

#vertical function
v () {
for i in $(seq 1 $[TODAY-1]); do
TODAYC[$i]="\${color $COLOROLD}"
done
TODAYC[$TODAY]="\${color $COLORTODAY}"
for i in $(seq $[TODAY+1] $LASTDAY); do
TODAYC[$i]="\${color $COLORREST}"
done
for j in $(seq $LASTDAY); do
echo "${days[$j]} ${TODAYC[$j]}$(printf "%02d" $j)\${color}"
done
}
# call function based on "$orientation" - default is horizontal
${orientation:-h}
The lang file didn't change, it's just here for completeness.
lang (http://dl.dropbox.com/u/1055489/scripts/lang):

case ${lang:-$LANG} in
af* ) DOW=("Ma" "Di" "Wo" "Do" "Vr" "Sa" "So");; # Afrikaans (Afrikaans)
be* ) DOW=("Па" "Аў" "Се" "Ча" "Пя" "Су" "Ня");; # Belarusian (Беларуская)
bs* ) DOW=("Po" "Ut" "Sr" "Če" "Pe" "Su" "Ne");; # Bosnian (Bosanac)
bg* ) DOW=("По" "Вт" "Ср" "Че" "Пе" "Съ" "Не");; # Bulgarian (Български)
zh* ) DOW=("周一" "周二" "周三" "周四" "周五" "周六" "周天");; # Chinese (中文)
hr* ) DOW=("Po" "Ut" "Ut" "Sr" "Če" "Su" "Ne");; # Croatian (Hrvatska)
cs* ) DOW=("Po" "Út" "St" "Čt" "Pá" "So" "Ne");; # Czech (Čeština)
da* ) DOW=("Ma" "Ti" "On" "To" "Fr" "Lø" "Sø");; # Danish (Dánština)
nl* ) DOW=("Ma" "Di" "Wo" "Do" "Vr" "Za" "Zo");; # Dutch (Nederlandse)
de* ) DOW=("Mo" "Di" "Mi" "Do" "Fr" "Sa" "So");; # German (Deutche)
el* ) DOW=("Δε" "Τρ" "Τε" "Πέ" "Πα" "Σά" "Κυ");; # Greek (Ελληνικά)
et* ) DOW=("Es" "Te" "Ko" "Ne" "Re" "La" "Pü");; # Estonian (Eesti)
tl* ) DOW=("Lu" "Ma" "Mi" "Hu" "Bi" "Sa" "Li");; # Filipino (Filipino)
fi* ) DOW=("Ma" "Ti" "Ke" "To" "Pe" "La" "Su");; # Finnish (Suomen)
fr* ) DOW=("Lu" "Ma" "Me" "Je" "Ve" "Sa" "Di");; # French (Français)
gl* ) DOW=("Lu" "Ma" "Mé" "Xo" "Ve" "Sá" "Do");; # Galician (Galego)
hi* ) DOW=("सोम" "मंगल" "बुध" "गुरु" "शुक्र" "शनि" "सूर्य") ;; # Hindi (हिन्दी)
hu* ) DOW=("Hé" "Ke" "Se" "Cü" "Pé" "So" "Va");; # Hungarian (Magyar)
is* ) DOW=("Má" "Þr" "Mi" "Fi" "Fö" "La" "Su");; # Icelandic (Íslenska)
id* ) DOW=("Se" "Se" "Ra" "Ka" "Ju" "Sa" "Mi");; # Indonesian (Indonesia)
it* ) DOW=("Lu" "Ma" "Me" "Gi" "Ve" "Sa" "Do");; # Italian (Italiano)
ja* ) DOW=("月曜" "火曜" "水曜" "木曜" "金曜" "土曜" "日曜");; # Japanese (日本語) x
ko* ) DOW=("월요" "화요" "수요" "목요" "금요" "토요" "일요");; # Korean (한국어) x
lv* ) DOW=("Pr" "Ot" "Tr" "Ce" "Pe" "Se" "Sv");; # Latvian (Latviešu)
lt* ) DOW=("pi" "an" "tr" "ke" "pe" "še" "se");; # Lithuanian (Lietuviškai)
mk* ) DOW=("По" "Вт" "Ср" "Че" "Пе" "Са" "Не");; # Macedonian (Македонски)
ml* ) DOW=("Is" "Se" "Ra" "Ra" "Ju" "Sa" "Mi");; # Malayam (Bahasa Melayu)
nb* ) DOW=("ma" "ti" "on" "to" "fr" "lø" "sø");; # Norwegian (Norsk)
pl* ) DOW=("Po" "Wt" "Śr" "Cz" "Pt" "So" "Nd");; # Polish (Polska)
pt* ) DOW=("Sq" "Te" "Qa" "Qi" "Se" "Sá" "Do");; # Portuguese (Português)
ro* ) DOW=("Lu" "Ma" "Mi" "Jo" "Vi" "Sa" "Du");; # Romanian (Român)
ru* ) DOW=("По" "Вт" "Ср" "Че" "Пя" "Су" "Во");; # Russian (Русский)
sr* ) DOW=("Po" "Ut" "Sr" "Če" "Pe" "Su" "Ne");; # Serbian (Српски)
sk* ) DOW=("Po" "Ut" "St" "Št" "Pi" "So" "Ne");; # Slovak (Slovenčina)
sl* ) DOW=("Po" "To" "Sr" "Če" "Pe" "So" "Ne");; # Slovenian (Slovenski)
es* ) DOW=("Lu" "Ma" "Mi" "Ju" "Vi" "Sá" "Do");; # Spanish (Español)
sv* ) DOW=("Må" "Ti" "On" "To" "Fr" "Lö" "Sö");; # Swedish (Svenska)
tr* ) DOW=("Pa" "Sa" "Ça" "Pe" "Cu" "Cu" "Pa");; # Turkish (Türkçe)
uk* ) DOW=("По" "Ві" "Се" "Че" "Пя" "Су" "Не");; # Ukrainian (Українська)
* ) DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su") ;;
esac

Horizontal and English are the defaults. 143347

conkycal.sh
make it vertical: 143348

conkycal.sh -v
change the language to Spanish:

conkycal.sh -l es
or both at once:

conkycal.sh -v -l es
The order of the arguments doesn't matter:

conkycal.sh -l es -v

Bruce M.
January 12th, 2010, 12:56 AM
I updated the horizontal/vertical calendar script a bit.

BUT - will it get rid of my January 6 Error?

I'll be right back to let you know.[-o<

CHIMO!
Bruce

I'm Baaaaack: YES! #6 gone - BUT where do I put the goto to move it to the right?

mobilediesel
January 12th, 2010, 01:21 AM
BUT - will it get rid of my January 6th Error?

I'll be right back to let you know.[-o<

CHIMO!
Bruce

I'm Baaaaack: YES! #6 gone - BUT where do I put the goto to move it to the right?

I dunno why that would have fixed the number 6 problem.
to add the goto:

conkycal.sh -l es|sed 's/^/\${goto xx}/'
Change the xx to whatever number you were using that I forgot. :D

That should work even when using -v for vertical.

Bruce M.
January 12th, 2010, 01:33 AM
I dunno why that would have fixed the number 6 problem.
to add the goto:

conkycal.sh -l es|sed 's/^/\${goto xx}/'
Change the xx to whatever number you were using that I forgot. :D

That should work even when using -v for vertical.

Well that works. :)


${voffset 5}${font DejaVu Sans Mono:Bold:size=10}${execpi 3600 ~/Conky/scripts/conkycal.sh -l es|sed 's/^/\${goto 240}/'}${color}
${voffset -32}${goto 180}${font LCDMono:bold:size=24}${color6}${time %b}${goto 980}${color3}${time %y}${font}${color}

Gotta play with the vertical part now. :)


C H I M O!
Bruce

mobilediesel
January 12th, 2010, 01:41 AM
Well that works. :)


${voffset 5}${font DejaVu Sans Mono:Bold:size=10}${execpi 3600 ~/Conky/scripts/conkycal.sh -l es|sed 's/^/\${goto 240}/'}${color}
${voffset -32}${goto 180}${font LCDMono:bold:size=24}${color6}${time %b}${goto 980}${color3}${time %y}${font}${color}

Gotta play with the vertical part now. :)


C H I M O!
Bruce

The vertical part is neat, too. I can't decide between the different calendar scripts. The main one is the regular calendar formatted one that now highlights holidays. Hmmm.. I'll have to add the holiday highlighting to this one now. Shouldn't be too hard to add. except that I've been awake for 20 hours now.. heh I'll do that when I get up later

Bruce M.
January 12th, 2010, 01:54 AM
The vertical part is neat, too. I can't decide between the different calendar scripts. The main one is the regular calendar formatted one that now highlights holidays. Hmmm.. I'll have to add the holiday highlighting to this one now. Shouldn't be too hard to add. except that I've been awake for 20 hours now.. heh I'll do that when I get up later

Wait - Holidays? For what country? What religion?

I made a change to the script already - nothing big but might come in handy 6 months from now when someone can't find the previous posts:


#!/bin/bash
cd $(dirname $0)
# horizontal and vertical calendar for conky by ans
# Updated by: mobilediesel, dk75, Bruce, Crinos512, et al.
# locale depend week day names

# The 'lang' file must be in the same directory as this script.
# Horizontal and English are the defaults:
# conkycal.sh
# Make it vertical:
# conkycal.sh -v
# Change the language to Spanish:
# conkycal.sh -l es
# Or both at once:
# conkycal.sh -v -l es
# The order of the arguments doesn't matter:
# conkycal.sh -l es -v
# Need to use a goto:
# conkycal.sh -l es|sed 's/^/\${goto 240}/'
# or a goto and a tab:
# conkycal.sh |sed -e 's/^/\${goto 240}/' -e 's/$/\${tab 20}/'

DOW=("Mo" "Tu" "We" "Th" "Fr" "Sa" "Su")

Really great work there Mr. Diesel, really great!!!
C H I M O!
Bruce

mobilediesel
January 12th, 2010, 10:18 AM
Wait - Holidays? For what country? What religion?

I made a change to the script already - nothing big but might come in handy 6 months from now when someone can't find the previous posts:

...

Really great work there Mr. Diesel, really great!!!
C H I M O!
Bruce

Ah, yes. Descriptive comments. I added that to the script (http://dl.dropbox.com/u/1055489/scripts/conkycal.sh). Excellent idea!

and as for the holidays, most are U.S. holidays. Using the remind (http://wiki.43folders.com/index.php/Remind_FAQ) command you can put in any holidays or birthdays you want. It can handle the holidays like Thanksgiving in the U.S. being on the 4th Thursday of November. It even handles the different days and months that Easter falls on every year.

SET Week_1 1
SET Week_2 8
SET Week_3 15
SET Week_4 22
SET easter EASTERDATE(YEAR(TODAY()))
REM [TRIGGER(easter)] MSG Easter Sunday %b
REM thu nov [Week_4] MSG Thanksgiving Day %b

My current holiday file for remind:

SET Week_1 1
SET Week_2 8
SET Week_3 15
SET Week_4 22
FSET _last(mo) "1 " + MON((mo%12)+1)+" --7"
FSET _trig() TRIGGER(TRIGDATE())
FSET _back(days) TRIGGER(TODAY()-days)
SET SaveTrig $NumTrig
SET easter EASTERDATE(YEAR(TODAY()))
REM Jan 1 +5 MSG New Years Day %b
REM Mon Jan [Week_3] +5 MSG Martin Luther King Day %b
REM Feb 2 +5 MSG Ground Hog Day %b
REM Feb 14 +5 MSG Valentines Day %b
REM Mon Feb [Week_3] +5 MSG Presidents Day %b
REM Mar 17 +5 MSG St Patricks Day %b
REM Sun Mar 8 ++5 MSG Daylight Saving Time starts %b
REM [TRIGGER(easter)] MSG Easter Sunday %b
REM Apr 1 +5 MSG April Fools Day %b
REM Apr 22 +14 MSG Earth Day %b
REM May 5th +5 MSG Cinco De Mayo %b
REM Sun May [Week_2] +7 MSG Mother's Day %b
REM Mon Jun 1 -7 +5 MSG Memorial Day %b
REM Jun 14 +5 MSG Flag Day %b
REM Sun Jun [Week_3] +7 MSG Father's Day %b
REM Jul 4 +7 MSG Independence Day %b
REM Mon Sep [Week_1] +5 MSG Labor Day %b
REM Mon Oct [Week_2] +5 MSG %"Columbus Day%" %b
REM Oct 31 +7 MSG Halloween %b
REM SUN Nov 1 ++5 MSG Daylight Saving Time ends %b
REM Thu Nov [Week_4] +7 MSG Thanksgiving Day %b
REM Nov 11 +5 MSG Veterans Day %b
REM Dec 24 MSG Christmas Eve %b
REM Dec 25 +25 MSG Christmas %b
REM Dec 31 MSG New Year's Eve %b

A few examples can be found at http://wiki.43folders.com/index.php/Remind_Include_Files
and http://wiki.43folders.com/index.php/User:JamesRifkin/defs.rem
There's even a section in there for all the Jewish holidays.
remind reads the .reminders file in your home directory. To keep holidays, birthdays and reminders separate you can keep them in separate files and include them in .reminders
~/.reminders:

include /home/username/.remind/reminders.txt
include /home/username/.remind/birthdays.txt
include /home/username/.remind/holidays.txt

mobilediesel
January 12th, 2010, 11:01 AM
And a new one for no reason:

#!/usr/bin/env bash

DAY=$(date +%d)
for i in {-15..15}; do
DOW=$(date +%a -d "$i days")
days="$days ${DOW:0:2}"
week="$week $(date +%d -d "$i days")"
done
echo "${days#* }"
echo "${week#* }"|sed "s/$DAY\>/\${color ffffff}&\${color}/"
Current day highlighted and in the center, with 15 days before and after for a full 31 days. Just uses default locale's abbreviated day names. Probably could make it use the lang (http://dl.dropbox.com/u/1055489/scripts/lang) file to give a choice of language.
143381

Rodney9
January 12th, 2010, 11:30 AM
My Conky - http://farm5.static.flickr.com/4043/4268767450_a3110322c3_o.png


# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# - tail of /var/log/messages
# - netstat connections to your computer
#
# -- Pengo (conky@pengo.us)
#

# Create own window instead of using desktop (required in nautilus)
own_window yes

background no

own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# fiddle with window

use_xft yes

# Update interval in seconds
update_interval 3.0

# Minimum size of text area
minimum_size 400 5

# Draw shades?
draw_shades yes

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no

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

# Stippled borders?
stippled_borders 8

# border margins
border_margin 2

# border width
border_width 1

# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color black
default_outline_color white

own_window_colour brown
own_window_transparent yes

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

# Gap between borders of screen and text
gap_x 1
gap_y 20

# stuff after 'TEXT' will be formatted on screen

override_utf8_locale no
xftfont Terminus:size=10
xftalpha 0.8

use_spacer right




TEXT


${offset 240}${font georgia :size=39}${color white}${alignc} ${time %l:%M %p}
${font}
#${color slate grey}{font Times:size=33}$hr
${offset 240}${color slate grey}${time %a, } ${color }${time %e %B %G}
${offset 240}${color slate grey}${time %Z, }${color }${time %H:%M:%S}
${offset 240}${color slate grey}UpTime: ${color }$uptime
${offset 240}${color slate grey}Kern:${color }$kernel
${offset 240}${color slate grey}CPU:${color } $cpu% ${acpitemp}C
${offset 240}${cpugraph 20,130 000000 ffffff}
${offset 240}CPU:1 ${cpu cpu1}% ${cpubar cpu1}
${offset 240}CPU:2 ${cpu cpu2}% ${cpubar cpu2}
${offset 240}${color slate grey}Load: ${color }$loadavg
${offset 240}${color slate grey}Processes: ${color }$processes
${offset 240}${color slate grey}Running: ${color }$running_processes

${offset 240}${color slate grey}Highest CPU:
${offset 240}${color #ddaa00} ${top name 1}${top_mem cpu 1}
${offset 240}${color lightgrey} ${top name 2}${top cpu 2}
${offset 240}${color lightgrey} ${top name 3}${top cpu 3}
${offset 240}${color lightgrey} ${top name 4}${top cpu 4}

${offset 240}${color slate grey}Highest MEM:
${offset 240}${color #ddaa00} ${top_mem name 1}${top_mem mem 1}
${offset 240}${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${offset 240}${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${offset 240}${color lightgrey} ${top_mem name 4}${top_mem mem 4}

${offset 240}${color slate grey}MEM: ${color } $memperc% $mem/$memmax
${offset 240}${membar 3,100}
${offset 240}${color slate grey}SWAP: ${color }$swapperc% $swap/$swapmax
${offset 240}${swapbar 3,100}

${offset 240}${color slate grey}ROOT: ${color }${fs_free /}/${fs_size /}
${offset 240}${fs_bar 3,100 /}
${offset 240}${color slate grey}HOME: ${color }${fs_free /home}/${fs_size /home}
${offset 240}${fs_bar 3,100 /home}
${offset 240}${color slate grey}NET:
${offset 240}${color}Up: ${color }${upspeed eth0} k/s
${offset 240}${upspeedgraph eth0 20,130 000000 ffffff}
${offset 240}${color}Down: ${color }${downspeed eth0}k/s${color}
${offset 240}${downspeedgraph eth0 20,130 000000 ffffff}

${offset 240}${color Cyan}Brisbane WEATHER ${hr 2}$color${execi 600 sh /home/puss/conky_weather/weather_script.sh }
${offset 240}${font conkyweather:size=35}${execi 600 sed -n '4p' /home/puss/conky_weather/weather1}${font} ${voffset -20}${execi 600 sed -n '1p' /home/puss/conky_weather/weather1}


${offset 240}${rss http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|AU|QLD|BRISBANE 10 item_title 1}
${offset 240}${font conkyweather:size=35}${execi 600 sed -n '5p' /home/puss/conky_weather/weather1}${font} ${voffset -20}${execi 600 sed -n '2p' /home/puss/conky_weather/weather1}


${offset 240}${rss http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=OCN|AU|QLD|BRISBANE 10 item_title 2}
${offset 240}${font conkyweather:size=35}${execi 600 sed -n '6p' /home/puss/conky_weather/weather1}${font} ${voffset -20}${execi 600 sed -n '3p' /home/puss/conky_weather/weather1}

Bruce M.
January 12th, 2010, 06:45 PM
Ah, yes. Descriptive comments. I added that to the script (http://dl.dropbox.com/u/1055489/scripts/conkycal.sh). Excellent idea!

See, I ain't just a pretty face here ya know.

Now all that "Martian talk" that followed is really nice. but ...
How do you use it in conky?

Guess my face ain't so pretty after all.:lolflag:

CHIMO!
Bruce

mobilediesel
January 13th, 2010, 08:04 AM
See, I ain't just a pretty face here ya know.

Now all that "Martian talk" that followed is really nice. but ...
How do you use it in conky?

Guess my face ain't so pretty after all.:lolflag:

CHIMO!
Bruce

Well, first you set up remind to give you all your holiday and birthday reminders. That's what all the "Martian talk" was. :lol:

143479
New year's day and Martin Luther King day are highlighted green, current day in white. Here's the calendar code:

date=$(date '+%F')
DAY=${date:8:2}
# m="-m" # uncomment this line for starting the week on Monday instead of Sunday.
cal=$(cal $m)
prev=$(cal $m $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1)
next=$(cal $m $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1)
if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next"
else next="\${color9} $next"
fi
if [ ${#prev} == 20 ]; then prev="$prev"$'\n '
else prev="$prev "
fi
dates=$(remind -s|cut -d ' ' -f1|uniq|cut -d '/' -f3|sed "/$DAY/d")
current=$(echo "${cal:42}"|sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' )
for i in $dates; do
current=$(echo "$current"|sed -e /" ${i/#0/} "/s/" ${i/#0/} "/" "'${color green}'"${i/#0/}"'${color}'" "/)
done
current=$(echo "$current"|sed -e /" ${DAY/#0/} "/s/" ${DAY/#0/} "/" "'${color3}'"${DAY/#0/}"'${color}'" "/ -e 's/^ //' -e 's/ *$//')
echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${colo r9}$prev\${color}$current$next"
The section in green is what colors the holidays and birthdays green according to information returned by remind.

dmillerct
January 13th, 2010, 03:15 PM
With all these calendar scripts floating around I am quite surprised that no one has entered the January conky of the month contest.

http://blog.conky.be/2009/12/16/the-lines-are-now-closed/

mobilediesel
January 13th, 2010, 03:52 PM
With all these calendar scripts floating around I am quite surprised that no one has entered the January conky of the month contest.

http://blog.conky.be/12/16/2009/the-lines-are-now-closed/

I entered but I was looking to see if one can enter the contest multiple times in the same month. Maybe Londonali1010 can clear that up for us.

dmillerct
January 13th, 2010, 03:53 PM
I entered but I was looking to see if one can enter the contest multiple times in the same month. Maybe Londonali1010 can clear that up for us.

Oh, you entered? am I not linking the correct post to place entries?

mobilediesel
January 13th, 2010, 04:00 PM
Oh, you entered? am I not linking the correct post to place entries?

I entered after you posted about no one entering. :D

dmillerct
January 13th, 2010, 04:01 PM
I entered after you posted about no one entering. :D

Too funny. =D

mobilediesel
January 13th, 2010, 04:17 PM
Too funny. =D

I was going to enter yesterday but ended up having a migraine. I never really believed that "migraines" were a real thing. Then several months ago I woke up with a migraine. I usually have to sleep it off which means I sometimes end up sleeping about 18 to 20 hours. Then I got up today and found that a mouse **** on some of my clean dishes. I poured boiling water all over the counter and the dishes to make sure they were sterile and cleaned up everything again.

Ah, good old Michigan where it's 25 freakin degrees Fahrenheit right now. Living in a house that would never pass an inspection if it were to be sold. Ants in the summer. Mice in the winter. Moths and spiders continuously throughout the year. I've dealt with fewer pests while camping.

At least the internet work#(^&%(^&#!(&$#(&#((RR

NO CARRIER





Heh, most people born after 1978 probably wouldn't get that.

londonali1010
January 13th, 2010, 07:22 PM
I was going to enter yesterday but ended up having a migraine. I never really believed that "migraines" were a real thing. Then several months ago I woke up with a migraine. I usually have to sleep it off which means I sometimes end up sleeping about 18 to 20 hours. Then I got up today and found that a mouse **** on some of my clean dishes. I poured boiling water all over the counter and the dishes to make sure they were sterile and cleaned up everything again.

Ah, good old Michigan where it's 25 freakin degrees Fahrenheit right now. Living in a house that would never pass an inspection if it were to be sold. Ants in the summer. Mice in the winter. Moths and spiders continuously throughout the year. I've dealt with fewer pests while camping.

At least the internet work#(^&%(^&#!(&$#(&#((RR

NO CARRIER





Heh, most people born after 1978 probably wouldn't get that.

Dude, that sounds fun :S

Anyway, sorry taking a while to respond, yes, you guys are posting in the right place.

Also, straw poll of (2) people: would it be better or worse if I made it publicly votable?

mobilediesel
January 13th, 2010, 07:38 PM
Dude, that sounds fun :S

Anyway, sorry taking a while to respond, yes, you guys are posting in the right place.

Also, straw poll of (2) people: would it be better or worse if I made it publicly votable?

"Fun" yeah I used a different word starting with the same first two letters. :D

Yeah, make it publicly votable!

dmillerct
January 13th, 2010, 07:45 PM
Dude, that sounds fun :S

Anyway, sorry taking a while to respond, yes, you guys are posting in the right place.

Also, straw poll of (2) people: would it be better or worse if I made it publicly votable?

Either publicly votable or committee, It doesn't matter to me either way.

As long as people can't vote for thier own config like umpfteen thousand times. :twisted:

TeoBigusGeekus
January 13th, 2010, 09:44 PM
Congrats Bruce!!!
I just found out about your thread - awesome!
My contribution to it will be the weather scripts I've written
http://ubuntuforums.org/showthread.php?t=1156383
As a civil engineer I'm always concerned about the weather...
Here's me desktop.

londonali1010
January 13th, 2010, 10:54 PM
I entered but I was looking to see if one can enter the contest multiple times in the same month. Maybe Londonali1010 can clear that up for us.

Oh, and I meant to say, yeah, go for it, enter as many times as you like! I don't have a problem with it as long as no one takes the mick :D

mobilediesel
January 13th, 2010, 11:40 PM
Oh, and I meant to say, yeah, go for it, enter as many times as you like! I don't have a problem with it as long as no one takes the mick :D

I had to look up "takes the mick" as that wasn't one of the many sayings I picked up watching BBC shows. :D

For two countries that speak English we sure don't speak the same language sometimes! That's more the fault of the U.S. though, I'll totally admit that. :lol:

Bruce M.
January 14th, 2010, 05:21 PM
With all these calendar scripts floating around I am quite surprised that no one has entered the January conky of the month contest.

http://blog.conky.be/2009/12/16/the-lines-are-now-closed/

:( And I thought is was a good idea too. That's why I suggested it.

January was coming, a new year, twenty and a half (2010) and a million (OK, I exaggerate) post about calendars. {sigh}

Bruce M.
January 14th, 2010, 05:35 PM
I was going to enter yesterday but ended up having a migraine. I never really believed that "migraines" were a real thing.

Oh my. I remember discovering the truth about migraines. had this headache all day that would NOT go away, just getting worse. Finally tried ice, cold shower, hot shower... nada! ... {blank}

Woke up at 10AM the next morning in a hospital with a nurse taking my pulse.
N: "How do you feel?"
Me "Fine."
N: "Do you remember coming here?"
Me: "No, why?"
N: "Take a look at how you are dressed, other than taking your boots off, we did nothing except put you to sleep."

Getting up I checked; tie draped around my neck, shirt buttoned with two buttons in the wrong holes, not tucked in, pants completely undone, just the belt done up. (Thank God for underwear) I looked at the Nurse who just added,
"That's not the scary part, you drove 12 miles to get here." Don't remember a thing.

That nurse told me a "migraine" was like birth pains in your head that just do NOT go away! Being a guy, I wouldn't know. :)


At least the internet work#(^&%(^&#!(&$#(&#((RR

NO CARRIER

Heh, most people born after 1978 probably wouldn't get that.

Ohhhhhhhhhhhh, I HATE THAT SOUND!!!!

CHIMO!
Bruce

Bruce M.
January 14th, 2010, 05:42 PM
Well, first you set up remind to give you all your holiday and birthday reminders. That's what all the "Martian talk" was. :lol:

Oh, OK. Clear as mud.
{psst, Tom, does that do it for you? I didn't think so, back to reading}

They couldn't do something simple like:

remind.txt

1 Jan
15 Feb
12 May
18 Jun
22 Oct
for remind to read ... nooooooooooooo that would be too easy. :)



143479
New year's day and Martin Luther King day are highlighted green, current day in white. Here's the calendar code:

date=$(date '+%F')
DAY=${date:8:2}
# m="-m" # uncomment this line for starting the week on Monday instead of Sunday.
cal=$(cal $m)
prev=$(cal $m $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1)
next=$(cal $m $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1)
if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next"
else next="\${color9} $next"
fi
if [ ${#prev} == 20 ]; then prev="$prev"$'\n '
else prev="$prev "
fi
dates=$(remind -s|cut -d ' ' -f1|uniq|cut -d '/' -f3|sed "/$DAY/d")
current=$(echo "${cal:42}"|sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' )
for i in $dates; do
current=$(echo "$current"|sed -e /" ${i/#0/} "/s/" ${i/#0/} "/" "'${color green}'"${i/#0/}"'${color}'" "/)
done
current=$(echo "$current"|sed -e /" ${DAY/#0/} "/s/" ${DAY/#0/} "/" "'${color3}'"${DAY/#0/}"'${color}'" "/ -e 's/^ //' -e 's/ *$//')
echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${colo r9}$prev\${color}$current$next"
The section in green is what colors the holidays and birthdays green according to information returned by remind.

Now that language I understand perfectly, it's called: copy/paste. :lolflag:

Seriously: Gotta read up on Remind, I like it.

CHIMO
Bruce

dmillerct
January 14th, 2010, 06:06 PM
Oh my. I remember discovering the truth about migraines. had this headache all day that would NOT go away, just getting worse. Finally tried ice, cold shower, hot shower... nada! ... {blank}

Woke up at 10AM the next morning in a hospital with a nurse taking my pulse.
N: "How do you feel?"
Me "Fine."
N: "Do you remember coming here?"
Me: "No, why?"
N: "Take a look at how you are dressed, other than taking your boots off, we did nothing except put you to sleep."

Getting up I checked; tie draped around my neck, shirt buttoned with two buttons in the wrong holes, not tucked in, pants completely undone, just the belt done up. (Thank God for underwear) I looked at the Nurse who just added,
"That's not the scary part, you drove 12 miles to get here." Don't remember a thing.

That nurse told me a "migraine" was like birth pains in your head that just do NOT go away! Being a guy, I wouldn't know. :)



Ohhhhhhhhhhhh, I HATE THAT SOUND!!!!

CHIMO!
Bruce

That reminds me of my night out in Manhattan last Friday. Except in my case my lack of memory was caused by Beer and warm Slivovitz. :(

Bruce M.
January 14th, 2010, 08:34 PM
That reminds me of my night out in Manhattan last Friday. Except in my case my lack of memory was caused by Beer and warm Slivovitz. :(

Ah yes:

#!/bin/bash
blackout=beer+warmSlivovitz

In my case it got to:

#!/bin/bash
blackout=bruce+alcohol

But that was years after the migraines stopped.

CHIMO!
Bruce

londonali1010
January 14th, 2010, 08:55 PM
:( And I thought is was a good idea too. That's why I suggested it.

January was coming, a new year, twenty and a half (2010) and a million (OK, I exaggerate) post about calendars. {sigh}

I haven't seen *your* entry yet, Bruce :) /offtopic

wlourf
January 14th, 2010, 11:16 PM
Hi folks !

Here is my entry for the calendar contest (is here the right place to post it ?)

Well as you can see, it's a circular calendar (wheel of time, you know ...) associated with a text file where you can set your bank holiday and adding some text inside the circle. All is drawn with lua !

There is some paramaters (colors, size ...) that you can change in the lua script

I hope you like it, 10 more screenshots are here: http://picasaweb.google.com/wlourf/WheelCalendar#
(http://picasaweb.google.com/wlourf/WheelCalendar#)
Il was designed for a 800*1024 screen but will work with other resolutions ...

Any comments are welcome, of course :P

Edit :
As this calendar won the contest (thanks to all), the updated script is now on this post : http://ubuntuforums.org/showpost.php?p=8782789&postcount=147

dmillerct
January 15th, 2010, 12:13 AM
Hi folks !

Here is my entry for the calendar contest (is here the right place to post it ?)

Well as you can see, it's a circular calendar (wheel of time, you know ...) associated with a text file where you can set your bank holiday and adding some text inside the circle. All is drawn with lua !

There is some paramaters (colors, size ...) that you can change in the lua script

I hope you like it, 10 more screenshots are here: http://picasaweb.google.com/wlourf/WheelCalendar#
(http://picasaweb.google.com/wlourf/WheelCalendar#)
Il was designed for a 800*1024 screen but will work with other resolutions ...

Any comments are welcome, of course :P

Here's the lua script, the (simple) conkyrc is in the archive ..

--[[
calendar wheel by Wlourf (14 jan. 2010)

This script is designed to draw dates on a circular way on the left of the screen.
Some text can be added in the circle with the file calendar.txt (see below)
Some parameters (colors, sizes ... ) can be adjusted (see below).

As this script draw a lot of things, a short update of the conky is not necessary.

Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/calendar.lua):
lua_load ~/scripts/calendar.lua
lua_draw_hook_pre draw_calendar
]]

require 'cairo'
require 'imlib2'



function string:split(delimiter)
--source for the split function : http://www.wellho.net/resources/ex.php4?item=u108/split
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end


function conky_draw_calendar()
if conky_window==nil then return end
local width=conky_window.width
local height=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, width, height)
cr=cairo_create(cs)

-------------------------- parameters are set here -----------------------------------

-- vertical center of the circle (height/2 for centered circle)
yc=height/2

--number of days to display before and after today (i.e. with range = 30 --> 60 days are displayed)
--even number between 20 and 30 for nice effect
range = 20

--not sure of the engish words so I leave then in french !
--fleche (arrow) is the segment from x=0 to x=radius-xc (with xc =center of the circle)
--fleche for the external circle
--fleche2 for the internal circle
--fleche2 must be < fleche
fleche=125
fleche2=fleche*.75

--corde (chord) is the vertical segment (where x=0) of the external circle
--if 'corde' too close to 'height', imlib will display some warnings
corde=height-200

--colors RGB (0-255)
--week day
wday={51,51,255}
--week-end and bank holidays
eday={255,255,153}
--color of today
dday={0,255,255}

--vertical gradient (both circle and dates)? (true/false)
vgradient=true

--horizontal gradient for the circle? (0 to 1, 0 is the best choice for "moon like" circle )
hgradient=0


--you can change the font here
font="Japan"
--font_size (of dates) must be less than delta (= heigth of a day)
delta = yc/(range+0.5)
--the font-size has to be adjusted depending on the font used
font_size=delta-1

--file calendar (absolute path, can be "" if no file used)
calendar_file="/home/wlourf/scripts/calendar.txt"
--format of in this text file
--MMDD;N;TEXT
--MMDD = month day
--N = 0 or 1 (1 to display same colors as week-ends)
--TEXT = Text to display (use * for multiline)

--information text (from calendar.txt)
info_color={255,255,204}
--font size of text infos
font_size_info=font_size


--need to write a little image, didn't fiond a way to use a buffer
image_tmp="/tmp/img_cal.png"


-------------------------- end of the parameters, ouf -----------------------------------

--some calculations
--radius for external circle
--radius2 for internal circle
--delta = number of arcs in the circle
radius=(corde^2+4*fleche^2)/(8*fleche)
radius2=(corde^2+4*fleche2^2)/(8*fleche2)
decal=2*(delta-font_size)
wday[1]=wday[1]/255
wday[2]=wday[2]/255
wday[3]=wday[3]/255
eday[1]=eday[1]/255
eday[2]=eday[2]/255
eday[3]=eday[3]/255


--xc =x center of external circle
--xc2=x center of internal circle
xc = fleche - radius
xc2 = fleche2 - radius2

--local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
h_txt = height/(2*range+1)
--local cs2=cairo_image_surface_create(CAIRO_FORMAT_ARGB32 , 100, h_txt)

-- conky_window.drawable
cr2=cairo_create(cs2)

t = os.date('*t') -- date in table

--read the calendar file
file = io.open(calendar_file,"r")
tabcal={}
idx=1
if file ~= nil then
while true do
line = file:read("*l")
if line == nil then break end
lineok = string.split(line,";") --text = line .. "\n" .. text
if (#lineok)==3 then
tabcal[idx]={lineok[1],lineok[2],lineok[3]}
idx=idx+1
end
end
end
angmini=math.atan((corde/2)/(radius-fleche))

for i=-range,range do
--get the date
s = os.time(t) -- date in seconds
--dd= os.date("%a-%d-%y")
s2 = s + 3600*24*i --date diff in seconds
--t2 = os.date('*t',s2) --date diff in table
wd = os.date("%w",s2)
md = os.date("%m%d",s2)
dt = os.date("%a. %d %b.",s2),os.date("%d",s2),os.date("%b",s2)

--percentage of vertical gradient
pc=(range-math.abs(i))/range
if not vgradient then pc=1 end

--angle min et max of one block
ang0=angmini*((i-0.5)/range)
ang1=angmini*(i+0.5)/range
angm=(ang0+ang1)/2

--read the calendar.txt array
flag = false
for idy=1,idx-1 do
if tabcal[idy][1] == md then
if i == 0 then
today = tabcal[idy]
end
if tabcal[idy][2] == "1" then
flag = true
end
break
end

end

--colors
if wd=="6" or wd=="0" or flag == true then
colR,colG,colB=eday[1],eday[2],eday[3]
else
colR,colG,colB=wday[1],wday[2],wday[3]
end

cairo_set_source_rgba (cr,colR, colG, colB,pc);
pat = cairo_pattern_create_radial (xc, yc, radius,
xc2,yc,radius2);
cairo_pattern_add_color_stop_rgba (pat, 0, colR, colG, colB, pc);
cairo_pattern_add_color_stop_rgba (pat, 1, colR, colG, colB, hgradient);
cairo_set_source (cr, pat);

--draw the arcs
x1,y1=radius*math.cos(ang0)+xc,radius*math.sin(ang 0)+yc
x2,y2=radius*math.cos(ang1)+xc,radius*math.sin(ang 1)+yc
xm,ym=radius*math.cos(angm)+xc,radius*math.sin(ang m)+yc
-- am=(ym-yc)/(xm-xc)
-- bm=ym-am*xm

cairo_move_to(cr,x1,y1)
cairo_line_to(cr,x2,y2)
cairo_line_to(cr,xc,yc)
cairo_fill(cr)

--lenght of the arc
dx,dy=math.abs(x2-x1),math.abs(y2-y1)
h_txt=math.sqrt(dx*dx+dy*dy)
w_txt=font_size*10

--write text in another image
--didn't find to work in memory only
local cs2=cairo_image_surface_create(CAIRO_FORMAT_ARGB32 , w_txt, h_txt)
cr2=cairo_create(cs2)
cairo_set_font_size (cr2, font_size);
if i==0 then
--weight = CAIRO_FONT_WEIGHT_BOLD
colR, colG, colB = dday[1]/255,dday[2]/255,dday[3]/255
--else
-- weight = CAIRO_FONT_WEIGHT_NORMAL
end
cairo_select_font_face(cr2, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)

cairo_move_to(cr,xc+(delta+radius)*math.cos(ang0), corde/2+(radius-fleche)*math.tan(ang0))

cairo_move_to(cr2,0,h_txt-decal)
cairo_set_source_rgba (cr2, colR, colG, colB,pc)
cairo_show_text(cr2, " " .. dt)
cairo_stroke(cr2)

cairo_surface_write_to_png(cs2,image_tmp)
cairo_destroy(cr2)

--put date text on cairo surface
imageTmp = imlib_load_image(image_tmp)
imlib_context_set_image(imageTmp)

rot_img = imlib_create_rotated_image(angm)
imlib_free_image()

imlib_context_set_image(rot_img)

w_img0, h_img0 = imlib_image_get_width(), imlib_image_get_height()

---look for center of text
rt=radius+w_txt/2
xt=rt*math.cos(angm)+xc-w_img0/2
yt=rt*math.sin(angm)+yc-h_img0/2
imlib_render_image_on_drawable(xt,yt)
imlib_free_image()


--write text info if needed
have=""
if today ~= nil then
cairo_select_font_face(cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL )
cairo_set_line_width(cr,0)
cairo_set_font_size(cr,font_size_info)
cairo_set_source_rgba (cr, info_color[1]/255, info_color[2]/255, info_color[3]/255,1);

have = string.split(today[3],"*")
for i=1,#have do
cairo_move_to(cr,10,height/2+(i-#have/2)*font_size_info)
cairo_show_text(cr, have[i])
cairo_fill(cr)
end
end

end
end


Looks awesome!! I think to officially enter you need to post the entry on the conky blog located Here (http://blog.conky.be)

wlourf
January 15th, 2010, 12:27 AM
Looks awesome!! I think to officially enter you need to post the entry on the conky blog located Here (http://blog.conky.be)
thanks last month winner ! , I've done it too ! Did you entry for this month ?

dmillerct
January 15th, 2010, 12:59 AM
thanks last month winner ! , I've done it too ! Did you entry for this month ?

No, I am just swamped with work and family issues this month. I probably could of slapped something together however I really wanted to make something special and just ran out of time.

On a related note, I wanted to use the prize money to some how give back to the conky community. After discussing this with a few buds here, there really wasn't anything that could be purchased from amazon to benefit everyone (directly anyway).

So I did what I thought was the next best thing and got the following:
http://ecx.images-amazon.com/images/I/31S6MZ1DCVL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg

and
http://ecx.images-amazon.com/images/I/51gUR%2Bt6K6L._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg

I figure with these at least I can help in-directly help the community. :P

Bruce M.
January 15th, 2010, 02:38 AM
I haven't seen *your* entry yet, Bruce :) /offtopic

I do believe that I said because I suggested it I wouldn't send one in. Besides mine would be a copy/paste jobe as I can't write a script worth a dime. :(

C H I M O!!
Bruce

Bruce M.
January 15th, 2010, 02:44 AM
Hi folks !

Here is my entry for the calendar contest (is here the right place to post it ?)

Well as you can see, it's a circular calendar (wheel of time, you know ...) associated with a text file where you can set your bank holiday and adding some text inside the circle. All is drawn with lua !

There is some paramaters (colors, size ...) that you can change in the lua script

I hope you like it, 10 more screenshots are here: http://picasaweb.google.com/wlourf/WheelCalendar#
(http://picasaweb.google.com/wlourf/WheelCalendar#)
Il was designed for a 800*1024 screen but will work with other resolutions ...

Any comments are welcome, of course :P

Here's the lua script, the (simple) conkyrc is in the archive ..

--[[
calendar wheel by Wlourf (14 jan. 2010)

This script is designed to draw dates on a circular way on the left of the screen.
Some text can be added in the circle with the file calendar.txt (see below)
Some parameters (colors, sizes ... ) can be adjusted (see below).

As this script draw a lot of things, a short update of the conky is not necessary.

Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/calendar.lua):
lua_load ~/scripts/calendar.lua
lua_draw_hook_pre draw_calendar
]]

require 'cairo'
require 'imlib2'



function string:split(delimiter)
--source for the split function : http://www.wellho.net/resources/ex.php4?item=u108/split
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end


function conky_draw_calendar()
if conky_window==nil then return end
local width=conky_window.width
local height=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, width, height)
cr=cairo_create(cs)

-------------------------- parameters are set here -----------------------------------

-- vertical center of the circle (height/2 for centered circle)
yc=height/2

--number of days to display before and after today (i.e. with range = 30 --> 60 days are displayed)
--even number between 20 and 30 for nice effect
range = 20

--not sure of the engish words so I leave then in french !
--fleche (arrow) is the segment from x=0 to x=radius-xc (with xc =center of the circle)
--fleche for the external circle
--fleche2 for the internal circle
--fleche2 must be < fleche
fleche=125
fleche2=fleche*.75

--corde (chord) is the vertical segment (where x=0) of the external circle
--if 'corde' too close to 'height', imlib will display some warnings
corde=height-200

--colors RGB (0-255)
--week day
wday={51,51,255}
--week-end and bank holidays
eday={255,255,153}
--color of today
dday={0,255,255}

--vertical gradient (both circle and dates)? (true/false)
vgradient=true

--horizontal gradient for the circle? (0 to 1, 0 is the best choice for "moon like" circle )
hgradient=0


--you can change the font here
font="Japan"
--font_size (of dates) must be less than delta (= heigth of a day)
delta = yc/(range+0.5)
--the font-size has to be adjusted depending on the font used
font_size=delta-1

--file calendar (absolute path, can be "" if no file used)
calendar_file="/home/wlourf/scripts/calendar.txt"
--format of in this text file
--MMDD;N;TEXT
--MMDD = month day
--N = 0 or 1 (1 to display same colors as week-ends)
--TEXT = Text to display (use * for multiline)

--information text (from calendar.txt)
info_color={255,255,204}
--font size of text infos
font_size_info=font_size


--need to write a little image, didn't fiond a way to use a buffer
image_tmp="/tmp/img_cal.png"


-------------------------- end of the parameters, ouf -----------------------------------

--some calculations
--radius for external circle
--radius2 for internal circle
--delta = number of arcs in the circle
radius=(corde^2+4*fleche^2)/(8*fleche)
radius2=(corde^2+4*fleche2^2)/(8*fleche2)
decal=2*(delta-font_size)
wday[1]=wday[1]/255
wday[2]=wday[2]/255
wday[3]=wday[3]/255
eday[1]=eday[1]/255
eday[2]=eday[2]/255
eday[3]=eday[3]/255


--xc =x center of external circle
--xc2=x center of internal circle
xc = fleche - radius
xc2 = fleche2 - radius2

--local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
h_txt = height/(2*range+1)
--local cs2=cairo_image_surface_create(CAIRO_FORMAT_ARGB32 , 100, h_txt)

-- conky_window.drawable
cr2=cairo_create(cs2)

t = os.date('*t') -- date in table

--read the calendar file
file = io.open(calendar_file,"r")
tabcal={}
idx=1
if file ~= nil then
while true do
line = file:read("*l")
if line == nil then break end
lineok = string.split(line,";") --text = line .. "\n" .. text
if (#lineok)==3 then
tabcal[idx]={lineok[1],lineok[2],lineok[3]}
idx=idx+1
end
end
end
angmini=math.atan((corde/2)/(radius-fleche))

for i=-range,range do
--get the date
s = os.time(t) -- date in seconds
--dd= os.date("%a-%d-%y")
s2 = s + 3600*24*i --date diff in seconds
--t2 = os.date('*t',s2) --date diff in table
wd = os.date("%w",s2)
md = os.date("%m%d",s2)
dt = os.date("%a. %d %b.",s2),os.date("%d",s2),os.date("%b",s2)

--percentage of vertical gradient
pc=(range-math.abs(i))/range
if not vgradient then pc=1 end

--angle min et max of one block
ang0=angmini*((i-0.5)/range)
ang1=angmini*(i+0.5)/range
angm=(ang0+ang1)/2

--read the calendar.txt array
flag = false
for idy=1,idx-1 do
if tabcal[idy][1] == md then
if i == 0 then
today = tabcal[idy]
end
if tabcal[idy][2] == "1" then
flag = true
end
break
end

end

--colors
if wd=="6" or wd=="0" or flag == true then
colR,colG,colB=eday[1],eday[2],eday[3]
else
colR,colG,colB=wday[1],wday[2],wday[3]
end

cairo_set_source_rgba (cr,colR, colG, colB,pc);
pat = cairo_pattern_create_radial (xc, yc, radius,
xc2,yc,radius2);
cairo_pattern_add_color_stop_rgba (pat, 0, colR, colG, colB, pc);
cairo_pattern_add_color_stop_rgba (pat, 1, colR, colG, colB, hgradient);
cairo_set_source (cr, pat);

--draw the arcs
x1,y1=radius*math.cos(ang0)+xc,radius*math.sin(ang 0)+yc
x2,y2=radius*math.cos(ang1)+xc,radius*math.sin(ang 1)+yc
xm,ym=radius*math.cos(angm)+xc,radius*math.sin(ang m)+yc
-- am=(ym-yc)/(xm-xc)
-- bm=ym-am*xm

cairo_move_to(cr,x1,y1)
cairo_line_to(cr,x2,y2)
cairo_line_to(cr,xc,yc)
cairo_fill(cr)

--lenght of the arc
dx,dy=math.abs(x2-x1),math.abs(y2-y1)
h_txt=math.sqrt(dx*dx+dy*dy)
w_txt=font_size*10

--write text in another image
--didn't find to work in memory only
local cs2=cairo_image_surface_create(CAIRO_FORMAT_ARGB32 , w_txt, h_txt)
cr2=cairo_create(cs2)
cairo_set_font_size (cr2, font_size);
if i==0 then
--weight = CAIRO_FONT_WEIGHT_BOLD
colR, colG, colB = dday[1]/255,dday[2]/255,dday[3]/255
--else
-- weight = CAIRO_FONT_WEIGHT_NORMAL
end
cairo_select_font_face(cr2, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)

cairo_move_to(cr,xc+(delta+radius)*math.cos(ang0), corde/2+(radius-fleche)*math.tan(ang0))

cairo_move_to(cr2,0,h_txt-decal)
cairo_set_source_rgba (cr2, colR, colG, colB,pc)
cairo_show_text(cr2, " " .. dt)
cairo_stroke(cr2)

cairo_surface_write_to_png(cs2,image_tmp)
cairo_destroy(cr2)

--put date text on cairo surface
imageTmp = imlib_load_image(image_tmp)
imlib_context_set_image(imageTmp)

rot_img = imlib_create_rotated_image(angm)
imlib_free_image()

imlib_context_set_image(rot_img)

w_img0, h_img0 = imlib_image_get_width(), imlib_image_get_height()

---look for center of text
rt=radius+w_txt/2
xt=rt*math.cos(angm)+xc-w_img0/2
yt=rt*math.sin(angm)+yc-h_img0/2
imlib_render_image_on_drawable(xt,yt)
imlib_free_image()


--write text info if needed
have=""
if today ~= nil then
cairo_select_font_face(cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL )
cairo_set_line_width(cr,0)
cairo_set_font_size(cr,font_size_info)
cairo_set_source_rgba (cr, info_color[1]/255, info_color[2]/255, info_color[3]/255,1);

have = string.split(today[3],"*")
for i=1,#have do
cairo_move_to(cr,10,height/2+(i-#have/2)*font_size_info)
cairo_show_text(cr, have[i])
cairo_fill(cr)
end
end

end
end


To quote you:

Any comments are welcome, of course :P

As soon as I get my lower jaw off the floor, and have the doc wire it into place, I'll be back make a comment.

WoW! Simply does NOT cut it!

Bruce M.
January 15th, 2010, 02:51 AM
No, I am just swamped with work and family issues this month. I probably could of slapped something together however I really wanted to make something special and just ran out of time.

On a related note, I wanted to use the prize money to some how give back to the conky community. After discussing this with a few buds here, there really wasn't anything that could be purchased from amazon to benefit everyone (directly anyway).

So I did what I thought was the next best thing and got the following:
http://ecx.images-amazon.com/images/I/31S6MZ1DCVL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg

and
http://ecx.images-amazon.com/images/I/51gUR%2Bt6K6L._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA240_SH20_OU01_.jpg

I figure with these at least I can help in-directly help the community. :P

Looks good on you.
CHIMO!
Bruce

mobilediesel
January 15th, 2010, 10:01 AM
Oh, OK. Clear as mud.
{psst, Tom, does that do it for you? I didn't think so, back to reading}

They couldn't do something simple like:

remind.txt

Jan 1
Feb 15 May 12th Jun 18 Oct 22
for remind to read ... nooooooooooooo that would be too easy. :)



Now that language I understand perfectly, it's called: copy/paste. :lolflag:

Seriously: Gotta read up on Remind, I like it.

CHIMO
Bruce

Remind can be pretty powerful. When you set up birthdays you can have it tell you how old someone will be! I also have it set to tell me when Daylight Saving Time begins and ends.

Bruce M.
January 15th, 2010, 06:35 PM
Remind can be pretty powerful. When you set up birthdays you can have it tell you how old someone will be! I also have it set to tell me when Daylight Saving Time begins and ends.

${grumble grumble} darned script junkies!
I'll get it ... someday when I have time.

CHIMO!
Bruce

abumaia
January 31st, 2010, 02:37 AM
Well as you can see, it's a circular calendar (wheel of time, you know ...) associated with a text file where you can set your bank holiday and adding some text inside the circle. All is drawn with lua!

Nice calendar! Wish I could get it to work on my computer. I keep getting

***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:

imlib_free_image();

With the parameter:

image

being NULL. Please fix your program. (among many others) whenever I try to use it

wlourf
January 31st, 2010, 12:35 PM
Nice calendar! Wish I could get it to work on my computer. I keep getting
(among many others) whenever I try to use it
please post your conky -v (because you need at least conky 1.7.2 with imlib)

Did you setup a correct path in the lua script ? image_tmp="/tmp/img_cal.png"

Also, you should post the beginning of the error message that will say on which line is the error.
At least, you can try the last version of the script here (http://u-scripts.blogspot.com/2010/01/calendar-wheel-v12.html). If you have no deviant art account, I can post it here.

hth

abumaia
January 31st, 2010, 11:47 PM
please post your conky -v (because you need at least conky 1.7.2 with imlib)

Did you setup a correct path in the lua script ? image_tmp="/tmp/img_cal.png"

Also, you should post the beginning of the error message that will say on which line is the error.
At least, you can try the last version of the script here (http://u-scripts.blogspot.com/2010/01/calendar-wheel-v12.html). If you have no deviant art account, I can post it here.

hth


$ conky -v
Conky 1.7.2 compiled Fri Oct 23 15:55:48 UTC 2009 for Linux 2.6.24-23-server (i686)

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

X11:
* Xdamage extension
* XDBE (double buffer extension)
* Xft

Music detection:
* MPD
* MOC

General:
* math
* hddtemp
* portmon
* Curl
* RSS
* Weather (METAR)
* Weather (XOAP)
* wireless
* support for IBM/Lenovo notebooks
* nvidia
* eve-online
* config-output
* Imlib2
* ALSA mixer support
* apcupsd
* iostats
* Lua

Lua bindings:
* Cairo
* Imlib2path is a correct, full path: /home/abumaia/ConkyScripts/img_cal.png

cannot reach the beginning of the error messages, they scroll beyond the capacity of my terminal buffer. here is the full section of errors, this group repeats itself over and over:

***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:

imlib_create_rotated_image();

With the parameter:

image

being NULL. Please fix your program.
***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:

imlib_free_image();

With the parameter:

image

being NULL. Please fix your program.
***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:

imlib_image_get_width();

With the parameter:

image

being NULL. Please fix your program.
***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:

imlib_image_get_height();

With the parameter:

image

being NULL. Please fix your program.
***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:

imlib_render_image_on_drawable();

With the parameter:

image

being NULL. Please fix your program.
***** Imlib2 Developer Warning ***** :
This program is calling the Imlib call:

imlib_free_image();

With the parameter:

image

being NULL. Please fix your program.

I did try yours, downloaded from DA. It works when I call your script from your conky file, but not when I call your script from my conky file, and they both call the lua file exactly the same.

wlourf
February 1st, 2010, 12:38 PM
I did try yours, downloaded from DA. It works when I call your script from your conky file, but not when I call your script from my conky file, and they both call the lua file exactly the same.

Interesting! in the conkyrc you need at least one line (empty or not) after the word TEXT.
Just check that or post your conkyrc

abumaia
February 1st, 2010, 07:27 PM
Interesting! in the conkyrc you need at least one line (empty or not) after the word TEXT.
Just check that or post your conkyrc

Yup, I have just an "A" after text, as it's a test conkyrc, and not my main one.

dk75
February 1st, 2010, 07:57 PM
interesting, that in dev version or in 1.8.x it is no longer true ;P

Bruce M.
February 4th, 2010, 08:01 PM
Since I can't write a script - I need help.


if_match - - expression - - - Evaluates the given boolean expression, printing everything between $if_match and the matching $endif depending on whether the evaluation returns true or not. Valid expressions consist of a left side, an operator and a right side. Left and right sides are being parsed for contained text objects before evaluation. Recognised left and right side types are:

* double - Argument consists of only digits and a single dot.
* long - Argument consists of only digits.
* string - Argument is enclosed in quotation mark or the checks for double and long failed before.

Valid operands are: '>', '<', '>=', '<=', '==', '!='.

Unfortunately, if_match does NOT evaluate "><" (greater than or less than)

Sooooooooooo:

${if_match ${time %y} == 00}${color}${else}${color4}
${if_match ${time %y} == 01}${color}${else}${color4}
${if_match ${time %y} == 02}${color}${else}${color4}
${if_match ${time %y} == 03}${color}${else}${color4}
${if_match ${time %y} == 04}${color}${else}${color4}
- - - {snip a whole bunch}
${if_match ${time %y} == 94}${color}${else}${color4}
${if_match ${time %y} == 95}${color}${else}${color4}
${if_match ${time %y} == 96}${color}${else}${color4}
${if_match ${time %y} == 97}${color}${else}${color4}
${if_match ${time %y} == 98}${color}${else}${color4}
${if_match ${time %y} == 99}${color}${else}${color4}

all on one line and ending with 100 ${endif} statements is a tad much

Any scripter out the that can take:

${time %y}/10 = I.D (Intiger point Deciaml)

Then I could do

${if_match ${I} == 0}${color}${else}${color4}
${if_match ${I} == 1}${color}${else}${color4}
${if_match ${I} == 2}${color}${else}${color4}
${if_match ${I} == 3}${color}${else}${color4}
${if_match ${I} == 4}${color}${else}${color4}
${if_match ${I} == 5}${color}${else}${color4}
${if_match ${I} == 6}${color}${else}${color4}
${if_match ${I} == 7}${color}${else}${color4}
${if_match ${I} == 8}${color}${else}${color4}
${if_match ${I} == 9}${color}${else}${color4}
on one line with 9 ${endif} statements
and continue with${else}
${if_match ${D} == 0}${color}${else}${color4}
${if_match ${D} == 1}${color}${else}${color4}
${if_match ${D} == 2}${color}${else}${color4}
${if_match ${D} == 3}${color}${else}${color4}
${if_match ${D} == 4}${color}${else}${color4}
${if_match ${D} == 5}${color}${else}${color4}
${if_match ${D} == 6}${color}${else}${color4}
${if_match ${D} == 7}${color}${else}${color4}
${if_match ${D} == 8}${color}${else}${color4}
${if_match ${D} == 9}${color}${else}${color4}
on one line with 9 ${endif} statements

Anyone up to a challange?

Thanks, Have a nice day.
Bruce

mobilediesel
February 4th, 2010, 08:23 PM
Since I can't write a script - I need help.



Unfortunately, if_match does NOT evaluate "><" (greater than or less than)

Sooooooooooo:

Anyone up to a challange?

Thanks, Have a nice day.
Bruce

Hmmm... possibly..

Unfortunately, if_match does NOT evaluate "><" (greater than or less than)
Do you mean it doesn't evaluate them both at the same time or either one of them separate?

Bruce M.
February 4th, 2010, 09:58 PM
Hmmm... possibly..

Do you mean it doesn't evaluate them both at the same time or either one of them separate?

Valid operands are: '>', '<', '>=', '<=', '==', '!='.

There are 100 years in a century, if I use '==' I need 100 ${if_matching}, 100 ${else} and 100 ${endif} statements.

If I use '>=' it's the same because I'll need 100 >= statements.

I need the "Decades" and the "Years" ie: 61/10 = 6.1 filter the 6 and the 1 as two separate variables and I'm down to 18 of eaxt ${ifmatching ${else} and ${endif} A lot less computer intensive.

I want to fill the space.
CHIMO!
Bruce

dk75
February 6th, 2010, 01:10 AM
Unfortunately, if_match does NOT evaluate "><" (greater than or less than)

Bruce, wasn't "greater than or less than" is equal to "not equal"?
If it is then "!=" is your "bingo!" :roll:

PS: ${execi 3600 echo $[$(date +%C)+1]} for century

mobilediesel
February 6th, 2010, 02:08 AM
Valid operands are: '>', '<', '>=', '<=', '==', '!='.

There are 100 years in a century, if I use '==' I need 100 ${if_matching}, 100 ${else} and 100 ${endif} statements.

If I use '>=' it's the same because I'll need 100 >= statements.

I need the "Decades" and the "Years" ie: 61/10 = 6.1 filter the 6 and the 1 as two separate variables and I'm down to 18 of eaxt ${ifmatching ${else} and ${endif} A lot less computer intensive.

I want to fill the space.
CHIMO!
Bruce

Lemme see the rest of the code you have so far.


Bruce, wasn't "greater than or less than" is equal to "not equal"?
If it is then "!=" is your "bingo!" :roll:

PS: ${execi 3600 echo $[$(date +%C)+1]} for century

That looks like it's on the right track!

wlourf
February 6th, 2010, 11:34 AM
As I post my entry for the January's CotM here, I just want to say THANKS to all people who vote for my conky script because I won this contest !!
Also I updated this script, with :
- today's date can now be set anywere in the arc : yoffset
- today's date can now have an offset (positive or negative) : xoffset
- the main thing is that the calendar is draw only at the start of the conky and when the date change (i.e. the calendar is saved in a PNG file and this is this file that will be displayed in the conky) or if the PNG file is deleted : so the conky become really really fast ...
- it can be drawn on the right side of the screen
(more info on my blog)


Edit 22 Feb 2010, new version (1.3) with minor changes can be downloaded in the attachments
Edit 01 April 2010, version 1.3a : updatedREADME with some feedbacks I received
Edit 6 april 2010 - v1.4 : This calendar is now a widget and it can be call with a simple function with some parameters. To use the calendar, you don't need to copy/paste the code in your lua script, just import the script file with his path (more infos in the README):

dofile("/home/wlourf/calendar/calendar.lua")Edit 7 april 2010 - v1.4.1 : new parameters for font and alpha of text info and for calendar.txt file

varsamakos
February 6th, 2010, 02:14 PM
Hey wlourf,

Congrats for your conky.

I was trying to make it work in my desktop (latest version)
and I've got a problem.

Things are doing fine and calendar is working
but when I click out of its layer, it disappears.
(see attachment, the layer's end is visible on the right)

(btw, I don't know if it matters but I changed the size to 300x800 for other conky's sake)

Bruce M.
February 6th, 2010, 02:48 PM
Bruce, wasn't "greater than or less than" is equal to "not equal"?
If it is then "!=" is your "bingo!" :roll:

PS: ${execi 3600 echo $[$(date +%C)+1]} for century

Don't want the century, just the "decade" and the "year" number For example next year will be 2011 so I need it to look like:


X O O X 0 0
0 0 0 0 0 0
0 0 0 0 0 0

and in 2012


X 0 0 0 X 0
0 0 0 0 0 0
0 0 0 0 0 0

and "!=" would be a case of another 100 commands. :(

Have a nice day
Bruce

dk75
February 6th, 2010, 03:22 PM
echo $(date +%y) |cut -c1
will give you decade


echo $(date +%y) |cut -c2
will give you year in that decade

Bruce M.
February 6th, 2010, 04:03 PM
Lemme see the rest of the code you have so far.

That looks like it's on the right track!

I'm not so sure. Here is the code I have, it only has 1 line for the years but I'm getting errors already, and I need two more. That's why I was wondering is a bash script could take the %y command and divide by 10 and somehow saving the "Decade" and "Year" as seperate variable I cna use.


0 bruloo@bruloo: ~
Sat Feb 06, 11:51 $ killall conky
0 bruloo@bruloo: ~
Sat Feb 06, 11:53 $ conky -c $HOME/Conky/OB_Dots
Conky: unknown variable e
Conky: one or more $endif's are missing
Conky: desktop window (1a7) is root window
Conky: window type - normal
Conky: drawing to created window (0xc00001)
Conky: drawing to double buffer

EDIT: I counted if_matching and endif's. They are equal.

Here's the code with the one line between years:


background no
own_window yes
own_window_type normal
own_window_transparent no
own_window_hints skip_taskbar,skip_pager
own_window_title DotsBox
use_xft yes
xftfont webdings:size=12
xftalpha 1
update_interval 1.0
total_run_times 0
double_buffer yes
minimum_size 100 100
maximum_width 200
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment br
gap_x 30
gap_y 65
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

# Colors
default_color 7FFF00 #Chartreuse
color0 FFFFF0 #Ivory
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
# colours below used by colorize script
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red


TEXT
${font dodger:size=12}${color3}TOTA ${color0}Linux
${goto 25}${color3}ALMINAC${COLOR}${font}
${font webdings: size=12}${if_match ${time %I} == 1}${color}${else}${color4}${endif}= ${if_match ${time %I} == 2}${color}${else}${color4}${endif}= ${if_match ${time %I} == 3}${color}${else}${color4}${endif}= ${goto 101}${if_match ${time %m} == 1}${color}${else}${color4}${endif}= ${if_match ${time %m} == 2}${color}${else}${color4}${endif}= ${if_match ${time %m} == 3}${color}${else}${color4}${endif}=
${if_match ${time %I} == 4}${color}${else}${color4}${endif}= ${if_match ${time %I} == 5}${color}${else}${color4}${endif}= ${if_match ${time %I} == 6}${color}${else}${color4}${endif}= ${goto 101}${if_match ${time %m} == 4}${color}${else}${color4}${endif}= ${if_match ${time %m} == 5}${color}${else}${color4}${endif}= ${if_match ${time %m} == 6}${color}${else}${color4}${endif}=
${if_match ${time %I} == 7}${color}${else}${color4}${endif}= ${if_match ${time %I} == 8}${color}${else}${color4}${endif}= ${if_match ${time %I} == 9}${color}${else}${color4}${endif}= ${goto 101}${if_match ${time %m} == 7}${color}${else}${color4}${endif}= ${if_match ${time %m} == 8}${color}${else}${color4}${endif}= ${if_match ${time %m} == 9}${color}${else}${color4}${endif}=
${if_match ${time %I} == 10}${color}${else}${color4}${endif}= ${if_match ${time %I} == 11}${color}${else}${color4}${endif}= ${if_match ${time %I} == 12}${color}${else}${color4}${endif}= ${goto 101}${if_match ${time %m} == 10}${color}${else}${color4}${endif}= ${if_match ${time %m} == 11}${color}${else}${color4}${endif}= ${if_match ${time %m} == 12}${color}${else}${color4}${endif}=
${color7}${font DejaVu Sans Mono:bold:size=8}${goto 25}Hour${goto 115}Month${font}${color}
${if_match ${time %M} == 10}${color}${else}${color4}${if_match ${time %M} == 11}${color}${else}${color4}${if_match ${time %M} == 12}${color}${else}${color4}${if_match ${time %M} == 13}${color}${else}${color4}${if_match ${time %M} == 14}${color}${else}${color4}${if_match ${time %M} == 15}${color}${else}${color4}${if_match ${time %M} == 16}${color}${else}${color4}${if_match ${time %M} == 17}${color}${else}${color4}${if_match ${time %M} == 18}${color}${else}${color4}${if_match ${time %M} == 19}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %M} == 20}${color}${else}${color4}${if_match ${time %M} == 21}${color}${else}${color4}${if_match ${time %M} == 22}${color}${else}${color4}${if_match ${time %M} == 23}${color}${else}${color4}${if_match ${time %M} == 24}${color}${else}${color4}${if_match ${time %M} == 25}${color}${else}${color4}${if_match ${time %M} == 26}${color}${else}${color4}${if_match ${time %M} == 27}${color}${else}${color4}${if_match ${time %M} == 28}${color}${else}${color4}${if_match ${time %M} == 29}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %M} == 30}${color}${else}${color4}${if_match ${time %M} == 31}${color}${else}${color4}${if_match ${time %M} == 32}${color}${else}${color4}${if_match ${time %M} == 33}${color}${else}${color4}${if_match ${time %M} == 34}${color}${else}${color4}${if_match ${time %M} == 35}${color}${else}${color4}${if_match ${time %M} == 36}${color}${else}${color4}${if_match ${time %M} == 37}${color}${else}${color4}${if_match ${time %M} == 38}${color}${else}${color4}${if_match ${time %M} == 39}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${goto 101}${if_match ${time %d} == 10}${color}${else}${color4}${if_match ${time %d} == 11}${color}${else}${color4}${if_match ${time %d} == 12}${color}${else}${color4}${if_match ${time %d} == 13}${color}${else}${color4}${if_match ${time %d} == 14}${color}${else}${color4}${if_match ${time %d} == 15}${color}${else}${color4}${if_match ${time %d} == 16}${color}${else}${color4}${if_match ${time %d} == 17}${color}${else}${color4}${if_match ${time %d} == 18}${color}${else}${color4}${if_match ${time %d} == 19}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %d} == 20}${color}${else}${color4}${if_match ${time %d} == 21}${color}${else}${color4}${if_match ${time %d} == 22}${color}${else}${color4}${if_match ${time %d} == 23}${color}${else}${color4}${if_match ${time %d} == 24}${color}${else}${color4}${if_match ${time %d} == 25}${color}${else}${color4}${if_match ${time %d} == 26}${color}${else}${color4}${if_match ${time %d} == 27}${color}${else}${color4}${if_match ${time %d} == 28}${color}${else}${color4}${if_match ${time %d} == 29}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %d} == 30}${color}${else}${color4}${if_match ${time %d} == 31}${color}${else}${color4}${if_match ${time %d} == 32}${color}${else}${color4}${if_match ${time %d} == 33}${color}${else}${color4}${if_match ${time %d} == 34}${color}${else}${color4}${if_match ${time %d} == 35}${color}${else}${color4}${if_match ${time %d} == 36}${color}${else}${color4}${if_match ${time %d} == 37}${color}${else}${color4}${if_match ${time %d} == 38}${color}${else}${color4}${if_match ${time %d} == 39}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}=
${if_match ${time %M} == 40}${color}${else}${color4}${if_match ${time %M} == 41}${color}${else}${color4}${if_match ${time %M} == 42}${color}${else}${color4}${if_match ${time %M} == 43}${color}${else}${color4}${if_match ${time %M} == 44}${color}${else}${color4}${if_match ${time %M} == 45}${color}${else}${color4}${if_match ${time %M} == 46}${color}${else}${color4}${if_match ${time %M} == 47}${color}${else}${color4}${if_match ${time %M} == 48}${color}${else}${color4}${if_match ${time %M} == 49}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %M} == 50}${color}${else}${color4}${if_match ${time %M} == 51}${color}${else}${color4}${if_match ${time %M} == 52}${color}${else}${color4}${if_match ${time %M} == 53}${color}${else}${color4}${if_match ${time %M} == 54}${color}${else}${color4}${if_match ${time %M} == 55}${color}${else}${color4}${if_match ${time %M} == 56}${color}${else}${color4}${if_match ${time %M} == 57}${color}${else}${color4}${if_match ${time %M} == 58}${color}${else}${color4}${if_match ${time %M} == 59}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${color4}=
${color7}${font DejaVu Sans Mono:bold:size=8}${goto 18}Min x10${goto 110}Day x10${font}${color}
${if_match ${time %M} == 01}${color}${else}${color4}${if_match ${time %M} == 11}${color}${else}${color4}${if_match ${time %M} == 21}${color}${else}${color4}${if_match ${time %M} == 31}${color}${else}${color4}${if_match ${time %M} == 41}${color}${else}${color4}${if_match ${time %M} == 51}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %M} == 02}${color}${else}${color4}${if_match ${time %M} == 12}${color}${else}${color4}${if_match ${time %M} == 22}${color}${else}${color4}${if_match ${time %M} == 32}${color}${else}${color4}${if_match ${time %M} == 42}${color}${else}${color4}${if_match ${time %M} == 52}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %M} == 03}${color}${else}${color4}${if_match ${time %M} == 13}${color}${else}${color4}${if_match ${time %M} == 23}${color}${else}${color4}${if_match ${time %M} == 33}${color}${else}${color4}${if_match ${time %M} == 43}${color}${else}${color4}${if_match ${time %M} == 53}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${goto 101}${if_match ${time %d} == 01}${color}${else}${color4}${if_match ${time %d} == 11}${color}${else}${color4}${if_match ${time %d} == 21}${color}${else}${color4}${if_match ${time %d} == 31}${color}${else}${color4}${if_match ${time %d} == 41}${color}${else}${color4}${if_match ${time %d} == 51}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %d} == 02}${color}${else}${color4}${if_match ${time %d} == 12}${color}${else}${color4}${if_match ${time %d} == 22}${color}${else}${color4}${if_match ${time %d} == 32}${color}${else}${color4}${if_match ${time %d} == 42}${color}${else}${color4}${if_match ${time %d} == 52}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %d} == 03}${color}${else}${color4}${if_match ${time %d} == 13}${color}${else}${color4}${if_match ${time %d} == 23}${color}${else}${color4}${if_match ${time %d} == 33}${color}${else}${color4}${if_match ${time %d} == 43}${color}${else}${color4}${if_match ${time %d} == 53}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}=
${if_match ${time %M} == 04}${color}${else}${color4}${if_match ${time %M} == 14}${color}${else}${color4}${if_match ${time %M} == 24}${color}${else}${color4}${if_match ${time %M} == 34}${color}${else}${color4}${if_match ${time %M} == 44}${color}${else}${color4}${if_match ${time %M} == 54}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %M} == 05}${color}${else}${color4}${if_match ${time %M} == 15}${color}${else}${color4}${if_match ${time %M} == 25}${color}${else}${color4}${if_match ${time %M} == 35}${color}${else}${color4}${if_match ${time %M} == 45}${color}${else}${color4}${if_match ${time %M} == 55}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %M} == 06}${color}${else}${color4}${if_match ${time %M} == 16}${color}${else}${color4}${if_match ${time %M} == 26}${color}${else}${color4}${if_match ${time %M} == 36}${color}${else}${color4}${if_match ${time %M} == 46}${color}${else}${color4}${if_match ${time %M} == 56}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${goto 101}${if_match ${time %d} == 04}${color}${else}${color4}${if_match ${time %d} == 14}${color}${else}${color4}${if_match ${time %d} == 24}${color}${else}${color4}${if_match ${time %d} == 34}${color}${else}${color4}${if_match ${time %d} == 44}${color}${else}${color4}${if_match ${time %d} == 54}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %d} == 05}${color}${else}${color4}${if_match ${time %d} == 15}${color}${else}${color4}${if_match ${time %d} == 25}${color}${else}${color4}${if_match ${time %d} == 35}${color}${else}${color4}${if_match ${time %d} == 45}${color}${else}${color4}${if_match ${time %d} == 55}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %d} == 06}${color}${else}${color4}${if_match ${time %d} == 16}${color}${else}${color4}${if_match ${time %d} == 26}${color}${else}${color4}${if_match ${time %d} == 36}${color}${else}${color4}${if_match ${time %d} == 46}${color}${else}${color4}${if_match ${time %d} == 56}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}=
${if_match ${time %M} == 07}${color}${else}${color4}${if_match ${time %M} == 17}${color}${else}${color4}${if_match ${time %M} == 27}${color}${else}${color4}${if_match ${time %M} == 37}${color}${else}${color4}${if_match ${time %M} == 47}${color}${else}${color4}${if_match ${time %M} == 57}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %M} == 08}${color}${else}${color4}${if_match ${time %M} == 18}${color}${else}${color4}${if_match ${time %M} == 28}${color}${else}${color4}${if_match ${time %M} == 38}${color}${else}${color4}${if_match ${time %M} == 48}${color}${else}${color4}${if_match ${time %M} == 58}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %M} == 09}${color}${else}${color4}${if_match ${time %M} == 19}${color}${else}${color4}${if_match ${time %M} == 29}${color}${else}${color4}${if_match ${time %M} == 39}${color}${else}${color4}${if_match ${time %M} == 49}${color}${else}${color4}${if_match ${time %M} == 59}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${goto 101}${if_match ${time %d} == 07}${color}${else}${color4}${if_match ${time %d} == 17}${color}${else}${color4}${if_match ${time %d} == 27}${color}${else}${color4}${if_match ${time %d} == 37}${color}${else}${color4}${if_match ${time %d} == 47}${color}${else}${color4}${if_match ${time %d} == 57}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %d} == 08}${color}${else}${color4}${if_match ${time %d} == 18}${color}${else}${color4}${if_match ${time %d} == 28}${color}${else}${color4}${if_match ${time %d} == 38}${color}${else}${color4}${if_match ${time %d} == 48}${color}${else}${color4}${if_match ${time %d} == 58}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}= ${if_match ${time %d} == 09}${color}${else}${color4}${if_match ${time %d} == 19}${color}${else}${color4}${if_match ${time %d} == 29}${color}${else}${color4}${if_match ${time %d} == 39}${color}${else}${color4}${if_match ${time %d} == 49}${color}${else}${color4}${if_match ${time %d} == 59}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}=
${color7}${font DejaVu Sans Mono:bold:size=8}${goto 28}Min${goto 125}Day${font}${color}

${font DejaVu Sans Mono:bold:size=8}years${font}${color}
${if_match ${time %y} == 10}${color}${else}${color4}${if_match ${time %y} == 11}${color}${else}${color4}${if_match ${time %y} == 21}${color}${else}${color4}${if_match ${time %y} == 31}${color}${else}${color4}${if_match ${time %y} == 41}${color}${else}${color4}${if_match ${time %y} == 51}${color}${else}${color4}${if_match ${time %y} == 61}${color}${else}${color4}${if_match ${time %y} == 71}${color}${else}${color4}${if_match ${time %y} == 81}${color}${else}${color4}${if_match ${time %y} == 91}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %y} == 02}${color}${else}${color4}${if_match ${time %y} == 12}${color}${else}${color4}${if_match ${time %y} == 22}${color}${else}${color4}${if_match ${time %y} == 32}${color}${else}${color4}${if_match ${time %y} == 42}${color}${else}${color4}${if_match ${time %y} == 52}${color}${else}${color4}${if_match ${time %y} == 62}${color}${else}${color4}${if_match ${time %y} == 72}${color}${else}${color4}${if_match ${time %y} == 82}${color}${else}${color4}${if_match ${time %y} == 92}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %y} == 03}${color}${else}${color4}${if_match ${time %y} == 13}${color}${else}${color4}${if_match ${time %y} == 23}${color}${else}${color4}${if_match ${time %y} == 33}${color}${else}${color4}${if_match ${time %y} == 43}${color}${else}${color4}${if_match ${time %y} == 53}${color}${else}${color4}${if_match ${time %y} == 63}${color}${else}${color4}${if_match ${time %y} == 73}${color}${else}${color4}${if_match ${time %y} == 83}${color}${else}${color4}${if_match ${time %y} == 93}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${goto 101}${if_match ${time %y} == 01}${color}${else}${color4}${if_match ${time %y} == 11}${color}${else}${color4}${if_match ${time %y} == 21}${color}${else}${color4}${if_match ${time %y} == 31}${color}${else}${color4}${if_match ${time %y} == 41}${color}${else}${color4}${if_match ${time %y} == 51}${color}${else}${color4}${if_match ${time %y} == 61}${color}${else}${color4}${if_match ${time %y} == 71}${color}${else}${color4}${if_match ${time %y} == 81}${color}${else}${color4}${if_match ${time %y} == 91}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %y} == 02}${color}${else}${color4}${if_match ${time %y} == 12}${color}${else}${color4}${if_match ${time %y} == 32}${color}${else}${color4}${if_match ${time %y} == 32}${color}${else}${color4}${if_match ${time %y} == 42}${color}${else}${color4}${if_match ${time %y} == 52}${color}${else}${color4}${if_match ${time %y} == 62}${color}${else}${color4}${if_match ${time %y} == 72}${color}${else}${color4}${if_match ${time %y} == 82}${color}${else}${color4}${if_match ${time %y} == 92}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}= ${if_match ${time %y} == 03}${color}${else}${color4}${if_match ${time %y} == 13}${color}${else}${color4}${if_match ${time %y} == 23}${color}${else}${color4}${if_match ${time %y} == 33}${color}${else}${color4}${if_match ${time %y} == 43}${color}${else}${color4}${if_match ${time %y} == 53}${color}${else}${color4}${if_match ${time %y} == 63}${color}${else}${color4}${if_match ${time %y} == 73}${color}${else}${color4}${if_match ${time %y} == 83}${color}${else}${color4}${if_match ${time %y} == 93}${color}${else}${color4}${endif}${endif}${endif }${endif}${endif}${endif}${endif}${endif}${endif}$ {endif}=
${font DejaVu Sans Mono:bold:size=8}years${font}${color}

${color7}${font DejaVu Sans Mono:bold:size=8}${goto 28}Yr x10${goto 125}Yr${font}${color}
${if_match ${cpu cpu1} >0}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >10}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >20}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >30}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >40}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >50}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >60}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >70}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >80}${color}${else}${color4}${endif}=${if_match ${cpu cpu1} >90}${color}${else}${color4}${endif}=
${color7}${font DejaVu Sans Mono:bold:size=8}${goto 28}C P U${font}${color}
${if_match ${memperc} >0}${color}${else}${color4}${endif}=${if_match ${memperc} >10}${color}${else}${color4}${endif}=${if_match ${memperc} >20}${color}${else}${color4}${endif}=${if_match ${memperc} >30}${color}${else}${color4}${endif}=${if_match ${memperc} >40}${color}${else}${color4}${endif}=${if_match ${memperc} >50}${color}${else}${color4}${endif}=${if_match ${memperc} >60}${color}${else}${color4}${endif}=${if_match ${memperc} >70}${color}${else}${color4}${endif}=${if_match ${memperc} >80}${color}${else}${color4}${endif}=${if_match ${memperc} >90}${color}${else}${color4}${endif}=
${color7}${font DejaVu Sans Mono:bold:size=8}${goto 28}MEMORY${font}${color}


As you can see it's very heavy on "if_matching" even for the time it's a lot..

Any help appreciated.
Bruce

wlourf
February 6th, 2010, 04:29 PM
Hey wlourf,

Congrats for your conky.

I was trying to make it work in my desktop (latest version)
and I've got a problem.

Things are doing fine and calendar is working
but when I click out of its layer, it disappears.
(see attachment, the layer's end is visible on the right)

(btw, I don't know if it matters but I changed the size to 300x800 for other conky's sake)

I think you have changed some things in your conkyrc, especially in the window block :

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,belowcan you check or post your conkyrc?

wlourf
February 6th, 2010, 05:44 PM
As you can see it's very heavy on "if_matching" even for the time it's a lot..

Any help appreciated.
Bruce

Hi Bruce, I don't answer to your question but as your conky seems very hard to read, did you try to use Lua to achieve what you want.
Here is a small example for a clock that is more readable !

The conkyrc (just set the path at the line lua_load ~/scripts/test/dots.lua):

background no
own_window yes
own_window_type normal
own_window_transparent no
own_window_hints skip_taskbar,skip_pager
own_window_title DotsBox
use_xft yes
xftalpha 1
update_interval 1.0
total_run_times 0
double_buffer yes
minimum_size 200 100
maximum_width 200
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment br
gap_x 30
gap_y 65
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

# Colors
default_color 7FFF00 #Chartreuse

# -- Lua load -- #
lua_load ~/scripts/test/dots.lua
lua_draw_hook_pre main

TEXT
${time}




H Mx10 Sthe lua script :

require 'cairo'

function draw_block(nb_cols,nb_rows,off_x,off_y,delta_x,del ta_y,value)
local idx=-1
for yi=1,nb_rows do
for xi=1,nb_cols do
idx=idx+1
if idx==value then
cairo_set_source_rgba(cr,1,0,0,1)
else
cairo_set_source_rgba(cr,0,0,1,1)
end
cairo_move_to(cr,off_x+xi*delta_x,off_y+yi*delta_y )
cairo_show_text(cr,"=")
end
end
end

function conky_main()
if conky_window==nil then return end
local w=conky_window.width
local h=conky_window.height
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, w, h)
cr=cairo_create(cs)

cairo_set_source_rgba(cr,1,0,0,1)
cairo_select_font_face(cr,"webdings",
CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD)

local hours=tonumber(os.date("%H"))
if hours>12 then hours=hours-12 end --another way to do this
local mins=math.floor(os.date("%M")/10,0)
local secs=math.floor(os.date("%S")/5,0)
draw_block(3,4,10,30,15,15,hours)
draw_block(3,2,60,30,15,15,mins)
draw_block(3,4,110,30,15,15,secs)

cairo_stroke(cr)
cairo_destroy(cr)
endhth !

varsamakos
February 6th, 2010, 06:04 PM
I think you have changed some things in your conkyrc, especially in the window block :

own_window yes
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,belowcan you check or post your conkyrc?

I didn't. I took it directly from your files.
Here it is :


# -- Conky settings -- #
background no
update_interval 5

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 desktop
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 800

alignment tl
gap_y 0
gap_x 0

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=12
xftalpha 0.8

uppercase yes

default_color FFFFFF

# -- Lua load -- #
lua_load ~/.scripts/calendar.lua
lua_draw_hook_pre main

TEXT

wlourf
February 6th, 2010, 07:23 PM
hi varsamakos
Sorry, I tried the script with gnome and openbox but didn't manage to reproduce your problem. (with conky 1.7.2).:-(

varsamakos
February 6th, 2010, 07:41 PM
I'm running conky in version 1.8.0
maybe I should downgrade ?

Edit:
Just tested with 1.7.2.
Same problem :/

a click out of layer and ...
http://www.youtube.com/watch?v=i71Gg1njyTQ

Bruce M.
February 6th, 2010, 08:10 PM
Hi Bruce, I don't answer to your question but as your conky seems very hard to read, did you try to use Lua to achieve what you want.
Here is a small example for a clock that is more readable !

I've seen that somewhere, but can's figure out the seconds on that one. :)

Besides, I didn't want to use LUA for this.

Have a nice day.
Bruce

Bruce M.
February 6th, 2010, 08:58 PM
echo $(date +%y) |cut -c1
will give you decade


echo $(date +%y) |cut -c2
will give you year in that decade

Thanks dk75, it works great in a terminal. :)

I REALLY REALLY hate being "script deficient" and having too much on my plate at this stage of my life to learn.


# Colors
default_color 7FFF00 #Chartreuse
color0 FFFFF0 #Ivory
color1 FFA07A #LightSalmon
color2 FF8C00 #Darkorange
color3 7FFF00 #Chartreuse
color4 778899 #LightSlateGrey
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
# colours below used by colorize script
color7 48D1CC #MediumTurquoise
color8 FFFF00 #Yellow
color9 FF0000 #Red

TEXT
${font webdings: size=12}
${color}= ${color4}= =${goto 101}= = =
= = =${goto 101}= = =
= = =${goto 101}= = =${color}
${color7}${font DejaVu Sans Mono:bold:size=8}${goto 28}Yr x10${goto 125}Yr${font}${color}

=
${if_match {echo $(date +%y) |cut -c1} == 1}${color}${else}${color4}${endif}=
${if_match {echo $(date +%y) |cut -c1} == 2}${color}${else}${color4}${endif}=
${font}

Hard coded above just to display (20)10

That first = should be green and is,
the second should be green and is
the third should be grey, it's green :(

Maybe that command doesn't work inside an "if_matching" command.

Did I say that I hate being "script deficient"?

Any ideas?

Have a nice day
Bruce

PS Have to run, back tomorrow

mobilediesel
February 7th, 2010, 08:24 AM
Don't want the century, just the "decade" and the "year" number For example next year will be 2011 so I need it to look like:



and in 2012


X 0 0 0 X 0
0 0 0 0 0 0
0 0 0 0 0 0

and "!=" would be a case of another 100 commands. :(

Have a nice day
Bruce

Is this possibly what you are looking for?
146298
If so, for lack of a better name, dotdatetime.sh (http://dl.dropbox.com/u/1055489/scripts/dotdatetime.sh) is what I called it. It might still need some tweaking to the text alignment.

#!/bin/bash
################################################## ##########
# This work is licensed under the Creative Commons #
# Attribution-Share Alike 3.0 Unported License. #
# To view a copy of this license, visit #
# http://creativecommons.org/licenses/by-sa/3.0/ #
# or send a letter to Creative Commons, 171 Second Street, #
# Suite 300, San Francisco, California, 94105, USA. #
################################################## ##########
cd $(dirname $0)
DATE=$(date +%y%m%d%I%M)
CURRENT="\${color 7FFF00}"
DEFAULT="\${color 778899}"
TEXT="\${color 48D1CC}"
MONTH=${DATE:2:2}
HOUR=${DATE:6:2}
YEAR10C[${DATE:0:1}]="$CURRENT"
YEARC[${DATE:1:1}]="$CURRENT"
MONTHC[${MONTH/#0/}]="$CURRENT"
DAY10C[${DATE:4:1}]="$CURRENT"
DAYC[${DATE:5:1}]="$CURRENT"
HOURC[${HOUR/#0/}]="$CURRENT"
MIN10C[${DATE:8:1}]="$CURRENT"
MINC[${DATE:9:1}]="$CURRENT"
YEAR10R[${DATE:0:1}]="$DEFAULT"
YEARR[${DATE:1:1}]="$DEFAULT"
MONTHR[${MONTH/#0/}]="$DEFAULT"
DAY10R[${DATE:4:1}]="$DEFAULT"
DAYR[${DATE:5:1}]="$DEFAULT"
HOURR[${HOUR/#0/}]="$DEFAULT"
MIN10R[${DATE:8:1}]="$DEFAULT"
MINR[${DATE:9:1}]="$DEFAULT"
echo -n "\${font webdings:size=12}$DEFAULT"
for n in 1 4 7 10; do
for i in $(seq $n $[n+2]); do
echo -n "${HOURC[$i]}=${HOURR[$i]} "
done
echo -n "\${goto 101}"
for i in $(seq $n $[n+2]); do
echo -en "${MONTHC[$i]}=${MONTHR[$i]} "
done
echo
done
echo "$TEXT\${font DejaVu Sans Mono:bold:size=8}\${goto 25}Hour\${goto 115}Month\${font webdings:size=12}$DEFAULT"
for n in 1 2 3; do
echo -n "${MIN10C[$n]}=${MIN10R[$n]} "
done
echo -n "\${goto 101}"
for n in 1 2 3; do
echo -n "${DAY10C[$n]}=${DAY10R[$n]} "
done
echo
for n in 4 5 6; do
echo -n "${MIN10C[$n]}=${MIN10R[$n]} "
done
echo -e "\n$TEXT\${font DejaVu Sans Mono:bold:size=8}\${goto 18}Min x10\${goto 110}Day x10\${font webdings:size=12}$DEFAULT"
for n in 1 4 7; do
for i in $(seq $n $[n+2]); do
echo -n "${MINC[$i]}=${MINR[$i]} "
done
echo -n "\${goto 101}"
for i in $(seq $n $[n+2]); do
echo -en "${DAYC[$i]}=${DAYR[$i]} "
done
echo
done
echo "$TEXT\${font DejaVu Sans Mono:bold:size=8}\${goto 28}Min\${goto 125}Day\${font webdings:size=12}$DEFAULT"
for n in 1 4 7; do
for i in $(seq $n $[n+2]); do
echo -n "${YEAR10C[$i]}=${YEAR10R[$i]} "
done
echo -n "\${goto 101}"
for i in $(seq $n $[n+2]); do
echo -en "${YEARC[$i]}=${YEARR[$i]} "
done
echo
done
echo "$TEXT\${font DejaVu Sans Mono:bold:size=8}\${goto 28}Year x10\${goto 110}Year$DEFAULT"

wlourf
February 7th, 2010, 12:50 PM
I'm running conky in version 1.8.0
maybe I should downgrade ?

Edit:
Just tested with 1.7.2.
Same problem :/

a click out of layer and ...
http://www.youtube.com/watch?v=i71Gg1njyTQ
this is a private video, it seems that I can't play it, even with my youtube account ...

Edit : I saw the video, and I already understood the problem but I can't fix it since I can't reproduce it, sorry about that, try google with "conky disappear click"

varsamakos
February 7th, 2010, 02:10 PM
My bad. It's ok now.
Note : @0.12 I just clicked in destkop.

mobilediesel
February 7th, 2010, 06:55 PM
${font webdings:size=12}

I should point out that the webdings font is part of the msttcorefonts (http://packages.ubuntu.com/search?searchon=names&keywords=msttcorefonts) package which is in the Ubuntu Multiverse repositories.

I discovered that when I tried the script on my wife's computer and it showed a bunch of equal signs instead of dots.

dotdatetime.sh (http://dl.dropbox.com/u/1055489/scripts/dotdatetime.sh) has been updated a couple times since I first posted it. Minor stuff.

dk75
February 8th, 2010, 09:42 PM
I'm running conky in version 1.8.0
maybe I should downgrade ?

Edit:
Just tested with 1.7.2.
Same problem :/

a click out of layer and ...
http://www.youtube.com/watch?v=i71Gg1njyTQ

set some variables in conkyrc to

own_window_type normal

own_window_class Conky

own_window_title Conky

install Compiz configuration

sudo apt-get install compizconfig-settings-manager

go to "General Options" and there to "Focus & Raise Behaviour", disable "Auto raise" and set "Focus Prevention Window" to

!(class=Polkit-gnome-authentication-agent-1) | class=Nautilus | class=Conky

and if you use "Add Helper" plugin then go to it's settings, "Misc. Options", then in "Window Types" add this to default string

& !(class=Gimp-2.6 | class=Conky)

varsamakos
February 8th, 2010, 11:59 PM
It works :)
Thanks dk75 !

I've added the variables and changed Focus Prevention Window value.

One last question. Which variable makes calendar's layer
look like it's a bit above the rest of my desktop ?
I mean, the line where each layer ends.

wlourf
February 9th, 2010, 08:09 PM
well done dk75 !
@varsamakos, I'm not sure to understand your question, did you try to change hgradient (like in picture attached) ?

varsamakos
February 9th, 2010, 08:55 PM
Here it is :
http://www.ubuntu-pics.de/thumb/41787/screenshot_001_OxdJaI.png (http://www.ubuntu-pics.de/bild/41787/screenshot_001_OxdJaI.png)

It looks like it's above the desktop.
You can see the difference in wallpaper.

wlourf
February 9th, 2010, 09:38 PM
Hello again varsamakos,

In your conky you have :

alignment tl
gap_y 0
gap_x 0which mean top-left alignment, but you have also a taskbar in the top of your window, so you probably should add a gap greater than the height of your taskbar.
And if your screen is 800 pixels height, just reduce the minimum_size and use alignment bl

At least, you should have :


alignment tl
gap_y 50
gap_x 0
minimum_size 300 750
or


alignment bl
gap_y 00
gap_x 0
minimum_size 300 750
Way to perfection is not so easy :p
I don't use taskbar so I didn't notice this behaviour, but I reproduced after adding some taskbars, maybe dk75 has a trick to change this behaviour!

PS. I've tested that with own_window_type set to desktop or normal

dmillerct
February 9th, 2010, 09:41 PM
Here it is :
http://www.ubuntu-pics.de/thumb/41787/screenshot_001_OxdJaI.png (http://www.ubuntu-pics.de/bild/41787/screenshot_001_OxdJaI.png)

It looks like it's above the desktop.
You can see the difference in wallpaper.

Try this:

http://conky.linux-hardcore.com/?page_id=3744

dk75
February 9th, 2010, 11:13 PM
strange, I have shadow for any window but Conky don't have it... could it be

own_window_argb_visual yes
in conkyrc v1.8.0rc1?

varsamakos
February 9th, 2010, 11:30 PM
A change in gap_y (30px in my case) variable did the trick :)
Before that, the change in compiz's shadow didn't make any change.

Thank you guys :)

wlourf
February 12th, 2010, 12:20 AM
Hello again.

I wrote a new widget (a bar graph like on old equalizers) but fully configurable as you can see on the pictures.
Any feedback is welcome if you try it (or don't !)

Edit 28 Feb 2010 : the widget is renamed to bargraph
Edit 03 March 2010 : the bargraph can be drawn on a circular way
Edit 14 July 2010 : add reflection parameter and set-u are now made in a table, it's more easy to configure.

Last version of the script can be downloaded on deviantArt : http://wlourf.deviantart.com/gallery/?offset=0#/d2jj1rz

Bruce M.
February 12th, 2010, 12:32 AM
Hello again.

I wrote a new widegt (a bar graph like on old equalizers) but fully configurable as you can see on the pictures.
Any feedback is welcome if you try it (or don't !)

w.

Now that's GREAT!

Very nice work.

+1 for you.

Have a nice day.
Bruce

dmillerct
February 12th, 2010, 02:39 AM
Hello again.

I wrote a new widegt (a bar graph like on old equalizers) but fully configurable as you can see on the pictures.
Any feedback is welcome if you try it (or don't !)

w.

Very impressive!

wlourf
February 12th, 2010, 10:32 PM
thanks ! if you try it on your own, it would be nice to see a capture !

Edit : just for fun (because it can use too much cpu) , a moving equalizer : video here (http://www.youtube.com/watch?v=qv7IvnRWdvo)

wlourf
February 21st, 2010, 11:23 PM
Hi all,

While I was working on an equalizer widget, I tried an audio equalizer for conky. Well, it was easy because the work was already done for a screenlet for gnome (Impulse):
https://launchpad.net/impulse.bzr

So the work was only to adapt scripts from python to lua. I've done it for two "themes" default and circle like on the picture.

If you want to try it, you have to set the path in the conkyrc (all variables are set in conkyrc so there is no need to make any changes in the lua script)

And you need to download the C library from the Impulse web site :
http://gnome-look.org/content/show.php/?content=99383
just copy impulse.so and libimpulse.so into the script folder.

the Lua script call the python script, in fact I use this line because i didn't find a better way to do it, so if you have any ideas !
conky_parse('${exec python impulse.py'}')

In the tar.gz, there is the conkyrc, the lua and python scripts and the two librairies .so.

If you have any question, don't hesitate.

Edit 28 Feb. 2010 : with the help of the auhor of Impulse, I managed to make something faster ! You can see here (http://www.youtube.com/watch?v=hP9Wt7YKoHM) in action but the sound is crap, sorry for your ears...
I also added peaks like on the video and it is possible to use this widget with the bargraph widget I made a few weeks ago

Edit 10 March 2010 : the conkyrc can be called with an absolute path.
I added last version of the bargraph widget which can be drawn on a circular way.
And another video (http://www.youtube.com/watch?v=rcM9nTKeC74&feature=channel) with better sound

airtonix
February 22nd, 2010, 01:22 AM
As I post my entry for the January's CotM here, I just want to say THANKS to all people who vote for my conky script because I won this contest !!
Also I updated this script, with :
- today's date can now be set anywere in the arc : yoffset
- today's date can now have an offset (positive or negative) : xoffset
- the main thing is that the calendar is draw only at the start of the conky and when the date change (i.e. the calendar is saved in a PNG file and this is this file that will be displayed in the conky) or if the PNG file is deleted : so the conky become really really fast ...
- it can be drawn on the right side of the screen
(more info on my blog)

See you in February maybe :p
Some great work , but unfortunately it does not work without some fixing :


~/Desktop/calendar_wheel_1.2a$ conky -c conky-calendar
>>>>>> Conky: conky-calendar: 19: config file error
>1. >> Conky: llua_load: cannot open /home/airtonix/scripts/cal1.2/calendar.lua: No such file or directory
Conky: desktop window (1e00276) is subwindow of root window (157)
Conky: window type - normal
Conky: drawing to created window (0x5000001)
Conky: drawing to double buffer
> 2. >> Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
...
etc
etc
etc
...

$ conky -v
Conky 1.7.2 compiled Fri Oct 23 15:55:48 UTC 2009 for Linux 2.6.24-23-server (i686)

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

X11:
* Xdamage extension
* XDBE (double buffer extension)
* Xft

Music detection:
* MPD
* MOC

General:
* math
* hddtemp
* portmon
* Curl
* RSS
* Weather (METAR)
* Weather (XOAP)
* wireless
* support for IBM/Lenovo notebooks
* nvidia
* eve-online
* config-output
* Imlib2
* ALSA mixer support
* apcupsd
* iostats
* Lua

Lua bindings:
* Cairo
* Imlib2
also two things :

1. conky-calendar
@line48 :

lua_load ~/scripts/cal1.2/calendar.luachange to :

lua_load ./calendar.lua>> assume the lua file will sit in the same place as the conky script.
>> otherwise you'll need to start creating a README file. to explain why the files need to be split all over the drive and what happens if you do or don't.

2. calendar.lua
@ line31 :
calendar_file="/home/wlourf/scripts/cal1.2/calendar.txt" change to :


local current_directory=assert( io.popen('pwd'):read("*l") )
calendar_file= current_directory .. "/calendar.txt"
>> again, assume all required files to make mod/addon/widget/etc work are to be in the same directory.



all the required files in the same place make the thing more portable... with these changes I was able to get it working.

wlourf
February 22nd, 2010, 09:14 PM
Thanks airtonix, I updated the tar.gz on this post, and added a README ;-):
http://ubuntuforums.org/showpost.php?p=8782789&postcount=147

Also I would like to show you a nice use of this calendar on ubuntu.ru forums:
http://forum.ubuntu.ru/index.php?topic=63273.msg638103#msg638103
the widgets used for this picture are :
Conky Widgets by londonali1010 (2009) - часы и кольца
Conky vertical bar graph by iggykoopa - горизонтальный и вертикальный бары
Shadowed clock by wlourf (10 jan. 2010) - стрелки часов с тенью
calendar wheel by Wlourf (14 jan. 2010) - календарь

and the result is this nice picture, isn't it ?
http://static.itmages.ru/i/10/0220/h_1266658020_47855c759d.png (http://itmages.ru/)

mobilediesel
February 22nd, 2010, 09:24 PM
Thanks airtonix, I updated the tar.gz on this post, and added a README ;-):
http://ubuntuforums.org/showpost.php?p=8782789&postcount=147

Also I would like to show you a nice use of this calendar on ubuntu.ru forums:
and the result is this nice picture, isn't it ?
http://static.itmages.ru/i/10/0220/h_1266658020_47855c759d.png (http://itmages.ru/)

Now I gotta go and upgrade my system so it will support Lua so the newr conky will work. That is just *awesome*

miegiel
February 22nd, 2010, 09:32 PM
...

and the result is this nice picture, isn't it ?
http://static.itmages.ru/i/10/0220/h_1266658020_47855c759d.png (http://itmages.ru/)

Definitely, I was really impressed by the one you posted on the conky blog for conky of the month. Well, impressed by the innovative way to make the calender. To be honest I did think it looked a bit ... euhm ... ugly (sorry :roll:). This one is innovative and looks great. :D

wlourf
February 22nd, 2010, 09:50 PM
Definitely, I was really impressed by the one you posted on the conky blog for conky of the month. Well, impressed by the innovative way to make the calender. To be honest I did think it looked a bit ... euhm ... ugly (sorry :roll:). This one is innovative and looks great. :D

lol !
Don't be sorry, tastes and colors, you know ... but in changing a few parameters you can adjust it to your taste! if you like the circular shape of course ! :D
Have a nice day

mrpeachy
February 23rd, 2010, 03:24 AM
I thought I would share some of the things I've been working on.
I do my conky tinkering on the backwaters of the crunchbanglinux website :D

anyway, a couple of things you might be interested in:

circlewriting
http://omploader.org/tM2w4NQ (http://omploader.org/vM2w4NQ)
details on my blog: http://thepeachyblog.blogspot.com/2010/02/i-have-improved-my-circlewriting.html
(EDIT - I see this has already been put to good use in previous posts :) . I really ought to start writing intros for my scripts)

alternate graphs
http://omploader.org/tM21qaA (http://omploader.org/vM21qaA)
you can change the direction that the graph moves in, colors, bar thickness and spacing, have gridlines on or off and graph height and you can edit a setting to get either bars up only, bars down only or bars up and down
http://thepeachyblog.blogspot.com/2010/02/alternate-graphs.html

You can also see my flower conky entry for the valentines conky of the month via the comments on the conky blog
http://blog.conky.be/2010/02/03/februarys-cotm-competition-st-valentines-daymassacre/#comments

degan
February 24th, 2010, 07:59 PM
Hi boys....:D

I would want to make a conky.lua as this.

http://upload.centerzone.it/images/73369541832206811637_thumb.jpg (http://upload.centerzone.it/viewer.php?file=73369541832206811637.png)

Instead of visualizing the various dates, I would want to visualize departing from the tall one:

root
home
cpu
ram
ecc
ecc............

Can you help me?

Sets the conky & the .lua to be modified...

Thanks

................

.conkyrc


# -- Conky settings -- #
background no
update_interval 5

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 desktop
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 800

alignment tl
gap_y 0
gap_x 0

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=12
xftalpha 0.8

uppercase yes

default_color FFFFFF

# -- Lua load -- #
lua_load /Scrivania/deegan.lua
lua_draw_hook_pre main

TEXT

.lua


--[[
calendar wheel by Wlourf (14 jan. 2010)

This script is designed to draw dates on a circular way on the left of the screen.
Some text info can be added in the circle with the file calendar.txt (see below)
Some parameters (colors, sizes ... ) can be adjusted (see below).

As this script draw a png file only if necessary, a short update of the conky can be used.

Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/calendar.lua):
lua_load ~/scripts/calendar.lua
lua_draw_hook_pre main


v1.0 - 14 jan. 2010 - Original release
v1.1 - 19 jan. 2010 - Calendar are now drawn in an PNG file and this file
is called at every conky call, when day change, a new PNG file is created.
- An x offset can be added to "Today's block"
- An y offset can be added too to "Today's block"
v1.2 - 28 jan. 2010 - Calendar can be drawn on the right side of the conky (but without text info)
- Calendar is drawn after the second conky refresh only
v1.2a - 29 jan. 2010 - Minor update, picture was refresh every second instead of every day
v1.3 - 22 Feb. 2010 - calendar.txt is now relative to this script path


]]

require 'cairo'
require 'imlib2'

-------------------------- parameters (part one) are set here -----------------------------------

--text file calendar (in the folder of this script
local current_directory=assert( io.popen('pwd'):read("*l") )
calendar_file= current_directory .. "/calendar.txt"
--format of in this text file
--MMDD;N;TEXT
--MMDD = month day
--N = 0 or 1 (1 to display same colors as week-ends)
--TEXT = Text to display (use * for multiline)

--some paths to images created (absolutes paths)
image_tmp="/tmp/img_tmp.png" --used to rotate a single date
image_calendar="/tmp/conky-calendar-arc.png"
image_dates="/tmp/conky-calendar-dates.png"

--more parameters below
-------------------------- end of parameters (part one) -----------------------------------


function string:split(delimiter)
--source for the split function : http://www.wellho.net/resources/ex.php4?item=u108/split
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end


function conky_draw_calendar()
if conky_window==nil then return end
local width=conky_window.width
local height=conky_window.height

--sometimes, there is problem with init and width & height are set to 0 or 2 !!
if width<3 or height<3 then return end

local cs=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height)
local cr=cairo_create(cs)

-------------------------- parameters (part two) are set here -----------------------------------

-- vertical center of the circle (height/2 for centered circle)
local yc=height/2

--number of days to display before and after today (i.e. with range = 30 --> 60 days are displayed)
--even number between 20 and 30 for nice effect
local range = 20

--not sure of the engish words so I leave then in french !
--fleche (arrow) is the segment from x=0 to x=radius-xc (with xc =center of the circle)
--fleche for the external circle
--fleche2 for the internal circle
--fleche2 must be < fleche
local fleche=150
local fleche2=fleche*.5

--corde (chord) is the vertical segment (where x=0) of the external circle
local corde = height

--colors RGB (0-255)
--week day
local wday={50,50,255}
--week-end and bank holidays defined in calendar.txt
local eday={255,255,126}
--color of today
local dday={255,0,0}

--vertical gradient (both circle and dates)? (true/false)
local vgradient=true

--horizontal gradient for the circle? (0 to 1, 0 is the best choice for "moon like" circle )
local hgradient=0

--you can change the font here
local font="Japan"
--font_size (of dates) must be less than delta (= heigth of a day)
local delta = yc/(range+0.5)
--the font-size has to be adjusted depending on the font used
local font_size=delta-2

--information text (from calendar.txt)
local info_color={0,255,204}
--font size of text infos
local font_size_info=font_size

--today_xoffset is the offset for the date of today (can be positive/null/negative, in pixels)
local today_xoffset=10

--today_yoffset where today will be displayed (value between -range to + range)?
-- 0 = center of the arc
-- -range = top of the arc
-- +range = bottom of the arc
local today_yoffset=-9

--display on right side of the screen (true/false)
local align_right = false

-------------------------- end of the parameters, ouf -----------------------------------

--some calculations
--radius for external circle
--radius2 for internal circle
--delta = number of arcs in the circle
local radius=(corde^2+4*fleche^2)/(8*fleche)
local radius2=(corde^2+4*fleche2^2)/(8*fleche2)
local decal=2*(delta-font_size)
wday[1]=wday[1]/255
wday[2]=wday[2]/255
wday[3]=wday[3]/255
eday[1]=eday[1]/255
eday[2]=eday[2]/255
eday[3]=eday[3]/255

--xc =x center of external circle
--xc2=x center of internal circle
local xc = fleche - radius
local xc2 = fleche2 - radius2

if align_right then
xc = width-xc
xc2 = width-xc2
end

local h_txt = height/(2*range+1)

local t = os.date('*t') -- date in table
--get the date
local s = os.time(t) -- date in seconds

--read the calendar file
local file = io.open(calendar_file,"r")
local tabcal={}
local idx=1
local line,lineok="",""
if file ~= nil then
while true do
line = file:read("*l")
if line == nil then break end
lineok = string.split(line,";")
if (#lineok)==3 then
tabcal[idx]={lineok[1],lineok[2],lineok[3]}
idx=idx+1
end
end
end
io.close()
local angmini=math.atan((corde/2)/(radius-fleche))

local imageDates=imlib_create_image(width,height)
imlib_context_set_image(imageDates)
imlib_image_set_has_alpha(1)
imlib_save_image(image_dates)

for i=-range,range do
local s2 = s + 3600*24*(i-today_yoffset) --date diff in seconds

local wd = os.date("%w",s2)
local md = os.date("%m%d",s2)
local dt = os.date("%a. %d %b.",s2),os.date("%d",s2),os.date("%b",s2)

--percentage of vertical gradient
local pc = (range-math.abs(i))/range
if not vgradient then pc=1 end

--angle min et max of one block
local ang0 = angmini*(i-0.5)/range
local ang1 = angmini*(i+0.5)/range
if align_right then
ang0=math.pi-ang0
ang1=math.pi-ang1
end
local angm = (ang0+ang1)/2

--read the calendar.txt array
local flag = false
for idy=1,idx-1 do
if tabcal[idy][1] == md then
if (i-today_yoffset) == 0 then
today = tabcal[idy]
end
if tabcal[idy][2] == "1" then
flag = true
end
break
end
end

--colors
local colR,colG,colB=0,0,0
if wd=="6" or wd=="0" or flag == true then
colR,colG,colB=eday[1],eday[2],eday[3]
else
colR,colG,colB=wday[1],wday[2],wday[3]
end

--offset of today
local offset_x=0
local way = 1
if (i-today_yoffset)==0 then
if align_right then way =-1 end
offset_x=today_xoffset*way
end

local pat = cairo_pattern_create_radial (xc+offset_x, yc, radius,
xc2+offset_x,yc,radius2);

cairo_pattern_add_color_stop_rgba (pat, 0, colR, colG, colB, pc);
cairo_pattern_add_color_stop_rgba (pat, 1, colR, colG, colB, hgradient);

cairo_set_source (cr, pat);
--draw the portion of arc
if align_right then
x1,y1=radius*math.cos(ang0)+xc+offset_x,(radius-offset_x)*math.sin(ang0)+yc
x2,y2=radius*math.cos(ang1)+xc+offset_x,(radius-offset_x)*math.sin(ang1)+yc
else
x1,y1=radius*math.cos(ang0)+xc+offset_x,(radius+of fset_x)*math.sin(ang0)+yc
x2,y2=radius*math.cos(ang1)+xc+offset_x,(radius+of fset_x)*math.sin(ang1)+yc
end
cairo_move_to(cr,x1,y1)
cairo_line_to(cr,x2,y2)
cairo_line_to(cr,xc,yc)
cairo_fill(cr)

--for tests
if (i-today_yoffset)==0 then
--cairo_set_source_rgba (cr,1, 0,0,1);
--cairo_arc(cr,x1,y1,1,0,2*math.pi)
--cairo_stroke(cr)
--cairo_arc(cr,xc,yc,radius,0,2*math.pi)
--cairo_stroke(cr)
--cairo_set_source_rgba (cr,0, 1, 0,pc);
--cairo_arc(cr,x2,y2,1,0,2*math.pi)
--cairo_stroke(cr)
end

--write text info if needed, for left-side calendar only
local have=""
if (today ~= nil) and (align_right ~= true) then
cairo_select_font_face(cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL )
cairo_set_line_width(cr,0)
cairo_set_font_size(cr,font_size_info)
cairo_set_source_rgba (cr, info_color[1]/255, info_color[2]/255, info_color[3]/255,1);

have = string.split(today[3],"*")
for i=1,#have do
cairo_move_to(cr,10,height/2+(i-#have/2)*font_size_info)
cairo_show_text(cr, have[i])
cairo_fill(cr)
end
end

--lenght of the arc
local dx,dy=math.abs(x2-x1),math.abs(y2-y1)
local h_txt=math.sqrt(dx*dx+dy*dy)
local w_txt=font_size*10

--write text in another image for working (rotate) on it
--didn't find to work in memory only
local cs2=cairo_image_surface_create(CAIRO_FORMAT_ARGB32 , w_txt, h_txt)
local cr2=cairo_create(cs2)
cairo_set_font_size (cr2, font_size);
if (i-today_yoffset)==0 then
colR, colG, colB = dday[1]/255,dday[2]/255,dday[3]/255
pc=1
end
cairo_select_font_face(cr2, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)

--write ONE date in ONE picture
local txt_date = " " .. dt .. " "
--start the drawing date here in order to get the lenght of the text
--for right alignement
cairo_move_to(cr2,0,h_txt-decal)--+offset_x*math.atan(ang0))
cairo_set_source_rgba (cr2, colR, colG, colB,pc)
cairo_show_text(cr2, txt_date)

if align_right then
local xmax,ymax=cairo_get_current_point(cr2,0,0)
--don't use local for cs2fit cause local will be just for if .. end section
--and then surface will not be deleted --> memory leak
cs2fit = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, xmax, h_txt)
cr2fit = cairo_create(cs2fit)


cairo_set_font_size (cr2fit, font_size);
cairo_select_font_face(cr2fit, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
cairo_move_to(cr2fit,0,h_txt -decal)
cairo_set_source_rgba (cr2fit, colR, colG, colB,pc)
cairo_show_text(cr2fit, txt_date)

cairo_stroke(cr2fit)
cairo_surface_write_to_png(cs2fit,image_tmp)

else
cairo_stroke(cr2)
cairo_surface_write_to_png(cs2,image_tmp)
end

--blend date image on cairo surface
local imageTmp = imlib_load_image(image_tmp)
imlib_context_set_image(imageTmp)

if align_right then
rot_img = imlib_create_rotated_image(angm+math.pi)
else
rot_img = imlib_create_rotated_image(angm)
end

imlib_context_set_image(imageTmp)
imlib_free_image()

--image is now a square
imlib_context_set_image(rot_img)
local w_img0, h_img0 = imlib_image_get_width(), imlib_image_get_height()

---look for center of text
local rt=radius+w_img0/2
if align_right then
rt=rt-offset_x
else
rt=rt+offset_x
end
local xt=rt*math.cos(angm)+xc-w_img0/2
local yt=rt*math.sin(angm)+yc-h_img0/2

imlib_context_set_image(imageDates)
imlib_blend_image_onto_image(rot_img, 1, 0, 0, w_img0, h_img0, xt,yt, w_img0, h_img0)
imageDates=imlib_context_get_image()
imlib_context_set_image(rot_img)
imlib_free_image()




if align_right then

cairo_destroy(cr2fit)
cairo_surface_destroy(cs2fit)
end

cairo_destroy(cr2)
cairo_surface_destroy(cs2)

cairo_pattern_destroy(pat)
end --of loop

--write to disk images with dates only
imlib_context_set_image(imageDates)
imlib_save_image(image_dates)

--write to disk image with arc only
cairo_surface_write_to_png(cs,image_calendar)

--make final image
local imageCal = imlib_load_image(image_calendar)
imlib_context_set_image(imageCal)
imlib_blend_image_onto_image(imageDates, 1, 0, 0, width, height, 0,0, width, height)

imlib_save_image(image_calendar)
imlib_free_image()

imlib_context_set_image(imageDates)
imlib_free_image()

--free memory
cairo_destroy(cr)
cairo_surface_destroy(cs)

end


function conky_main()
--last_date is global
local actual_date = os.date("%Y%m%d") --os.date("%Y%m%d")
local actual_cal = imlib_load_image(image_calendar)
if (conky_parse('${updates}')+0) <2 then return end
if last_date ~= actual_date or actual_cal == nil then
--print (os.date("%H%M%S"),'new picture')
conky_draw_calendar()
last_date = actual_date
else
--print (os.date("%H%M%S"),'use old picture')
end
if actual_cal == nil then
actual_cal = imlib_load_image(image_calendar)
end
imlib_context_set_image(actual_cal)
imlib_render_image_on_drawable(0,0)
imlib_free_image()
end

wlourf
February 24th, 2010, 10:53 PM
Yes, it's possible but the script will need to redraw all the stuff at each update of the conky (the actual script draw all the stuff when conky start and when day change). It may use some cpu (you have to try on your computer) except if you rewrite the script to draw only changed values, which will be more difficult :P

Well, I wrote a quick thing which will draw all the stuff with some conky variables.


Replace the main function with this one :

function conky_main()

--last_date is global
--local actual_date = os.date("%Y%m%d") --os.date("%Y%m%d")
--local actual_cal = imlib_load_image(image_calendar)
if (conky_parse('${updates}')+0) <3 then return end
my_array={
{-5,conky_parse(' cpu0 ${cpu cpu0}')},
{5,conky_parse(' cpu1 ${cpu cpu1}')},
}


--if last_date ~= actual_date or actual_cal == nil then
conky_draw_calendar()
-- last_date = actual_date
--else
--print (os.date("%H%M%S"),'use old picture')
--end
-- if actual_cal == nil then
local actual_cal = imlib_load_image(image_calendar)
-- end


imlib_context_set_image(actual_cal)
imlib_render_image_on_drawable(0,0)
imlib_free_image()
endAs you see, I write the conky variables I want in the array my_array,
-5 et 5 are the positions of the variables in the arc. You can add more variables if you want of course

And in the function conky_draw_calendar, just add

for aa = 1,#my_array do
if my_array[aa][1] == i then
txt_date = my_array[aa][2]
end
end
after the line :
local txt_date = " " .. dt .. " "

HTH

mrpeachy
February 25th, 2010, 08:01 PM
here are a couple of other things
more alternate graphs
http://omploader.org/tM25keQ (http://omploader.org/vM25keQ)
http://thepeachyblog.blogspot.com/2010/02/i-was-having-some-trouble-with-getting.html
Using these graphs, and with some tweaking I produced this:
http://omploader.org/tM25qNw (http://omploader.org/vM25qNw)

textblur and shadow effect
http://omploader.org/tM255Mg (http://omploader.org/vM255Mg)
http://thepeachyblog.blogspot.com/2010/02/text-blur-and-shadow.html

wlourf
February 25th, 2010, 09:27 PM
very nice blur, thanks Mr Peachy !

mrpeachy
February 26th, 2010, 01:04 AM
very nice blur, thanks Mr Peachy !
you are welcome :D

andreino
February 26th, 2010, 01:12 AM
hy boys
can see the day week
this lua for language Italian?
thanks for the help
http://forum.ubuntu.ru/index.php?topic=63273.msg638103#msg638103

DoeRayMe
February 26th, 2010, 03:37 AM
Still playing around with it, but mostly done

But just wondered, what would be the best way to add cpu temp and anyone know if you can have a hotmail email checker on conky at all?


background yes
use_xft yes
xftfont HandelGotD:size=9
xftalpha 0.5
update_interval 1.0
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 200 5
maximum_width 200
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white
default_shade_color red
default_outline_color green
alignment top_right
gap_x 12
gap_y 48
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

##The number of samples to average for CPU monitoring
cpu_avg_samples 2

TEXT
${color dark red}SYSTEM ${hr 2}$color
${font sans-serif:bold:size=8}${exec cat /proc/cpuinfo | grep "model name" -m1 | cut -d ":" -f2 | tr -s [:space:] | tr -d [\(TMR\)]}'}
OS $alignr ${exec lsb_release -is} ${exec lsb_release -rs}
Uptime $alignr $uptime
Kernel $alignr $kernel
GPU $alignr ${exec lspci | grep VGA | cut -c68-81 | head -n1}
Processes $alignr $processes ($running_processes running)

CPU $alignr ${cpu cpu0}%
${cpubar cpu0}

MEM $alignc $mem / $memmax $alignr $memperc%
$membar

/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_free_perc /}%
${fs_bar /}

swap $alignc $swap / $swapmax $alignr $swapperc%
${swapbar}${font}

${color dark red}INTERNET ${hr 2}$color${font sans-serif:bold:size=8}
Hostname $alignr $nodename
IP Address $alignr ${addr wlan1}

Inbound $alignr ${downspeed wlan1} kb/s
Outbound $alignr ${upspeed wlan1} kb/s${font}

${color dark red}EMAIL ${hr 2}$color
${font sans-serif:bold:size=8} ${execi 300 python ~/Scripts/conkyEmail.py -e -m IMAP -s imap.aol.com -u wshand4@aol.com -p bouncer -i 10}${font}

mrpeachy
February 26th, 2010, 04:29 AM
But just wondered, what would be the best way to add cpu temp

You can try using ${acpitemp}

or you could install and configure lm-sensors, then try something like:${execi 300 sensors | grep Core}
or look here http://conky.linux-hardcore.com/?page_id=393 for other sensor stuff

I've seen this kind of thing too (1 cpu and lm-sensors installed):
${hwmon temp 1}

lots of ways! :D

HangukMiguk
February 26th, 2010, 11:31 AM
Ugh

So conky is not rendering my font colors when I put them in hex.

Here is my conky config file. There's only one hex in there, and it's at the top of the TEXT area.

Can anyone tell me if my syntax looks wrong?



use_xft yes
xftfont sans Bold:size=9
double_buffer yes

update_interval 1

draw_borders 0
draw_shades yes

no_buffers yes

default_color black
default_shade_color black
default_outline_color black

alignment top_left
maximum_width 325

uppercase no

override_utf8_locale yes

use_spacer yes

TEXT

${color #0C1F22}${font Twelve Ton Sushi:size=15}SYSTEM${hr 2}
$font${color red}$nodename $kernel (Linux Mint 8)
Uptime ${color grey}$uptime
${color red}CPU: ${color grey}$cpu% ${color red} RAM: ${color grey}$mem/$memmax
${color red}HD: ${color grey}${fs_used /}/${fs_free /} ${color red}Swap: ${color grey}$swap/$swapmax
${color red}Processes: ${color grey}$processes ${color red} Running: ${color grey}$running_processes
${color red}Battery: ${color grey}${battery BAT1}
$color${font Twelve Ton Sushi:size=15}NETWORK${hr 2}
$font${color red}SSID: ${color grey}${wireless_essid wlan0} ${color red}(${color grey}${addr wlan0}${color red})
${color red}Download: ${color grey}${downspeedf wlan0} $font${color red}Upload: ${color grey}${upspeedf wlan0}
$color}${font Twelve Ton Sushi:size=15}TWITTER${hr 2}
$font${color grey}$font${color grey}${rss http://xxx:xxx@twitter.com/statuses/friends_timeline/35138760.rss 20 item_titles 5}
$color${font Twelve Ton Sushi:size=15}PERSONAL${hr 2}
$font${color red}Gmail: ${color grey}${execi 60 python ~/.scripts/gmail.py} message(s)
$font${color red}Currently: ${color grey}${execi 60 conkyForecast --location=USIL0514 --datatype=CC} ${execi 60 conkyForecast --location=USIL0514 --datatype=HT --imperial}
$font${color red}Rhythmbox: ${color grey}${exec conkyRhythmbox --template=~/.scripts/rhythmbox.template}

mrpeachy
February 26th, 2010, 04:23 PM
@ HangukMiguk

# is the symbol conky uses to denote a comment, remove the # and it will work

also heres an idea for colors...

set them before the "TEXT

color1 000000
color2 111111

TEXT

${color1}text${color2}text

miegiel
February 26th, 2010, 04:35 PM
@ HangukMiguk

# is the symbol conky uses to denote a comment, remove the # and it will work

also heres an idea for colors...

set them before the "TEXT

color1 000000
color2 111111

TEXT

${color1}text${color2}text

...
TEXT

...
default color ${color CCCCCC} color=cccccc ${color} default color
...

Should work just as well. But you're right don't use a # in the hex color code.

wlourf
February 26th, 2010, 08:14 PM
Hi all,

Here is my entry for this CotM contest : St Valentine's Day /Massacre ! Nice choice by the way :-). If you like it, you can vote for it here (http://blog.conky.be/2010/03/01/please-vote-on-februarys-cotm-entries/)

For this, I made a simple blooding heart like on this image:
http://img192.imageshack.us/img192/7800/bloodyg.th.png (http://img192.imageshack.us/i/bloodyg.png/)
The seven vertical "lines" are linked to conky, from left to right we have:
memperc, cpu0, uploadspeed, mixer volume, download speed, cpu1, running processes.

For better vizualisation, you should see it in action, on this video (http://www.youtube.com/watch?v=oeNTK7_20wk).

The same used with a wallpaper from dA : for_a_rainy_day_by_fusiom
http://img695.imageshack.us/img695/1174/withwallpaperd.th.png (http://img695.imageshack.us/i/withwallpaperd.png/)


With the same script, I can choose other shapes, for example, a heart breathing :
http://img534.imageshack.us/img534/729/hearthm.th.png (http://img534.imageshack.us/i/hearthm.png/)
This one is linked to cpu usage on this video (http://www.youtube.com/watch?v=zuf6IBtS-Hs).

But, if you don't care with heart and things like that, you can draw your own shape.
This one for example :
http://img692.imageshack.us/img692/5288/eightcorners.th.png (http://img692.imageshack.us/i/eightcorners.png/)
In action here (http://www.youtube.com/watch?v=bJxDKyd3UJs) (top and bottom = cpu0 and cpu1, left and right are upload and dowload speed).

If you want to try it, make sure the variables used in the Lua script fit your system (mines are wlan0, cpu0, cpu1 ...).
The option to choose the shape to draw is written in the conkyrc.

Well, now, if you are rash, you can try to draw your own shape. I will try to explain how with this simple example ;-)
Image :
http://img63.imageshack.us/img63/7338/exampleg.th.png (http://img63.imageshack.us/i/exampleg.png/)
All the shapes are drawn with Bezier curves. Here is the code for the picture :


function theme_test()
local xc,yc,r=100,100,20
local points = {
-- Px Py, Cx, Cy, Radius, Start side
{xc-2*r, yc-r, xc, yc, r, 1}, --top left
{xc+100+2*r, yc-r, xc+100, yc, r, 1}, --top right
}
return points
end
Cx and Cy are center coordinates of the circles
Radius are the radius of the circles
Px and Py are the center point of the Bezier Curve

First, the script calculate the tangeants points for each circle (0 and 1 on the picture)
"Start side" is the side where start the next bezier curve. It is one here
When Px,Py is above the circle, left side is always 0, right side is always 1. (And this it an absolute position, it means when Px,Py is bellow the circle, 0 is still left side but you will see it on the right because it's now upside down...)
After that, the script calculate the intersecion points of the tangeants (I1 and I2)

then the script draw curves with:
(Circle1,P0), P1 ,(Circle1,P1)
(Circle1,P1), I1 ,(Circle2,P0)
(Circle2,P0), P2 ,(Circle2,P1)
(Circle2,P1), I2 ,(Circle1,P0)

Well, it's not easy to explain, I hope you understood a little bit ! It's more an (art) script than a ready-to-use widget, and it's not very readable but it was not what I was looking for! ... If you have questions, don't hesitate !

It was fun to make it, I hope you like it ;)
(conkyrc and script are in the attachments)

mrpeachy
February 26th, 2010, 08:37 PM
@wlourf

thats a nice idea.
I wish I had the energy (or indeed the time) to learn how to apply shading effects to cairo graphics. I think my flowers entry for the competition would benefit greatly from a bit of extra graphical flair.

--- well shading turned out to be pretty straightforward :)

wlourf
February 26th, 2010, 11:18 PM
hy boys
can see the day week
this lua for language Italian?
thanks for the help
http://forum.ubuntu.ru/index.php?topic=63273.msg638103#msg638103

Thanks for asking! I'm french and I didn't managed to get dates in french till now.

Here is what I've done for having dates according to my locale settings:
It your conkyrc, in the TEXT section, write

${time}If you want to hide this date ,

use_xft yes
xftalpha 0
default_color 000000It seems it works only for the black color .

Can you check on your system if it also works and I will update the script if it's ok.
I didn't find a better way in Lua script with os.setlocale() for example...
@mrpeachy:
you made an electroencephalogram and I made a pulsing heart, that's funny !

HangukMiguk
February 26th, 2010, 11:33 PM
...
TEXT

...
default color ${color CCCCCC} color=cccccc ${color} default color
...

Should work just as well. But you're right don't use a # in the hex color code.

took the pound sign out, still not working. still showing up as black.

degan
February 27th, 2010, 11:22 AM
Hi boys....

How do I do to remove the shade that I have in the conky?


http://upload.centerzone.it/images/48821683483617706559_thumb.jpg (http://upload.centerzone.it/viewer.php?file=48821683483617706559.png)


--[[
При сборке скрипта использованы данные из следующих скриптов

Conky Widgets by londonali1010 (2009) - часы и кольца
Conky vertical bar graph by iggykoopa - горизонтальный и вертикальный бары
Shadowed clock by wlourf (10 jan. 2010) - стрелки часов с тенью
calendar wheel by Wlourf (14 jan. 2010) - календарь

Собрал все это Борис Кринкель <olgmen> krinkel@rambler.ru

Для этого серипта требуется CONKY версии 1.7.2

Для вызова этого скрипта в Conky вставьте следующие строки до TEXT (при условии, что скрипт сохранен в ~/scripts/conky_widgets.lua):
lua_load ~/scripts/widgets.lua
lua_draw_hook_pre widgets
]]

require 'cairo'
require 'imlib2'

--[[ AIR CLOCK WIDGET ]]
--[[ Виджет выводит изображение часов с объемными стрелками и тенью от стрелок.
Часть настроек находится в виджете
]]

function clock(cr, x, y, s, bgc, bga, fgc, fga)

-- функция перекодировки цвета

function rgb_to_r_g_b(colour,alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end

-- назначаем толщину выводимых линий

local s_th = 2

-- рисуем циферблат

local radius = s/2
local m_x,m_y = x + s/2, y + s/2
cairo_set_line_width(cr,6)
cairo_arc(cr, m_x,m_y, radius, 0, math.rad(360))
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)

-- прозрачный "корпус часов"

cairo_arc(cr, m_x, m_y, radius*1.25, 0, 2*math.pi)
cairo_set_source_rgba(cr, 0.5, 0.5, 0.5, 0.8)
cairo_set_line_width(cr,1)
cairo_stroke(cr)

local border_pat=cairo_pattern_create_linear(m_x, m_y - radius*1.25, m_x, m_y + radius*1.25)

cairo_pattern_add_color_stop_rgba(border_pat,0,0,0 ,0,0.7)
cairo_pattern_add_color_stop_rgba(border_pat,0.3,1 ,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,0.5,1 ,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,0.7,1 ,1,1,0)
cairo_pattern_add_color_stop_rgba(border_pat,1,0,0 ,0,0.7)
cairo_set_source(cr,border_pat)
cairo_arc(cr, m_x, m_y, radius*1.125, 0, 2*math.pi)
cairo_close_path(cr)
cairo_set_line_width(cr, radius*0.25)
cairo_stroke(cr)

-- вывод часовых делений

local i = 0
local winkel = math.rad(30)

for i=0,11,1 do
cairo_set_line_width(cr,s_th*1.5)
cairo_move_to(cr, m_x-math.sin(winkel*i)*radius, m_y-math.cos(winkel*i)*radius)
cairo_line_to(cr, m_x-math.sin(winkel*i)*(radius*0.9), m_y-math.cos(winkel*i)*(radius*0.9))
cairo_fill_preserve(cr)
cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
cairo_stroke(cr)
end

-- вывод минутных делений

local i = 0
local winkel = math.rad(6)

for i=0,59,1 do
cairo_set_line_width(cr,1)
cairo_move_to(cr, m_x-math.sin(winkel*i)*radius, m_y-math.cos(winkel*i)*radius)
cairo_line_to(cr, m_x-math.sin(winkel*i)*(radius*0.9), m_y-math.cos(winkel*i)*(radius*0.9))
cairo_stroke(cr)
end

-- рисуем деления 3, 6, 9 и 12 часовые

cairo_set_line_width(cr,s_th/2) -- устанавливаем толщину линий

cairo_move_to (cr, x + 0.15*s, y + 0.5*s)
cairo_line_to (cr, x + 0.45*s, y + 0.5*s)
cairo_move_to (cr, x + 0.55*s, y + 0.5*s)
cairo_line_to (cr, x + 0.85*s, y + 0.5*s)
cairo_move_to (cr, x + 0.5*s, y + 0.15*s)
cairo_line_to (cr, x + 0.5*s, y + 0.45*s)
cairo_move_to (cr, x + 0.5*s, y + 0.55*s)
cairo_line_to (cr, x + 0.5*s, y + 0.85*s)
cairo_stroke(cr)

-- часовые стрелки с тенью, взято из Shadowed clock by wlourf (10 jan. 2010)

function draw_hand(a_trame,arc,arc0,arc1,lg,r,border,rgb)
xx = xc + clock_r*math.sin(arc)*lg
yy = yc - clock_r*math.cos(arc)*lg
x0 = xc + r*math.sin(arc0)
y0 = yc - r*math.cos(arc0)
x1 = xc + r*math.sin(arc1)
y1 = yc - r*math.cos(arc1)

if border ~= nil then
cairo_set_line_width(cr,1)
cairo_set_source_rgba(cr,border[1],border[2],border[3],0.5)
cairo_move_to (cr, x0, y0)
cairo_curve_to (cr, x0, y0, xx, yy, x1, y1)
cairo_arc(cr,xc,yc,r,arc1-math.pi/2,arc0-math.pi/2)
cairo_stroke(cr)
end

-- рисуем тень

cairo_move_to (cr, x0, y0)
cairo_curve_to (cr, x0, y0, xx+shadow_xoffset, yy+shadow_yoffset, x1, y1)
cairo_arc(cr,xc,yc,r,arc1-math.pi/2,arc0-math.pi/2)
pat = cairo_pattern_create_radial (xc, yc, 0, xc, yc, clock_r)
cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, shadow_opacity)
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 0)
cairo_set_source (cr, pat)
cairo_fill (cr)

-- рисуем стрелки

cairo_move_to (cr, x0, y0)
cairo_curve_to (cr, x0, y0, xx, yy, x1, y1)
cairo_arc(cr,xc,yc,r,arc1-math.pi/2,arc0-math.pi/2)
pat = cairo_pattern_create_radial (xc, yc, clock_r/10, xc, yc, clock_r*lg)
cairo_pattern_add_color_stop_rgba (pat,0, rgb[1], rgb[2], rgb[3], 1)
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1)
cairo_set_source (cr, pat)
cairo_fill (cr)
cairo_pattern_destroy (pat)
end

-- Здесь вводятся основные данные

-- радиус часов в пикселях, задаем половину диаметра часов

clock_r=s/2

-- координаты центра часов

xc = x+s/2
yc = y+s/2

-- координаты источника света относительно центра часов, 0 - источник света над центром
-- может быть положительным, источник света выше центра, или отрицательным

shadow_xoffset=70
shadow_yoffset=70

-- прозрачность тени, значения от 0 до 1

shadow_opacity=0.5

-- Выводить секундную стрелку, Да - true, Нет - false.
-- При выводе секундной стрелки update_interval в .conkyrc должен быть менее 1 сек.

show_seconds=true

-- Выводить ось стрелок в центре часов, Да - true, Нет - false.

show_dot = true

-- размеры стрелок, первая цифра ширина, вторая - длина

rh,lgh=3,1.2 -- часовая стрелка
rm,lgm=2,1.75 -- минутная стрелка
rs,lgs=1,1.9 -- секундная стрелка

-- забираем данные из ОС

local hours=os.date("%I")
local mins=os.date("%M")
local secs=os.date("%S")

-- расчет угла движения стрелок

gamma = math.pi/2-math.atan(rs/(clock_r*lgs))
secs_arc=(2*math.pi/60)*secs
secs_arc0=secs_arc-gamma
secs_arc1=secs_arc+gamma

gamma = math.pi/2-math.atan(rm/(clock_r*lgm))
mins_arc=(2*math.pi/60)*mins + secs_arc/60
mins_arc0=mins_arc-gamma
mins_arc1=mins_arc+gamma

gamma = math.pi/2-math.atan(rh/(clock_r*lgh))
hours_arc=(2*math.pi/12)*hours+mins_arc/12
hours_arc0=hours_arc-gamma
hours_arc1=hours_arc+gamma

-- вывод стрелок

draw_hand(alpha_trame,hours_arc,hours_arc0,hours_a rc1,lgh,rh,{0,0,0},{1,1,1})
draw_hand(alpha_trame,mins_arc,mins_arc0,mins_arc1 ,lgm,rm,{0,0,0},{.9,.9,.9})
if show_seconds then
draw_hand(alpha_trame,secs_arc,secs_arc0,secs_arc1 ,lgs,rs,{0,0,0},{.8,.8,.8})
end

-- рисуем ось стрелок

if show_dot then

lg_shadow_center=3
radius=math.min(rh,rm,rs)*0.75
if radius<1 then radius=1 end
ang = math.atan(shadow_yoffset/shadow_xoffset)

-- тень от оси

gamma = -math.atan(1/lg_shadow_center)
ang0=ang-gamma
ang1=ang+gamma

-- тень от стрелок

if shadow_xoffset<0 and shadow_yoffset>0 then
ang0=ang0+math.pi
ang1=ang1+math.pi
ang=ang+math.pi
end

if shadow_yoffset<0 and shadow_xoffset>0 then
ang0=ang0-math.pi/2
ang1=ang1-math.pi/2
ang=ang-math.pi/2
end

if shadow_yoffset<0 and shadow_xoffset<0 then
ang0=ang0-math.pi/2
ang1=ang1-math.pi/2
ang=ang-math.pi/2
end

x0 = xc + radius*math.sin(ang0)
y0 = yc - radius*math.cos(ang0)
xx = xc + radius*math.sin(ang+math.pi/2)*lg_shadow_center
yy = yc - radius*math.cos(ang+math.pi/2)*lg_shadow_center
x1 = xc - radius*math.sin(ang1)
y1 = yc + radius*math.cos(ang1)

cairo_move_to(cr,x0,y0)
cairo_curve_to(cr,x0,y0,xx,yy,x1,y1)
pat = cairo_pattern_create_radial (xc, yc, 0, xc, yc, radius*4)
cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0,0, shadow_opacity)
cairo_pattern_add_color_stop_rgba (pat, 1, 0,0,0, 0)
cairo_set_source (cr, pat)
cairo_fill (cr)

ang = ang-math.pi/2
xshad = xc + radius*math.sin(ang)*.5
yshad = yc - radius*math.cos(ang)*.5

local ds_pat=cairo_pattern_create_radial(xc, yc, 0, xshad, yshad, radius)
cairo_pattern_add_color_stop_rgba(ds_pat,0,.9,.9,. 9,1)
cairo_pattern_add_color_stop_rgba(ds_pat,1,0,0,0,1 )
cairo_arc(cr,xc,yc,radius,0,2*math.pi)
cairo_set_source(cr,ds_pat)
cairo_fill(cr)

-- рисуем глянец на стекле

pat = cairo_pattern_create_radial (115.2, 102.4, 25.6, 102.4, 102.4, 128)
cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 0.1)
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 0.4)
cairo_set_source (cr, pat)
cairo_arc (cr, xc, yc, s/2, 0, 2 * math.pi)
cairo_fill (cr)
cairo_pattern_destroy (pat)
end

--[[ END AIR CLOCK WIDGET ]]

-- ----------------------------------------------------------------------------------

--[[
calendar wheel by Wlourf (14 jan. 2010)

This script is designed to draw dates on a circular way on the left of the screen.
Some text info can be added in the circle with the file calendar.txt (see below)
Some parameters (colors, sizes ... ) can be adjusted (see below).

As this script draw a png file only if necessary, a short update of the conky can be used.

Call this script in Conky using the following before TEXT (assuming you save this script to ~/scripts/calendar.lua):
lua_load ~/scripts/calendar.lua
lua_draw_hook_pre main


v1.0 - 14 jan. 2010 - Original release
v1.1 - 19 jan. 2010 - Calendar are now drawn in an PNG file and this file
is called at every conky call, when day change, a new PNG file is created.
- An x offset can be added to "Today's block"
- An y offset can be added too to "Today's block"
v1.2 - 28 jan. 2010 - Calendar can be drawn on the right side of the conky (but without text info)
- Calendar is drawn after the second conky refresh only
v1.2a - 29 jan. 2010 - Minor update, picture was refresh every second instead of every day!
]]

--require 'cairo'
--require 'imlib2'

-------------------------- parameters (part one) are set here -----------------------------------

--text file calendar (absolute path, can be "" if no file used)
calendar_file="/home/boris/scripts/calendar.txt"
--format of in this text file
--MMDD;N;TEXT
--MMDD = month day
--N = 0 or 1 (1 to display same colors as week-ends)
--TEXT = Text to display (use * for multiline)

--some paths to images created (absolutes paths)
image_tmp="/tmp/img_tmp.png" --used to rotate a single date
image_calendar="/tmp/conky-calendar-arc.png"
image_dates="/tmp/conky-calendar-dates.png"

--more parameters below
-------------------------- end of parameters (part one) -----------------------------------


function string:split(delimiter)
--source for the split function : http://www.wellho.net/resources/ex.php4?item=u108/split
local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end



function conky_draw_calendar()
-- if conky_window==nil then return end
local width=conky_window.width
local height=conky_window.height
--local height = s
--local width = s
--sometimes, there is problem with init and width & height are set to 0 or 2 !!
-- if width<3 or height<3 then return end

local cs=cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height)
local cr=cairo_create(cs)

-------------------------- parameters (part two) are set here -----------------------------------


-- vertical center of the circle (height/2 for centered circle)
local yc=s/2+y

--number of days to display before and after today (i.e. with range = 30 --> 60 days are displayed)
--even number between 20 and 30 for nice effect
local range = 11

--not sure of the engish words so I leave then in french !
--fleche (arrow) is the segment from x=0 to x=radius-xc (with xc =center of the circle)
--fleche for the external circle
--fleche2 for the internal circle
--fleche2 must be < fleche
local fleche=125
local fleche2=fleche*.85

--corde (chord) is the vertical segment (where x=0) of the external circle
local corde = 1.5*s--height+s/2

--colors RGB (0-255)
--week day
local wday={150,150,150}
--week-end and bank holidays defined in calendar.txt
local eday={255,200,0}
--color of today
local dday={255,255,255}

--vertical gradient (both circle and dates)? (true/false)
local vgradient=true

--horizontal gradient for the circle? (0 to 1, 0 is the best choice for "moon like" circle )
local hgradient=0

--you can change the font here
local font="PT Sans"
--font_size (of dates) must be less than delta (= heigth of a day)
local delta = yc/(range+0.5)
--the font-size has to be adjusted depending on the font used
local font_size=delta-1

--information text (from calendar.txt)
local info_color={255,200,0}
--font size of text infos
local font_size_info=font_size

--today_xoffset is the offset for the date of today (can be positive/null/negative, in pixels)
local today_xoffset=5

--today_yoffset where today will be displayed (value between -range to + range)?
-- 0 = center of the arc
-- -range = top of the arc
-- +range = bottom of the arc
local today_yoffset=0 -- -9

--display on right side of the screen (true/false)
local align_right = true


-------------------------- end of the parameters, ouf -----------------------------------

--some calculations
--radius for external circle
--radius2 for internal circle
--delta = number of arcs in the circle
local radius=(corde^2+4*fleche^2)/(8*fleche)
local radius2=(corde^2+4*fleche2^2)/(8*fleche2)
local decal=2*(delta-font_size)
wday[1]=wday[1]/255
wday[2]=wday[2]/255
wday[3]=wday[3]/255
eday[1]=eday[1]/255
eday[2]=eday[2]/255
eday[3]=eday[3]/255

--xc =x center of external circle
--xc2=x center of internal circle
local xc = fleche - radius
local xc2 = fleche2 - radius2

if align_right then
xc = width-xc-1.5*s/2
xc2 = width-xc2-1.5*s/2
end

local h_txt = height/(2*range+1)

local t = os.date('*t') -- date in table
--get the date
local s = os.time(t) -- date in seconds

--read the calendar file
local file = io.open(calendar_file,"r")
local tabcal={}
local idx=1
local line,lineok="",""
if file ~= nil then
while true do
line = file:read("*l")
if line == nil then break end
lineok = string.split(line,";")
if (#lineok)==3 then
tabcal[idx]={lineok[1],lineok[2],lineok[3]}
idx=idx+1
end
end
end
io.close()
local angmini=math.atan((corde/2)/(radius-fleche))

local imageDates=imlib_create_image(width,height)
imlib_context_set_image(imageDates)
imlib_image_set_has_alpha(1)
imlib_save_image(image_dates)

for i=-range,range do
local s2 = s + 3600*24*(i-today_yoffset) --date diff in seconds

local wd = os.date("%w",s2)
local md = os.date("%m%d",s2)
local dt = os.date("%a. %d %b.",s2),os.date("%d",s2),os.date("%b",s2)

--percentage of vertical gradient
local pc = (range-math.abs(i))/range
if not vgradient then pc=1 end

--angle min et max of one block
local ang0 = angmini*(i-0.5)/range
local ang1 = angmini*(i+0.5)/range
if align_right then
ang0=math.pi-ang0
ang1=math.pi-ang1
end
local angm = (ang0+ang1)/2

--read the calendar.txt array
local flag = false
for idy=1,idx-1 do
if tabcal[idy][1] == md then
if (i-today_yoffset) == 0 then
today = tabcal[idy]
end
if tabcal[idy][2] == "1" then
flag = true
end
break
end
end

--colors
local colR,colG,colB=0,0,0
if wd=="6" or wd=="0" or flag == true then
colR,colG,colB=eday[1],eday[2],eday[3]
else
colR,colG,colB=wday[1],wday[2],wday[3]
end

--offset of today
local offset_x=0
local way = 1
if (i-today_yoffset)==0 then
if align_right then way =-1 end
offset_x=today_xoffset*way
end

local pat = cairo_pattern_create_radial (xc+offset_x, yc, radius,
xc2+offset_x,yc,radius2);

cairo_pattern_add_color_stop_rgba (pat, 0, colR, colG, colB, pc);
cairo_pattern_add_color_stop_rgba (pat, 1, colR, colG, colB, hgradient);

cairo_set_source (cr, pat);
--draw the portion of arc
if align_right then
x1,y1=radius*math.cos(ang0)+xc+offset_x,(radius-offset_x)*math.sin(ang0)+yc
x2,y2=radius*math.cos(ang1)+xc+offset_x,(radius-offset_x)*math.sin(ang1)+yc
else
x1,y1=radius*math.cos(ang0)+xc+offset_x,(radius+of fset_x)*math.sin(ang0)+yc
x2,y2=radius*math.cos(ang1)+xc+offset_x,(radius+of fset_x)*math.sin(ang1)+yc
end
cairo_move_to(cr,x1,y1)
cairo_line_to(cr,x2,y2)
cairo_line_to(cr,xc,yc)
cairo_fill(cr)

--for tests
if (i-today_yoffset)==0 then

end

--write text info if needed, for left-side calendar only
local have=""
local height = 20 -- расположение текста из calendar.txt по вертикали

if today ~= nil then
-- if (today ~= nil) and (align_right ~= true) then
cairo_select_font_face(cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
cairo_set_line_width(cr,0)
cairo_set_font_size(cr,font_size_info)
cairo_set_source_rgba (cr, info_color[1]/255, info_color[2]/255, info_color[3]/255,1);

have = string.split(today[3],"*")
for i=1,#have do
cairo_move_to(cr,10,height+(i-#have/2)*font_size_info)
cairo_show_text(cr, have[i])
cairo_fill(cr)
end
end

--lenght of the arc
local dx,dy=math.abs(x2-x1),math.abs(y2-y1)
local h_txt=math.sqrt(dx*dx+dy*dy)
local w_txt=font_size*10

--write text in another image for working (rotate) on it
--didn't find to work in memory only
local cs2=cairo_image_surface_create(CAIRO_FORMAT_ARGB32 , w_txt, h_txt)
local cr2=cairo_create(cs2)
cairo_set_font_size (cr2, font_size);
if (i-today_yoffset)==0 then
colR, colG, colB = dday[1]/255,dday[2]/255,dday[3]/255
pc=1
end
cairo_select_font_face(cr2, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)

--write ONE date in ONE picture
local txt_date = " " .. dt .. " "
--start the drawing date here in order to get the lenght of the text
--for right alignement
cairo_move_to(cr2,0,h_txt-decal)--+offset_x*math.atan(ang0))
cairo_set_source_rgba (cr2, colR, colG, colB,pc)
cairo_show_text(cr2, txt_date)

if align_right then
local xmax,ymax=cairo_get_current_point(cr2,0,0)
--don't use local for cs2fit cause local will be just for if .. end section
--and then surface will not be deleted --> memory leak
cs2fit = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, xmax, h_txt)
cr2fit = cairo_create(cs2fit)


cairo_set_font_size (cr2fit, font_size);
cairo_select_font_face(cr2fit, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
cairo_move_to(cr2fit,0,h_txt -decal)
cairo_set_source_rgba (cr2fit, colR, colG, colB,pc)
cairo_show_text(cr2fit, txt_date)

cairo_stroke(cr2fit)
cairo_surface_write_to_png(cs2fit,image_tmp)

else
cairo_stroke(cr2)
cairo_surface_write_to_png(cs2,image_tmp)
end

--blend date image on cairo surface
local imageTmp = imlib_load_image(image_tmp)
imlib_context_set_image(imageTmp)

if align_right then
rot_img = imlib_create_rotated_image(angm+math.pi)
else
rot_img = imlib_create_rotated_image(angm)
end

imlib_context_set_image(imageTmp)
imlib_free_image()

--image is now a square
imlib_context_set_image(rot_img)
local w_img0, h_img0 = imlib_image_get_width(), imlib_image_get_height()

---look for center of text
local rt=radius+w_img0/2
if align_right then
rt=rt-offset_x
else
rt=rt+offset_x
end
local xt=rt*math.cos(angm)+xc-w_img0/2
local yt=rt*math.sin(angm)+yc-h_img0/2

imlib_context_set_image(imageDates)
imlib_blend_image_onto_image(rot_img, 1, 0, 0, w_img0, h_img0, xt,yt, w_img0, h_img0)
imageDates=imlib_context_get_image()
imlib_context_set_image(rot_img)
imlib_free_image()




if align_right then

cairo_destroy(cr2fit)
cairo_surface_destroy(cs2fit)
end

cairo_destroy(cr2)
cairo_surface_destroy(cs2)

cairo_pattern_destroy(pat)
end --of loop

--write to disk images with dates only
imlib_context_set_image(imageDates)
imlib_save_image(image_dates)

--write to disk image with arc only
cairo_surface_write_to_png(cs,image_calendar)

--make final image
local imageCal = imlib_load_image(image_calendar)
imlib_context_set_image(imageCal)
imlib_blend_image_onto_image(imageDates, 1, 0, 0, width, height, 0,0, width, height)

imlib_save_image(image_calendar)
imlib_free_image()

imlib_context_set_image(imageDates)
imlib_free_image()

--free memory
cairo_destroy(cr)
cairo_surface_destroy(cs)

end
-- ------------------------------------------------------------------------------------------

function calendar()
--last_date is global
local actual_date = os.date("%Y%m%d") --os.date("%Y%m%d")
local actual_cal = imlib_load_image(image_calendar)
if (conky_parse('${updates}')+0) <2 then return end
if last_date ~= actual_date or actual_cal == nil then
--print (os.date("%H%M%S"),'new picture')
conky_draw_calendar()
last_date = actual_date
else
--print (os.date("%H%M%S"),'use old picture')
end
if actual_cal == nil then
actual_cal = imlib_load_image(image_calendar)
end
imlib_context_set_image(actual_cal)
imlib_render_image_on_drawable(0,0)
imlib_free_image()
end
end
-- [[ END CALENDAR WIDGET ]]
-- -----------------------------------------------------------------------------------
--[[ PIE WIDGET ]]
--[[
Conky Cairo Lua scripting example

Copyright (c) 2009 Brenden Matthews, all rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

You can tweak the settings_table below to suit your preferences. You can draw
as many pies as you want, by simply adding more entries in the settings_table.

Load this in your conkyrc like so (assuming you save this script to
~/cairo_pie.lua):

lua_load ~/scripts/cairo-pie.lua
lua_draw_hook_pre pie_time
lua_draw_hook_post cairo_cleanup

]]

settings_table = {
{
-- Can be one of 'top', 'top_mem', or 'top_io' (requires iostats
-- support in Conky). This is the top stat we're basing our pie on.
name='top',
-- Draw a background pie? Can be true or false.
draw_bg=true,
-- Background pie colour, RGB value.
bg_colour=0xffffee,
-- Foreground pie colour, RGB value.
fg_colour=0xffdf00,
-- X and Y coordinates, relative to the centre of Conky, in pixels.
x=65, y=40,
-- Radius of our pie, in pixels.
radius=79,
-- Angle to rotate the pie, in degrees.
angle=90,
-- Reverse pie? Can be true or false.
reverse=false,
-- Shade each pie slice relative to the others.
shade=true,
},
{
name='top_mem',
draw_bg=false,
bg_colour=0x071672,
fg_colour=0xff8700,
x=65, y=40,
radius=79,
angle=90,
reverse=true,
shade=true,
},
}

require 'cairo'
-- функция перекодировки цвета
function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
-- сбрасываем значения
cs, cr = nil
--
function draw_pie(t, pt)

-- если нет окна коньков, то выходим из программы
if conky_window == nil then return end

-- если cs равняется nil или cairo_xlib_surface_get_width(cs) не равно ширине окна коньков или cairo_xlib_surface_get_height(cs) не равно высоте окна коньков тогда
if cs == nil or cairo_xlib_surface_get_width(cs) ~= conky_window.width or cairo_xlib_surface_get_height(cs) ~= conky_window.height then
-- если cs существует, то сбрасываем cs и выходим
if cs then cairo_surface_destroy(cs) end
-- создаем cs с параметрами окна коньков
cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
end

-- если cr существует, то сбрасываем cr
if cr then cairo_destroy(cr) end

-- создаем cr с параметрами cs - параметрами окна коньков
cr = cairo_create(cs)

-- забираем данные

local xi, yi, radius, angle, draw_bg, bg_colour, fg_colour, reverse, shade = pt['x'], pt['y'], pt['radius'], pt['angle'], pt['draw_bg'], pt['bg_colour'], pt['fg_colour'], pt['reverse'], pt['shade']

-- расчитаваем место вывода диаграмм

local x, y = 0, 0 --conky_window.text_start_x, conky_window.text_start_y
local w, h = 350, 350 --conky_window.text_width, conky_window.text_height
local xc = x + w / 2. + xi
local yc = y + h / 2. + yi
local two_pi = 2 * math.pi

-- выводим диаграммы

local function draw_dat_pie(start, stop, radius, colour, alpha, str)

-- если направление диаграммы против часовой стрелки, тогда

if reverse then
-- start, stop меняем на -start, -stop
start, stop = -start, -stop
end

-- сохраняем параметры cr

cairo_save(cr)

-- переносим центр диаграммы в расчитанную точку

cairo_translate(cr, xc, yc)

-- разворачиваем диаграмму

cairo_rotate(cr, math.pi / 2 + math.rad(angle))

-- делаем градиентную окраску диаграммы

pattern = cairo_pattern_create_radial(0, 0, radius * 0.95, 0, 0, radius)
cairo_pattern_add_color_stop_rgba(pattern, 0, rgb_to_r_g_b(colour, alpha))
cairo_pattern_add_color_stop_rgba(pattern, 1, 0, 0, 0, 0)

-- расчитываем хорду диаграммы

local function coords()
local x = radius * math.cos(two_pi * start)
local y = radius * math.sin(two_pi * start)
return x, y
end

-- начальная точка диаграммы

cairo_move_to(cr, 0, 0)

-- проводим линию

cairo_line_to(cr, coords())

-- если диаграмма выводится по часовой стрелке, тогда

if not reverse then

-- рисуем дугу по часовой стрелке

cairo_arc(cr, 0, 0, radius, two_pi * start, two_pi * stop)

-- иначе, если диаграмма выводится против часовой стрелке

else

-- рисуем дугу против часовой стрелке

cairo_arc_negative(cr, 0, 0, radius, two_pi * start, two_pi * stop)
end

-- заканчиваем вывод сектора диаграммы

cairo_line_to(cr, 0, 0)
cairo_close_path(cr)
-- окрашиваем сектор
cairo_set_source(cr, pattern)
cairo_pattern_destroy(pattern)
cairo_fill(cr)
cairo_set_source(cr, pattern)
-- ------------------------------------------------- вывод текста ---------------------
-- если str существует, тогда
if str then
-- задействуем extents
local extents = cairo_text_extents_t
-- разворачиваем текст
cairo_rotate(cr, (start + (stop - start) / 2) * two_pi + math.pi)
-- назначаем цвет текста - в данном случае белый
cairo_set_source_rgba(cr, 0, 0, 0, alpha)
-- назначаем шрифт
cairo_select_font_face(cr, "PT Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
-- назначаем размер шрифта
cairo_set_font_size(cr, radius * 0.10)
-- назначаем место вывода текста
cairo_move_to (cr, -radius + radius * 0.075, radius * 0.03)
-- выводим текст
cairo_show_text(cr, str)
end
-- восстанавливаем cr
cairo_restore(cr)
end
-- ------------------------------------ конец вывода текста ----------------------------

-- если используем фон, т.е. окружность на которую выводится диаграмма, тогда загружаем данные фона

if draw_bg then draw_dat_pie(0, 1, radius, bg_colour, 1) end
-- сбрасываем значение p на 0
local p = 0
-- загружаем в f значение
local f = t[1]['value'] / 100

for i in pairs(t) do
local v = t[i]['value']
local str = string.format('%.1f %s', v, t[i]['name'])
v = v / 100
-- если используем тень, тогда загружаем данные тени
if shade then
draw_dat_pie(p, p + v, radius * 0.94, fg_colour, v / p, str)
-- иначе загружаем данные без тени
else
draw_dat_pie(p, p + v, radius * 0.94, fg_colour, 1, str)
end


p = p + v
end
-- сбрасываем cr
cairo_destroy(cr)
cr = nil
end

function conky_cairo_cleanup()
-- сбрасываем значения cs
cairo_surface_destroy(cs)
cs = nil
end

-- Compatibility: Lua-5.1
-- thanks to Lua users wiki for this
function split(str, pat)
local t = {} -- NOTE: use {n = 0} in Lua-5.0
local fpat = "(.-)" .. pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= "" then
table.insert(t, cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t, cap)
end
return t
end

function tablify_top(t)
local ret = {}
for i in pairs(t) do
table.insert(ret, {
value=tonumber(string.match(t[i], '(%d+%.%d+)')), name=string.match(t[i], '%d+%.%d+ ([%w_]+)')
})
end
return ret
end

function conky_pie_time()
local function pie_me(pt)
local str = ''
local sort_key = ''
if pt['name'] == 'top' then
sort_key = 'cpu'
elseif pt['name'] == 'top_mem' then
sort_key = 'mem'
elseif pt['name'] == 'top_io' then
sort_key = 'io_perc'
else
print('Invalid top type')
return
end
-- будем выводить 10 секторов
for i=1,10 do
str = str .. string.format('${%s %s %i} ${%s name %i}\n', pt['name'], sort_key, i, pt['name'], i)
end


str = conky_parse(str)
local tbl = split(str, '\n')
tbl = tablify_top(tbl)
draw_pie(tbl, pt)
end

for i in pairs(settings_table) do
pie_me(settings_table[i])
end
end
--[[ END PIE WIDGET ]]
-- ------------------------------------------------------------------------------------

--function rgb_to_r_g_b(colour,alpha)
-- return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
--end

--[[ BACKGROUND WIDGET by londonali1010 (2009)]]
function background(cr)
local w=conky_window.width
local h=conky_window.height
-- "corner_r" is the radius, in pixels, of the rounded corners. If you don't want rounded corners, use 0.
local corner_r=45
-- Set the colour of your background.
local bg_colour=0x000000
-- Set the transparency (alpha) of your background.
local bg_alpha=0.4

cairo_move_to(cr,corner_r,0)
cairo_line_to(cr,w-corner_r,0)
cairo_curve_to(cr,w,0,w,0,w,corner_r)
cairo_line_to(cr,w,h-corner_r)
cairo_curve_to(cr,w,h,w,h,w-corner_r,h)
cairo_line_to(cr,corner_r,h)
cairo_curve_to(cr,0,h,0,h,0,h-corner_r)
cairo_line_to(cr,0,corner_r)
cairo_curve_to(cr,0,0,0,0,corner_r,0)
cairo_close_path(cr)

cairo_set_source_rgba(cr,rgb_to_r_g_b(bg_colour,bg _alpha))
cairo_fill(cr)
end
--[[ END BACKGROUND WIDGET ]]
-- ----------------------------------------------------------------------
--[[ TEXT WIDGET ]]

function addzero100(num)

if tonumber(num) < 10 then
return "00" .. num
elseif tonumber(num) <100 then
return "0" .. num
else
return num
end
end

function string:split(delimiter)

local result = { }
local from = 1
local delim_from, delim_to = string.find( self, delimiter, from )
while delim_from do
table.insert( result, string.sub( self, from , delim_from-1 ) )
from = delim_to + 1
delim_from, delim_to = string.find( self, delimiter, from )
end
table.insert( result, string.sub( self, from ) )
return result
end

function circlewriting(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)

local inum=string.len(text)
range=finish
deg=(finish-start)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start+(deg*(i-1))))+var1
interval2=degrads*(start+(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2)
cairo_show_text (cr, (texttable[i]))
cairo_rotate (cr, -interval2)
end
end

function circlewritingdown(cr, text, font, fsize, radi, horiz, verti, tred, tgreen, tblue, talpha, start, finish, var1)

local inum=string.len(text)
deg=(start-finish)/(inum-1)
degrads=1*(math.pi/180)
local textcut=string.gsub(text, ".", "%1@@@")
texttable=string.split(textcut, "@@@")
for i = 1,inum do
ival=i
interval=(degrads*(start-(deg*(i-1))))+var1
interval2=degrads*(start-(deg*(i-1)))
txs=0+radi*(math.sin(interval))
tys=0-radi*(math.cos(interval))
cairo_select_font_face (cr, font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
cairo_set_font_size (cr, fsize);
cairo_set_source_rgba (cr, tred, tgreen, tblue, talpha);
cairo_move_to (cr, txs+horiz, tys+verti);
cairo_rotate (cr, interval2+(180*math.pi/180))
cairo_show_text (cr, (texttable[i]))
cairo_rotate (cr, -interval2-(180*math.pi/180))
end
end

function conky_draw_text()

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



--circlewriting variable
cpu=tonumber(conky_parse('${CPU}'))
--text must be in quotes
text=("CPU " .. (addzero100(cpu)) .. "%")
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=82
positionx=240
positiony=215
colorred=1
colorgreen=0.7
colorblue=0
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450. Finish has to be greater than start.
start=280
finish=350
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewritingdown variables
hdd=tonumber(conky_parse('${fs_used_perc /}'))
--text must be in quotes
text=("FILESYS " .. (addzero100(hdd)) .. "%")
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=82
positionx=240
positiony=215
colorred=1
colorgreen=0.7
colorblue=0
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90. Start has to be greater than finish
start=10
finish=80
letterposition=0
circlewriting(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewritingdown variable
mem=tonumber(conky_parse('${memperc}'))
--text must be in quotes
text=("MEMORY " .. (addzero100(mem)) .. "%")
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=90
positionx=240
positiony=215
colorred=1
colorgreen=0.7
colorblue=0
coloralpha=1
--to set start and finish values for circlewritingdown, if the text will cross 0 degrees then you must calculate for 0-finish degrees
--eg if you want to go from 90 to 270, then you will input 90 to -90. Start has to be greater than finish
start=260
finish=190
letterposition=0.06
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)

--circlewriting variables
swap=tonumber(conky_parse('${swapperc}'))
--text must be in quotes
text=("SWAP " .. (addzero100(swap)) .. "% ")
--font name must be in quotes
font="PT Sans"
fontsize=12
radius=90
positionx=240
positiony=215
colorred=1
colorgreen=0.7
colorblue=0
coloralpha=1
--to set start and finish values for circlewriting, if the text will cross 0 degrees then you must calculate for 360+finish degrees
--eg if you want to go from 270 to 90, then you will input 270 to 450. Finish has to be greater than start.
start=170
finish=100
letterposition=0
circlewritingdown(cr, text, font, fontsize, radius, positionx, positiony, colorred, colorgreen, colorblue, coloralpha, start, finish, letterposition)


end
end
--[[ END TEXT WIDGET ]]
-- ---------------------------------------------------------------
--[[ EQUALIZER WIDGET
v1.0 by wlourf (10 Feb. 2010)
This widget draw a simple bar like (old) equalizers on hi-fi systems.
http://u-scripts.blogspot.com/

The arguments are :
- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument.
If you would not use an argument in the Conky variable, use ''.
- "max" is the maximum value of the bar. If the Conky variable outputs a percentage, use 100.
- "nb_blocks" is the umber of block to draw
- "cap" id the cap of a block, possibles values are CAIRO_LINE_CAP_ROUND , CAIRO_LINE_CAP_SQUARE or CAIRO_LINE_CAP_BUTT
see http://www.cairographics.org/samples/set_line_cap/
- "xb" and "yb" are the coordinates of the bottom left point of the bar
- "w" and "h" are the width and the height of a block (without caps)
- "space" is the space betwwen two blocks, can be null or negative
- "bgc" and "bga" are background colors and alpha when the block is not LIGHT OFF
- "fgc" and "fga" are foreground colors and alpha when the block is not LIGHT ON
- "alc" and "ala" are foreground colors and alpha when the block is not LIGHT ON and ALARM ON
- "alarm" is the value where blocks LIGHT ON are in a different color (values from 0 to 100)
- "led_effect" true or false : to show a block with a led effect
- "led_alpha" alpha of the center of the led (values from 0 to 1)
- "smooth" true or false : colors in the bar has a smooth effect
- "mid_color",mid_alpha" : colors of the center of the bar (mid_color can to be set to nil)
- "rotation" : angle of rotation of the bar (values are 0 to 360 degrees). 0 = vertical bar, 90 = horizontal bar

]]

function equalizer(cr, name, arg, max, nb_blocks, cap, xb, yb, w, h, space, bgc, bga, fgc, fga,alc,ala,alarm,led_effect,led_alpha,smooth,mid_ color,mid_alpha,rotation)
local function rgb_to_r_g_b(colour, alpha)
return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end
local cap_round = CAIRO_LINE_CAP_ROUND
local cap_square = CAIRO_LINE_CAP_SQUARE
local cap_butt = CAIRO_LINE_CAP_BUTT

local function setup_equalizer()

local str = conky_parse(string.format('${%s %s}', name, arg))

local value = tonumber(str)
if value == nil then value = 0 end
if value <= 100 then max = 50 end
local pct = 100*value/max
local pcb = 100/nb_blocks

cairo_set_line_width (cr, h)
cairo_set_line_cap (cr, cap)

local angle= rotation*math.pi/180
for pt = 1,nb_blocks do
local light_on=false
--set colors
local col,alpha = bgc,bga
if pct>=(100/nb_blocks/2) then --start after an half bloc
if pct>=(pcb*(pt-1)) then
light_on=true
col,alpha = fgc,fga
if pct>=alarm and (pcb*pt)>alarm then col,alpha = alc,ala end
end
end

--vertical points
local x1=xb
local y1=yb-pt*(h+space)
local radius0 = yb-y1

local x2=xb+radius0*math.sin(angle)
local y2=yb-radius0*math.cos(angle)

--line on angle
local a1=(y2-yb)/(x2-xb)
local b1=y2-a1*x2

--line perpendicular to angle
local a2=-1/a1
local b2=y2-a2*x2

--dots on perpendicular
local xx0,xx1,yy0,yy1=0,0,0,0
if rotation == 90 or rotation == 270 then
xx0,xx1=x2,x2
yy0=yb
yy1=yb+w
else
xx0,xx1=x2,x2+w*math.cos(angle)
yy0=xx0*a2+b2
yy1=xx1*a2+b2
end

--perpendicular segment
cairo_move_to (cr, xx0 ,yy0)
cairo_line_to (cr, xx1 ,yy1)

--colors
local xc,yc=(xx0+xx1)/2,(yy0+yy1)/2
if light_on and led_effect then
local pat = cairo_pattern_create_radial (xc, yc, 0, xc,yc,w/1.5)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col,led_alpha))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col,alpha))
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
else
cairo_set_source_rgba(cr, rgb_to_r_g_b(col,alpha))
end

if light_on and smooth then
local radius = (nb_blocks+1)*(h+space)
if pt==1 then
xc0,yc0=xc,yc --remember the center of first block
end
cairo_move_to(cr,xc0,yc0)
local pat = cairo_pattern_create_radial (xc0, yc0, 0, xc0,yc0,radius)
cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(fgc,fga))
cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(alc,ala))
if mid_color ~=nil then
cairo_pattern_add_color_stop_rgba (pat, 0.5,rgb_to_r_g_b(mid_color,mid_alpha))
end
cairo_set_source (cr, pat)
cairo_pattern_destroy(pat)
end

cairo_stroke (cr);

end
end
--prevent segmentatioon error
local updates=tonumber(conky_parse('${updates}'))
if updates> 3 then
setup_equalizer()
end
end

-- -------------------------------------------------------------------------------------
function conky_widgets()
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)
-- -------------------------------------------------------------------------------------

cr = cairo_create(cs)
background(cr)
cairo_destroy(cr)
-- ---------------------------------------
cr = cairo_create(cs)
conky_pie_time()
cairo_destroy(cr)

--[[ Вывод часов ]]

cr = cairo_create(cs)
clock(cr, 165, 140, 150, 0xffffff, 1, 0x606070, 1)
cairo_destroy(cr)
-- ---------------------------------------------------------------------------------

cr = cairo_create(cs)
calendar()
cairo_destroy(cr)

-- -------------------------------------------------------------------
cr = cairo_create(cs)
conky_draw_text()
cairo_destroy(cr)
-- ------------------------------------------------------------


cr = cairo_create(cs)

equalizer(cr, 'downspeedf', 'eth0', 1000, 10, CAIRO_LINE_CAP_ROUND, 215, 111, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)

equalizer(cr, 'upspeedf', 'eth0', 100, 10, CAIRO_LINE_CAP_ROUND, 215, 317, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)

cairo_destroy(cr)


end

wlourf
February 27th, 2010, 12:47 PM
Hi boys....

How do I do to remove the shade that I have in the conky?


hi, it's very simple : don't call the background widget in the conky_widgets() function
delete or comment theses three lines :

cr = cairo_create(cs)
background(cr)
cairo_destroy(cr)

degan
February 27th, 2010, 12:58 PM
This:

--[[ Вывод часов ]]

cr = cairo_create(cs)
clock(cr, 165, 140, 150, 0xffffff, 1, 0x606070, 1)
cairo_destroy(cr)
-- ---------------------------------------------------------------------------------

cr = cairo_create(cs)
calendar()
cairo_destroy(cr)

-- -------------------------------------------------------------------
#cr = cairo_create(cs)
#conky_draw_text()
#cairo_destroy(cr)
-- ------------------------------------------------------------


cr = cairo_create(cs)

equalizer(cr, 'downspeedf', 'eth0', 1000, 10, CAIRO_LINE_CAP_ROUND, 215, 111, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)

equalizer(cr, 'upspeedf', 'eth0', 100, 10, CAIRO_LINE_CAP_ROUND, 215, 317, 1, 12, 2, 0x606070, 0.5, 0xffdf00, 0.5, 0xff8700, 1, 80, true, 1, true, 0xff0000, 0.5, 90)

cairo_destroy(cr)


end

miegiel
February 27th, 2010, 06:04 PM
took the pound sign out, still not working. still showing up as black.

Ok, didn't want to complain about it earlier, since it looked like a easy problem. But your question is kind of off-topic in this thread. This thread is for scripts people use in combination with conky (like weather scripts, calendar scripts) and not about the .conkyrc configuration script you use with conky.

The Post your .conkyrc files w/ screenshots (http://ubuntuforums.org/showthread.php?t=281865) mega thread is a better place to ask help.

Ok, that's enough nagging :D

Colors are working fine here. Try my test conky if you like:

# Info on stuff above TEXT here : http://conky.sourceforge.net/config_settings.html
# Info on stuff below TEXT here : http://conky.sourceforge.net/variables.html
#
minimum_size 256 512
maximum_width 1366
gap_x 1
gap_y 1
#alignment bm
update_interval 2.0
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
uppercase no
own_window yes
own_window_type normal # normal desktop override
own_window_transparent no # yes no
own_window_hints skip_taskbar,skip_pager # undecorated,below,above,sticky,skip_taskbar,skip_p ager
own_window_colour black
double_buffer yes
use_xft yes
xftfont Radio Space Bold:size=8 # get font at http://www.dafont.com/radio-space.font
default_color white
text_buffer_size 1024 # The size of this buffer cannot be smaller than the default value of 256 bytes.

#${color green}1 / TRUE / YES${color}${else}${color red}0 / FALSE / NO${color}${endif}
#no test ${font sans:size=8}^_^${font}

TEXT
${color yellow}build_arch ${conky_build_arch}
build_date ${conky_build_date}
conky_version ${conky_version}${color}

${color green}start test${color}

default color ${color 00CCCC} color=00CCCC ${color} default color

${color red}end test${color}

${color yellow}${kernel}
${machine}${if_match "${battery}" != "not present"}${if_match "${execi 60 cat /proc/acpi/battery/BAT0/state | grep charged | awk '{print $3}'}" != "charged"}

${execi 60 cat /proc/acpi/battery/BAT0/state | grep capacity: | awk '{print $3 $4}'}
${execi 60 cat /proc/acpi/battery/BAT0/state | grep rate: | awk '{print $3 $4}'}
${battery_time}${endif}${endif}${color}

wannabegeek
February 27th, 2010, 10:01 PM
hi everyone,
I'm a noob to shell scripting and programming in general...but I really want a conky
that has my wireless connection speed.

I cut and paste a script and got conky to work. I deleted a few things, but don't understand very much of what the code means.

thank you,
wbg



# set to yes if you want Conky to be forked in the background
background yes

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Trebuchet MS:size=10

# Text alpha when using Xft
xftalpha 0.9

# Update interval in seconds
update_interval 1.0

# 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

# If own_window is yes, you may use type normal, desktop or override
own_window_type normal

# Use pseudo transparency with own_window?
own_window_transparent yes

# If own_window is yes, these window manager hints may be used
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area
minimum_size 160 5

# Maximum width
maximum_width 160

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders no

# Stippled borders?
# stippled_borders 8

# border margins
# border_margin 2

# border width
# border_width 1

# Default colors and also border colors
default_color white
default_shade_color red
default_outline_color green

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

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

# 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

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

# variable is given either in format $variable or in ${variable}

# stuff after 'TEXT' will be formatted on screen

# unused text
# Current:${alignr}${execi 20 /home/tonyt/scripts/.conky_eth2} Mbits/sec
# hda Temp:${alignr}${execi 1800 /home/tonyt/scripts/.hdtemp}

TEXT
$sysname $kernel
Uptime:$alignr$uptime
${time %A}$alignr${time %F}

Hostname:$alignr$nodename
ath0:$alignr${addr ath0}
Signal:$alignr${linkstatus ath0}
Current:${alignr}${execi 20 /home/tonyt/scripts/.conky_ath0} Mbits/sec
eth2:$alignr${addr eth2}
Signal:$alignr${linkstatus eth2}
eth0:$alignr${addr eth0}

RAM: $mem/$memmax ${color lightgray}$membar$color
CPU0 ${cpu cpu1}% ${color lightgray}${cpubar cpu1}$color
CPU1 ${cpu cpu2}% ${color lightgray}${cpubar cpu2}$color

hda3: ${fs_used_perc /}% ${color lightgray}${fs_bar /}$color
hda5: ${fs_used_perc /mnt/FILES}% ${color lightgray}${fs_bar /mnt/FILES/}$color
Swap: $swapperc% ${color lightgray}$swapbar$color

Processes: $processes ${alignr}Running: $running_processes

miegiel
February 27th, 2010, 10:15 PM
hi everyone,
I'm a noob to shell scripting and programming in general...but I really want a conky
that has my wireless connection speed.

I cut and paste a script and got conky to work. I deleted a few things, but don't understand very much of what the code means.

thank you,
wbg


...

Read post above yours or just klick and post again here (http://ubuntuforums.org/showthread.php?t=281865).

wannabegeek
February 27th, 2010, 11:02 PM
Hi Miegiel,
I figured these lines are the pertinent ones:

${offset 240}${color}Up: ${color }${upspeed eth0} k/s
${offset 240}${upspeedgraph eth0 20,130 000000 ffffff}
${offset 240}${color}Down: ${color }${downspeed eth0}k/s${color}
${offset 240}${downspeedgraph eth0 20,130 000000 ffffff}

Is upspeed a function call ? and the {} prints the return of upspeed to the screen ?
I would need the name of my wireless, instead of 'eth0'
is that just the name of my network that I see under the network manager ?

thanks !
wbg

miegiel
February 27th, 2010, 11:06 PM
Hi Miegiel,
I figured these lines are the pertinent ones:

${offset 240}${color}Up: ${color }${upspeed eth0} k/s
${offset 240}${upspeedgraph eth0 20,130 000000 ffffff}
${offset 240}${color}Down: ${color }${downspeed eth0}k/s${color}
${offset 240}${downspeedgraph eth0 20,130 000000 ffffff}

Is upspeed a function call ? and the {} prints the return of upspeed to the screen ?
I would need the name of my wireless, instead of 'eth0'
is that just the name of my network that I see under the network manager ?

thanks !
wbg

Yeah, use wlan0 instead of eth0. But, in this thread, you are off-topic ;)

The mega conky thread is here (http://ubuntuforums.org/showthread.php?t=281865) (for showing off and asking help regarding conky).

wlourf
February 28th, 2010, 09:50 PM
Hi folks,

I just updated the audio spectrum analyzer I posted some days ago. My work in this project is nothing comparing to the author of Impulse who made the library used for analyzing the audio output. Because it's not all my work, I can advise you to see the conky in action here (http://www.youtube.com/watch?v=hP9Wt7YKoHM) (I managed to record sound but it is crap and not synchrone with the video, sorry about that).
In this version , I add some "peak" effect and include my bargraph widget in it, so the spectrum can be more colorize, and it is faster !
The updated version is on the post 175 (http://ubuntuforums.org/showpost.php?p=8861782&postcount=175) of this thread.

Bye !

wannabegeek
March 1st, 2010, 07:54 AM
Hi everyone

My friend is getting the Conky bug and is looking for the script used in Parted Magic.
We searched around Parted for it but since we're newbies, and haven't got a handle on grep yet, weren't able to find it.

If you have the script and can post it that is great. Any grep tips are welcome too...

peace,
wbg

andreino
March 1st, 2010, 06:41 PM
Thanks for asking! I'm french and I didn't managed to get dates in french till now.

Here is what I've done for having dates according to my locale settings:
It your conkyrc, in the TEXT section, write

${time}If you want to hide this date ,

use_xft yes
xftalpha 0
default_color 000000It seems it works only for the black color .

Can you check on your system if it also works and I will update the script if it's ok.
I didn't find a better way in Lua script with os.setlocale() for example...
@mrpeachy:
you made an electroencephalogram and I made a pulsing heart, that's funny !
thank so much wlourt
andreino:D

andreino
March 1st, 2010, 11:29 PM
I ask again, help
wlourf
to see pictures of this
lua in my pc
What should I change in the lua and script

for the zip pas1.1

http://ubuntuforums.org/showthread.php?t=1280453&page=13

wlourf
March 2nd, 2010, 12:33 AM
I am not sure to understand your question ;-)

If you want photos from your computer, in the conkyrc use

lua_load /path/to/the/script/photo_album_stack.lua
lua_draw_hook_pre photo_albumand in the lua script (line 33), set the folder you want to use

album_dir = "/home/wlourf/pictures/"If you want random photos from deviant art website, in the conkyrc use

lua_load /path/to/the/script/photo_album_stack.lua
lua_draw_hook_pre photo_album /tmp/img-deviant
TEXT
${exec /path/to/the/script/get_deviation.sh /tmp/img-deviant}
Don't forget to set the path to fit your system in the conkyrc. If you have any errors messages, post them


HTH

andreino
March 2nd, 2010, 04:57 PM
where I put
script photo_album_stack.lua?
where this path?
/ path / to / the
not work in my
path
lua_load ~ / pas1.1/photo_album_stack.lua
pictures not seen


http://upload.centerzone.it/images/63954394191211212651_thumb.jpg (http://upload.centerzone.it/viewer.php?file=63954394191211212651.png)

andreino
March 2nd, 2010, 05:02 PM
The lua
work only

this script

lua_load /path/to/the/script/photo_album_stack.lua
lua_draw_hook_pre photo_album /tmp/img-deviant
TEXT
${exec /path/to/the/script/get_deviation.sh /tmp/img-deviant}

wlourf
March 2nd, 2010, 07:51 PM
show us the errors messages please

andreino
March 2nd, 2010, 08:53 PM
hy wlourf
the terminal is not error -
I do not see the pictures of conky
and does not load the images
Lua
http://www.google.it/images/cleardot.gif

bye

wlourf
March 2nd, 2010, 09:23 PM
hy wlourf
the terminal is not error -
I do not see the pictures of conky
and does not load the images
Lua
http://www.google.it/images/cleardot.gif

bye
for the bash script, you have to do that

chmod +x /path/to/the/script/get_deviation.shbefore using it.
I you have still troubles, send me the files you use on your computer in a Private Message, I will try to help you, or use the conky mega-thread for getting more help, thanks !

dk75
March 2nd, 2010, 10:32 PM
where I put
script photo_album_stack.lua?
wherever you wan't

where this path?
/ path / to / the
not work in my
path
lua_load ~ / pas1.1/photo_album_stack.lua
pictures not seen

it is because You passed "/home/your_login" as your path to the scirpt where it should be "/home/your_login/path/to/the/script.lua"

character "~" is evaluated by shell and Conky as "/home/your_login" and as you passed "space" character after "~" then the rest was ommited and not passed to "lua_load"
It should be ( that if "/home/your_login/pas1.1./photo_album_stack.lua" is a real path to the script )

lua_load ~/pas1.1/photo_album_stack.lua

so not

~<space>/<space>pas1.1/photo_album_stack.lua
but

~/pas1.1/photo_album_stack.lua

andreino
March 2nd, 2010, 10:52 PM
lua

--[[
Photo Album Stack by wlourf based on Photo Album by londonali1010 (2009)

This script draws a photo album of the files in a specified directory.
Files will be displayed randomized. Each time the script is called, a photo is added on the previous one.
Some parameters bellow control how the photo is drawn (position, angle ...).
A file /tmp/photo_album.png is created to keep history of the files displayed.

To call this script in Conky (assuming that you have saved it as ~/scripts/pas1.1/photo_album_stack.lua), use the following before TEXT:
lua_load ~/scripts/photo_album_stack.lua
lua_draw_hook_pre photo_album

Before calling the conky, use
rm /tmp/photo_album.png & conky -c ~/scripts/pas1.1/conkyrc
to start with a blank screen


Changelog:
v1.0 -- Original release (03/01/2010)
v1.1 -- Add a gray shadow on the bottom right side of each image (optional) (31/01/2010)
-- Littles images are no more enlarged
-- Filename can be written in the frame and/or a special area
-- A specific image (instead of a random image) can be use, so we can get random image from the web
]]


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 "~")
-- don't forget the last /
album_dir = "/home/ettore/photo_album"

-- "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
-- this is the "drop zone"
w_max, h_max = 300, 300

-- can images go out the drop zone (0=no, else =yes)? i.e; cutted on the border of the drop zone
out_l = 0 --left
out_r = 0 --right
out_b = 0 --bottom
out_t = 0 --top

-- "xc" and "yc" are the coordinates of the center of the photo album,
-- relative to the top left corner of the Conky window, in pixels
xc, yc = w_max/2, h_max/2

-- dispersion of the images around xc,yc (in pixels)
disp_x = w_max
disp_y = h_max

--pictures are resized to fit the drop zone, but they can be smaller than
--the drop zone if pc <=100
pc = 75

-- "t" is the thickness of the frame, in % of the photo (0 = no frame)
t = 1

-- "s" is to draw a shadow on the bottom right side of the image (true/false)
-- has to be improve with rotation of picture
s = true

-- "update_interval" is the number of Conky updates between refreshes
update_interval = 1

-- angle is the maximum angle of rotation of the image, in degrees (0-180).
angle = 20

-- filename of the image created by the script
image_tmp="/tmp/photo_album.png"

-- filename can be written in the frame if it exists
show_filename = false
font_path = '/usr/share/fonts/truetype/thai'
font_name = 'Purisa'

--and/or at xt,yt of the conky window if font_size>0
--height of text area is twice font_size
font_size = 0
bgcolor={0,0,0}
fgcolor={255,255,255}
xt = 0
yt = 0--800-font_size*2



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)
math.randomseed( os.time() )
num_file_to_show = math.random(num_files)

return conky_parse("${exec ls " .. album_dir .. " | sed -n " .. num_file_to_show .. "p}")
end


function init_drawing_surface()
imlib_set_cache_size(406 * 524)
imlib_context_set_dither(1)
end


function draw_image(fixed_image)
--load fixed image or random image
if fixed_image == nil then
image = imlib_load_image(album_dir .. filename)
else
image = imlib_load_image(fixed_image)
end
if image == nil then
print ("can't open image")
return
end
imlib_context_set_image(image)
w_img0, h_img0 = imlib_image_get_width(), imlib_image_get_height()

--draw a border (frame) ?
bsize = 0
if t>0 then
bsize = math.floor(math.max(w_img0,h_img0)*t/100)
fm=imlib_create_image(w_img0, h_img0)
imlib_context_set_image(fm)
imlib_image_set_has_alpha(1)
imlib_context_set_color(255, 255,255,255);
imlib_image_fill_rectangle(0, 0, w_img0, h_img0);

imlib_blend_image_onto_image(image,1, 0,0, w_img0, h_img0,
bsize,bsize,w_img0-2*bsize, h_img0-2*bsize)
imlib_context_set_image(image)
imlib_free_image()
imlib_context_set_image(fm)
image=fm
else
imlib_context_set_image(image)
end

--draw a shadow ?
ssize=0
if s then
ssize = math.floor(math.max(w_img0,h_img0)/100)
w_img0, h_img0 = imlib_image_get_width(), imlib_image_get_height()
shad=imlib_create_image(w_img0+ssize, h_img0+ssize)
imlib_context_set_image(shad)
imlib_image_set_has_alpha(1)

range = imlib_create_color_range();
imlib_context_set_color_range(range);
-- imlib_context_set_color(0, 0, 255, 255)
-- imlib_add_color_to_color_range(0);
--imlib_context_set_color(255, 0, 0, 255);
imlib_context_set_color(0, 0, 0, 255);
imlib_add_color_to_color_range(0);
imlib_context_set_color(0, 0, 0, 0)
imlib_add_color_to_color_range(100);

imlib_context_set_image(shad);
imlib_image_fill_color_range_rectangle( w_img0,0, w_img0+ssize, h_img0+ssize,180);
imlib_image_fill_color_range_rectangle( 0,h_img0, w_img0+ssize, h_img0+ssize,90);

imlib_blend_image_onto_image(image, 1, 0,0, w_img0, h_img0,
0,0,w_img0, h_img0)
imlib_context_set_image(image)
imlib_free_image()
imlib_context_set_image(shad)

end

--add filename in the frame ?
if show_filename and t>0 then
imlib_add_path_to_font_path(font_path)
font = imlib_load_font(font_name .. '/' .. bsize/2)
imlib_context_set_font(font)
imlib_context_set_color(0, 0, 0, 255);
imlib_text_draw(bsize,h_img0-bsize,filename);
imlib_free_font();
end

--add filename in the text area ?
if font_size>0 then
actual_image=imlib_context_get_image()
imlib_add_path_to_font_path(font_path)
font = imlib_load_font(font_name .. '/' .. font_size)
imlib_context_set_font(font)

text_img=imlib_create_image(w_max, font_size*2)
imlib_context_set_image(text_img)
imlib_image_set_has_alpha(0)
imlib_context_set_color(bgcolor[1],bgcolor[2],bgcolor[3],255);
imlib_image_fill_rectangle(0, 0, w_max, font_size*2);
imlib_context_set_color(fgcolor[1],fgcolor[2],fgcolor[3], 255);
imlib_text_draw(font_size/4,font_size/4,filename);
imlib_context_set_image(actual_image)
end

--rotate image
math.randomseed( os.time() )
if angle == 0 then
angle_rad=0
else
angle_rad = (math.random(angle*2)-angle)*math.pi/180
end
rot_img = imlib_create_rotated_image(angle_rad)
imlib_free_image()
imlib_context_set_image(rot_img)

--after rotation, image is a square
w_img, h_img = imlib_image_get_width(), imlib_image_get_height()
if h_max >= w_max then
width = (w_max - 2*bsize - ssize)
height = width
else
height = (h_max - 2*bsize - ssize)
width = height
end

--prevent enlarge of small images
if width>w_img0 or height>h_img0 then
if h_img0 >= w_img0 then
width = w_img0
height = w_img0
else
width = h_img0
height = h_img0
end
else
width = pc*width/100
height = pc*height/100
end

--create or open final image for the conky
file = io.open(image_tmp, "r")
io.close()
if file == nil then
x=imlib_create_image(w_max,h_max)
imlib_context_set_image(x)
imlib_image_set_has_alpha(1)
imlib_save_image(image_tmp)
imlib_free_image()
end
imageTmp = imlib_load_image(image_tmp)
imlib_context_set_image(imageTmp)
rand_x = 0
if disp_x ~= 0 then
rand_x = math.random(2*disp_x)-disp_x
end
rand_y = 0
if disp_y ~= 0 then
rand_y = math.random(2*disp_y)-disp_y
end

dx = xc - width/2 + rand_x
dy = yc - height/2 + rand_y

--fit in window if asked
-- abs and random values are here to avoid stacks close to the corners
if out_l == 0 then
dx = math.max(0, math.abs(dx))
end
if out_r == 0 then
if dx>(w_max-width) then
dx=math.random(w_max-width)
end
end
if out_t == 0 then
dy = math.max(0,math.abs(dy))
end
if out_b == 0 then
if dy>(h_max-height) then
dy = math.random(h_max-height)
end
end

--add picture (filename) to the final image
imlib_blend_image_onto_image(rot_img, 1, 0,0, w_img, h_img,dx,dy,width,height)

--add text (filename) to the final image
if font_size>0 then
imlib_blend_image_onto_image(text_img, 1, 0,0, w_max,font_size*2,
xt,yt,w_max,font_size*2)
imlib_context_set_image(text_img)
imlib_save_image(image_tmp)
end

-- free memory
imlib_context_set_image(imageTmp)
imlib_save_image(image_tmp)

imlib_render_image_on_drawable(0,0)
imlib_free_image()

imlib_context_set_image(rot_img)
imlib_free_image()

end


function conky_photo_album( fixed_image)
if tonumber(conky_parse("${updates}"))<1 then return end
if conky_window == nil then return end
if fixed_image == nil then
filename = get_file_to_use()
else
filename = fixed_image
end
if filename == "none" then
print(album_dir .. ": No files found ... ")
else
draw_image(fixed_image)
end
end


conky


# -- Conky settings -- #
background no
update_interval 15

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 desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 800 800

alignment tr
gap_x 0
gap_y 0

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


default_color FFFFFF

#For pictures on hard drive folder :

# -- Lua Load -- #
lua_load ~/pas1.1/photo_album_stack.lua
lua_draw_hook_pre photo_album



TEXT



I corrected the lua and conky,my images are in the folder photo_album.
but conky not working

andreino
March 2nd, 2010, 10:59 PM
my terminal error

Conky: desktop window (20000b5) is subwindow of root window (13c)
Conky: window type - desktop
Conky: drawing to created window (0x1800001)
Conky: drawing to double buffer
can't open image
can't open image
can't open image
can't open image
can't open image
can't open image

wlourf
March 2nd, 2010, 11:27 PM
Andreino, you see you have errors in the terminal!

In the Lua script, just before the line :


album_dir = "/home/ettore/photo_album"It is written :

-- don't forget the last /so you have to write

album_dir = "/home/ettore/photo_album/"I know English is not your native language (like me ;)) but well, what can I say ... ? Hmm, I know ... I will add a routine to check if the path is correct ! this time it should works fine (I hope to see your capture on italians forums) !

@dk75, if conkyrc and lua script are in the same folder and if you call the script from this folder in a terminal, you can use

lua_load ./photo_album_stack.lua but I'm sure you knew that. But it seems more complicated when Lua call a python script, if you read this message (http://ubuntuforums.org/showpost.php?p=8901473&postcount=179) and if you have ay idea ... thanks

andreino
March 2nd, 2010, 11:58 PM
wlourf
is all ok thank so much
my englis is poor

ronnie wood in los angeles

thank @dk75

http://upload.centerzone.it/images/64501429557404907634_thumb.jpg (http://upload.centerzone.it/viewer.php?file=64501429557404907634.png)

wlourf
March 4th, 2010, 07:02 PM
rock'n roll andreino ;)

this post to says that the voting is now open for the conky of the month competition over on the conky blog. And the vote is very short because it will close on sunday!
http://blog.conky.be/2010/03/01/please- … m-entries/ (http://blog.conky.be/2010/03/01/please-vote-on-februarys-cotm-entries/)

(http://blog.conky.be/2010/03/01/please-vote-on-februarys-cotm-entries/)
So go there and pick the one that fit whit that :



Visual composition
Conky innovation
Adherence to theme, "St. Valentine's Day/Massacre"


I hope its okay to post this... (It's not my intention to try and solicit votes for myself of course ...:P)

Happy Conkying !

wlourf
March 10th, 2010, 01:42 PM
Hi all !

I am an Openbox + Ubuntu user but sometimes, I can't remember some shortcuts. So I wrote a script to display the shorcuts (keyboard+mouse) from rc.xml in a conky window, and this window is called with a shortcut (!) only when I need it. Maybe this kind of script already exist but I didn't find it :P.

First I need a conkyrc template . The python script will use this file to create a conkyrc in a new file.
The only thing to do in this file is to choose yours colors.
The name of the file is conky_template.

The python script shortcuts.py read the openbox's rc.xml file.
There are some parameters to set at the beginning of the script :

#!/usr/bin/env python
# coding=utf-8

#this script read the file rc.xml for OpenBox configuration
#and returns the shortcuts for Mouse ou Keyboard in a file called by conky
#wlourf 07/03/2010 http://u-scripts.blogspot.com/

import sys
import xml.etree.ElementTree as etree

#full path and name of the rc.xml file
rc_path_file="/home/ll/.config/openbox/rc.xml"
#template of conkyrc to use
conkytemplate_path_file ="/home/ll/scripts/raccourcis/conky_template"

#column width (Ms = souris, Kb= clavier)
lgColMs=50
lgColKb=40

#Number of lines per Column (Ms = souris, Kb= clavier)
nbLnMs=30
nbLnKb=30

#in "Keyboard" array, "appliFirst" will display application name before shorcut
appliFirst=True

#END OF THE PARAMETERS !

Next, a little bash script launcher.sh needed to run the python script and to call conky. Don't forget to make it executable.

The 3 files are in the attchment.

In your rc.xml, you have to add two shortcuts to run launcher.sh with parameters


<keybind key="W-r">
<action name="Execute">
<name>shortcuts for desktop</name>
<command>/home/ll/scripts/raccourcis/launcher.sh /tmp/conky_kb k</command>
</action>
</keybind>
<keybind key="W-s">
<action name="Execute">
<name>shortcuts for mouse</name>
<command>/home/ll/scripts/raccourcis/launcher.sh /tmp/conky_ms m</command>
</action>
</keybind>
And the output, for the keyboard :
http://img294.imageshack.us/img294/5571/sckb.th.png (http://img294.imageshack.us/i/sckb.png/)

and the output for the mouse :
http://img251.imageshack.us/img251/1161/scms.th.png (http://img251.imageshack.us/i/scms.png/)

Edit : 29/04/2010, v1.1 :
Keyboard shortcuts without commands are no more displayed.
Long command lines are shortened in the dispay to fit the column width.
Edit : 02/05/2010 v1.2 thanks buttate_la _pasta :)
In keyboard section, when a command string hold the full path to the executable,
it keeps only the name of the executable itself

vickoxy
March 22nd, 2010, 12:39 AM
Here's a fairly simple script to display a normal calendar with conky. It shows the last few days of the previous month as well as the first few days of the next month.

You can have the month/year line a different color and the days of the week line a different color.


#!/bin/bash
date=$(date '+%F')
DAY=${date:8:2}
DAY=${DAY/#0/}
cal=$(cal)
prev=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1)
next=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1)
if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next"
else next="\${color9} $next"
fi
if [ ${#prev} == 20 ]; then prev="$prev"$'\n '
else prev="$prev "
fi
echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${colo r9}$prev\${color}$(echo "${cal:42}" | sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' -e /" $DAY "/s/" $DAY "/" "'${color3}'"$DAY"'${color}'" "/ -e 's/^ //' -e 's/ *$//')$next"
140669

I did it this way to limit the number of calls to cal as I was calling it a few times. Now it's just 3. :)

According to my problem /to mark all the week days with different color (http://ubuntuforums.org/showthread.php?t=1433914)/ i tried to use this scripts, but output is very odd:

mobilediesel
March 22nd, 2010, 01:23 AM
According to my problem /to mark all the week days with different color (http://ubuntuforums.org/showthread.php?t=1433914)/ i tried to use this scripts, but output is very odd:

The script has to be called with execpi instead of execi.

The simplest calendar to color the current day different is this one:

cal|sed -e 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'
or for starting the week on Monday:

cal -m|sed -e 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

For the making the weekdays different color from weekend, I'm not sure yet how to do that. I might have figured it out using sed but I still have to mess with it.

vickoxy
March 22nd, 2010, 08:31 AM
The script has to be called with execpi instead of execi.

The simplest calendar to color the current day different is this one:

cal|sed -e 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'
or for starting the week on Monday:

cal -m|sed -e 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

For the making the weekdays different color from weekend, I'm not sure yet how to do that. I might have figured it out using sed but I still have to mess with it.

Well, i successfully use one line calendar-having no colored days. So i tried to use one of your scripts (there are weekdays colored with different colors). I saved it in /home/cal.sh and executed it with ${execpi 60 ~/cal.sh}, but i got nothing...

vickoxy
March 28th, 2010, 09:56 AM
This is sort of bump again. So this is my cal line:


${voffset -72}${font andale mono:size=7}${color ffffff}${execpi 600 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc -30} /' | sed /" $DJS "/s/" $DJS "/" "'${color 00A9CB}'"$DJS"'${color ffffff}'" "/}${font}

So, if anyone knows how/where to put/ to mark week days with different color, not default one.

Thanks

dgw
March 28th, 2010, 02:04 PM
I made a simple bash script that shows what filesystems are mounted and details about them. I have it refreshed every 10 seconds in my conky, so if I connect a flash drive to my computer or something, I see it show up pretty quickly in conky. It shows / and it shows stuff that's mounted in /media.


#!/bin/bash

# change this to reflect your mount point
mountPoint="media"

# root
rootDrive=`df -h | awk '{print $(NF)}' | grep "/" | grep -v "dev" | head -1`
drivePercent=`df -h | awk '{print $(NF-1)}' | grep "%" | head -1`
usedSpace=`df -h | grep "%" | grep -v "Use%" | awk '{print $(NF-3)}' | head -1`
totalSpace=`df -h | grep "%" | grep -v "Use%" | awk '{print $(NF-4)}' | head -1`

printf "%-16s%5s%-10s%-12s\n" "Filesystems:" "Used" " / Total" "Percent"
printf "%-16s%5s%-10s%-12s\n" " $rootDrive" $usedSpace " / $totalSpace" "$drivePercent"

# everything that's mounted in the mount point
for drive in `df -h |grep "/media" | awk '{print $(NF)}' | cut -d"/" -f3 | cut -b -12`
do
drivePercent=`df -h |grep "$mountPoint/"$drive | awk '{print $(NF-1)}'`
usedSpace=`df -h |grep "$mountPoint/"$drive | awk '{print $(NF-3)}'`
totalSpace=`df -h |grep "$mountPoint/"$drive | awk '{print $(NF-4)}'`
printf "%-16s%5s%-10s%-12s\n" " $drive" $usedSpace " / $totalSpace" $drivePercent
doneI guess there's probably a better way of doing this, but this does what I wanted it to do.

mobilediesel
March 28th, 2010, 06:54 PM
This is sort of bump again. So this is my cal line:


${voffset -72}${font andale mono:size=7}${color ffffff}${execpi 600 DJS=`date +%_d`; cal | sed '1d' | sed '/./!d' | sed 's/$/ /' | fold -w 21 | sed -n '/^.\{21\}/p' | sed 's/^/${alignc -30} /' | sed /" $DJS "/s/" $DJS "/" "'${color 00A9CB}'"$DJS"'${color ffffff}'" "/}${font}

So, if anyone knows how/where to put/ to mark week days with different color, not default one.

Thanks

I was working on it when you first posted. I got distracted with other stuff offline. Here's what I came up with:

First, that calendar code can be simplified to:

cal | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

To color weekends different from weekdays:

cal | sed '/^ *$/d' | sed -r '2,8s/^(.{18})(.{2})/\1${color red}\2${color}/' | sed -r '2,8s/^(.{0})(.{2})/\1${color red}\2${color}/'

Add the code for coloring current day:

cal | sed '/^ *$/d' | sed -r '2,8s/^(.{18})(.{2})/\1${color red}\2${color}/' | sed -r '2,8s/^(.{0})(.{2})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

Or to start the week on Monday instead of Sunday:

cal -m | sed '/^ *$/d' | sed -r '2,8s/^(.{0})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

vickoxy
March 28th, 2010, 07:09 PM
I was working on it when you first posted. I got distracted with other stuff offline. Here's what I came up with:

First, that calendar code can be simplified to:

cal | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

To color weekends different from weekdays:

cal | sed '/^ *$/d' | sed -r '2,8s/^(.{18})(.{2})/\1${color red}\2${color}/' | sed -r '2,8s/^(.{0})(.{2})/\1${color red}\2${color}/'

Add the code for coloring current day:

cal | sed '/^ *$/d' | sed -r '2,8s/^(.{18})(.{2})/\1${color red}\2${color}/' | sed -r '2,8s/^(.{0})(.{2})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

Or to start the week on Monday instead of Sunday:

cal -m | sed '/^ *$/d' | sed -r '2,8s/^(.{0})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

Thanks for helping. Actually i just want to have week days names (Mo Tu We Th Fr Sa Su) colored and current day.

The second thing is - i do not need in cal the current month and date above calendar, because i placed it somewhere else.

So, on picture you can see my cal and i just want these week days names colored.

Thanks a lot

mobilediesel
March 28th, 2010, 07:25 PM
Thanks for helping. Actually i just want to have week days names (Mo Tu We Th Fr Sa Su) colored and current day.

The second thing is - i do not need in cal the current month and date above calendar, because i placed it somewhere else.

So, on picture you can see my cal and i just want these week days names colored.

Thanks a lot

You're welcome. This will remove the month/year line and only color the day names:

cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

vickoxy
March 28th, 2010, 07:43 PM
You're welcome. This will remove the month/year line and only color the day names:

cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

Well, i have some issues-if i add these lines after ${execpi 600
everything in my conky is dead/invisible after cal line. Other then that-there are only Mo and TU colored, but not the other days (neither current day) ?

wannabegeek
March 28th, 2010, 08:15 PM
Hello all conky fans

I have been cleaning up my desktop and finally got rid of the volume and wireless indicator
icons in the top right of my panel.

So, I've been updating my conky to include all that info...

So far it's been easy, but I'm stuck on using ${mixer} and ${mixerbar}
I've been reading a lot this morning and don't know what I'm missing.

I just want the default master mixer volume # and a simple bar.
I get a '0' and a empty bar that doens't repsond to changes in volumes, although
the sound gui does show a change when I press the short cut keys.



thank you,
wbg

mobilediesel
March 28th, 2010, 08:58 PM
Well, i have some issues-if i add these lines after ${execpi 600
everything in my conky is dead/invisible after cal line. Other then that-there are only Mo and TU colored, but not the other days (neither current day) ?

Run this in the terminal and paste the output:

cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

vickoxy
March 28th, 2010, 08:59 PM
mini@mini:~$ cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'
${color red}Mo Di${color} Mi Do Fr Sa So
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 ${color white}28${color}
29 30 31

mobilediesel
March 29th, 2010, 09:13 AM
See if this is closer to what you're looking for:

cal -m | sed '1d' | sed '/^ *$/d' | sed -r '1,8s/^(.{15})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'

yeleek
March 29th, 2010, 09:39 AM
Submitted to Sec as its more for people with that type of interest.

However incase people find the use of color (colour!) helpful

http://ubuntuforums.org/showthread.php?t=1441718

vickoxy
March 29th, 2010, 10:21 AM
See if this is closer to what you're looking for:

cal -m | sed '1d' | sed '/^ *$/d' | sed -r '1,8s/^(.{15})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'


Actually this is what i have. Only need to change days names colors (not the dates...) And after calendar my other stuff in conky are dead-have nothing after calendar...

Could you post what do i have to add in conky (${execpi 600... and till the end)?

mobilediesel
March 29th, 2010, 12:58 PM
Actually this is what i have. Only need to change days names colors (not the dates...) And after calendar my other stuff in conky are dead-have nothing after calendar...

Could you post what do i have to add in conky (${execpi 600... and till the end)?

To color just the day names:

${execpi 3600 cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{15})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'}

I'm not sure why conky would not display anything after the calendar, though.

vickoxy
March 29th, 2010, 01:11 PM
To color just the day names:

${execpi 3600 cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{15})(.{5})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'}

I'm not sure why conky would not display anything after the calendar, though.

Now it is better-it does not crush conky. Still, can i have all names colored, not only weekend?
And second: how to align it to center (see pict)?

Thanks

mobilediesel
March 29th, 2010, 01:58 PM
Now it is better-it does not crush conky. Still, can i have all names colored, not only weekend?
And second: how to align it to center (see pict)?

Thanks


${execpi 3600 cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{20})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'|sed 's/^/${alignc}/'}

If that doesn't properly center the calendar, change the alignc to goto 100 and adjust the number from there.

vickoxy
March 29th, 2010, 02:12 PM
${execpi 3600 cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{20})/\1${color red}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color white}&${color}/'|sed 's/^/${alignc}/'}

If that doesn't properly center the calendar, change the alignc to goto 100 and adjust the number from there.

Thanks a lot. That did it. :popcorn:


${voffset -72}${font andale mono:size=7}${color ffffff}${execpi 3600 cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{20})/\1${color BFEEFC}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color 4CD5FF}&${color}/'|sed 's/^/${alignc -30}/'}


Just don´t understand those lines and where to put colors and other stuff. Once again, thanks a lot.

mobilediesel
March 30th, 2010, 05:04 AM
Thanks a lot. That did it. :popcorn:


${voffset -72}${font andale mono:size=7}${color ffffff}${execpi 3600 cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/^(.{0})(.{20})/\1${color BFEEFC}\2${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color 4CD5FF}&${color}/'|sed 's/^/${alignc -30}/'}


Just don´t understand those lines and where to put colors and other stuff. Once again, thanks a lot.

I edited the code a little bit. Nothing important so you don't need to edit yours.

Here it is with color coding to explain the different parts:

cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/.*/${color BFEEFC}&${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color 4CD5FF}&${color}/'|sed 's/^/${alignc -30}/'

Removes the first line. (Month and year)
Removes any blank lines.
The 0 means it'll only change the first line. It adds the color to the beginning and end of the line. (Names of the days of the week.)
Surrounds the current day number with color code.
Adds the alignment code to the beginning of each line.

vickoxy
March 30th, 2010, 07:28 AM
I edited the code a little bit. Nothing important so you don't need to edit yours.

Here it is with color coding to explain the different parts:

cal -m | sed '1d' | sed '/^ *$/d' | sed -r '0,/./s/.*/${color BFEEFC}&${color}/' | sed 's/\<'"$(date +%-d)"'\>/${color 4CD5FF}&${color}/'|sed 's/^/${alignc -30}/'

Removes the first line. (Month and year)
Removes any blank lines.
The 0 means it'll only change the first line. It adds the color to the beginning and end of the line. (Names of the days of the week.)
Surrounds the current day number with color code.
Adds the alignment code to the beginning of each line.

Well, thanks-i just have to add this answer to my bookmarks. Still it is hard to know where exactly to put those values. :popcorn:

wannabegeek
April 1st, 2010, 09:25 PM
anyone have a suggestion for making {mixer} and {mixerbar} work...
all I get is a 0 for master volume and an empty bar...

tia
wbg


# set to yes if you want Conky to be forked in the background
background yes

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Trebuchet MS:size=10

# Text alpha when using Xft
xftalpha 0.9

# Update interval in seconds
update_interval 1.0

# 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

# If own_window is yes, you may use type normal, desktop or override
own_window_type override

# Use pseudo transparency with own_window?
own_window_transparent yes

# If own_window is yes, these window manager hints may be used
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area
#minimum_size 150 5

# Maximum width
maximum_width 140

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders no

# Stippled borders?
# stippled_borders 8

# border margins
# border_margin 2

# border width
# border_width 1

# Default colors and also border colors
default_color black
default_shade_color red
default_outline_color green

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

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

# 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

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

# variable is given either in format $variable or in ${variable}

# stuff after 'TEXT' will be formatted on screen

# unused text
# $sysname $kernel
# Uptime:$alignr$uptime
# ${time %A}$alignr${time %F}
# hda1: ${fs_used_perc /mnt/FILES}% ${color lightgray}${fs_bar /mnt/FILES/}$color
# Swap: $swapperc% ${color lightgray}$swapbar$color
# Signal:$alignr${linkstatus ath0}
# Current:${alignr}${execi 20 /home/tonyt/scripts/.conky_ath0} Mbits/sec
# eth2:$alignr${addr eth2}
# ${upspeedgraph wlan0 20,130 000000 ffffff}
# ${downspeedgraph wlan0 20,130 000000 ffffff}

TEXT

${color black}${time %e %B %G}
${color black}${time %I:%M %P}
Up-load ${upspeed wlan0} k/s
Down-Load ${downspeed wlan0}k/s${color}
RAM: $mem/$memmax
${color darkgray}$membar$color
CPU0 ${cpu cpu1}% ${color darkgray}${cpubar cpu1}$color
CPU1 ${cpu cpu2}% ${color darkgray}${cpubar cpu2}$color
sda1: ${fs_used_perc /}% ${color darkgray}${fs_bar /}$color
Processes: $processes ${alignr}Running: $running_processes
HDD Temp ${execi 5 hddtemp /dev/sda1 | cut -c 34-36}Deg C
Battery: $battery_short
${color black}$battery_bar
Volume:${mixer}
${color blue}${mixerbar}

wlourf
April 7th, 2010, 04:13 PM
Hi folks !

For my personal use I wrote a Lua script used to transform square image to "rounded" image (ie circle with transparency).
I also wrote a script to get images from Moon or from Earth...

From this image http://img62.imageshack.us/img62/6329/13851582.th.jpg (http://img62.imageshack.us/i/13851582.jpg/) to this one (in a conky) http://img215.imageshack.us/img215/6806/earthx.th.png (http://img215.imageshack.us/i/earthx.png/)


First, the script to get the moon or earth image : get_moon_earth.sh (to get the moon you need to pass moon as parameter). The parameters at the beginning of the script are the same as on this page : http://www.fourmilab.ch/earthview/expert.html

#!/bin/bash
#This script download image from Earth or from Moon (if first parameter = "moon")
#the parameters are the sames as on this page
#http://www.fourmilab.ch/earthview/expert.html
#version1.0, wlourf 07 avril 2010
#http://u-scripts.blogspot.com/


#===========début des paramètres===============
dir="/tmp/earth"

if [[ "$1" == "moon" ]]; then
Latitude=46 #number
NorthSouth=n #n/s
Longitude=0 #number
EastWest=e #e/w
Altitude=401725 #altitude in kilometers (max=401725)
#___Image___
Image=topo #topo,albedo
Size=320 #number (default=320)
ShowNight=true #true/false
file1=$dir/get_moon.txt #temp file for url
file2=$dir/moon_image #final image
else
#___View___
Latitude=33 #number
NorthSouth=n #n/s
Longitude=70 #number
EastWest=e #e/w
Altitude=35785 #altitude in kilometers (max=35785)
#___Image___
Image=live #live,marble,nasa,topo,cloudy,ir,cweather,vapour_b g,vapour
Size=320 #number (default=320)
ShowNight=true #true/false
file1=$dir/get_earth.txt #temp file for url
file2=$dir/earth_image #final image
fi

#===========fin des paramètres===============

base=http://www.fourmilab.ch

#mise en forme des paramètres
if [[ "$NorthSouth" == "s" ]]; then
NorthSouth="South"
else
NorthSouth="North"
fi
if [[ "$EastWest" == "e" ]]; then
EastWest="East"
else
EastWest="West"
fi

if [[ "$ShowNight" == true ]]; then
DayNight=""
else
DayNight="&daynight=d"
fi
if [[ "$1" == "moon" ]]; then
case $Image in
"topo") Image="MoonTopo.evif";;
*) Image="Moon.evif";;
esac
else
case $Image in
"marble") Image="NASA500m.evif";;
"nasa") Image="nasa.evif";;
"topo") Image="NOAAtopo.evif";;
"clouds") Image="cloudy.bmp";;
"ir") Image="irsat.bmp";;
"cweather") Image="wx-cmap.bmp";;
"vapour_bg")Image="vapour_bg.bmp";;
"vapour") Image="vapour.bmp";;
*) Image="learth.evif";;
esac
fi

#get the url
mkdir -p $dir
cd $dir

GET http://www.fourmilab.ch/cgi-bin/Earth?lat=$Latitude\&ns=l$NorthSouth\&lon=$Longitude\&ew=$EastWest\&alt=$Altitude$DayNight\&img=$Image\&imgsize=$Size > $file1

#extract the line of the image
match="<img src="
url_line=""
while read line
do
if [[ "$line" =~ "${match}" ]]; then
url_line=$line
break
fi
done < $file1

if [[ "$url_line" == "" ]]; then
echo "no url matched"
exit
fi

#extract the link of the image and save the image
begin="<img src=\""
end="\" ismap"

a=$(($(expr "$url_line" : ".*$begin")))
b=$(($(expr "$url_line" : ".*$end")-$a-${#end}))
url_image=${url_line:$a:$b}
GET $base$url_image > $file2

exitThe Lua script square_to_round.lua :

--[[ SQUARE_TO_ROUND WIDGET by Wlourf (07 April 2010, version 1.0.1)
http://u-scripts.blogspot.com/

This widget display a rounded image on your conky from a square image only.

Parameters are
filename --name of picture to use
xc,yc --coordinates of the center of circle relative to top left corner of conky window
radius --radius of the circle
angle --angle of rotation in degrees
radius_crop --percentage of original image to keep (0-100)
period --convert input image to output image every 'period' seconds

]]

require 'cairo'
require 'imlib2'


function convert_square(fileIn,fileOut,radius,angle,radius_ crop)
--convert Input file from jpg to png, scale it and rotate it
local imageInput = imlib_load_image(fileIn)
local out_size = radius*2/(radius_crop/100)
imlib_context_set_image(imageInput)
w = imlib_image_get_width();
h = imlib_image_get_height();
imlib_image_set_format("png")
buffer = imlib_create_image(out_size,out_size);
imlib_context_set_image(buffer);

imlib_blend_image_onto_image(imageInput, 0,
0, 0, w, h,
0,0, out_size,out_size)
rot_img=imlib_create_rotated_image(angle*math.pi/180)
imlib_context_set_image(rot_img)
imlib_save_image(fileOut)
imlib_free_image()

imlib_context_set_image(buffer)
imlib_free_image()
imlib_context_set_image(imageInput)
imlib_free_image()
end

function crop_square_to_round(filename,xc,yc,radius)
local surface = cairo_image_surface_create_from_png(filename)
local img_w = cairo_image_surface_get_width (surface);

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)
cairo_translate(cr,xc-img_w/2,yc-img_w/2)
cairo_arc (cr, img_w/2,img_w/2, radius, 0, 2*math.pi)
cairo_clip (cr)
cairo_new_path (cr)
cairo_set_source_surface (cr, surface, 0, 0)

cairo_paint (cr)
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)

end

function display_round(filename,xc,yc,radius,angle,radius_c rop,period)
if conky_window == nil then return end

if tonumber(conky_parse('${updates}')) <2 then return end
local filepng = filename .. ".png"
local actual_time = os.time()

if last_time == nil then last_time=0 end
local actual_img = io.open(filepng,"r")
if last_time+period < actual_time or last_time == 0 or actual_img == nil then
print ('convert image ' .. filename)
convert_square(filename,filepng,radius,angle,radiu s_crop)
last_time=actual_time
end
crop_square_to_round(filepng,xc,yc,radius)
io.close()
end


--[[END OF SQUARE TO ROUND WIDGET]]

function conky_main(filename)
if conky_window == nil then return end
display_round(filename,
275,275,120, --xc,yc,radius
5, --angle
98, --radius_crop (1-100)
3600 --period

)
end
And the conkyrc

# -- Conky settings -- #
background no
update_interval 10

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
own_window_colour FFFFFF
own_window_title square to round

border_inner_margin 0
border_outer_margin 0

minimum_size 450 550

alignment tm
gap_y 0
gap_x 0

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=12
xftalpha 0

uppercase no

default_color 000000
text_buffer_size 2048
imlib_cache_size 0
#--- LUA ---
lua_load ~/wip/earth/square_to_round.lua
#first parameter is the square image to use
lua_draw_hook_pre main /tmp/earth/earth_image

TEXT
${execpi 3600 ~/wip/earth/get_moon_earth.sh earth}
And if you are inspired, you can get amazing conkys like this one :
http://img101.imageshack.us/img101/8289/moon2.th.png (http://img101.imageshack.us/i/moon2.png/)


Happy conkying :P

EDIT : a more simple way to have rounded images is here, with a script from larryni : http://wwww.ubuntuforums.org/showpost.php?p=9541241&postcount=13076
You need the 2 masks from the above topic.

I use it now in my script, so it gives that :

#!/bin/bash
#This script download image from Earth or from Moon (if first parameter = "moon")
#the parameters are the sames as on this page
#http://www.fourmilab.ch/earthview/expert.html
#version1.1, wlourf 14 sept. 2010
#http://u-scripts.blogspot.com/
#http://ubuntuforums.org/showpost.php?p=9088516&postcount=244

#http://ubuntuforums.org/showpost.php?p=8117609&postcount=9846
#http://wwww.ubuntuforums.org/showpost.php?p=9541241&postcount=13076

#first parameter moon to display moon, other or mssing = earth

#===========début des paramètres===============
dir="/tmp/earth"
dirmasks="/home/ll/conky/earth"

if [[ "$1" == "moon" ]]; then
Latitude=47.243055556 #number
NorthSouth=n #n/s
Longitude=6.021944444 #number
EastWest=e #e/w
Altitude=401725 #altitude in kilometers (max=401725)
#___Image___
Image=topo #topo,albedo
Size=100 #number (default=320)
ShowNight=true #true/false
file1=$dir/get_moon.txt #temp file for url
file2=$dir/moon_image #final image
basename="moon"
else
#___View___
Latitude=47.243055556 #number
NorthSouth=n #n/s
Longitude=6.021944444 #number
EastWest=e #e/w
Altitude=35785 #altitude in kilometers (max=35785)
#___Image___
Image=live #live,marble,nasa,topo,cloudy,ir,cweather,vapour_b g,vapour
Size=100 #number (default=320)
ShowNight=true #true/false
file1=$dir/get_earth.txt #temp file for url
file2=$dir/earth_image #final image
basename="earth"
fi

#===========fin des paramètres===============

base=http://www.fourmilab.ch

#mise en forme des paramètres
if [[ "$NorthSouth" == "s" ]]; then
NorthSouth="South"
else
NorthSouth="North"
fi
if [[ "$EastWest" == "e" ]]; then
EastWest="East"
else
EastWest="West"
fi

if [[ "$ShowNight" == true ]]; then
DayNight=""
else
DayNight="&daynight=d"
fi
if [[ "$1" == "moon" ]]; then
case $Image in
"topo") Image="MoonTopo.evif";;
*) Image="Moon.evif";;
esac
else
case $Image in
"marble") Image="NASA500m.evif";;
"nasa") Image="nasa.evif";;
"topo") Image="NOAAtopo.evif";;
"clouds") Image="cloudy.bmp";;
"ir") Image="irsat.bmp";;
"cweather") Image="wx-cmap.bmp";;
"vapour_bg")Image="vapour_bg.bmp";;
"vapour") Image="vapour.bmp";;
*) Image="learth.evif";;
esac
fi

#get the url
mkdir -p $dir
cd $dir

wget -q http://www.fourmilab.ch/cgi-bin/Earth?lat=$Latitude\&ns=l$NorthSouth\&lon=$Longitude\&ew=$EastWest\&alt=$Altitude$DayNight\&img=$Image\&imgsize=$Size -O $file1

#extract the line of the image
url_image="$(cat $file1 | grep "<img src=" | awk -F'\"' '{print $2}' )"

if [[ "$url_image" == "" ]]; then
echo "no url matched"
exit
fi

#extract the link of the image and save the image
wget -q $base$url_image -O $file2

convert $file2 -colorspace Gray $dirmasks/overlay$Size.png -compose HardLight -composite $dirmasks/mask$Size.png -alpha off -compose CopyOpacity -composite $dir/$basename-out.png

#convert $file2 -colorspace Gray $dirmasks/mask$Size.png -alpha off -compose CopyOpacity -composite $dir/$basename-out.png

exit 0

dmillerct
April 7th, 2010, 04:28 PM
Hi folks !

For my personal use I wrote a Lua script used to transform square image to "rounded" image (ie circle with transparency).
I also wrote a script to get images from Moon or from Earth...

From this image http://img62.imageshack.us/img62/6329/13851582.th.jpg (http://img62.imageshack.us/i/13851582.jpg/) to this one (in a conky) http://img215.imageshack.us/img215/6806/earthx.th.png (http://img215.imageshack.us/i/earthx.png/)


First, the script to get the moon or earth image : get_moon_earth.sh (to get the moon you need to pass moon as parameter). The parameters at the beginning of the script are the same as on this page : http://www.fourmilab.ch/earthview/expert.html (http://www.fourmilab.ch/earthview/expert.html,)

#!/bin/bash
#This script download image from Earth or from Moon (if first parameter = "moon")
#the parameters are the sames as on this page
#http://www.fourmilab.ch/earthview/expert.html
#version1.0, wlourf 07 avril 2010
#http://u-scripts.blogspot.com/


#===========début des paramètres===============
dir="/tmp/earth"

if [[ "$1" == "moon" ]]; then
Latitude=46 #number
NorthSouth=n #n/s
Longitude=0 #number
EastWest=e #e/w
Altitude=401725 #altitude in kilometers (max=401725)
#___Image___
Image=topo #topo,albedo
Size=320 #number (default=320)
ShowNight=true #true/false
file1=$dir/get_moon.txt #temp file for url
file2=$dir/moon_image #final image
else
#___View___
Latitude=33 #number
NorthSouth=n #n/s
Longitude=70 #number
EastWest=e #e/w
Altitude=35785 #altitude in kilometers (max=35785)
#___Image___
Image=live #live,marble,nasa,topo,cloudy,ir,cweather,vapour_b g,vapour
Size=320 #number (default=320)
ShowNight=true #true/false
file1=$dir/get_earth.txt #temp file for url
file2=$dir/earth_image #final image
fi

#===========fin des paramètres===============

base=http://www.fourmilab.ch

#mise en forme des paramètres
if [[ "$NorthSouth" == "s" ]]; then
NorthSouth="South"
else
NorthSouth="North"
fi
if [[ "$EastWest" == "e" ]]; then
EastWest="East"
else
EastWest="West"
fi

if [[ "$ShowNight" == true ]]; then
DayNight=""
else
DayNight="&daynight=d"
fi
if [[ "$1" == "moon" ]]; then
case $Image in
"topo") Image="MoonTopo.evif";;
*) Image="Moon.evif";;
esac
else
case $Image in
"marble") Image="NASA500m.evif";;
"nasa") Image="nasa.evif";;
"topo") Image="NOAAtopo.evif";;
"clouds") Image="cloudy.bmp";;
"ir") Image="irsat.bmp";;
"cweather") Image="wx-cmap.bmp";;
"vapour_bg")Image="vapour_bg.bmp";;
"vapour") Image="vapour.bmp";;
*) Image="learth.evif";;
esac
fi

#get the url
mkdir -p $dir
cd $dir

GET http://www.fourmilab.ch/cgi-bin/Earth?lat=$Latitude\&ns=l$NorthSouth\&lon=$Longitude\&ew=$EastWest\&alt=$Altitude$DayNight\&img=$Image\&imgsize=$Size > $file1

#extract the line of the image
match="<img src="
url_line=""
while read line
do
if [[ "$line" =~ "${match}" ]]; then
url_line=$line
break
fi
done < $file1

if [[ "$url_line" == "" ]]; then
echo "no url matched"
exit
fi

#extract the link of the image and save the image
begin="<img src=\""
end="\" ismap"

a=$(($(expr "$url_line" : ".*$begin")))
b=$(($(expr "$url_line" : ".*$end")-$a-${#end}))
url_image=${url_line:$a:$b}
GET $base$url_image > $file2

exitThe Lua script square_to_round.lua :

--[[ SQUARE_TO_ROUND WIDGET by Wlourf (07 April 2010, version 1.0.1)
http://u-scripts.blogspot.com/

This widget display a rounded image on your conky from a square image only.

Parameters are
filename --name of picture to use
xc,yc --coordinates of the center of circle relative to top left corner of conky window
radius --radius of the circle
angle --angle of rotation in degrees
radius_crop --percentage of original image to keep (0-100)
period --convert input image to output image every 'period' seconds

]]

require 'cairo'
require 'imlib2'


function convert_square(fileIn,fileOut,radius,angle,radius_ crop)
--convert Input file from jpg to png, scale it and rotate it
local imageInput = imlib_load_image(fileIn)
local out_size = radius*2/(radius_crop/100)
imlib_context_set_image(imageInput)
w = imlib_image_get_width();
h = imlib_image_get_height();
imlib_image_set_format("png")
buffer = imlib_create_image(out_size,out_size);
imlib_context_set_image(buffer);

imlib_blend_image_onto_image(imageInput, 0,
0, 0, w, h,
0,0, out_size,out_size)
rot_img=imlib_create_rotated_image(angle*math.pi/180)
imlib_context_set_image(rot_img)
imlib_save_image(fileOut)
imlib_free_image()

imlib_context_set_image(buffer)
imlib_free_image()
imlib_context_set_image(imageInput)
imlib_free_image()
end

function crop_square_to_round(filename,xc,yc,radius)
local surface = cairo_image_surface_create_from_png(filename)
local img_w = cairo_image_surface_get_width (surface);

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)
cairo_translate(cr,xc-img_w/2,yc-img_w/2)
cairo_arc (cr, img_w/2,img_w/2, radius, 0, 2*math.pi)
cairo_clip (cr)
cairo_new_path (cr)
cairo_set_source_surface (cr, surface, 0, 0)

cairo_paint (cr)
cairo_destroy(cr)
cairo_surface_destroy (cs)
cairo_surface_destroy (surface)

end

function display_round(filename,xc,yc,radius,angle,radius_c rop,period)
if conky_window == nil then return end

if tonumber(conky_parse('${updates}')) <2 then return end
local filepng = filename .. ".png"
local actual_time = os.time()

if last_time == nil then last_time=0 end
local actual_img = io.open(filepng,"r")
if last_time+period < actual_time or last_time == 0 or actual_img == nil then
print ('convert image ' .. filename)
convert_square(filename,filepng,radius,angle,radiu s_crop)
last_time=actual_time
end
crop_square_to_round(filepng,xc,yc,radius)
io.close()
end


--[[END OF SQUARE TO ROUND WIDGET]]

function conky_main(filename)
if conky_window == nil then return end
display_round(filename,
275,275,120, --xc,yc,radius
5, --angle
98, --radius_crop (1-100)
3600 --period

)
end
And the conkyrc

# -- Conky settings -- #
background no
update_interval 10

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
own_window_colour FFFFFF
own_window_title square to round

border_inner_margin 0
border_outer_margin 0

minimum_size 450 550

alignment tm
gap_y 0
gap_x 0

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

# -- Text settings -- #
use_xft yes
xftfont Santana:size=12
xftalpha 0

uppercase no

default_color 000000
text_buffer_size 2048
imlib_cache_size 0
#--- LUA ---
lua_load ~/wip/earth/square_to_round.lua
#first parameter is the square image to use
lua_draw_hook_pre main /tmp/earth/earth_image

TEXT
${execpi 3600 ~/wip/earth/get_moon_earth.sh earth}
And if you are inspired, you can get amazing conkys like this one :
http://img101.imageshack.us/img101/8289/moon2.th.png (http://img101.imageshack.us/i/moon2.png/)

The 3 files are in the attachment.

Happy conkying :P

You don't cease to amaze me with the stuff you are doing with LUA. Keep it up!

wlourf
April 7th, 2010, 10:52 PM
You don't cease to amaze me with the stuff you are doing with LUA. Keep it up!
Thanks dmillerct, and it's a pleasure to see captures around with some of my scripts:)
And I didn't start to use conky 1.8.0 ... better setup are coming ;-)

zet120
April 8th, 2010, 12:13 PM
Great script
Thanks.

http://img511.imageshack.us/img511/2259/ziemiad.th.png (http://img511.imageshack.us/i/ziemiad.png/)

Psumi
April 8th, 2010, 12:16 PM
Too bad I can't use lua scripts :(

I can't compile 1.7.2 for debian: http://ubuntuforums.org/showthread.php?t=1441834

wlourf
April 8th, 2010, 02:03 PM
anyone have a suggestion for making {mixer} and {mixerbar} work...
all I get is a 0 for master volume and an empty bar...

tia
wbg


Hi, do you have ALSA mixer enabled in your conky, type conky -v to check.
I am compiling version 1.8.0 and ALSA is not enabled by default, so ${mixer} doesn't work anymore ...
I tried to compile conky with --enabled-alsa but without success, If someone can help :)

wlourf
April 8th, 2010, 06:02 PM
Too bad I can't use lua scripts :(

I can't compile 1.7.2 for debian: http://ubuntuforums.org/showthread.php?t=1441834
Did you try last version 1.8.0 :
http://sourceforge.net/projects/conky/files/conky/
there are some deb for Ubuntu if you use it :
https://launchpad.net/~norsetto/+archive/ppa/+packages (https://launchpad.net/%7Enorsetto/+archive/ppa/+packages)

(I didn't test them )