SEARCH

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

You are not logged in.

#526 2014-01-30 01:00:16

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

Re: Wun Weather Script for Conky (Lua)

i think this code works
this is a function to try out in a template, put it right at the top, before the template code starts

function daytime(sr,ss)
local srh=tonumber(sr:sub(1,2))
local srm=tonumber(sr:sub(4,5))
local ssh=tonumber(ss:sub(1,2))
local ssm=tonumber(ss:sub(4,5))
local smd=ssm-srm
local shd=ssh-srh
if smd<0 then
shd=shd-1
smd=smd+60
end
return shd,smd
end--daytime

then within the template do something like this

day7time_hours,day7time_mins=daytime(day[7].sunrise_24_pad,day[7].sunset_24_pad)

do the same for any of the available days
use your 2 variables
day7time_hours
day7time_mins
in an out function smile
let me know if anything doesnt look right

Offline

Be excellent to each other!

#527 2014-01-30 01:01:56

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Wun Weather Script for Conky (Lua)

Seems that I have missed a lot!

Nice work on CPS S11!! The wun section is very  cool

Peachy a quick question..
Would it be a waste of time to make a day/night icon for each condition.. or just go ahead and use the settings that you have in the wun.lua?

Last edited by falldown (2014-01-30 01:03:39)

Offline

#528 2014-01-30 01:11:34

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

Re: Wun Weather Script for Conky (Lua)

falldown wrote:

Seems that I have missed a lot!

Nice work on CPS S11!! The wun section is very  cool

Peachy a quick question..
Would it be a waste of time to make a day/night icon for each condition.. or just go ahead and use the settings that you have in the wun.lua?

if you made them, the script would use them

which icon, night or day, is determined from the iconurl
nt_iconname for night time icons

the script looks for the nt_ part and shows whichever icon has been set there
if you wanted to make a different icon for night and day it would require setting up the table in wun.lua (line 176 to 334 ) a little differently, but that is not a big problem

can just include instructions in the readme or how to

having just looked in my icons folder at the wicons, it appears that i may have one missing, there is a nt_sleet but no sleet
ill have to put that one in there and update the archive! - done

Last edited by mrpeachy (2014-01-30 01:15:42)

Offline

#529 2014-01-30 01:17:26

falldown
#! Samurai
Registered: 2011-09-01
Posts: 1,727

Re: Wun Weather Script for Conky (Lua)

Thats good cause I have been doing both.  big_smile
You can walk through the setup when I get these done.   wink

Offline

#530 2014-01-30 01:44:36

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

Re: Wun Weather Script for Conky (Lua)

looks like there is a bug in the moon data, on Wed 5th, Thu 6th and Fri 07 i am getting NA for all moon data
but looking in the downloaded files i see times in there

ill check into it!

Offline

#531 2014-01-30 02:21:56

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

Re: Wun Weather Script for Conky (Lua)

fixed, and updated in archive
an oopsie, put n should have been i

line 872 should read:

			if mtab[i ] then

--had to put a space between the i and ] to get the thing to show, otherwise the forum thinks i want italics roll
NOT

			if mtab[n] then

Offline

#532 2014-01-30 15:00:56

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

Re: Wun Weather Script for Conky (Lua)

falldown wrote:

Seems that I have missed a lot!

Nice work on CPS S11!! The wun section is very  cool

Peachy a quick question..
Would it be a waste of time to make a day/night icon for each condition.. or just go ahead and use the settings that you have in the wun.lua?

Well see that's what you get for galloping around with your buddy, Forrest GIMP.   lol  lol  lol

Thank you, I was inspired.

Day ~ night?  Ooooooooooooooo  cool  más cool  mucho más cool  extremo cool


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

Offline

#533 2014-01-30 15:20:48

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

fixed, and updated in archive
an oopsie, put n should have been i

line 872 should read:

			if mtab[i ] then

--had to put a space between the i and ] to get the thing to show, otherwise the forum thinks i want italics roll
NOT

			if mtab[n] then

And dum-dum's like me would naturally copy/paste that line into wun.lua and get worse results than:

Crunchbang forum wrote:

[i ] was found without a matching [/i ]

... of course realizing that 'before' copy pasting  the line, I simply changed the "n" for a non-italic "i"  lol  lol

New catch phrase for us "Bull in the China Shoppe" types:
RTEP <-- Read The Entire Post!


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

Offline

#534 2014-01-30 16:13:16

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

@Sector11
Looking at the iweather_joe.lua template I see why it looks like it was setup for light backgrounds.
line 342 in --SET DEFAULTS section reads

default_color=0x000000--white

which is black text it should read

default_color=0xFFFFFF--white

roll My-Oop's :8


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

Offline

#535 2014-01-30 16:42:48

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

Re: Wun Weather Script for Conky (Lua)

jst_joe wrote:

@Sector11

roll My-Oop's :8

Careful, that sounds like you're getting "S11itis"!

I've been known to do the same thing, change the colour but not the comment.   roll

But I thought you wanted the black text, I didn't look that deep into it.

With white text on a very light transparent lua background, it would be for "dark" backgrounds.

The way I tweaked it it goes anywhere.  big_smile

/media/5/wun/conky_configs/wunrci_jjoe.conky

## draw-bg.lua Settings ######################################################
## Above and After TEXT
##
lua_load /media/5/Conky/LUA/draw-bg.lua
#lua_draw_hook_pre draw_bg 0 0 0 0 0 0x000000 0.45
#lua_draw_hook_post draw_bg 10 0 0 0 0 0x000000 0.2
#TEXT
#${lua conky_draw_bg 10 0 0 0 0 0x000000 0.2}
#######################################################  End LUA Settings  ###

TEXT
${lua conky_draw_bg 10 2 05 370 410 0x000000 0.4}

2014_01_30_13_26_20_1920x1080_Sector11.jpg 2014_01_30_13_27_24_1920x1080_Sector11.jpg

H± and W± are Humidity and Wind averages.


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

Offline

#536 2014-01-30 17:03:51

jst_joe
#! Junkie
From: Here, There and After
Registered: 2012-07-03
Posts: 297

Re: Wun Weather Script for Conky (Lua)

Sector11 wrote:

The way I tweaked it it goes anywhere.  big_smile

That does look good. smile
I've been playing with a very slight shadow on all the text that even shows up on a white bg.
I think I'll play with your idea some also. wink


A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain

Offline

#537 2014-01-30 17:10:42

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

Re: Wun Weather Script for Conky (Lua)

jst_joe wrote:

That does look good. smile
I've been playing with a very slight shadow on all the text that even shows up on a white bg.
I think I'll play with your idea some also. wink

I have to admit, it does look good.  I use draw-bk.lua on all my conkys since my wallpapers run from pure white and pure black (for testing purposes) and a thousand or so "in between" type walls. I like dark, my wife animals, flowers and beaches.

What can I say ... light grey semi-transparent conky backgrounds are  cool

Last edited by Sector11 (2014-01-30 17:12:51)


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

Offline

#538 2014-01-30 18:31:24

Habitual
#! Member
From: Youngstown, OH
Registered: 2010-09-10
Posts: 62
Website

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

hmmm... this is just a guess but maybe your tmp folder gets cleaned out every once in a while?

Man, you a good guesser!

*/15 * * * * /usr/sbin/tmpwatch --atime 1 /tmp --exclude=/tmp/SBo/ > /dev/null 2>&1

so I've added

--exclude=/tmp/xdo

to that.

as a note: I tested it by firing up wuncri and while it ran, I nuked /tmp/xdo and sure enough, it showed the same symptom.

Thanks, you rock!


Success is 1% Inspiration
and 98% Perspiration and
2% atttention to details.

Offline

#539 2014-01-30 18:45:11

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

Re: Wun Weather Script for Conky (Lua)

@ mrpeachy & Habitual

And I had a post typed up getting ready to ask if you had a blank file at:

/tmp/xdo

I thought naaaaaaaaaaaaaaa that can't be it.

Go figure!

