SEARCH

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

You are not logged in.

#126 2011-11-13 20:04:00

dlm955
#! CrunchBanger
From: Mansfield,Ohio USA
Registered: 2011-07-23
Posts: 128

Re: November 2011 Conky Thread

Sector11 wrote:

1. the click image doesn't work ...
2. outta coffee!  P-A-N-I-C!

  Fixed I think


Give a man a truth and he will think for a day.
Teach a man to reason and he will think for a lifetime!

Offline

Help fund CrunchBang, donate to the project!

#127 2011-11-13 20:20:03

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

Re: November 2011 Conky Thread

dlm955 wrote:
Sector11 wrote:

1. the click image doesn't work ...
2. outta coffee!  P-A-N-I-C!

  Fixed I think

What? the link or the coffee   big_smile

Ahhh the link ... looks good.  {sip}

Last edited by Sector11 (2011-11-13 20:22:35)


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

Offline

#128 2011-11-13 21:29:52

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: November 2011 Conky Thread

dlm955 wrote:

..Thank you MrPeachy yea it works on xubuntu 11.10 a few small bugs when I edit the conkyrc and save it throws this error and will not restart 
Conky: llua_do_call: function conky_weather execution failed: /home/dlm955/conky/luas/thermometer3.lua:223: attempt to index global 'day1' (a nil value)

but I overcome this will killall conky and restart it ok....

It took a couple fires here also.  It seems the script is running ahead of the webpage parsing. After 'day1' is loaded it renders the first time.   One time blank, then empty thermometer and right text then all is well again.

That right conky is a great work in progress.


Congratulations, you've figured out the sound of one hand clapping...

Offline

#129 2011-11-13 21:55:42

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: November 2011 Conky Thread

dlm955 wrote:

Thank you MrPeachy yea it works on xubuntu 11.10 a few small bugs when I edit the conkyrc and save it throws this error and will not restart 
Conky: llua_do_call: function conky_weather execution failed: /home/dlm955/conky/luas/thermometer3.lua:223: attempt to index global 'day1' (a nil value)

but I overcome this will killall conky and restart it ok....
  well here's a screen with everything working so far

you are welcome
yes, because of the timed section at the top of the script which is triggered by the number of conky updates
and when you edit the conkyrc and re-save the update number doesnt reset to 0, it keeps going
so kill restart is best

Offline

#130 2011-11-13 22:26:11

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

Re: November 2011 Conky Thread

mrpeachy wrote:

you are welcome
yes, because of the timed section at the top of the script which is triggered by the number of conky updates
and when you edit the conkyrc and re-save the update number doesnt reset to 0, it keeps going
so kill restart is best

That's right: KFC that sucker!!!
That's Kentucky Fried Conky for all you folks out there:

Bash alias:

alias kfc='killall conky'

EDIT: No it was never meant to mean "that"!!!!

Last edited by Sector11 (2011-11-13 22:27:38)


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

Offline

#131 2011-11-14 03:19:39

demarsjcd
#! Member
Registered: 2011-09-28
Posts: 94

Re: November 2011 Conky Thread

latest conky using my favorite game.  I'll post up the scripts in a bit.  Thanks for everyone's help

BTW.  Still not finished just wanted to post up before I get yelled at by the girlfriend big_smile

screenshot-11132011-101130pm.png

Also does anyone have a script for a conky with just a battery bar meter that covers the whole screen width wise.  One preferablly with rounded edges.  thanks.

Offline

#132 2011-11-14 03:34:27

dlm955
#! CrunchBanger
From: Mansfield,Ohio USA
Registered: 2011-07-23
Posts: 128

Re: November 2011 Conky Thread

demarsjcd wrote:

latest conky using my favorite game.  I'll post up the scripts in a bit.  Thanks for everyone's help

BTW.  Still not finished just wanted to post up before I get yelled at by the girlfriend big_smile

screenshot-11132011-101130pm.png

Also does anyone have a script for a conky with just a battery bar meter that covers the whole screen width wise.  One preferablly with rounded edges.  thanks.

        rounded ends (=====) or the bars rounded
     check back a few post I'am learning to use a lua  by wlourf that makes great bars and such tell me how wide and tall you want it in pixels and I'll give it a go....it can even make it go top to bottom of screen if you like..


Give a man a truth and he will think for a day.
Teach a man to reason and he will think for a lifetime!

Offline

#133 2011-11-14 04:03:07

