Page 328 of 380 FirstFirst ... 228278318326327328329330338378 ... LastLast
Results 3,271 to 3,280 of 3796

Thread: Conky Weather Forecast Python Script

  1. #3271
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Sometimes things are just too good not to be seen. Like conkyForecast with colours!

    And this has to be seen to be appreciated, the background LUA originally by londonali1010 (2009) as modified by dk75 and mrpeachy. dk75 added the ability to set variables and mrpeachy the ability to set any size. As you see this has a combination of affects. All mrpeachy's ideas, I'm just expanding on it here.

    Done in the conky not the LUA script.... NICE!


    This background LUA script is great! The first layer is the complete semi-transparent black background with rounded corners set at an alpha level of 0.4.

    The next comes the blocks of colours for various sections of the conky. Here the different days are just a ripe choice for that, I've set their alpha level at 0.2 for this example.

    Now some the little white boxes for the images set and positioned very similar to the way the ${image} command works I found that they are out by a few pixels, but close enough that the "-p xx,xx" portion of the images will get you close enough to make the final adjustments.

    I have alpha setting set to 0.1 and 0.2 under HOY for today's weather image and the moon. Under Lunes: 0.3, Martes: 0.4 and Míercoles:0.5 just to show various affects. Lunes, Martes and Míercoles started showing rounded corners on the white boxes as well, values of 2,3 and 4 respectively.

    Different backgrounds:

    Yea, that's nice. Thank you mrpeachy

    the LUA script:
    Code:
    --[[Background originally by londonali1010 (2009)
        ability to set any size for background mrpeachy 2011
        ability to set variables for bg in conkyrc dk75
    
    the conky bits that matter (sample):
    _ _ _ _ _ _ _ _ _ _
    lua_load ~/lua/background.lua
    
    TEXT
    ${lua conky_draw_bg 10 100 100 100 100 0x000000 0.2}
    ${lua conky_draw_bg 10 200 200 100 100 0x000000 0.2}
    ${lua conky_draw_bg 10 100 300 100 100 0x000000 0.2}
    
    #${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
    
    ${execpi 1800 conkyForecast --template=~/lua/test.template}
    _ _ _ _ _ _ _ _ _ _
    test template:
    _ _ _ _ _ _ _ _ _ _
    ${image [--datatype=WI --startday=1]  -p 100,100 -s 90x90}
    ${image [--datatype=WI --startday=2]  -p 200,200 -s 90x90}
    ${image [--datatype=WI --startday=3]  -p 100,300 -s 90x90}
    ${image [--datatype=WI --startday=4]  -p 200,400 -s 90x90}
    _ _ _ _ _ _ _ _ _ _
    
    or you can have one background over the whole window
    and others to highlight parts of the conky
    _ _ _ _ _ _ _ _ _ _
    TEXT
    ${lua conky_draw_bg 50 0 0 400 800 0x000000 0.2} # whole background
    ${lua conky_draw_bg 20 100 100 100 100 0x000000 0.2} # dark shade
    ${lua conky_draw_bg 0 200 200 100 100 0xffffff 0.2} # light square
    ${lua conky_draw_bg 50 100 300 100 100 0xff0000 0.2} # red circle
    _ _ _ _ _ _ _ _ _ _
    
    ]]
    
    require 'cairo'
    local    cs, cr = nil
    function rgb_to_r_g_b(colour,alpha)
    return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
    end
    function conky_draw_bg(r,x,y,w,h,color,alpha)
    if conky_window == nil then return end
    if cs == nil then cairo_surface_destroy(cs) end
    if cr == nil then cairo_destroy(cr) end
    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
    local cr = cairo_create(cs)
    cairo_set_source_rgba (cr,rgb_to_r_g_b(color,alpha))
    --top left mid circle
    local xtl=x+r
    local ytl=y+r
    --top right mid circle
    local xtr=(x+r)+((w)-(2*r))
    local ytr=y+r
    --bottom right mid circle
    local xbr=(x+r)+((w)-(2*r))
    local ybr=(y+r)+((h)-(2*r))
    --bottom right mid circle
    local xbl=(x+r)
    local ybl=(y+r)+((h)-(2*r))
    -----------------------------
    cairo_move_to (cr,xtl,ytl-r)
    cairo_line_to (cr,xtr,ytr-r)
    cairo_arc(cr,xtr,ytr,r,((2*math.pi/4)*3),((2*math.pi/4)*4))
    cairo_line_to (cr,xbr+r,ybr)
    cairo_arc(cr,xbr,ybr,r,((2*math.pi/4)*4),((2*math.pi/4)*1))
    cairo_line_to (cr,xbl,ybl+r)
    cairo_arc(cr,xbl,ybl,r,((2*math.pi/4)*1),((2*math.pi/4)*2))
    cairo_line_to (cr,xtl-r,ytl)
    cairo_arc(cr,xtl,ytl,r,((2*math.pi/4)*2),((2*math.pi/4)*3))
    cairo_close_path(cr)
    cairo_fill (cr)
    ------------------------------------------------------------
    cairo_surface_destroy(cs)
    cairo_destroy(cr)
    return ""
    end
    I took the liberty of adding some instructions to the top.

    And what I use in the conky for this example:

    Code:
    ####################################
     border_inner_margin 2
    # border_outer_margin 0
    ####################################
     lua_load ~/Conky/LUA/m-bg.lua
    # ${lua conky_draw_bg 50 100 0 400 20 0x000000 0.2}
    # ${lua conky_draw_bg corner_radius x_position y_position width height color alpha}
    TEXT
    ${lua conky_draw_bg 30 0 0 90 920 0x000000 0.4}\
    ${lua conky_draw_bg 0 0 21 90 200 0xff0000 0.2}${lua conky_draw_bg 0 5 24 40 40 0xffffff 0.1}${lua conky_draw_bg 0 56 24 16 16 0xffffff 0.2}\
    ${lua conky_draw_bg 0 0 221 90 97 0xffff00 0.2}${lua conky_draw_bg 2 6 247 40 40 0xffffff 0.3}\
    ${lua conky_draw_bg 0 0 320 90 97 0x0000ff 0.2}${lua conky_draw_bg 3 6 341 40 40 0xffffff 0.4}\
    ${lua conky_draw_bg 4 6 443 40 40 0xffffff 0.5}\
    ${execpi 1800 conkyForecast --location=ARBA0009 --template=~/Conky/templates/ob_mb_weather.template}
    The \ that you see on the ends of the lines confuses conky into thinking it all one line. Easier to code that way.

  2. #3272
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    827
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Conky Weather Forecast Python Script

    Wow!!!
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  3. #3273
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by GrouchyGaijin View Post
    Wow!!!
    Yea, slick huh! mrpeachy you make good LUAs!

    Remember the commercial: Mr Christie you make good cookies!

  4. #3274
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by Sector11 View Post
    I found that they are out by a few pixels
    the nerve!

  5. #3275
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by mrpeachy View Post
    the nerve!
    Yea, I was meaning to talk to you about that....

    All in all a:

    The SDL Award!
    You know SuperDuperLUA

  6. #3276
    Join Date
    Jun 2011
    Beans
    9

    Question Re: Conky Weather Forecast Python Script

    Hello Ubuntu community!!! First time poster.... long time lurker. I am fairly new to Linux but have a strong IT background. I am running Ubuntu 11.04 and am working on getting this weather forecast script working.

    I have CONKY-colors v5.1.1 installed and running as per this link. No problems so far. Then I followed the link at the bottom of the CC post for the weather forecast python script which brought me here.

    I have followed the instructions to the letter using install method #1, registered for the XOAP service @ weather.com, got my location code etc, and edited the .conkyForecast.config file to reflect the above info.

    When I get to the next section "Example Use" I do not have the following path on my system /usr/share/conkyforecast/example or the 8 files contained inside. I also do not have the path /usr/share/conkyforecast/test listed under the "Testing" section. The closest path name I have is /usr/share/conkycolors.

    So, I cannot get the weather script to work. Is this due to installing CONKY-colors as opposed to just Conky? Is this due to running 11.04 since it is a new release? Any idea's would be greatly appreciated!

    John

  7. #3277
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by firstrock View Post
    So, I cannot get the weather script to work. Is this due to installing CONKY-colors as opposed to just Conky? Is this due to running 11.04 since it is a new release? Any idea's would be greatly appreciated!

    John
    Nothing to do with CONKY-colors.
    Show us your conky version.
    Code:
      08:56 ~
             $ conky --version
    Conky 1.8.0 compiled Tue Apr  6 23:19:18 UTC 2010 for Linux 2.6.32.11-dsa-amd64 (x86_64)
    
    Compiled in features:
    
    System config file: /etc/conky/conky.conf
    Package library path: /usr/lib/conky
    
     X11:
      * Xdamage extension
      * XDBE (double buffer extension)
      * Xft
      * ARGB visual
    
     Music detection:
      * MPD
      * MOC
    
     General:
      * math
      * hddtemp
      * portmon
      * Curl
      * RSS
      * Weather (METAR)
      * Weather (XOAP)
      * wireless
      * support for IBM/Lenovo notebooks
      * nvidia
      * eve-online
      * config-output
      * Imlib2
      * ALSA mixer support
      * apcupsd
      * iostats
      * ncurses
      * Lua
    
      Lua bindings:
       * Cairo
       * Imlib2
    
      08:56 ~
             $
    It sounds like conkyForecast is not installed, try this:
    Code:
    conkyForecast --verbose
    You should see something like this, if you don't re-install conkyForecast:
    Code:
      08:51 ~
             $ conkyForecast --verbose
    *** INITIAL OPTIONS:
        config: ~/.conkyForecast.config
        location: None
        datatype: HT
        start day: None
        end day: None
        spaces: 1
        template: None
        locale: None
        imperial: False
        beaufort: False
        metrespersecond: False
        night: False
        shortweekday: False
        hideunits: False
        hidedegreesymbol: False
        minuteshide: None
        centeredwidth: None
        refetch: False
        verbose: True
        errorlogfile: None
        infologfile: None
    *** CONFIG OPTIONS:
        CACHE_FOLDERPATH: /home/sector11/Conky/cache/
        CONNECTION_TIMEOUT: 5
        EXPIRY_MINUTES: 30
        TIME_FORMAT: %H:%M
        DATE_FORMAT: %Y-%m-%d
        LOCALE: es
        XOAP_PARTNER_ID: HIDE FROM VIEW
        XOAP_LICENCE_KEY: HIDE FROM VIEW
        DEFAULT_LOCATION: HIDE FROM VIEW (if you want)
        MAXIMUM_DAYS_FORECAST: 9
        BASE_XOAP_URL: http://xml.weather.com/weather/local/<LOCATION>?cc=*&dayf=10&link=xoap&prod=xoap&par=<XOAP_PARTNER_ID>&key=<XOAP_LICENCE_KEY>&unit=m
    INFO: Locale set to es
    INFO: Looking for translation file for 'es' under /usr/share/conkyforecast/locale
    INFO: Translation file found for 'es'
    INFO: Translation installed for 'es'
    INFO: Not using a proxy as none is defined
    INFO: Loading cache file /home/sector11/Conky/cache/.conkyForecast-ARBA0009.cache
    8°C
    
      08:52 ~
             $

  8. #3278
    Join Date
    Feb 2008
    Location
    52°38'41.6"N/1°19'43.6"E
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    I'm setting up a 11.04 ubuntu VM to test the install too...just in case...

    edit: @firstrock - the test and example folders are installed in 11.04...I suggest uninstalling and reinstalling the conkyforecast package and checking for the folders again

    edit2: if you still have trouble then download the tarball of it all here: https://launchpad.net/~conky-compani...st_2.20.tar.gz
    Attached Images Attached Images
    Last edited by kaivalagi; June 8th, 2011 at 09:45 PM.

  9. #3279
    Join Date
    Nov 2007
    Beans
    16

    Re: Conky Weather Forecast Python Script

    I got a problem here, conky doesnt create .conkyForecast-xxxxxx.cache file.

    i have to run conkyForecast command first, once cache created then i re-run conky, it displays correctly.
    I checked config file, everythings fine. CACHE_FOLDERPATH = /tmp

    please help.

    thanks a lot

  10. #3280
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Conky Weather Forecast Python Script

    Quote Originally Posted by iooma View Post
    I got a problem here, conky doesnt create .conkyForecast-xxxxxx.cache file.

    i have to run conkyForecast command first, once cache created then i re-run conky, it displays correctly.
    I checked config file, everythings fine. CACHE_FOLDERPATH = /tmp

    please help.

    thanks a lot
    Sometimes it help to change:
    Code:
    CACHE_FOLDERPATH = /tmp
    to something else. Mine is:
    Code:
    #===============================================#
    # USER SETTINGS, EDIT BASED ON DOCUMENTED SETUP #
    #===============================================#
    CACHE_FOLDERPATH = /home/sector11/Conky/cache/

Page 328 of 380 FirstFirst ... 228278318326327328329330338378 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •