Page 2049 of 2348 FirstFirst ... 1049154919491999203920472048204920502051205920992149 ... LastLast
Results 20,481 to 20,490 of 23480

Thread: Post your .conkyrc files w/ screenshots

  1. #20481
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    here is a short lua script dealing with filesystems
    Code:
    --partitions for conky by mrpeachy
    conky_start=1
    function conky_get_mounted_data(interval)
    local updates=tonumber(conky_parse("${updates}"))
    timer=(updates % interval)
    if timer==0 or conky_start==1 then
    fsys={}
    size={}
    used={}
    avail={}
    uperc={}
    mount={}
    local file = io.popen("df -h")
    	for line in file:lines() do
    		if string.find(line,"/dev/")~=nil then
    		local s,f,fs=string.find(line,"^([%d%a%p]*)%s")
    		table.insert(fsys,fs)
    		local s,f,sz=string.find(line,"%s*([%d%a%p]*)%s",f)
    		table.insert(size,sz)
    		local s,f,us=string.find(line,"%s*([%d%a%p]*)%s",f)
    		table.insert(used,us)
    		local s,f,av=string.find(line,"%s*([%d%a%p]*)%s",f)
    		table.insert(avail,av)
    		local s,f,up=string.find(line,"%s*([%d%a%p]*)%s",f)
    		table.insert(uperc,up)
    		local s,f,mn=string.find(line,"%s*([%d%a%p]*)%s*$",f)
    		table.insert(mount,mn)
    		end
    	end
    file:close()
    conky_start=nil
    end--timed section
    return ""
    end
    
    function conky_mount(n,d)--n=partition_number,d=data_type
    d=tostring(d)
    n=tonumber(n)
    if d=="total" then
    data=#fsys or 1
    elseif d=="fsys" then
    data=fsys[n] or ""
    elseif d=="size" then
    data=size[n] or ""
    elseif d=="used" then
    data=used[n] or ""
    elseif d=="free" then
    data=avail[n] or ""
    elseif d=="use%" then
    data=uperc[n] or ""
    elseif d=="mount" then
    data=mount[n] or ""
    else
    data="check data type"
    end
    return data
    end--end main function
    here is how to use it in conkyrc, with an example setup
    Code:
    ##instructions
    ##load script
    lua_load ~/lua/mounted.lua
    ## first lua command below text:
    ## ${lua get_mounted_data interval}, where interval is a number.  This starts data gathering
    ## to get output:
    ## ${lua mount partition_number data_type}, where partition number is a number
    ## data_type can be
    ## total - shows total number of partitions mounted, requires a partition_number also, use 1, could be used in an if_match
    ## fsys - shows filesystem
    ## size - shows space used in appropriate units
    ## free - shows free space in appropriate units
    ## use% - shows % used
    ## mount - shows mountpoint
    
    TEXT
    CPU %: ${cpu cpu0} ${lua get_mounted_data 10}
    TOTAL PARTITIONS MOUNTED: ${lua mount 1 total}
    FSYS${goto 100}SIZE${goto 200}USED%${goto 300}MOUNT
    ${lua mount 1 fsys}${goto 100}${lua mount 1 size}${goto 200}${lua mount 1 use%}${goto 300}${lua mount 1 mount}
    ${lua mount 2 fsys}${goto 100}${lua mount 2 size}${goto 200}${lua mount 2 use%}${goto 300}${lua mount 2 mount}
    ${lua mount 3 fsys}${goto 100}${lua mount 3 size}${goto 200}${lua mount 3 use%}${goto 300}${lua mount 3 mount}
    ${lua mount 4 fsys}${goto 100}${lua mount 4 size}${goto 200}${lua mount 4 use%}${goto 300}${lua mount 4 mount}
    and what it looks like
    Last edited by mrpeachy; September 2nd, 2012 at 05:07 AM.

  2. #20482
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mrpeachy View Post
    here is a short lua script dealing with filesystems
    Something told me you'd pop in ... Well done mrpeachy, well done indeed!

  3. #20483
    Join Date
    Oct 2009
    Location
    Under a rock
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    thanks sector11, let me know if you try it and run into any problems!

  4. #20484
    Join Date
    May 2012
    Beans
    33

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Sector11 View Post
    Yes please ... are these your work or from others?
    Tomorrow I look at the one you posted. Thank you.
    Mainly mine. I may have grabbed a snippet or concept here or there but most of it's my doing. So if there's anything there anyone could recommend an improvement on, please let me know.

    getweather.py

    Code:
    #!/usr/bin/python
    import string
    import sys
    import subprocess
    import os
    import time
    
    while True:
    
        command_process = subprocess.Popen("rm /home/scott/Documents/weather.out /home/scott/*.png", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        command_output = command_process.communicate()[0]
    
        s1 = 'http://www.weather.com/weather/today/USNC0121'
    
        command_process = subprocess.Popen("extimg5.py " + s1, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        command_output = command_process.communicate()[0]
        log_file = open('/home/scott/Documents/weather.out', 'a')
        log_file.write(command_output)
        log_file.close()
    
        f = open('/home/scott/Documents/weather.out', 'r')
        s2=f.read()
        f.close()
    
        f1=s2[51:53]
        f2=s2[109:111]
    
        command_process = subprocess.Popen("wget " + s2, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        command_output = command_process.communicate()[0]
    
        command_process = subprocess.Popen("cp /home/scott/" + f1 + ".png " + "/home/scott/Pictures/weather1.png", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        command_output = command_process.communicate()[0]
    
        command_process = subprocess.Popen("cp /home/scott/" + f2 + ".png " + "/home/scott/Pictures/weather2.png", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        command_output = command_process.communicate()[0]
    
        time.sleep(3600)  # Delay for 1 minute (60 seconds)
    In .conkyrc:

    ${image /home/scott/Pictures/weather2.png -p 1230,50 -s 100x100}
    ${image /home/scott/Pictures/weather1.png -p 1265,290 -s 100x100}

    I'm surprised no one's asked about the Pithos song art. That one took the most work actually.

    I just realize you'll need the following as well. Now this one is not mine, other then a slight modification (line 33 - I changed the original code I found to 'startswith' as I recall).

    extimg5.py

    Code:
    #!/usr/bin/env python
    
    import sys
    import urllib
    import urlparse
    
    from optparse import OptionParser
    from BeautifulSoup import BeautifulSoup
    
    
    class MyOpener(urllib.FancyURLopener):
        version = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15'
    # MyOpener
    
    def get_url_info(url):
        d = urllib.urlopen(url)
        return d.info()
    # get_url_info
    
    
    def process(url, options):
        myopener = MyOpener()
        #page = urllib.urlopen(url)
        page = myopener.open(url)
    
        text = page.read()
        page.close()
    
        soup = BeautifulSoup(text)
    
        for tag in soup.findAll('img', src=True):
            image_url = urlparse.urljoin(url, tag['src'])
        if image_url.lower().startswith('http://s.imwx.com/v.20120328.084208/img/wxicon/120'):
                print image_url,
    
    
    def main():
        parser = OptionParser(usage='%prog URL [URL]... [options]')
        
        #[options]
        parser.add_option('-l',
                          '--length',
                          action='store_true',
                          default=False,
                          help='Show lengths of images.')
        
        options, arguments = parser.parse_args()
    
        if not arguments:
            parser.print_help()
            sys.exit(1)
        # else, if at least one parameter was passed
        for url in arguments:
            process(url, options)
    # main
    
    #############################################################################
    
    if __name__ == "__main__":
        main()
    Last edited by scottr99; September 2nd, 2012 at 05:25 AM.

  5. #20485
    Join Date
    Jul 2007
    Location
    The U. S. of A.
    Beans
    163
    Distro
    Kubuntu Development Release

    Thumbs down Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mrpeachy View Post
    here is a short lua script dealing with filesystems...

    and what it looks like
    Mind == Blown

    I just thought I'd pop in to see what's up and I find this. Granted I lost track of things shortly after LUA came onto the scene, but making lua procedure calls in line with conky.... SWEET!

    || Kubuntu x86_64 (15.10 Dev.) || KDE 4.9.00 ||
    || Dell Inspiron 570 || 8GB PC3-10600 DDR3 RAM || AMD Phenom II X4 820 @ 2.8Ghz ||
    || Logitech M570 Trackball || Logitech G15 Gaming Keyboard ||
    Conky: ... no such configuration: 'normal'

  6. #20486
    Join Date
    Jul 2009
    Beans
    2

    Re: Post your .conkyrc files w/ screenshots

    hi,
    Love your conky layout..pls gimme the scripts so i can customize according to my need. Also if possible pls include comments in english where ever possible as I dont know French.

    Thanks
    Jango


    Quote Originally Posted by ragamatrix View Post
    Hi ! I'im new in this forum, and congratulations to the "famous linux conky coders" : great works.
    Sorry for my English..
    I post you a screenshot to give immagination and ideas for making evoluate the world of conky.
    I'm also in the french forum ubuntu.
    I can give you scripts if you're interested in or make changes on them.

  7. #20487
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by mrpeachy View Post
    thanks sector11, let me know if you try it and run into any problems!
    I'm going to add that to Petro Dawg's test conky I have here. Work on the "| cut values" and get the three working.

    I have a feeling that Petro Dawg's values would be pretty close to the norm. The one strange one I have is a root partition for a dual boot system and no idea why it's there ... It's not mounted.

  8. #20488
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Crinos512 View Post
    Mind == Blown

    I just thought I'd pop in to see what's up and I find this. Granted I lost track of things shortly after LUA came onto the scene, but making lua procedure calls in line with conky.... SWEET!

    WOW!!!!! Look what the cat dragged in!
    Welcome back Crinos512.

    mrpeachy has that affect on people. His LUA code is what your bash scripts are to conky!

    What was that thing you said back a few weeks ago:
    Why all bash scripts? Because I can!
    something like that.

    Nice kitty, milk for life like I promised.

  9. #20489
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by scottr99 View Post
    Mainly mine. I may have grabbed a snippet or concept here or there but most of it's my doing. So if there's anything there anyone could recommend an improvement on, please let me know.
    What I know about python you could write on the head of a pin in ${font DejaVu Sans:size=12} and have room left over for a NY Times Editorial so I'm not your guy. But I want to try running them.

    Thank you

  10. #20490
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by Petro Dawg View Post
    The only way around that is to exec df and print the displays for sdb1, sdb2, and sdc3 if present.

    However it appears my cut points do not work on your system as they do on mine. I expect my code would give you the correct output if the cut points were adjusted accordingly.
    That's disadvantages of cutting by counting chars.
    And you calls 3 times 'df' with GREP and CUT for every mounted device.

    Here's BASH solution for sdb1, sdc1 and sdd1:
    Code:
    ${color2}${fs_bar 10 /home}${color}${if_existing /dev/sdb1}
    $(color6}${execpi 3 df -H |mawk '/sdb1/ {gsub(/\/.*\//,"",$6); print $6"${color}:${color8}${alignr}"$3"${color} / ${color8}"$2}'}${color}${else}${endif}${if_existing /dev/sdc1}
    $(color6}${execpi 3 df -H |mawk '/sdc1/ {gsub(/\/.*\//,"",$6); print $6"${color}:${color8}${alignr}"$3"${color} / ${color8}"$2}'}${color}${else}${endif}${if_existing /dev/sdd1}
    $(color6}${execpi 3 df -H |mawk '/sdd1/ {gsub(/\/.*\//,"",$6); print $6"${color}:${color8}${alignr}"$3"${color} / ${color8}"$2}'}${color}${else}${endif}
    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

Page 2049 of 2348 FirstFirst ... 1049154919491999203920472048204920502051205920992149 ... 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
  •