Author Topic: Conky Support, Codes and Screenshots  (Read 266523 times)

Sector11

  • Posts: 870
    • View Profile
v9000 weather - a default template
« Reply #285 on: March 10, 2013, 07:59:18 PM »
mrpeachy's v9000 script comes with a sample template: s11template.lua.

I wonder who did that.   ::)

Anyway it uses the font Digital-7 that just doesn't work well today - anywhere - no idea why as seen here:

Sooooooooooooo a tweaking I did go ... and got carried away, it went from 5 days to 10 days and the default font was changed to monofur.

Here it is under construction - I gotta find or make a "Conky Under Construction" wallpaper:

Notice the 250°, 240° and 240° for the Next 3 Hours.

That's to cover spacing for things like "-25°" or "101°" (F) we'd be in trouble if it was °C

And the finished template in action:

Changes in spacing (see above) came about because of the new mono font: monofur. I like it, others don't.

The new s11template.lua
Code: [Select]
--[[
 The latest script is a lua only weather script. aka: v9000
 http://crunchbanglinux.org/forums/topic/16100/weather-in-conky/

 the file:
http://dl.dropbox.com/u/19008369/v9000.tar.gz

 mrppeachys LUA Tutorial
 http://crunchbanglinux.org/forums/topic/17246/how-to-using-lua-scripts-in-conky/

 The "red+x.png" and "cyan_1.png" images, with others are available here:
 http://tiny.cc/gbuqtw - 1_pixel_images.tar.gz (3.3KB)

]]
_G.weather_script = function()--#### DO NOT EDIT THIS LINE ##############
--these tables hold the coordinates for each repeat do not edit #########
top_left_x_coordinate={}--###############################################
top_left_y_coordinate={}--###############################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Monofur"--font must be in quotes
default_font_size=14
default_color=0xffffff--white
default_alpha=1--fully opaque
default_image_width=50
default_image_height=50
--END OF DEFAULTS #######################################################
--START OF WEATHER CODE -- START OF WEATHER CODE -- START OF WEATHER CODE
out({c=0x00BFFF,a=1,x=10,y=15,txt=now["date"].." "..now["month_short"].." "..now["year"].." @ "..now["time"]})
image({x=10,y=20,h=70,w=70,file=now["weather_icon"]})
--  image({x=10,y=20,h=70,w=70,file="/media/5/Conky/images/red+x.png"})
-- Temp / FeelsLike & CONDITIONS TEXT
out({c=0x48D1CC,a=1,f="DS-Digital",fs=50,x=80,y=60,txt=now["temp"]})
out({c=0x00BFFF,a=1,f="DS-Digital",fs=50,x=140,y=60,txt=now["feels_like"]})
out({c=0xA4FFA4,a=1,x=81,y=72,txt="Temp     WC·HI"})
-- WC = Wind Chill · HI = Heat Index
out({c=0x48D1CC,a=1,f="Zekton",fs=18,x=10,y=105,txt=now["conditions"]})
image({x=205,y=110,h=60,w=60,file=now["wind_icon"]})
--  image({x=205,y=110,h=60,w=60,file="/media/5/Conky/images/red+x.png"})
image({x=205,y=200,h=50,w=50,file=moon_icon[1]})
--  image({x=205,y=200,h=60,w=60,file="/media/5/Conky/images/red+x.png"})

-- data titles
--    data output
datay=110   -- y=datay or
datayy=15   -- y=datay+(datayy*1) use 1 or more

out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*1),txt="Today's Hi·Lo:"})
   out({c=0xFF8C00,a=1,x=115,y=datay+(datayy*1),txt=high_temp[1].."°"})
   out({c=0x48D1CC,a=1,x=150,y=datay+(datayy*1),txt=low_temp[1].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*2),txt="Wind:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*2),txt=now["wind_km"]})
   out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*2),txt=now["wind_nesw"]})
   out({c=0xFAFAEC,a=1,x=150,y=datay+(datayy*2),txt="@"})
   out({c=0x48D1CC,a=1,x=165,y=datay+(datayy*2),txt=now["wind_deg"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*3),txt="Hum:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*3),txt=now["humidity"].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*3),txt="DP:"})
   out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*3),txt=now["dew_point"].."°"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*4),txt="Bar:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*4),txt=now["pressure_mb"]})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*4),txt="Vis:"})
   out({c=0x48D1CC,a=1,x=145,y=datay+(datayy*4),txt=now["visibility"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*5),txt="Ceil:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*5),txt=now["ceiling"]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*6),txt="Precip:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*6),txt=precipitation[1].."%"})