demarsjcd
#! Member
Registered: 2011-09-28
Posts: 94

Re: November 2011 Conky Thread

dlm955 wrote:
demarsjcd wrote:

latest conky using my favorite game.  I'll post up the scripts in a bit.  Thanks for everyone's help

BTW.  Still not finished just wanted to post up before I get yelled at by the girlfriend big_smile

screenshot-11132011-101130pm.png

Also does anyone have a script for a conky with just a battery bar meter that covers the whole screen width wise.  One preferablly with rounded edges.  thanks.

        rounded ends (=====) or the bars rounded
     check back a few post I'am learning to use a lua  by wlourf that makes great bars and such tell me how wide and tall you want it in pixels and I'll give it a go....it can even make it go top to bottom of screen if you like..

  Thanks buddy.  About 1000 x 100 pixels.  Any way they to section it or put verticle lines in it like below.  Thats just a sketch. 

example3.jpg

Offline

#134 2011-11-14 05:11:16

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: November 2011 Conky Thread

i think i am getting towards being done with this project for the time being smile
here is what it looks like
Screenshot.jpg

for those brave souls who want to try it
http://ompldr.org/vYjlteA


if anyone has ideas for weather, or wants to use a certain part of the script then let me know

Offline

#135 2011-11-14 05:15:31

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: November 2011 Conky Thread

@ mrpeachy

Pure fu**ing genius - brilliance my man...

AWESOME


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#136 2011-11-14 05:55:51

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: November 2011 Conky Thread

mrpeachy wrote:

i think i am getting towards being done with this project for the time being smile

if anyone has ideas for weather, or wants to use a certain part of the script then let me know

Time coded in lua still is a mystery to me.
I think I saw the howto earlier today and will not get to play until tomorrow afternoon as you now have almost 1200 lines. 

Also, alignment bottom_right seems to be not working.  If you have any insight on how to solve this.  I found bg scaling, and transparency on my own.

Screenshot_10.jpg


Congratulations, you've figured out the sound of one hand clapping...

Offline

#137 2011-11-14 15:16:11

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 146

Re: November 2011 Conky Thread

VastOne wrote:

@ mrpeachy

Pure fu**ing genius - brilliance my man...

AWESOME

Could not have said it better myself.  I have to ask, what is the first step in learning lau to a point where you can create the amazing lau scripts you create.  It is absolutely amazing.

Offline

#138 2011-11-14 15:26:18

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

Re: November 2011 Conky Thread

mrpeachy wrote:

i think i am getting towards being done with this project for the time being smile
here is what it looks like
{snip}
if anyone has ideas for weather, or wants to use a certain part of the script then let me know

Opposing statements: Does not compute!  recalculando - recalculando! (as they say here = recalculating)

1eb0bc159259973.jpg

I think it is awesome, and I can have it anytime anywhere!

e6e7d9159259691.jpg

EXCELLENT - AWESOME - FANTASTIC - only scratches the surface!

Well done mrpeachy!  Well done indeed!

EDIT
I moved the clock to the middle left, thanks for leaving the space.  big_smile

lua_load ~/Conky/LUA/thermometer_v4.lua

TEXT
${lua conky_draw_bg 10 0 0 650 510 0x000000 0.5}
${lua conky_weather}${voffset 240}${goto 10}${font digitalk:size=18}${time %T}${font}

Last edited by Sector11 (2011-11-14 15:33:42)


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

Offline

#139 2011-11-14 15:28:55

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

Re: November 2011 Conky Thread

Moderator: Kill this please

Last edited by Sector11 (2011-11-14 15:31:21)


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

Offline

#140 2011-11-14 15:53:08

wlourf
#! CrunchBanger
Registered: 2010-02-13
Posts: 153
Website

Re: November 2011 Conky Thread

+1, really nice output Mr Peachy !  Thanks for sharing smile

Offline

#141 2011-11-14 17:14:56

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: November 2011 Conky Thread

thanks all! big_smile

@ichase
how to learn lua...
i started by reading londonali1010's early scripts, the rings script and clock etc (back in the days when lua was just catching on in conky)

then try modifying a script and see what happens, start small
also read the cairo drawing tutorial http://cairographics.org/documentation/

here is a blank lua script that i use, so i dont have to go through the setup part each time
also has some useful bits and pieces that i use the most

require 'cairo'

