SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#5276 2013-05-07 19:58:02

farmersdaughter
#! Member
Registered: 2009-08-27
Posts: 99
Website

Re: Conky v1.9 Thread

PackRat wrote:

^ it's your location  code for Yahoo weather - typically your Zip code if you're in the USA. Search Yahoo weather for your location and will be navigation bar of the browser.

Okay, found that but how do I add it to conky, that was the part I didn't get.


The Canuck with Questions. And Acer Aspires... if you have #! on an Acer and have a question... ask!

Offline

Help fund CrunchBang, donate to the project!

#5277 2013-05-07 20:47:49

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Conky v1.9 Thread

The first line after TEXT of the .conkyrc included starts:

${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=2294941&u=c" -o  <rest of first line>

You need to replace all the 229494 in that .conkyrc with your location code.

You will need to have curl installed for that .conkyrc to work. I don't think it's installed by default. In a terminal:

sudo apt-get install curl

will install it.

Last edited by PackRat (2013-05-07 21:04:21)


"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe

Offline

#5278 2013-05-07 20:58:57

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

farmersdaughter wrote:
PackRat wrote:

^ it's your location  code for Yahoo weather - typically your Zip code if you're in the USA. Search Yahoo weather for your location and will be navigation bar of the browser.

Okay, found that but how do I add it to conky, that was the part I didn't get.

When you went to Conky Google Now, the link PackRat gave you, did you download the file from that page?  This one.

The first command after TEXT in the included conkys are where you change the location in /.conkyrc-dark and /.conkyrc:

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

that's the 229491 that they are talking about changing.

Be careful Be careful Be careful Be careful:
- if you extract it to your home directory and you have a ~/.conkyrc now that you are using ... it will over-write it if you are not careful.

EDIT: Obviously I type slower than PackRat and I was multi-tasking in real life.

Last edited by Sector11 (2013-05-07 21:10:45)


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5279 2013-05-07 22:46:27

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

hey there!

I just decided to start using conkyGoogleCalender.py and everything worked fine untill i tried to use --template=/home/kai/templates/conkyGoogleCalendar.template.
i have never worked with templates before in conky, but this seems wrong to me:

2013-05-08--1367966554_131x62_scrot_zps3ff33cb7.png

[starttime]
${color3} [title]
[location] 

the ${colorX} values are working in .conkyrc without any trouble but in the template it seems like nothing lead by a "$" is beeing interpreted (${voffset X}, ${goto X} etc.)

can anybody tell me what is wrong with that?

thanks -naik

edit:typo

Last edited by Naik (2013-05-07 22:48:18)


*kaum macht man es richtig, funktioniert es sofort*

Offline

#5280 2013-05-07 23:21:53

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

@ Naik . . . . . RE: conkyGoogleCalender.py
Are you starting it like this: with ${execi} or ${execpi}
It should be ${execpi}

What version of conky are you using?


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5281 2013-05-08 07:45:52

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

@Sektor11: using execpi doesnt change anything...  sad

Conky 1.9.0 compiled Fri May 11 18:26:45 UTC 2012 for Linux 2.6.32-5-686-bigmem (i686)

but right now im on linux 3.8.5 (i686) could this be a problem?


*kaum macht man es richtig, funktioniert es sofort*

Offline

#5282 2013-05-08 09:55:12

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

@mrpeachy:

many thanks. the script works: http://ompldr.org/vaWNoYg

i'm using two different functions to format the numbers (because of the fact that some people learn with help of v9000 lua!). now there is more to learn smile

Offline

#5283 2013-05-08 12:38:41

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Naik wrote:

@Sektor11: using execpi doesnt change anything...  sad

Conky 1.9.0 compiled Fri May 11 18:26:45 UTC 2012 for Linux 2.6.32-5-686-bigmem (i686)

but right now im on linux 3.8.5 (i686) could this be a problem?

OK your conky version is fine and the right one for your machine (32bit) and you need to use ${execpi} according to conky documentation - the "p" is to parse conky commands like ${color}, ${goto} etc.

I don't use Google Calendar so this is based on experience with conkyForecast that uses templates in the same manner and written by the same person.

With conky v1.8.0 things were just fine but starting with conky v.1.8.1 there were problems in templates with parsing conky commands as seen here.  However today the parsing works fine again with conky v1.9.0-2.

Why it's not working with conkyGoogleCalendar is a strange one.
If you take all the ${commands} out does the template work?

I'll contact the author and see what he has to say, I know he uses GoogleCalendar


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5284 2013-05-08 15:20:04

farmersdaughter
#! Member
Registered: 2009-08-27
Posts: 99
Website

Re: Conky v1.9 Thread

Sector11 wrote:
farmersdaughter wrote:
PackRat wrote:

^ it's your location  code for Yahoo weather - typically your Zip code if you're in the USA. Search Yahoo weather for your location and will be navigation bar of the browser.

Okay, found that but how do I add it to conky, that was the part I didn't get.

When you went to Conky Google Now, the link PackRat gave you, did you download the file from that page?  This one.

The first command after TEXT in the included conkys are where you change the location in /.conkyrc-dark and /.conkyrc:

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

that's the 229491 that they are talking about changing.

Be careful Be careful Be careful Be careful:
- if you extract it to your home directory and you have a ~/.conkyrc now that you are using ... it will over-write it if you are not careful.

EDIT: Obviously I type slower than PackRat and I was multi-tasking in real life.

I found it and got my town to show up. The only thing that will not show up is the icons, they were at the top of my conky, mixed in all weird. So right now, I cut out those lines.

My conky now:

# Settings
##############################################
background yes
use_xft yes
xftfont Sans:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 240 240
maximum_width 220
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color light blue
default_shade_color black
default_outline_color white
alignment top_right
gap_x 12
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes

TEXT
${font sans-serif:bold:size=8}SYSTEM $alignr $sysname $kernel
${hr 3} 
${font sans-serif:normal:size=8}#
Host:$alignr$nodename
Uptime:$alignr$uptime
File System: $alignr${fs_type}
/home $alignr ${fs_used /home} / ${fs_size /home}
SWAP $alignr ${swap} / ${swapmax}
CPU temp:$alignr${hwmon temp 1}°C
${execi 300 sensors | grep Core}

${font sans-serif:bold:size=8}MEMORY ${hr 2}
${font sans-serif:normal:size=8}RAM $alignc $mem / $memmax $alignr $memperc%
$membar
${font sans-serif:bold:size=8}PROCESSORS ${hr 2}
${font sans-serif:normal:size=8}${cpugraph cpu1}
CPU1: ${cpu cpu1}% ${cpubar cpu1}
${font sans-serif:bold:size=8}TOP PROCESSES ${hr 2}
${font sans-serif:normal:size=8}${top_mem name 1}${alignr}${top mem 1} %
${top_mem name 2}${alignr}${top mem 2} %
$font${top_mem name 3}${alignr}${top mem 3} %

${font sans-serif:bold:size=8}WEATHER ${hr 2}
#Listowel
${execi 300 curl -s "[url]http://weather.yahooapis.com/forecastrss?w=4347&u=c[/url]" -o ~/.cache/weather.xml}${font sans-serif:bold:size=8}${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "country=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}
${font sans-serif:bold:size=20}${alignr}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}
${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}
${color6}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${goto 60}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}${goto 190}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}
${goto 60}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}° ${color6}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}°${color}${goto 190}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}° ${color6}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}°${color}${voffset 15}
#Goderich ---- Guelph will have id 4048
${execi 300 curl -s "[url]http://weather.yahooapis.com/forecastrss?w=4044&u=c[/url]" -o ~/.cache/weather.xml}${font sans-serif:bold:size=8}${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "country=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}
${font sans-serif:bold:size=20}${alignr}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}
${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}
${color6}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${goto 60}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}${goto 190}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}
${goto 60}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}° ${color6}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}°${color}${goto 190}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}° ${color6}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}°${color}${voffset 15}