So tell me, where does this empty file "xdo" go exactly?

/tmp/xdo or ~/tmp/xdo

Interestingly enough I have no /tmp/xdo but I do have a ~/tmp/xdo.
And everything works.

Last edited by Sector11 (2014-01-30 18:45:47)


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

Offline

#540 2014-01-30 18:49:13

Habitual
#! Member
From: Youngstown, OH
Registered: 2010-09-10
Posts: 62
Website

Re: Wun Weather Script for Conky (Lua)

/tmp/xdo here.
YMMV on #!

Last edited by Habitual (2014-01-30 18:49:49)


Success is 1% Inspiration
and 98% Perspiration and
2% atttention to details.

Offline

#541 2014-01-30 18:54:59

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

Re: Wun Weather Script for Conky (Lua)

Habitual wrote:
mrpeachy wrote:

hmmm... this is just a guess but maybe your tmp folder gets cleaned out every once in a while?

Man, you a good guesser!

*/15 * * * * /usr/sbin/tmpwatch --atime 1 /tmp --exclude=/tmp/SBo/ > /dev/null 2>&1

so I've added

--exclude=/tmp/xdo

to that.

as a note: I tested it by firing up wuncri and while it ran, I nuked /tmp/xdo and sure enough, it showed the same symptom.

Thanks, you rock!

yay!

where is that line that cleans out tmp?
it may be a good idea to change the default in wunrci to point to additional_files in the wun folder so it is persistant

but it might also be a good idea to put a note in wunrci below the button setup with instructions how to add that --exclude command

Offline

#542 2014-01-30 18:56:14

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

Re: Wun Weather Script for Conky (Lua)

Habitual wrote:

/tmp/xdo here.
YMMV on #!

It must, I don't even have a /tmp directory, let alone a /tmp/xdo.

But the code all points to: /tmp/xdo - I just checked.
{was that Rod Serling that just streaked us?}


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

Offline

#543 2014-01-30 19:01:27

Habitual
#! Member
From: Youngstown, OH
Registered: 2010-09-10
Posts: 62
Website

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

yay!

where is that line that cleans out tmp?
it may be a good idea to change the default in wunrci to point to additional_files in the wun folder so it is persistant

but it might also be a good idea to put a note in wunrci below the button setup with instructions how to add that --exclude command

It's a system program called tmpwatch (a Linux utility).
It doesn't come 'standard' on most systems I've used (Slackware for 562 days now and OpenSUSE for ~500 days before that). It has to be installed.

Suggestion or improvement to write the xdo file in the ~/wun folder where ever it exists?

Sector11 wrote:

Interestingly enough I have no /tmp/xdo but I do have a ~/tmp/xdo.
And everything works.

Thanks!

Last edited by Habitual (2014-01-30 19:01:49)


Success is 1% Inspiration
and 98% Perspiration and
2% atttention to details.

Offline

#544 2014-01-30 19:19:47

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

Re: Wun Weather Script for Conky (Lua)

Habitual wrote:

Suggestion or improvement to write the xdo file in the ~/wun folder where ever it exists?

Sector11 wrote:

Interestingly enough I have no /tmp/xdo but I do have a ~/tmp/xdo.
And everything works.

Thanks!

Like that suggestion: /path/to/wun/xdo

OK, I stand corrected, I do have a /tmp and a /tmp/xdo - but I didn't create it.

tmpwatch doesn't exist for Debian, but tmpreaper does (it replaces it):

30 Jan 14 | 16:03:02 ~
    $ sho tmpreaper
Package: tmpreaper                       
State: not installed
Version: 1.6.13+nmu1
Priority: optional
Section: admin
Maintainer: Paul Slootman <paul@debian.org>
Architecture: amd64
Uncompressed Size: 172 k
Depends: libc6 (>= 2.2.5), debconf (>= 0.5.0) | debconf-2.0
Conflicts: tmpwatch
Replaces: tmpwatch
Description: cleans up files in directories based on their age