function conky_draw_fig()
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>5 then
--#########################################################################################################
--#########################################################################################################
--[[useful operations
1. cutting string up into individual characters (requires split function)
sub=string.gsub(text, ".", "%1|")
split=string.split(sub, "|")
slen=string.len(text)
2. how to find points around a circle
arc=(math.pi/180)*degree
x=0+radius*(math.sin(arc))
y=0-radius*(math.cos(arc))
3. set up and show text
font="Mono"
fsize=12
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,1,1,1,1)
cairo_move_to (cr,x,y)
cairo_show_text (cr,"text")
4-text extents
text="text
extents=cairo_text_extents_t:create()
cairo_text_extents(cr,text,extents)
width=extents.width
height=extents.height
5-linear gradient--example top to bottom
rh=rectangle height
rw=rectangle width
local pat = cairo_pattern_create_linear (0,y,0,y+rh);
cairo_pattern_add_color_stop_rgba (pat, 1, 0, 0, 0, 1);
cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 1);
cairo_rectangle (cr,x,y,rw, rh);
cairo_set_source (cr, pat);
cairo_fill (cr);
cairo_pattern_destroy (pat);
6 execute commands and save to strings
local f = io.popen("command")
string = f:read("*a")
f:close()
7 color function
function rgb_to_r_g_b(col_a)
return ((color/0x10000) % 0x100)/255,((color]/0x100) % 0x100)/255,(color % 0x100)/255
end
]]
--#########################################################################################################


--#########################################################################################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
end-- end main function

Offline

#142 2011-11-14 17:31:30

dlm955
#! CrunchBanger
From: Mansfield,Ohio USA
Registered: 2011-07-23
Posts: 128

Re: November 2011 Conky Thread

demarsjcd wrote:

  Thanks buddy.  About 1000 x 100 pixels.  Any way they to section it or put verticle lines in it like below.  Thats just a sketch. 

example3.jpg

            sorry did not find a way to radius the ends of the bar, but each bar is radius top/bottom
       Ok here you go....I tested this on my lappy with ubu 11.04 worked great here's a pic

         JbyLYs.png    click pic to inlarge ,      click pic again to fill browser

         the last ten bars are differant to show last 10 percent to charge
         empty bars are red with white outline
         full bars are solid green
         last ten bars empty red/white - full green with red outline
         the whole conky is 1010 pixels wide not sure of height as conky controls that

         make sure line num 47 in batbarconkyrc points to the battbargraph.lua folder {where you put it}

           here is link from my dropbox    http://dl.dropbox.com/u/40226108/batbar.zip

             just post any question here I'll try to give quick reply....

Last edited by dlm955 (2011-11-14 19:29:22)


Give a man a truth and he will think for a day.
Teach a man to reason and he will think for a lifetime!

Offline

#143 2011-11-14 22:44:54

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: November 2011 Conky Thread

oops... just noticed that my kmh and mph are in the wrong place on the wind speed gauge (the inside is kmh then mph with knots on the outside)

corrected code is here
http://ompldr.org/vYmEycg

or just go to line 438 and change that to mph, line 446 change to kmh

Offline

#144 2011-11-14 22:52:20

demarsjcd
#! Member
Registered: 2011-09-28
Posts: 94

Re: November 2011 Conky Thread

dlm955 wrote:
demarsjcd wrote:

  Thanks buddy.  About 1000 x 100 pixels.  Any way they to section it or put verticle lines in it like below.  Thats just a sketch. 

example3.jpg

            sorry did not find a way to radius the ends of the bar, but each bar is radius top/bottom
       Ok here you go....I tested this on my lappy with ubu 11.04 worked great here's a pic

         JbyLYs.png    click pic to inlarge ,      click pic again to fill browser

         the last ten bars are differant to show last 10 percent to charge
         empty bars are red with white outline
         full bars are solid green
         last ten bars empty red/white - full green with red outline
         the whole conky is 1010 pixels wide not sure of height as conky controls that

         make sure line num 47 in batbarconkyrc points to the battbargraph.lua folder {where you put it}

           here is link from my dropbox    http://dl.dropbox.com/u/40226108/batbar.zip

             just post any question here I'll try to give quick reply....

Thanks buddy.  It worked out good.  Any way I can get the script for that conky on the top right of you last screen shot.  It looked like a radar.  I was looking for something that lays horizontal with the cone shape and with a transparent background.  You are da man!

Offline

#145 2011-11-14 23:10:21

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