If anyone can either help me fix the icons or get the windspeed to show up on the same line as the temperature that would be good.


The Canuck with Questions. And Acer Aspires... if you have #! on an Acer and have a question... ask!

Offline

#5285 2013-05-08 16:19:36

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

farmersdaughter wrote:

I found it and got my town to show up. The only thing that will not show up is the icons, they were at the top of my conky, mixed in all weird. So right now, I cut out those lines.

If anyone can either help me fix the icons or get the windspeed to show up on the same line as the temperature that would be good.

Wish you had left those image commands in place, they would have helped.  Images work with the -p (position) and -s (size) variables, not where the ${image /path to/image.png} line actually is.

I have your conky and the original weather conky.  I'll try and patch then together using your layout.
However heading to the dentist at the moment ...  back soon ... is no one beats me to the punch.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5286 2013-05-08 17:12:18

kaivalagi
Member
From: 52°38'41.6"N/1°19'43.6"E
Registered: 2011-02-26
Posts: 13

Re: Conky v1.9 Thread

Sector11 wrote:

I'll contact the author and see what he has to say, I know he uses GoogleCalendar

Hi there Sector11, I'm not using any conky right now, and limited linux too. So it's been a while.....but looking at my old backed up scripts I can see I used to use the following for gcal.

top part of the conkyrc:

# conky configuration

# set to yes if you want Conky to be forked in the background
background yes

# Use Xft?
use_xft yes
xftfont Liberation Sans:size=9
xftalpha 0.8

# Print everything to console?
out_to_console no

# Update interval in seconds
update_interval 60

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

own_window_class Conky
own_window yes
own_window_type conky
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

double_buffer yes
draw_shades yes
draw_outline yes
draw_borders no
draw_graph_borders no
stippled_borders 0
border_inner_margin 0
border_width 
default_color white
default_shade_color black
default_outline_color black

# Minimum size of text area
minimum_size 300 300
maximum_width 300

# Text alignment, other possible values are commented
alignment top_right

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

# 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 1

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

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

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

color1 CCCCCC
color2 7095BB

text_buffer_size 1024
max_specials 1024
own_window_title conky_cal

conkyrc entry to display the calendar:

${execpi 3600 conkyGoogleCalendar --username=your@email.com -r"CalendarName" -a --limit=7 --dateformat="%a, %d %b" --timeformat="%H:%M" --template=/home/USER/.scripts/conky/googlecalendar.template}

googlecalendar.template:

${goto 20}${color1}[starttime] [duration]
${goto 20}${color2}[title]
${goto 20}${color1}[location]
${voffset -6}${color2}${hr}${color1}

So execpi should do the right thing with a template file including directives no worries, maybe try running 1.8.1 conky or the absolute latest?

Hope that helps

Offline

#5287 2013-05-08 17:24:35

farmersdaughter
#! Member
Registered: 2009-08-27
Posts: 99
Website

Re: Conky v1.9 Thread

Sector11 wrote:
farmersdaughter wrote:

I found it and got my town to show up. The only thing that will not show up is the icons, they were at the top of my conky, mixed in all weird. So right now, I cut out those lines.

If anyone can either help me fix the icons or get the windspeed to show up on the same line as the temperature that would be good.

Wish you had left those image commands in place, they would have helped.  Images work with the -p (position) and -s (size) variables, not where the ${image /path to/image.png} line actually is.

I have your conky and the original weather conky.  I'll try and patch then together using your layout.
However heading to the dentist at the moment ...  back soon ... is no one beats me to the punch.

Thank you. It's no rush.