out({c=0xFAFAEC,a=1,x=110,y=datay+(datayy*6),txt="Cloud:"})
   out({c=0x48D1CC,a=1,x=155,y=datay+(datayy*6),txt=cloud_cover[1].."%"})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*7),txt="UV:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*7),txt=uv_index_num[1]})
   out({c=0x48D1CC,a=1,x=110,y=datay+(datayy*7),txt=uv_index_txt[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*8),txt="Sun:"})
   out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*8),txt=sun_rise_24[1]})
   out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*8),txt=sun_set_24[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*9),txt="Moon:"})
   out({c=0xFAFAEC,a=1,x=60,y=datay+(datayy*9),txt=moon_rise_24[1]})
   out({c=0x48D1CC,a=1,x=120,y=datay+(datayy*9),txt=moon_set_24[1]})
out({c=0xFAFAEC,a=1,x=10,y=datay+(datayy*10),txt="Phase:"})
   out({c=0x48D1CC,a=1,x=60,y=datay+(datayy*10),txt=moon_phase[1]})

-- line
image({x=205,y=5,w=1,h=90,file="/media/5/Conky/images/cyan_1.png"})
-- 3 hour output
out({c=0x48D1CC,a=1,x=265,y=15,txt="Next 3 Hours"})
-- 1st hour
image({w=45,h=45,x=220,y=32,file=now["fc_hour1_wicon"]})
--  image({w=45,h=45,x=220,y=32,file="/media/5/Conky/images/red+x.png"})
out({c=0xA4FFA4,a=1,x=225,y=30,txt=now["fc_hour1_time_24"]..":00"})
out({a=1,x=228,y=90,txt=now["fc_hour1_temp"] .."°"})
-- 2nd hour
image({w=45,h=45,x=280,y=32,file=now["fc_hour2_wicon"]})
--  image({w=45,h=45,x=280,y=32,file="/media/5/Conky/images/red+x.png"})
out({c=0xA4FFA4,a=1,x=285,y=30,txt=now["fc_hour2_time_24"]..":00"})
out({a=1,x=290,y=90,txt=now["fc_hour2_temp"] .."°"})
-- 3rd hour
image({w=45,h=45,x=340,y=32,file=now["fc_hour3_wicon"]})
--  image({w=45,h=45,x=340,y=32,file="/media/5/Conky/images/red+x.png"})
out({c=0xA4FFA4,a=1,x=345,y=30,txt=now["fc_hour3_time_24"]..":00"})
out({a=1,x=352,y=90,txt=now["fc_hour3_temp"] .."°"})
-- line
image({x=205,y=95,w=190,h=1,file="/media/5/Conky/images/cyan_1.png"})
-- line
image({x=5,y=270,w=390,h=1,file="/media/5/Conky/images/cyan_1.png"})

--start or weather forecast table section
--set start forecast day
start_day=1
--set total forecast days you want to display
number_of_days=10
topy=15
topyy=135 -- topy+(topyy*1)
topx=285
topxx=137.5
--set coordinates for top lef corners for each repeat

top_left_x_coordinate[1],top_left_y_coordinate[1] =topx ,150

top_left_x_coordinate[2],top_left_y_coordinate[2] =10 ,290
   top_left_x_coordinate[3],top_left_y_coordinate[3] =10+(topxx*1) ,290
top_left_x_coordinate[4],top_left_y_coordinate[4] =10+(topxx*2) ,290

top_left_x_coordinate[5],top_left_y_coordinate[5] =10 ,440
   top_left_x_coordinate[6],top_left_y_coordinate[6] =10+(topxx*1) ,440
top_left_x_coordinate[7],top_left_y_coordinate[7] =10+(topxx*2) ,440

top_left_x_coordinate[8],top_left_y_coordinate[8] =10 ,590
   top_left_x_coordinate[9],top_left_y_coordinate[9]   =10+(topxx*1) ,590
top_left_x_coordinate[10],top_left_y_coordinate[10] =10+(topxx*2) ,590
--########################################################################################
for i=start_day,number_of_days-(start_day-1) do --start of day repeat, do not edit #######
tlx=top_left_x_coordinate[i] --sets top left x position for each repeat ##################
tly=top_left_y_coordinate[i] --sets top left y position for each repeat ##################
--########################################################################################
out({c=0xA4FFA4,a=1,x=tlx,y=tly,txt=forecast_day_short[i].."  "..forecast_date[i].."  "..forecast_month_short[i]})
image({x=tlx+40,y=tly+2,h=45,w=45,file=weather_icon[i]})
--  image({x=tlx+40,y=tly+2,h=45,w=45,file="/media/5/Conky/images/red+x.png"})
out({c=0xFF8C00,a=1,x=tlx+0,y=tly+20,txt=high_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx+0,y=tly+35,txt=low_temp[i].."°"})
out({c=0x48D1CC,a=1,x=tlx,y=tly+60,txt=conditions_short[i]})

