Page 2 of 178 FirstFirst 12341252102 ... LastLast
Results 11 to 20 of 1774

Thread: HOWTO: VinDSL Conky Script

  1. #11
    Join Date
    Aug 2010
    Location
    Arizona USA
    Beans
    2,800
    Distro
    Ubuntu Development Release

    Re: HOWTO: VinDSL Conky Script

    2-JULY-2011 UPDATE

    conkyForecast has quit working in UbuOO (29-Jun build) and (reportedly) Debian Sid. Here is the fix...


    Ubuntu Oneiric 11.10 / Debian Sid / conkyForecast Hack



    Modify your conkyForecast.py file (UTF-8 Compatible Text Editor)
    Code:
    $ sudo gedit ../../usr/share/conkyforecast/conkyForecast.py
    
    * Use spaces for indentation!  Read SOURCE #3 (above) if you're new to Python.
    Apply the wnelson hack
    Code:
    change Line 16
    
    add import urllib above import urllib2
    
    change Line 793
    
    usock = urllib2.urlopen(url)
    to 
    usock = urllib.urlopen(url)
    
    change Line 1624
    
    usock = urllib2.urlopen(url)
    to 
    usock = urllib.urlopen(url)

    Afterward, it should look like this...


    Line 16 Hack
    Code:
    from datetime import datetime, timedelta, tzinfo
    from optparse import OptionParser
    from xml.dom import minidom
    import sys
    import os
    import socket
    import urllib
    import urllib2
    import gettext
    import locale
    import re
    import codecs
    import traceback
    import time
    Line 793 Hack
    Code:
                # obtain current conditions data from xoap service
                try:
                    #url = "http://xoap.weather.com/weather/local/" + location + "?cc=*&dayf=10&link=xoap&prod=xoap&par=" + str(self.config.XOAP_PARTNER_ID) + "&key=" + self.config.XOAP_LICENCE_KEY + "&unit=m"
                    #url = "http://xoap.weather.com/weather/local/" + location + "?cc=*&dayf=10&link=xoap&par=" + str(self.config.XOAP_PARTNER_ID) + "&key=" + self.config.XOAP_LICENCE_KEY + "&unit=m"
                    #url = "http://xml.weather.com/weather/local/" + location + "?cc=*&unit=m&dayf=10&link=xoap&prod=xoap&par=" + str(self.config.XOAP_PARTNER_ID) + "&key=" + self.config.XOAP_LICENCE_KEY + "&unit=m"
    
                    url = self.config.BASE_XOAP_URL.replace("<LOCATION>",location).replace("<XOAP_PARTNER_ID>",str(self.config.XOAP_PARTNER_ID)).replace("<XOAP_LICENCE_KEY>",self.config.XOAP_LICENCE_KEY)
                           
                    self.logInfo("Fetching weather data from " + url)
    
    		usock = urllib.urlopen(url)
                    # usock = urllib2.urlopen(url)
                    xml = usock.read()
                    usock.close()
    Line 1624 Hack
    Code:
        def getImageSrcForWeatherMap(self, location):
            imagesrc = ""
            imgfilepath = ""
            try:
                url = "http://www.weather.com/outlook/travel/businesstraveler/map/" + location
    
                self.logInfo("Fetching satellite image page from " + url)
    
    	    usock = urllib.urlopen(url)
                # usock = urllib2.urlopen(url)
                html = usock.read()
    Compile conkyForecast.py using the sparker256 method
    Code:
    $ cd /usr/share/conkyforecast
    
    $ sudo python
    
    >>> import py_compile
    
    >>> py_compile.compile('conkyForecast.py')
    
    Ctrl-D to get you out of Python

    That's it...

    Special thanks to Walt, Bill, Mark, and Paul!

    And, remember the golden rule: Do Not Mix Tabs and Spaces in Python!
    Last edited by VinDSL; August 10th, 2011 at 01:38 AM. Reason: clarification
    Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
    Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
    XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU

  2. #12
    Join Date
    Aug 2010
    Location
    Arizona USA
    Beans
    2,800
    Distro
    Ubuntu Development Release

    Re: HOWTO: VinDSL Conky Script

    8-AUGUST-2011 UPDATE

    Added a couple of things to the Logo and System sections.


    This adds a second line, below the distribution ID, for additional info:
    Code:
    ##################################
    ##             LOGO             ##
    ##################################
    ## Uncomment for hard-coded ID (static)
    ${voffset -33}${font OpenLogos:size=103}${color2}v${font}${voffset -76}${goto 179}${font UbuntuTitleBold:size=19.8}${color4}1${offset 3}1${offset 1}.${offset 1}1${offset 1}0${font}
    ####
    ## Uncomment for soft-coded ID (dynamic)
    # ${voffset -33}${font OpenLogos:size=103}${color2}v${font}${voffset -76}${goto 179}${font UbuntuTitleBold:size=19.8}${color4}${pre_exec cat /etc/*release | grep 'RELEASE' | awk -F'=' '{print $2}'}${font}
    ####
    ## Additional ID (branch version, code name, release date, etc.)
    ${voffset -2}${goto 184}${font Ubuntu-B:size=8.5}${color4}alpha 3${font}

    This shows the currently installed nVidia driver version.
    Code:
    ##################################
    ##            SYSTEM            ##
    ##################################
    ${voffset 7}${font DroidSans:bold:size=8.25}${color4}SYSTEM${offset 8}${color8}${voffset -2}${hr 2}${font}
    ${voffset 4}${font OpenLogos:size=10}${color2}u${voffset -4}${font DroidSans:size=8.65}${color3}${offset 5}${pre_exec lsb_release -sd || cat /etc/*release}${alignr}${machine}${font}
    ${voffset 1}${offset -2}${font OpenLogos:size=12}${color2}Z${voffset -4}${font DroidSans:size=8.65}${color3}${offset 3}${sysname}${offset 3}${kernel}${offset 3}/${offset 3}nVidia-current${offset 3}${pre_exec dpkg --status nvidia-current | grep Version | cut -f 1 -d '-' | sed 's/[^.,0-9]//g'}${font}
    ${voffset 2}${font StyleBats:size=10}${color2}A${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}Intel${offset 3}P4${offset 3}Extreme${offset 3}Edition${alignr}${font DroidSans:size=8.3}${freq_g cpu0}${offset 1}GHz${font}
    ${voffset 2}${font StyleBats:size=10}${color2}q${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}System${offset 3}Uptime${alignr}${font DroidSans:size=8.4}${uptime_short}${font}
    If you aren't running an nVidia driver, just point it toward whichever video driver you are using.


    Also, I added the following to the list of scripts in the Perpetual Data Dump:

    ~/home/username/.config/autostart/conky-banshee-pre-load.sh (Optional - pre-loads Banshee into memory for faster startup)
    Code:
    #!/bin/bash
    sleep 30
    banshee --hide --redirect-log
    I've been playing around with this Banshee pre-loader for a while.

    Banshee works fine, for the most part, but it doesn't always play well with Conky.

    This autoloader pre-loads Banshee into memory, before Conky, at boot.

    It makes Banshee start much quicker, and causes less grief for Conky.


    See Post #4 (above) for the complete script(s) and screenies.
    Last edited by VinDSL; August 10th, 2011 at 12:54 PM. Reason: added additional text
    Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
    Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
    XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU

  3. #13
    Join Date
    Aug 2010
    Location
    Arizona USA
    Beans
    2,800
    Distro
    Ubuntu Development Release

    Re: HOWTO: VinDSL Conky Script

    11-AUGUST-2011 UPDATE

    conky-all 1.8.1-2 Oneiric (11.10) hit the repos today, and the Calendar Section definately wasn't happy about it.

    The 'fix' was easy -- simply remove the trailing ${font} tag, from a single line.

    Here is the pertinent section:

    Code:
    ##################################
    ##           CALENDAR           ##
    ##################################
    ${voffset 4}${font DroidSans:bold:size=8}${color4}DATE${offset 8}${color8}${voffset -2}${hr 2}${font}
    ${voffset 16}${font DroidSansMono:size=7.55}${color3}${alignc 60}${time %A}${font}
    ${voffset -4}${if_match ${time %e}<=9}${font DroidSansFallback:bold:size=18}${color5}${alignc 65}${time %e}${font}${else}${if_match ${time %e}>=10}${font DroidSansFallback:bold:size=18}${color5}${alignc 60}${time %e}${endif}${endif}${font}
    ${voffset 0}${font DroidSansMono:size=7.55}${color3}${alignc 60}${time %B}${font}
    ${voffset 0}${font DroidSansMono:size=7.6}${color3}${alignc 60}${time %Y}${font}
    ####
    ## Uncomment for Conky 1.8.0
    ${voffset -75}${font DroidSansMono:size=7.55}${color3}${execpi 60 VinDSL_Cal_8=`date +%-d`; cal -h | sed -e 's/\r//g' -e '1d' -e s/^/"\$\{offset 105"\}/ -e 's/\<'"$VinDSL_Cal_8"'\>/${color4}&${color3}/'}${font}
    ####
    ## Uncomment for Conky 1.8.1
    # ${voffset -75}${offset 105}${font DroidSansMono:size=7.55}${color3}${execpi 60 VinDSL_Cal_8=`date +%-d`; cal -h | sed -e 's/\r//g' -e '1d' -e 's/\<'"$VinDSL_Cal_8"'\>/${color4}&${color3}/'}${font}
    ${voffset -98}${font CutOutsFor3DFX:size=67}${color8}${alignc 99}2${font}
    For consistency, I dropped the tag from the Conky 1.8.0 version also, even though it wasn't necessary.
    Last edited by VinDSL; August 11th, 2011 at 08:31 PM. Reason: update
    Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
    Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
    XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU

  4. #14
    Join Date
    Jul 2011
    Beans
    1

    Re: HOWTO: VinDSL Conky Script

    Any recommended alternatives for the Weather Script since they're going to start charging for it?

  5. #15
    Join Date
    Aug 2010
    Location
    Arizona USA
    Beans
    2,800
    Distro
    Ubuntu Development Release

    Re: HOWTO: VinDSL Conky Script

    If they start charging, I'll look into using Weather Underground for data.

    I remember seeing scripts for WU, but it's been a while ago.

    cURL is your friend. With a little thought, I imagine you can pluck info from just about any source.

    Anyway, we'll see what happens...
    Intel ® P4 Extreme Edition 3.4 (Gallatin) || DFI ® LanParty PRO875B rev B1
    Crucial ® Ballistix Tracer PC4000 1GB || Mountain Mods U2-UFO Opti-1203
    XFX 7600GT 560M AGP (PV-T73A-UDF3) || Corsair HX520W Modular PSU

  6. #16
    Join Date
    Oct 2011
    Beans
    13

    Re: HOWTO: VinDSL Conky Script

    Got this whole thing working beautifully! Adding my own little tweaks here and there and I just have one question!

    Relating to the HDD section - lets say I want to show an external drive. Is that doable? That may seem like a really dumb question but I'm relatively new to the Ubuntu scene and still adjusting/learning what I can and cannot do so your patience and wisdom regarding this matter would be greatly appreciated!

  7. #17
    Join Date
    Oct 2011
    Beans
    13

    Question Re: HOWTO: VinDSL Conky Script

    Got this whole thing working beautifully! Adding my own little tweaks here and there and I just have one question!

    Relating to the HDD section - lets say I want to show an external drive. Is that doable? That may seem like a really dumb question but I'm relatively new to the Ubuntu scene and still adjusting/learning what I can and cannot do so your patience and wisdom regarding this matter would be greatly appreciated!

    **My apologies for the second post.. can't delete it either unfortunately.. if a moderator feels the need, please delete this one **
    Last edited by Gmasterhyde; October 23rd, 2011 at 04:17 AM.

  8. #18
    Join Date
    Apr 2007
    Beans
    195

    Re: HOWTO: VinDSL Conky Script

    Quote Originally Posted by Gmasterhyde View Post
    Got this whole thing working beautifully! Adding my own little tweaks here and there and I just have one question!

    Relating to the HDD section - lets say I want to show an external drive. Is that doable? That may seem like a really dumb question but I'm relatively new to the Ubuntu scene and still adjusting/learning what I can and cannot do so your patience and wisdom regarding this matter would be greatly appreciated!
    Yes. External drives are doable. And easy too. It all depends on how you want to do it. How would YOU like it done? It always shows? It only shows when plugged in? The whole setup adjusts to whether or not it's plugged in? It shows a special message when it is unplugged?

    How would you like it done? Although Vin has not put this kind of code in, there is a way to do it. You are not set into his code alone.

    *EDIT* Had to go grab some of my own code to answer your request.

    First, you need to define a few things for me. Where is the external drive mounted? Typically it auto-mounts in /media/labelofthedevice and you should know that name. I can generalise the code so you can put it in yourself, but you need to tell me if you know beforehand.

    To change the label to a message when not connected:
    Code:
    ${if_mounted /media/labelofthedevice}<put the normal HD code here, changing to the drive's name.>${else}Not Connected.${endif}
    To completely adjust the rest of the code to fill in the gap the drive normally takes up when it's not connected:
    Code:
    ${if_mounted /media/labelofthedevice}<put the normal HD code here, changing to the drive's name.>${else}${voffset -20}${endif}
    It is important to note that, like the rest of the script, if you have spacing problems because of this bit of code, pay attention to the voffset objects and change them accordingly.

    There is a way to get the lua script to decide whether or not the drive is mounted. I am not an expert, I have done this kind of checking in my own lua scripts, but I use a different format that would not apply to VinDSL's script.
    Last edited by 42dorian; October 23rd, 2011 at 08:24 AM.

  9. #19
    Join Date
    Oct 2011
    Beans
    13

    Talking Re: HOWTO: VinDSL Conky Script

    Before even noticing that you had replied I had actually figured it out! I really like your suggestion potentially changing what is displayed based on whether or not the device is connected and that's definitely worth looking into.

    I already tried that first segment of code you suggested but it didn't work for me the way I expected it to - it was ALWAYS displaying that the device wasn't connected. It's probably just a fluke on my part but I'm not even all that concerned simply because the drive (which is auto-mounted btw) is almost always plugged in anyway. I can deal with it showing some empty statistics if I take my laptop somewhere.

    On a side note, thanks a lot for the guide! I've been looking into Conky and all the configurations people had (I just started dual booting Ubuntu like 3 weeks ago) and Mr.DSL here has the most-informative, combined with good-looking, layout of any conky setup I've seen so far. Thanks for sharing Vin!

    This was a beautiful run-through for me to get some hands on experience with scripting and some code (given I'm in college) - I plan on modifying Vin's code to my taste and I've already got the modules I'd like to see on my desktop given I have less space than the original code demands [1366x768]. I'll probably add my graphics driver, change some fonts around, and maybe be a bit more vibrant with my colors depending on my desktop, but for right now I think I'm settling in.

    Cheers!
    Attached Images Attached Images
    Last edited by Gmasterhyde; October 23rd, 2011 at 10:50 AM.

  10. #20
    Join Date
    Jan 2008
    Beans
    130

    Re: HOWTO: VinDSL Conky Script

    GREAT STUFF! Been having fun learning this. Couple small things though.
    First, the lua background is going off the bottom of the screen. Is there a way I can 'set' height & width to conform to my particular conky? I've omitted a couple sections like weather to save on space.
    I'm using Lucid 10.04 1024 x 768. Conky version 1.80.

    Also, having an issue with ubuntu-title fonts loading. They are installed to /usr/share/fonts/truetype/myfonts. And I have updated the cashe using terminal.

    Lastly, flicker. I do have double buffer set to 'yes'. Seems to be worse with the draw_bg.lua enabled.

    (the led graphs are working beautifully, thank you.)

Page 2 of 178 FirstFirst 12341252102 ... 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
  •