Sorry, I didn't save a copy before I removed those lines. Thank you for explaining the positions.


The Canuck with Questions. And Acer Aspires... if you have #! on an Acer and have a question... ask!

Offline

#5288 2013-05-08 19:29:29

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Naik wrote:

@Sektor11: using execpi doesnt change anything...  sad

Conky 1.9.0 compiled Fri May 11 18:26:45 UTC 2012 for Linux 2.6.32-5-686-bigmem (i686)

but right now im on linux 3.8.5 (i686) could this be a problem?

kaivalagi responded here, give that config a try.

@ kaivalagi - Thank you kindly!  Limited Linux now too?  I hope that a sign of "lots of work".  big_smile


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5289 2013-05-08 19:32:19

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

farmersdaughter wrote:

Thank you. It's no rush.

Sorry, I didn't save a copy before I removed those lines. Thank you for explaining the positions.

Back - no cavities ... and not rushing, just helpin' another Canuck.
Now I start again on yours.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5290 2013-05-08 20:59:43

farmersdaughter
#! Member
Registered: 2009-08-27
Posts: 99
Website

Re: Conky v1.9 Thread

Sector11 wrote:

Back - no cavities ... and not rushing, just helpin' another Canuck.
Now I start again on yours.

Thank you smile No cavities is always good.


The Canuck with Questions. And Acer Aspires... if you have #! on an Acer and have a question... ask!

Offline

#5291 2013-05-08 21:44:50

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

farmersdaughter wrote:
Sector11 wrote:

Back - no cavities ... and not rushing, just helpin' another Canuck.
Now I start again on yours.

Thank you smile No cavities is always good.

You got that right. No cavities is always good!

I noticed in your conky you have Listowel and Goderich ... so I "modified" the code a tad to keep things from getting mixed up:

1. Listowel = weather1.xml, weather1.png, today1.png & tomorrow1.png
2. Goderich = weather2.xml, weather2.png, today2.png & tomorrow2.png

abhvVU0K.jpg
Your new ~/.conkyrc

# killall conky && conky
# Settings
##############################################
background yes
use_xft yes
xftfont sans-serif:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 240 440
maximum_width 240
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color light blue
default_shade_color black
default_outline_color white
alignment top_right
gap_x 12
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes

TEXT
${font sans-serif:bold:size=8}SYSTEM ${alignr}${sysname} ${kernel}${font}
${hr 3}
Host:${alignr}${nodename}
Uptime:${alignr}${uptime}
File System: ${alignr}${fs_type}
/home ${alignr} ${fs_used /home} / ${fs_size /home}
SWAP ${alignr}${swap} / ${swapmax}
CPU temp:${alignr}${hwmon temp 1} °C
${execi 300 sensors | grep Core}

${font sans-serif:bold:size=8}MEMORY${font} ${hr 2}
RAM ${alignc}${mem} / ${memmax}${alignr}${memperc} %
${membar}
${font sans-serif:bold:size=8}PROCESSORS ${hr 2}
${font}${cpugraph cpu1}
CPU1: ${cpu cpu1}% ${cpubar cpu1}
${font sans-serif:bold:size=8}TOP PROCESSES ${hr 2}
${font}${top_mem name 1}${alignr}${top mem 1} %
${top_mem name 2}${alignr}${top mem 2} %
$font${top_mem name 3}${alignr}${top mem 3} %