Re: November 2011 Conky Thread

mrpeachy wrote:

oops... just noticed that my kmh and mph are in the wrong place on the wind speed gauge (the inside is kmh then mph with knots on the outside)

corrected code is here
http://ompldr.org/vYmEycg

or just go to line 438 and change that to mph, line 446 change to kmh

Direct change to code is easier  big_smile
Thanks


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

Offline

#146 2011-11-14 23:58:02

mrpeachy
20% cooler
From: The Everfree Forest
Registered: 2009-11-08
Posts: 3,460

Re: November 2011 Conky Thread

battery bar is a perfect project to start on writing a lua script

require 'cairo'

function conky_battbar()
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>5 then
--#####################################
--set line thickness
cairo_set_line_width (cr, 30);
--set line to have rounded end
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND)
--set start position for line
x_position=30
y_position=100
--set total length of line
length=200
--draw background line
--set color and alpha for background
cairo_set_source_rgba (cr,0,0,0,0.5)
--[[
note about setting colors
in lua you set colors and alpha as numbers between 0 and 1 (red,green,blue,alpha)
when you get colors you often get rgb numbers out of 255
you can use these numbers directly as you can input equations just as easily as numbers
cairo_set_source_rgba (cr,250/255,100/255,0/255,1) gives you orange, for alpha 1=full opaque 0=fulltransparent
]]
--move tp where we want to start the line
cairo_move_to (cr,x_position,y_position)--reference positions set above
--draw a line the length we set
cairo_rel_line_to (cr,length,0)--reference length set above
cairo_stroke (cr)-- draws the line
--draw indicator line, draw after background so it draws ontop
--get value using conky parse
battperc=tonumber(conky_parse("${battery_percent}"))--tonumber makes sure battvalue is a number
--get a value to plot based on total length and battery %
battvalue=(length/100)*battperc
--set up our indicator
--width and line end type will carry over from when we set them at the top
--set color and alpah
cairo_set_source_rgba (cr,1,1,1,1)
--move to start
cairo_move_to (cr,x_position,y_position)--reference positions set above
--draw a line indicating current battery %
cairo_rel_line_to (cr,battvalue,0)--reference battvalue calculated above
cairo_stroke (cr)-- draws the line
--###########################################
end-- if updates>5
cairo_destroy(cr)
cairo_surface_destroy(cs)
cr=nil
return ""
end-- end main function

conkyrc

lua_load ~/lua/battbar.lua

TEXT
${lua conky_battbar}

it may not be as fancy as some bars you can get through other scripts
but the fanciness will come the better you get at writing scripts smile

Offline

#147 2011-11-15 00:36:27

demarsjcd
#! Member
Registered: 2011-09-28
Posts: 94

Re: November 2011 Conky Thread

all fixed.  Going to put this project on hold because its taking up too much time.  Here is a screen shot.  Wireless quality on left.  Battery percetange bar above it.  Cpu % right of it, memory % to top right.

screenshot-11142011-073207pm.php

Offline

#148 2011-11-15 00:45:37

dlm955
#! CrunchBanger
From: Mansfield,Ohio USA
Registered: 2011-07-23
Posts: 128

Re: November 2011 Conky Thread

demarsjcd wrote:

Thanks buddy.  It worked out good.  Any way I can get the script for that conky on the top right of you last screen shot.  It looked like a radar.  I was looking for something that lays horizontal with the cone shape and with a transparent background.  You are da man!

        thank you

             you have everything your looking for in that batbargraph.lua,read the first 100 lines and you will find info on what to edit to get the effect you want also check the web page on line 5 for advanced settings...

Last edited by dlm955 (2011-11-15 00:46:02)


Give a man a truth and he will think for a day.
Teach a man to reason and he will think for a lifetime!

Offline

#149 2011-11-15 01:41:43

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

Re: November 2011 Conky Thread

mrpeachy wrote:

battery bar is a perfect project to start on writing a lua script

{snip}

it may not be as fancy as some bars you can get through other scripts
but the fanciness will come the better you get at writing scripts smile

No battery!  sad

Will it do camera battery?  big_smile

You should start a Learn LUA with mrpeachy thread.


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

Offline

Be excellent to each other!

#150 2011-11-15 01:47:39

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

Re: November 2011 Conky Thread

mrpeachy's 100% LUA Weather is Featured and in the 2011 (3) Gallery at Conky PitStop.


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

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