Page 1 of 32 12311 ... LastLast
Results 1 to 10 of 313

Thread: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

  1. #1
    Join Date
    Sep 2007
    Beans
    Hidden!

    Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    OK, the mega thread Post your .conkyrc files w/ screenshots has been hijacked by Conky Calendars, to the point that people asking for help with other aspects of conky are having their requests for help buried in an avalanche.

    So today I though why not a Conky "Script" Support Thread? Obviously if you are showing your Conky screenshot and the files that did it the scripts will accompany it on the other thread.

    But if you see a "script", bash, python, perl - who cares, that you can "touch up" copy it here and have at it with various other "script junkies" (meant in a good way), after all we all win! Or if you have a NEW script for conky you are working on bring it here.

    I ask that each post here has a link to Post your .conkyrc files w/ screenshots if the script came from there or when the "CCCC" script writers agree that it's done as best it can be, a post on the mega thread explaining what the script does with a screenie and a link to the post here to get the script.

    What do you think?
    Have a nice day.
    Bruce
    Last edited by Bruce M.; December 18th, 2009 at 02:28 PM.

  2. #2
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    There could be a BASH script yes?
    Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
    Linux user No.: 483055 | My Conky Pitstop corner | One4All project

  3. #3
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by dk75 View Post
    There could be a BASH script yes?
    Absolutely for example:

    Code:
    ${execpi 8 hddtemp /dev/sda | cut --characters 34-37 | xargs ~/Conky/scripts/ColorTempHDD.sh}
    calls the bash script: ColorTempHDD.sh a modified version of Crinos'512's colorize.sh;

    Code:
    #!/bin/bash
    # colorize.sh
    # by: Crinos512
    
    COOL=45
    WARM=56
    
    if [[ $1 < $COOL ]]
       then echo "\${color7}"$1    # COOL
    elif [[ $1 > $WARM ]]
       then echo "\${color9}"$1    # HOT
    else echo "\${color8}"$1       # WARM
    fi
    
    exit 0
    CHIMO!
    Bruce

  4. #4
    Join Date
    Oct 2009
    Location
    UK
    Beans
    85

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    What a fantastic idea! Bruce you legend.

    Right... curl and rss feeds, can somebody give some me some guides, tips or help?

    Thanks in advance
    #!Crunchbang

  5. #5
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    why... did it need to be curl?

    Code:
    sudo apt-get install python-feedparser
    there is web page with all available commands: Universal Feedparser

    and there is my example code
    Code:
    #! /usr/bin/env python
    # -*- coding: utf-8 -*-
    ##############################################################
    # parse RSS feed
    # RSS.py rss.url no._of_entry_to_parse
    ##############################################################
    
    import sys
    import feedparser
    d = feedparser.parse(sys.argv[1])
    print
    print d.entries[int(sys.argv[2])].title.replace('<br />' , '\n').replace('<p>' , '\n\t').replace('</p>' , '\n')
    print
    print d.entries[int(sys.argv[2])].description.replace('<br />' , '\n').replace('<p>' , '\n\t').replace('</p>' , '\n')
    print
    e = d.entries[int(sys.argv[2])]
    print ('Link: '),e.link
    print
    print d.entries[int(sys.argv[2])].category
    print
    print d.entries[int(sys.argv[2])].status
    print
    quit()
    Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
    Linux user No.: 483055 | My Conky Pitstop corner | One4All project

  6. #6
    Join Date
    May 2008
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Excellent idea! I wish I'd thought of it!
    as a reply to one of your posts in the conky mega-thread:

    BASH Beginner's Guide
    and
    Writing Shell Scripts

    and this script I'll post here isn't even mine:
    conky-rss.sh
    Code:
    #!/bin/bash
    # RSS Display Script by Bill Woodford (admin@sdesign.us) v1.0
    #
    #RSS Setup - Don't change unless you want these values hard-coded!
    uri=$1                                                  #URI of RSS Feed
    lines=$2                                                #Number of headlines
    titlenum=$3                                             #Number of extra titles
    #Script start
    #Require a uri, as a minimum
    if [[ "$uri" == "" ]]; then
            echo "No URI specified, cannot continue!" >&2
            echo "Please read script for more information" >&2
    else
            #Set defaults if none specified
            if [[ $lines == "" ]]; then lines=25 ; fi
            if [[ $titlenum == "" ]]; then titlenum=2 ; fi
    
            #The actual work
            curl -A "Mozilla/5.0" -s --connect-timeout 30 $uri |\
            grep -io "<title>[^<]*"|\
            sed -e 's/<[^>]*>//'|\
            head -n $(($lines + $titlenum)) |\
            tail -n $(($lines))
    fi

  7. #7
    Join Date
    Sep 2007
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by mobilediesel View Post
    Excellent idea! I wish I'd thought of it!
    OK you though of it, no biggie.

    THANK YOU for the links.

    CHIMO!
    Bruce

  8. #8
    Join Date
    Oct 2009
    Location
    UK
    Beans
    85

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Quote Originally Posted by dk75 View Post
    why... did it need to be curl?
    It doesn't, that is all I knew really.
    I'll give it a go
    Cheers.
    #!Crunchbang

  9. #9
    Join Date
    May 2008
    Beans
    Hidden!

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    Here's a fairly simple script to display a normal calendar with conky. It shows the last few days of the previous month as well as the first few days of the next month.

    You can have the month/year line a different color and the days of the week line a different color.

    Code:
    #!/bin/bash
    date=$(date '+%F')
    DAY=${date:8:2}
    DAY=${DAY/#0/}
    cal=$(cal)
    prev=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 -1 month")|sed 's/ *$//;/^$/d'|tail -1)
    next=$(cal $(date '+%-m %Y' --date="${date:0:7}-15 +1 month")|sed '/^ *&/d;1,2d;s/^ *//'|head -1)
    if [ ${#next} == 19 ] ;then next=$'\n'"\${color9} $next"
    else next="\${color9}  $next"
    fi
    if [ ${#prev} == 20 ]; then prev="$prev"$'\n '
    else prev="$prev  "
    fi
    echo -e "\${color7}${cal:0:21}\${color4}${cal:21:21}\${color9}$prev\${color}$(echo "${cal:42}" | sed -e '/^ *$/d' -e 's/^/ /' -e 's/$/ /' -e 's/^ *1 / 1 /' -e /" $DAY "/s/" $DAY "/" "'${color3}'"$DAY"'${color}'" "/ -e 's/^ //' -e 's/ *$//')$next"
    screenshot2009-12-20T16:13:48-0500.png

    I did it this way to limit the number of calls to cal as I was calling it a few times. Now it's just 3.

  10. #10
    Join Date
    Oct 2009
    Location
    UK
    Beans
    85

    Re: Conky Support Scripts: Show us your "Scripts" & Screenshots of what they do.

    can I put an image on my conky from an RSS feed? For example: http://xkcd.com/
    #!Crunchbang

Page 1 of 32 12311 ... LastLast

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
  •