${font sans-serif:bold:size=8}WEATHER ${hr 2}
${execi 600 curl -s "http://weather.yahooapis.com/forecastrss?w=4347&u=c" -o ~/.cache/weather1.xml}${font sans-serif:bold:size=8}${execi 600 grep "yweather:location" ~/.cache/weather1.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 600 grep "yweather:location" ~/.cache/weather1.xml | grep -o "country=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}
${font sans-serif:bold:size=20}${alignr}${execi 600 grep "yweather:condition" ~/.cache/weather1.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}
${execi 600 cp -f ~/.weathericons/$(grep "yweather:condition" ~/.cache/weather1.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather1.png}${image ~/.cache/weather1.png -p 0,275 -s 50x50}

${execi 600 grep "yweather:condition" ~/.cache/weather1.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}
${color6}${execi 600 grep "yweather:wind" ~/.cache/weather1.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 600 grep "yweather:units" ~/.cache/weather1.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${execi 600 cp -f ~/.weathericons/$(grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1).png ~/.cache/weather-today1.png}${image ~/.cache/weather-today1.png -p 0,355 -s 30x30}${execi 600 cp -f ~/.weathericons/$(grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1).png ~/.cache/weather-tomorrow1.png}${image ~/.cache/weather-tomorrow1.png -p 130,355 -s 30x30}
${goto 60}${execi 600 grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}${goto 190}${execi 600 grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}
${goto 60}${execi 600 grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}° ${color6}${execi 600 grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}°${color}${goto 190}${execi 600 grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}° ${color6}${execi 600 grep "yweather:forecast" ~/.cache/weather1.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}°${color}${voffset 15}
${color7}${hr}${color}
${execi 600 curl -s "http://weather.yahooapis.com/forecastrss?w=4044&u=c" -o ~/.cache/weather2.xml}${font sans-serif:bold:size=8}${execi 600 grep "yweather:location" ~/.cache/weather2.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 600 grep "yweather:location" ~/.cache/weather2.xml | grep -o "country=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}
${font sans-serif:bold:size=20}${alignr}${execi 600 grep "yweather:condition" ~/.cache/weather2.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}
${execi 600 cp -f ~/.weathericons/$(grep "yweather:condition" ~/.cache/weather2.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*").png ~/.cache/weather2.png}${image ~/.cache/weather2.png -p 0,417 -s 50x50}

${execi 600 grep "yweather:condition" ~/.cache/weather2.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}
${color6}${execi 600 grep "yweather:wind" ~/.cache/weather2.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${execi 600 grep "yweather:units" ~/.cache/weather2.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
${execi 600 cp -f ~/.weathericons/$(grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1).png ~/.cache/weather-today2.png}${image ~/.cache/weather-today2.png -p 0,495 -s 30x30}${execi 600 cp -f ~/.weathericons/$(grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1).png ~/.cache/weather-tomorrow2.png}${image ~/.cache/weather-tomorrow2.png -p 130,495 -s 30x30}
${goto 60}${execi 600 grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}${goto 190}${execi 600 grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}
${goto 60}${execi 600 grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}° ${color6}${execi 600 grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | head -n1}°${color}${goto 190}${execi 600 grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}° ${color6}${execi 600 grep "yweather:forecast" ~/.cache/weather2.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n1}°${color}${voffset 15}
${color7}${hr}${color}

·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5292 2013-05-09 00:34:40

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

PackRat wrote:

Something like this?

it uses yahoo weather and the author has some instructions to set it up on his deviantArt page.

Nice little script that uses a whole bunch of "commandline-fu" that looks like something out of a Klingon tech manual.

However, it's easy to manipulate with one HUGE flaw ... Yahoo Weather has not "updated" it's data in the past three an a half hours hours!
abhQUrat.jpg
At 21:30 it's sill sunny out?  No I think not, sunset was at. 18:05 as seen in the conky on the left.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5293 2013-05-09 01:18:50

Naik
#! Die Hard
From: Leipzig
Registered: 2012-11-16
Posts: 595

Re: Conky v1.9 Thread

Sector11 wrote:

@ Naik . . . . . RE: conkyGoogleCalender.py
Are you starting it like this: with ${execi} or ${execpi}
It should be ${execpi}

naik wrote:

@Sektor11: using execpi doesnt change anything..

sorry, using ${execpi} changed anything! had to restart openbox (???) but now everything is fine

2013-05-09--1368062036_311x335_scrot_zps1e3349da.png

case closed! Thank you!


*kaum macht man es richtig, funktioniert es sofort*

Offline

#5294 2013-05-09 08:16:57

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

hi,
I saw this clock Click Clock for ipad.

As I see it, it displays numbers with increasing alpha and font. But how do I get the trail effect? -- [got it]
Another question - would it be copyright infringement if I were to use this design in conky?

Thanks

EDIT: Got it. I'll post the code.

Last edited by easysid (2013-05-09 12:13:04)

Offline

#5295 2013-05-09 09:34:41

easysid
#! CrunchBanger
From: India
Registered: 2013-01-25
Posts: 150

Re: Conky v1.9 Thread

Something I had been working on. Finished the main work of it.  Thanks to SR11

vbo26gM.png

First time writing anything in lua. So there is a lot of hand hacking and bad coding. Sorry for that.

Thanks smile ...

Book image here I resized it to 1366x768.

conkyrc

# Book of conky
# 
# Mon 06 May 2013 19:18:03 IST
# 
######################
# - Conky settings - #
######################

background no
update_interval 1
cpu_avg_samples 1
total_run_times 0
override_utf8_locale yes
 
double_buffer yes
no_buffers yes
 
text_buffer_size 10240
imlib_cache_size 10240

# For screen size 1366x768
minimum_size 1000 600
maximum_width 1000

gap_x 180
gap_y 90
#####################
# - Text settings - #
#####################
use_xft yes
xftfont times new roman:size=12
xftalpha 1

short_units yes
uppercase no

# Text alignment
alignment top_left

######################
# - Color settings - #
######################

default_color 000000 # Black ink 
default_shade_color gray
default_outline_color black
#############################
# - Window specifications - #
#############################
own_window yes
own_window_colour 202020
own_window_argb_visual yes
#own_window_argb_value 100
own_window_class Conky
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

border_inner_margin 0
border_outer_margin 0

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

# -- Lua load -- #
lua_load /home/siddharth/test/final.lua
lua_draw_hook_pre main
	
TEXT

${goto 30}${font ancient geek:pixelsize=40}The book of CONKY${font}
${goto 550}Space reserved for Clock, Processes, and/or Weather

Right now multiple functions are coded in a single file, all called though various params in main(), one after other.
final.lua

--[[ lua script for the book of conky
Thu 09 May 2013 00:00:57 IST
written by easysid
]]--

require 'cairo'

function conky_main()

--[[ Begin Parameters
    
    Notice that there are multiple tables
    ]]--
    
-- Table for cpu
    cpu_t={
        {
            xc=100,
            yc=120,
            radius=35,
            fg_color={0x000000,0.8},
            bg_color={0x000000,1},
            font_name="monospace",
            font_size=12,
            offset = 5,
            cpu=0,
        },
        {
            xc=100,
            yc=120,
            radius=35,
            fg_color={0x000000,0.8},
            bg_color={0x000000,1},
            font_name="monospace",
            font_size=12,
            offset = 5,
            cpu=1,
        },
        {
            xc=100,
            yc=120,
            radius=35,
            fg_color={0x000000,0.8},
            bg_color={0x000000,1},
            font_name="monospace",
            font_size=12,
            offset = 5,
            cpu=2,
        },
        {
            xc=100,
            yc=120,
            radius=35,
            fg_color={0x000000,0.8},
            bg_color={0x000000,1},
            font_name="monospace",
            font_size=12,
            offset = 5,
            cpu=3,
        },
    }  -- end table cpu_t  

-- Table for RAM
    
    ram_t={ 
    xc = 320,
    yc = 120,
    radius = 100,
    font_name = "monospace",
    font_size = 12,
    bg_color = {0x000000, 1},
    fg_color = {0x000000, 0.8},
    } --end ram_t

-- Table for Disks
    disks_t = {
        { 
        xc = 100,
        yc = 250,
        radius = 60,
        fs_name = "/",
        font_name = "monospace",
        font_size = 12,
        bg_color = {0x000000, 1},
        fg_color = {0x000000, 0.8},
        },
    
        { 
        xc = 230,
        yc = 250,
        radius = 60,
        fs_name = "/home",
        font_name = "monospace",
        font_size = 12,
        bg_color = {0x000000, 1},
        fg_color = {0x000000, 0.8},
        },

        { 
        xc = 360,
        yc = 250,
        radius = 60,
        fs_name = "/media/DATA",
        font_name = "monospace",
        font_size = 12,
        bg_color = {0x000000, 1},
        fg_color = {0x000000, 0.8},
        },
    
    } -- end table disks_t
   
-- Table for temperatures. The axis is drawn manually. Adjust in main.  
    temps_t={
        {
            name="CPU1", -- these are just headings
            arg="platform coretemp.0 temp 2", -- actual conky object
            xc=80,
            yc=435,
            max=100,
            size=90,
            fg_color={0x0000,1},
            bg_color={0x0000,1},
            font_name="monospace",
            font_size=12,
        },

        {
            name="CPU2",
            arg="platform coretemp.0 temp 4",
            xc=120,
            yc=435,
            max=100,
            size=90,
            fg_color={0x0000,1},
            bg_color={0x0000,1},
            font_name="monospace",
            font_size=12,
        },
        
        {
            name="ATI",
            arg="execi 10 aticonfig --odgt | grep Temp | cut -c 43-44",
            xc=160,
            yc=435,
            max=100,
            size=90,
            fg_color={0x0000,1},
            bg_color={0x0000,1},
            font_name="monospace",
            font_size=12,
        },
        
        {
            name="HDD",
            arg="execi 10 hddtemp /dev/sda -n",
            xc=200,
            yc=435,
            max=100,
            size=90,
            fg_color={0x0000,1},
            bg_color={0x0000,1},
            font_name="monospace",
            font_size=12,
        },

    }-- end table temps_t
    
    -- Battery settings
    batt_t=
    {
        xc=340,
        yc=420,
        size=120,
        deg = 9.7,
        fg_color={0x000000,1},
        font_name="monospace",
        font_size=12,
    }
    
    -- Net settings
    net_t=
    {
        xc=340,
        yc=520,
        size=120,
        deg = 9.7,
        fg_color={0x000000,1},
        font_name="monospace",
        font_size=12,
    }

-- Misc - Brightness and Volume
misc_t = {    
        {
        name="Brightness",
        arg="head /sys/class/backlight/acpi_video0/actual_brightness 20",
        max=8,
        xc=80,
        yc=520,
        inner_radius=12,
        outer_radius=40,
        bg_color={0X000000,1},
        fg_color={0X000000,0.8},
        font_name = "monospace",
        font_size = 12,
        },
        
        {
        name="Volume",
        arg="execi 30 amixer get Master | grep '%' | cut -c 22-23",
        max=100,
        xc=210,
        yc=520,
        inner_radius=12,
        outer_radius=40,
        bg_color={0X000000,1},
        fg_color={0X000000,0.8},
        font_name = "monospace",
        font_size = 12,        
        },
} -- end misc

-- End Params

    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)
    local updates=tonumber(conky_parse('${updates}'))
    if updates>3 then
   
        -- Draw cpu graph
        for i in ipairs(cpu_t)do
            draw_cpus(cr,cpu_t[i])
        end

        -- Draw RAM graph
            draw_ram(cr,ram_t)
            
        -- Draw Disks graph
        for i in ipairs(disks_t)do
            draw_disks(cr,disks_t[i])
        end
        
        -- Draw temperature graph
            draw_axis(cr,60,435,90) -- Draw axis first
        for i in ipairs(temps_t)do
            draw_temps(cr,temps_t[i])
        end
        
        -- Draw battery spiral
        draw_battery(cr,batt_t)
        -- Draw net spiral
        draw_net(cr,net_t)
        
        -- Draw misc graph
        for i in ipairs(misc_t)do
            draw_misc(cr,misc_t[i])
        end
     
    end --end if
    
    cairo_destroy(cr)
    cairo_surface_destroy(cs)
    cr=nil
end-- end main function
        




function draw_cpus(cr,cpu_t)
     
    local x0 = 0; local y0 = 0
    local tx = 0; local ty = 0  --text position
    local start_angle = 0; local end_angle = 0
    
    
    cairo_select_font_face (cr, cpu_t.font_name, CAIRO_FONT_SLANT_NORMAL,    CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, cpu_t.font_size)

    -- Check quadrant
    if cpu_t.cpu == 0 then 
            x0=cpu_t.xc+cpu_t.offset; y0=cpu_t.yc-cpu_t.offset
            start_angle, end_angle = 3*math.pi/2, 2*math.pi
            tx, ty = x0+cpu_t.radius, y0-cpu_t.radius
    elseif cpu_t.cpu == 1 then
            x0=cpu_t.xc+cpu_t.offset; y0=cpu_t.yc+cpu_t.offset
            tx, ty = x0+cpu_t.radius, y0+cpu_t.radius
            start_angle, end_angle = 0, math.pi/2 
    elseif cpu_t.cpu == 2 then
            x0=cpu_t.xc-cpu_t.offset; y0=cpu_t.yc+cpu_t.offset
            tx, ty = x0-cpu_t.radius, y0+cpu_t.radius
            start_angle, end_angle = math.pi/2, math.pi 
    elseif cpu_t.cpu == 3 then
            x0=cpu_t.xc-cpu_t.offset; y0=cpu_t.yc-cpu_t.offset
            tx, ty = x0-cpu_t.radius, y0-cpu_t.radius
            start_angle, end_angle = math.pi, 3*math.pi/2 
    end
    
        local value = tonumber(conky_parse(conky_parse(string.format('${%s %s}', "cpu", "cpu"..cpu_t.cpu))))

    --Outline
    cairo_move_to(cr,x0,y0)
    cairo_arc(cr, x0, y0, cpu_t.radius, start_angle, end_angle)
    cairo_line_to(cr,x0, y0);cairo_close_path(cr)
    
    --Label
    cairo_move_to(cr,tx,ty)
    cairo_show_text(cr,value.."%")
    
    --Draw
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(cpu_t.bg_color))
    cairo_set_line_width(cr,2)
    cairo_stroke(cr)
        
    -- Fill
    cairo_arc(cr, x0, y0, value*cpu_t.radius/100, start_angle, end_angle)
    cairo_line_to(cr,x0, y0)
    cairo_close_path(cr)
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(cpu_t.fg_color))
    cairo_fill(cr)
    
end -- end draw_cpu()


function draw_ram(cr,t)

    
    local value = tonumber(conky_parse('${memperc}'))
    
-- Draw the outer curve    
    cairo_move_to (cr, t.xc, t.yc);
    
    -- left leaf
    cairo_curve_to (cr, t.xc-t.radius, t.yc+t.radius, t.xc-t.radius, t.yc-t.radius, t.xc, t.yc)
    
    -- right leaf
    cairo_curve_to (cr, t.xc+t.radius, t.yc-t.radius, t.xc+t.radius, t.yc+t.radius, t.xc, t.yc)

    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.bg_color)) --curve outline color
    cairo_set_line_width (cr, 3.0)
    cairo_stroke (cr)


    --***** DRAW THE TEXT ******
    
    cairo_select_font_face (cr, t.font_name, CAIRO_FONT_SLANT_NORMAL,    CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, t.font_size)
    
    cairo_move_to(cr, t.xc-t.radius*1.1, t.yc) -- small correction
    cairo_show_text(cr, conky_parse("${mem}"))
    
    cairo_move_to(cr, t.xc+t.radius*0.8, t.yc) -- small correction
    cairo_show_text(cr,conky_parse("${memfree}"))
    
    cairo_move_to(cr, t.xc-1.5*t.font_size, t.yc+3*t.font_size) -- do --
    cairo_show_text(cr,conky_parse("${memmax}"))

    cairo_stroke (cr)



    --************************
    -- FILL THE REQUIRED AREA
    --************************
    
    -- Calculate the required vars:
    local dl = value*t.radius/100   -- 100 is MAX. Change this line
    local dr = t.radius 

    cairo_move_to (cr, t.xc, t.yc);    

    -- left filler
    cairo_curve_to (cr, t.xc-dl, t.yc-dl, t.xc-dl, t.yc+dl, t.xc, t.yc)
    -- right filler
    cairo_curve_to (cr, t.xc+dr, t.yc-dr, t.xc+dr, t.yc+dr, t.xc, t.yc)
    
    
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.fg_color)) --filling color
    cairo_set_line_width (cr, 2.0)
    cairo_fill(cr)
    
    --[[
      Refill right leaf.
     This is the tricky part. We use cairo's compositing 
      to make the chunk transparent. Requires argb_visual=true in conkyrc.
      Another workaround, if this does not work, is to refill the portion below with the background color. Giving the same effect.
     ]]-- 
         
    cairo_move_to (cr, t.xc, t.yc);
    cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
    cairo_curve_to (cr, t.xc+dl, t.yc-dl, t.xc+dl, t.yc+dl, t.xc, t.yc) 
    cairo_fill(cr)
    cairo_set_operator(cr,CAIRO_OPERATOR_OVER) -- Revert to default
    

end --end draw_ram


function draw_disks(cr,t)

    
    local value = tonumber(conky_parse(string.format('${%s %s}', "fs_used_perc", t.fs_name)))
    
-- Draw the outer curve    
    cairo_move_to (cr, t.xc, t.yc);
    
    -- left leaf
    cairo_curve_to (cr, t.xc, t.yc-t.radius*1.42, t.xc-t.radius*1.42, t.yc, t.xc, t.yc)
    
    -- right leaf
    cairo_curve_to (cr, t.xc, t.yc-t.radius*1.42, t.xc+t.radius*1.42, t.yc, t.xc, t.yc)
    
    --bottom leaf
    cairo_curve_to (cr, t.xc+t.radius, t.yc+t.radius, t.xc-t.radius, t.yc+t.radius, t.xc, t.yc)
    
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.bg_color)) --curve outline color
    cairo_set_line_width (cr, 3.0)
    cairo_stroke (cr)


    --***** DRAW THE TEXT ******
    
    cairo_select_font_face (cr, t.font_name, CAIRO_FONT_SLANT_NORMAL,    CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, t.font_size)
    
    cairo_move_to(cr, t.xc-t.radius/1.2, t.yc-t.radius/1.4)
    cairo_show_text(cr, conky_parse(string.format('${%s %s}', "fs_used", t.fs_name)))
    
    cairo_move_to(cr, t.xc+t.radius/2.4, t.yc-t.radius/1.4)
    cairo_show_text(cr,conky_parse(string.format('${%s %s}', "fs_free", t.fs_name)))
    
    cairo_move_to(cr, t.xc, t.yc+t.radius)
    cairo_show_text(cr,conky_parse(string.format('${%s %s}', "fs_size", t.fs_name)))
    cairo_move_to(cr, t.xc, t.yc+t.radius+2*t.font_size)
    cairo_show_text(cr, t.fs_name)
    cairo_stroke (cr)



    --************************
    -- FILL THE REQUIRED AREA
    --************************
    
    -- Calculate the required vars:
    local dl = value*t.radius/100   -- 100 is MAX. Change this line
    local dr = t.radius 

    cairo_move_to (cr, t.xc, t.yc);    

    -- bttom filler
    cairo_curve_to (cr, t.xc+t.radius, t.yc+t.radius, t.xc-t.radius, t.yc+t.radius, t.xc, t.yc)
    -- left filler
    cairo_curve_to (cr, t.xc, t.yc-dl*1.42, t.xc-dl*1.42, t.yc, t.xc, t.yc)
    -- right filler
    cairo_curve_to (cr, t.xc, t.yc-dr*1.42, t.xc+dr*1.42, t.yc, t.xc, t.yc)
    
    
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.fg_color)) --filling color
    cairo_set_line_width (cr, 2.0)
    cairo_fill(cr)
    
    --[[
      Refill right leaf.
     This is the tricky part. We use cairo's compositing 
      to make the chunk transparent. Requires argb_visual=true in conkyrc.
      Another workaround, if this does not work, is to refill the portion below with the background color. Giving the same effect.
      ]]--
         
    cairo_move_to (cr, t.xc, t.yc);
    cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
    cairo_curve_to (cr, t.xc, t.yc-dl*1.42, t.xc+dl*1.42, t.yc, t.xc, t.yc)
    cairo_fill(cr)
    cairo_set_operator(cr,CAIRO_OPERATOR_OVER) -- Revert to default
    