out({c=0xFAFAEC,a=1,x=tlx,y=tly+80,txt="P: "..precipitation[i].."%"})
out({c=0xFAFAEC,a=1,x=tlx+60,y=tly+80,txt="H: "..humidity[i].."%"})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+95,txt="S: "..sun_rise_24[i]})
  out({c=0x48D1CC,a=1,x=tlx+73,y=tly+95,txt=sun_set_24[i]})
out({c=0xFAFAEC,a=1,x=tlx,y=tly+110,txt="M: "..moon_rise_24[i]})
  out({c=0x48D1CC,a=1,x=tlx+73,y=tly+110,txt=moon_set_24[i]})
--########################################################################################
end--of forecast repeat section ##########################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--#######################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################

EDIT:  RE: I gotta find or make a "Conky Under Construction"  - I did, here!
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: v9000 weather - a default template
« Reply #286 on: March 10, 2013, 08:18:04 PM »
Very nice! I have been using Teos weather scripts for the last year or so and am finally looking at mrpeachys v9000. Thanks for this.
Don't Be A Dick!

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: Conky Codes and Images
« Reply #287 on: March 10, 2013, 08:20:47 PM »
@ VastOne

 :DWhat was the question again? I think that brain cell is on vacation....... Oh yeah, LMAO, ok Im changing my avatar now cuz it does look like that and causing me mental pain  ???
Don't Be A Dick!

VastOne

  •      v-ger
  • Posts: 4226
    • View Profile
    • VSIDO Community
Re: v9000 weather - a default template
« Reply #288 on: March 10, 2013, 08:33:43 PM »
Nice one Sector11!

@lwfitz, I see the avatar just keeps getting better and better!
VSIDO      VSIDO FB       

    I dev VSIDO

Sector11

  • Posts: 870
    • View Profile
Re: v9000 weather - a default template
« Reply #289 on: March 10, 2013, 09:52:06 PM »
@ lwfitz

You're welcome.  I've used Teo's, mrpeachy's and Mark's.  My wife is using a combo of mrpeachy's v9000 and Mark's conkyForecast.

conkyForecast gets "day numbers" and the "hours of daylight"

So v9000 displays: Mon
conkyForcast displays: 11  and 12:28 <<-- daylight HH:MM

And with a helper app; conkyForecast-SunsetSunriseCountdown.py (conkyForecast must be running) and conky's ${if_match} statment during the day you can have:

Sunset in 00:31:55
             and after sundown the line will switch to:
Sunrise in 11:14:32

Code: [Select]
10 Mar 13 | 18:47:42 ~
         $ conkyForecast-SunsetSunriseCountdown
00:30:16
 
 10 Mar 13 | 18:47:43 ~
         $ conkyForecast-SunsetSunriseCountdown
00:30:16
 
 10 Mar 13 | 18:47:43 ~
         $ conkyForecast-SunsetSunriseCountdown
00:30:15
 
 10 Mar 13 | 18:47:44 ~
         $ conkyForecast-SunsetSunriseCountdown
00:30:14
 
 10 Mar 13 | 18:47:45 ~
         $ conkyForecast-SunsetSunriseCountdown
00:30:14
 
 10 Mar 13 | 18:47:45 ~
         $

I think I'm probably the only person that ever used that ... or at least only one of a handful.

In fact in the image that 00:45:14 you see is just that.


@ VastOne - thanks!  I do what I do  :)
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: v9000 weather - a default template
« Reply #290 on: March 10, 2013, 10:58:17 PM »
I actually never even thought to mix the scripts...... thats a great idea!
Don't Be A Dick!

Sector11

  • Posts: 870
    • View Profile
Re: v9000 weather - a default template
« Reply #291 on: March 10, 2013, 11:38:08 PM »
@ lwfitz - Somethings you think of - somethings I think of.   ;)

I wanted to get all three in there but after cF and v9000 were maxed out Teo's script couldn't add anything new.  :(

I started with conkyForecast since it does a day and night forecast, and gets the images for both.  cF does the "sun" nice SR, SS and DL - but no Moonrise or Moonset, plus that other little sunrise-set countdown app I mentioned - enter v9000 and the moon stuff is added.

Makes for a nice combo.
Do you want the files?
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: v9000 weather - a default template
« Reply #292 on: March 11, 2013, 12:00:03 AM »
Yeah Id love them thanks! Itll give me something to work on tonight  8)
Don't Be A Dick!