This package provides a program that can be used to clean out temporary-file directories.  It recursively searches the directory, refusing to chdir() across symlinks, and removes files that haven't been accessed in a user-specified amount of time.  You can specify a set of files to protect from deletion with a shell pattern.  It will not remove files owned by the process EUID that have the `w' bit clear, unless you ask it to, much like `rm -f'.  `tmpreaper'  will not remove symlinks, sockets, fifos, or special files unless given a command line option enabling it to.

WARNING:  Please do not run `tmpreaper' on `/'.  There are no protections against this written into the program, as that would prevent it from functioning the way you'd expect it to in a `chroot(8)' environment.

The daily tmpreaper run can be configured through /etc/tmpreaper.conf .


30 Jan 14 | 16:03:16 ~
    $

Last edited by Sector11 (2014-01-30 19:23:09)


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

Offline

#545 2014-01-30 19:25:26

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

Re: Wun Weather Script for Conky (Lua)

i changed a couple of lines in wunrci to this:

lua_draw_hook_pre get_mouse {"interactiveconkyrc","/tmp/xdo"} 
## after function call, table containing window title and path to click log file
## In the example above "/tmp/xdo" creates a file called xdo in your /tmp directory
## NOTE if you are running a /tmp cleaning utility then by removing /tmp/xdo while the script is running will cause errors
## for a more persistent xdo log file you can change the path to point to your wun folder

Offline

#546 2014-01-30 19:54:56

Habitual
#! Member
From: Youngstown, OH
Registered: 2010-09-10
Posts: 62
Website

Re: Wun Weather Script for Conky (Lua)

Documentation is Important and you do a great job of it.


Success is 1% Inspiration
and 98% Perspiration and
2% atttention to details.

Offline

#547 2014-01-30 20:13:05

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

Re: Wun Weather Script for Conky (Lua)

Thank you very much Habitual!

ive put the daylength code into wun and trying it out here
Screenshot_from_2014_01_30_13_56_52.jpg

here is wun.lua with the change
https://dl.dropboxusercontent.com/u/190 … lua.tar.gz

2 new data options for each day (1 to 10)
day[1].daylength_hour
day[1].daylength_min

with most time options i have been making them padded or not, so i will most likely do that in the future

"_pad" to the end to retain a leading zero

Offline

#548 2014-01-30 20:15:06

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

Re: Wun Weather Script for Conky (Lua)

just noticed an OOPS!  my first quarter moon is the wrong way around  :8   :8  LOL
ill post a fix in a minute

FIXED - in main archive and in the wun.lua script here
https://dl.dropboxusercontent.com/u/190 … lua.tar.gz

yikes, and here i was thinking it was finished!  big_smile

Last edited by mrpeachy (2014-01-30 20:29:11)

Offline

#549 2014-01-30 20:29:39

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

i changed a couple of lines in wunrci to this:

lua_draw_hook_pre get_mouse {"interactiveconkyrc","/tmp/xdo"} 
## after function call, table containing window title and path to click log file
## In the example above "/tmp/xdo" creates a file called xdo in your /tmp directory
## NOTE if you are running a /tmp cleaning utility then by removing /tmp/xdo while the script is running will cause errors
## for a more persistent xdo log file you can change the path to point to your wun folder

I'll make a note on CPS as well.  big_smile


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

Offline

Be excellent to each other!

#550 2014-01-30 20:36:05

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

Re: Wun Weather Script for Conky (Lua)

mrpeachy wrote:

Thank you very much Habitual!

ive put the daylength code into wun and trying it out here
http://s21.postimg.org/8oxkyde0z/Screenshot_from_2014_01_30_13_56_52.jpg

here is wun.lua with the change
https://dl.dropboxusercontent.com/u/190 … lua.tar.gz

2 new data options for each day (1 to 10)
day[1].daylength_hour
day[1].daylength_min

with most time options i have been making them padded or not, so i will most likely do that in the future

"_pad" to the end to retain a leading zero

This I like!

Sunrise/set times are in 24 hour times with a leading 0 for most places as it's required for ships and planes - and this remouves any doubt as to what time.


·  ↓   ↓   ↓   ↓   ↓   ↓  ·
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