end -- end draw_disks()



function draw_temps(cr,t)
    -- S curve
    
    local value = tonumber(conky_parse(string.format("${%s}",t.arg)))
    
    local d = value*t.size/t.max
    cairo_move_to (cr, t.xc, t.yc);
    cairo_curve_to (cr,t.xc+d/2,t.yc,t.xc,t.yc-d,t.xc+d/2,t.yc-d);
    
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.fg_color))
    cairo_set_line_width (cr, 3.0);
--    cairo_stroke (cr);

    
    cairo_select_font_face (cr, t.font_name, CAIRO_FONT_SLANT_NORMAL,  CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, t.font_size)
--    cairo_set_source_rgba (cr,0,1,0,1)
    cairo_move_to (cr,t.xc+d/2,t.yc-d); cairo_show_text (cr,value.."°C")
    cairo_move_to (cr,t.xc,t.yc+1.5*t.font_size);cairo_show_text (cr,t.name)
    cairo_stroke (cr)

end -- function draw_temps()

    
function draw_axis(cr,x,y,c)
--    Just the axis
    cairo_set_source_rgba (cr, 0, 0, 0, 0.8); --black
    cairo_set_line_width (cr, 2.0);
    
    -- Y axis
    cairo_move_to (cr,x,y-c);   cairo_line_to (cr,x,y);
    cairo_move_to (cr,x-5,y-c+10);   cairo_line_to (cr,x,y-c);
    cairo_move_to (cr,x+5,y-c+10);   cairo_line_to (cr,x,y-c);
    
    -- X axis
    cairo_move_to (cr,x+2*c-10,y-5);   cairo_line_to (cr,x+2*c,y);
    cairo_move_to (cr,x+2*c-10,y+5);   cairo_line_to (cr,x+2*c,y);
    cairo_move_to (cr,x,y); cairo_line_to (cr,x+2*c,y);
    cairo_stroke (cr);