Sector11

  • Posts: 870
    • View Profile
Re: v9000 weather - a default template
« Reply #293 on: March 11, 2013, 12:27:50 AM »
@ IT! lwfitz

Here you go.  The S12 conkyForecastv9000 Combo

I'm S11, my wife is S12 - Everyone wave at S12  :D
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1781
  • sudo rm -rf /
    • View Profile
Re: v9000 weather - a default template
« Reply #294 on: March 11, 2013, 05:43:25 AM »
HI S12  ;D

Don't Be A Dick!

Sector11

  • Posts: 870
    • View Profile
Re: v9000 weather - a default template
« Reply #295 on: March 11, 2013, 11:03:35 AM »
Funny - and thanks ... from S12 too.

She smiled a big one!
Stay Home

jedi

  • DEFCON 1
  • Posts: 1642
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Re: v9000 weather - a default template
« Reply #296 on: March 11, 2013, 11:54:33 AM »
@Sector11, on your recommends a while back, I checked out the 'monofur' font and have been using it ever since in some stuff.  Also, I think that everytime I've used mrpeachy's v9000 weather script, it has been with one of several (many?) "default Sector11" templates!   ;D
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

Sector11

  • Posts: 870
    • View Profile
Re: v9000 weather - a default template
« Reply #297 on: March 11, 2013, 01:40:11 PM »
For some things in conky a mono font is a "blessing" not a must but it sure makes things easier to space properly.

Most mono fonts are "boring" and some lie, "i"'s are narrower than other letters or the numbers with the font aren't "mono"  so .... why do they call them mono? ???

monofur - it's all "mono" and has a certain style and class that makes it different. And while that's an opinion, I'm the one doing the writing here.  ;)

Not only that, it accepts every strange character my keyboard can toss at it.   ??? That' a big plus in MHO.  AND I like the looks of it.

And that's not including the accented letters: á â ä â ŵ ẅ blah blah ...

I even use it as a system font ... it took a day or so to get use to but it looks nice with headers and menus ... especially in OB.

As for the v9000 templates ...
  I have flooded the market with a whole bunch of mine ... so it stands to reason that someone somewhere has to be using at least one.

Kinda like a shotgun ...
  Blast away with enough shells and sooner or later a few pellets will hit something.  :D :D
Stay Home

jedi

  • DEFCON 1
  • Posts: 1642
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Re: v9000 weather - a default template
« Reply #298 on: March 11, 2013, 02:59:11 PM »
Ok, so that looks pretty awesome actually.  Never considered it for a system font... ???  Not sure why since I like it so much.  Gonna see how I like it as the sys font on mine...
Now we gotta talk about that VERY COOL menu showing the WEATHER!!!  How's that done?  Trade secret?  That just might replace having it on the screen in the form of Conky...  (well, maybe not 'replace')
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

sevensage

  • Posts: 6
    • View Profile
Battery Monitor
« Reply #299 on: March 11, 2013, 04:50:56 PM »
Hi guys - sorry to come to you with this I have tried finding a solution / reply within the bang forums but without success. I picked up a script (from wcs) and it was working perfectly. It has a python script to warn of low battery levels and a bash script executed once levels get too low to suspend. One fine morning when booting up my netbook it started up and went into suspend mode once the battery monitor in conky loaded. I cannot for the life of me figure what is triggering this behavior, it's not the end of the world if I disable the suspend portion of it but it was working perfectly at first. Anyhoo I'm going to lay down the code and the scripts, if you guys suspect what the culprit may be, I'd really appreciate a heads up.

conky bit
Code: [Select]
BAT ${if_existing /sys/class/power_supply/AC0/online 0}${if_match ${battery_percent BAT1} <= 20}${if_match ${battery_percent BAT1} <= 17}${if_match ${battery_percent BAT1} <= 15}${color red}${exec /home/mini/.scripts/pm-suspend}$else${color red}${execi 60 /home/mini/.scripts/criticalbat.py}$endif$else${color orange}${execi 120 /home/mini/.scripts/lowbat.py}$endif$endif$endif${battery_percent BAT1}%$color

bash bit
Code: [Select]
#!/bin/bash
gksu /usr/sbin/pm-suspend

python bits
lowbat
Code: [Select]
#!/usr/bin/env python2
import pynotify
pynotify.init("foo")
pynotify.Notification("Power warning", "Battery capacity is low.", "battery-low").show()

criticalbat
Code: [Select]
#!/usr/bin/env python2
import pynotify
pynotify.init("foo")
pynotify.Notification("POWER WARNING!", "Battery capacity is critically low!", "battery-caution").show()


cheers