end


function draw_battery(cr,t)
    --spiral function by mrpeachy
    --local function calculates points
    local function pt(px,py,prad,pdeg)
        local ppo=(math.pi/180)*pdeg
        local px1=px+prad*(math.sin(ppo))
        local py1=py-prad*(math.cos(ppo))
        return px1,py1
    end

    local value = conky_parse("${battery_short BAT0}")    
    if value == 'F' then value = 100
    else
        value = tonumber(string.sub(value,3,-2))
    end
    local rad_i=0.4
    local max_i=value*t.size/100

    --set line attributes
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.fg_color))
    cairo_set_line_width(cr,1.5)
    --draw points 
    for i=1,max_i do
        rad1=i*rad_i
        deg1=i*t.deg
        x1,y1=pt(t.xc,t.yc,rad1,deg1)
        rad2=rad_i*((i+1) or i)
        deg2=t.deg*((i+1) or i)
        x2,y2=pt(t.xc,t.yc,rad2,deg2)
        cairo_move_to(cr,x1,y1)
        cairo_line_to(cr,x2,y2)
        cairo_stroke(cr)
    end
    
    -- Draw text
    cairo_select_font_face (cr, t.font_name, CAIRO_FONT_SLANT_NORMAL,    CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, t.font_size)
    cairo_move_to(cr, t.xc+max_i*rad_i, t.yc)
    cairo_show_text(cr, conky_parse('${battery BAT0}'))

end

function draw_net(cr,t)
    --spiral by mrpeachy
    --local function calculates points
    local function pt(px,py,prad,pdeg)
        local ppo=(math.pi/180)*pdeg
        local px1=px+prad*(math.sin(ppo))
        local py1=py-prad*(math.cos(ppo))
        return px1,py1
    end

    local S = conky_parse("${if_existing /proc/net/route wlan0}${wireless_essid wlan0}${else}None${endif}")    
    

    local value = tonumber(conky_parse("${wireless_link_qual_perc wlan0}"))
    
    if S == 'None' then value, S = 0, "No Network"
    else S = string.format("[%s]%s%%",S,value)
    end

    local rad_i=0.4
    local max_i=value*t.size/100

    --set line attributes
    cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.fg_color))
    cairo_set_line_width(cr,1.5)
    --draw points 
    for i=1,max_i do
        rad1=i*rad_i
        deg1=i*t.deg
        x1,y1=pt(t.xc,t.yc,rad1,deg1)
        rad2=rad_i*((i+1) or i)
        deg2=t.deg*((i+1) or i)
        x2,y2=pt(t.xc,t.yc,rad2,deg2)
        cairo_move_to(cr,x1,y1)
        cairo_line_to(cr,x2,y2)
        cairo_stroke(cr)
    end
    
    -- Draw text
    cairo_select_font_face (cr, t.font_name, CAIRO_FONT_SLANT_NORMAL,    CAIRO_FONT_WEIGHT_NORMAL);
    cairo_set_font_size (cr, t.font_size)
    cairo_move_to(cr, t.xc+max_i*rad_i, t.yc)
    cairo_show_text(cr, S)

end


function draw_misc(cr, t)
        
        local value = tonumber(conky_parse(string.format("${%s}",t.arg)))
        cairo_move_to(cr, t.xc+t.outer_radius, t.yc)        
        cairo_arc (cr, t.xc, t.yc, t.outer_radius, 0, 2*math.pi)
        cairo_move_to(cr, t.xc+t.inner_radius, t.yc)
        cairo_arc(cr, t.xc, t.yc, t.inner_radius, 0, 2*math.pi)
        
        cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.bg_color))
        cairo_set_line_width (cr, 2.0)
        cairo_stroke(cr)
        
        cairo_select_font_face (cr, t.font_name, CAIRO_FONT_SLANT_NORMAL,  CAIRO_FONT_WEIGHT_NORMAL);
        cairo_set_font_size (cr, t.font_size)
        cairo_move_to (cr,t.xc-6,t.yc+5); cairo_show_text (cr,value)
        cairo_set_source_rgba (cr, rgba_to_r_g_b_a({0xff0000,1}))
        cairo_stroke(cr)

        local radius = value*(t.outer_radius - t.inner_radius)/t.max + t.inner_radius
        cairo_set_source_rgba (cr, rgba_to_r_g_b_a(t.fg_color))
        cairo_move_to(cr, t.xc+t.inner_radius, t.yc)
        for i=t.inner_radius, radius do
            cairo_arc(cr, t.xc, t.yc, i, 0, 2*math.pi)
            cairo_stroke(cr)
        end

end -- end draw_misc

    

function rgba_to_r_g_b_a(tcolor)
	local color,alpha=tcolor[1],tcolor[2]
	return ((color / 0x10000) % 0x100) / 255., 
		((color / 0x100) % 0x100) / 255., (color % 0x100) / 255., alpha
end --end rgba

Offline

#5296 2013-05-09 10:36:33

lionhead
#! Junkie
From: Dagobah / Germany
Registered: 2011-01-22
Posts: 459

Re: Conky v1.9 Thread

@mrpeachy

i've just found your amazing script: http://ompldr.org/vaWNzdA

is it possible to display the visibility of the iss (hubble is never visible here)? you wrote that it's possible while i use the programm 'predict'. do u have an idea how to do this?

btw: a new version of my custom v9000: http://ompldr.org/vaWN0ag

Last edited by lionhead (2013-05-09 13:04:42)

Offline

#5297 2013-05-09 13:04:00

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

Naik wrote:
Sector11 wrote:

@ Naik . . . . . RE: conkyGoogleCalender.py
Are you starting it like this: with ${execi} or ${execpi}
It should be ${execpi}

naik wrote:

@Sektor11: using execpi doesnt change anything..

sorry, using ${execpi} changed anything! had to restart openbox (???) but now everything is fine

http://i846.photobucket.com/albums/ab27/nlinedesignz/2013-05-09--1368062036_311x335_scrot_zps1e3349da.png

case closed! Thank you!

OH!!!! ... gotta remember that ... I would have thought "killall conky" and then restarting would have worked.
Either way, glad it's fixed and NICE conky!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5298 2013-05-09 13:08:43

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

easysid wrote:

Something I had been working on. Finished the main work of it.  Thanks to SR11

http://i.imgur.com/vbo26gM.png

First time writing anything in lua. So there is a lot of hand hacking and bad coding. Sorry for that.

:8 Thanks but I just encouraged you, as anyone can see it's LUA in there, I don't do LUA, thank mrpeachy, which I know you already did.

All I did was encourage you to continue with "The Book of Conky" idea.

Looks GREAT!  Thanks for including the wallpaper.  Now to tweak some LUA!


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

#5299 2013-05-09 13:13:50

Sector11
#!'er to BL'er
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 15,667
Website

Re: Conky v1.9 Thread

easysid wrote:

hi,
I saw this clock Click Clock for ipad.

As I see it, it displays numbers with increasing alpha and font. But how do I get the trail effect? -- [got it]
Another question - would it be copyright infringement if I were to use this design in conky?

Thanks

EDIT: Got it. I'll post the code.

Oooooooooooooo that I LIKE!!!!!!!!!!!!!!!!
Maybe an edited version to add month, day as well ... hmmmmmmmmmm

waiting patiently ....
... is it done yet?
... ... ... is it done yet?
... ... ... ... ... ... is it done yet?
From the front seat: ahhhhhhhh shuddup! lol


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
BunsenLabs Forums now Open for Registration
·  ↑   ↑   ↑   ↑   ↑   ↑  · BL ModSquad

Offline

Help fund CrunchBang, donate to the project!

#5300 2013-05-09 13:17:38

farmersdaughter
#! Member
Registered: 2009-08-27
Posts: 99
Website

Re: Conky v1.9 Thread

Thank you Sector 11, it looks amazing! And it works wonderfully!

Will share a screenshot when I get a chance to. I'm so happy LOL


The Canuck with Questions. And Acer Aspires... if you have #! on an Acer and have a question... ask!

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo