Page 1966 of 2348 FirstFirst ... 966146618661916195619641965196619671968197620162066 ... LastLast
Results 19,651 to 19,660 of 23480

Thread: Post your .conkyrc files w/ screenshots

  1. #19651
    Join Date
    Apr 2007
    Beans
    195

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by strungoutfan78 View Post
    What's the difference between the 2, since they yield the same results? Is their an advantage to one over the other, such as how using grep and cut you make twice as many calls as only using awk? Also I didn't realize that's what the p was for. I was just under the impression that execpi runs at the specified interval AND the conky refresh interval, whereas execi only runs at the specified interval. I might have this wrong.
    Straight from the Conky Objects page:

    Code:
    execp 	command 	Executes a shell command and displays the output in conky. warning: this takes a lot more resources than other variables. I'd recommend coding wanted behaviour in C and posting a patch. This differs from $exec in that it parses the output of the command, so you can insert things like ${color red}hi!${color} in your script and have it correctly parsed by Conky. Caveats: Conky parses and evaluates the output of $execp every time Conky loops, and then destroys all the objects. If you try to use anything like $execi within an $execp statement, it will functionally run at the same interval that the $execp statement runs, as it is created and destroyed at every interval.
    
    execpi 	interval command 	Same as execp but with specific interval. Interval can't be less than update_interval in configuration. Note that the output from the $execpi command is still parsed and evaluated at every interval.
    In short: exec executes things, execi executes things at intervals, execp parses the output of the executed thing, and execpi parses the executed thing at intervals.

    Easy way to remember? Bookmark the variables page. (Thought I was going for something there didn't ya? No. Sorry. I'm not THAT clever.)

    From what I remember about awk, grep, and cut, awk requires your desired result in the same space every time, where grep can look for where your result starts before it spits out anything, and cut just takes what you don't want and ignores it.

    There's no real benefit of one or the other, but rather a major benefit of you knowing what they all do so you can get the results you need every time, and know when to use which one to solve any problems that arise.
    Last edited by 42dorian; April 29th, 2012 at 08:30 AM.

  2. #19652
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Unless there is one benefit: with GREP and CUT you must load NYXMMS2 3 times from disk, then load GREP 3 times and then load CUT 3 times - so in one Conky loop you have 9 disk load operation just for XMMS2 status.

    With AWK you have 2.

    AWK don't only search or substitute - it's way more than that. It's like scripting shell with sophisticated REGEXP/string manipulation tools.

    So sometimes it's not efficient to use it because of it's complexity.
    But it is a problem of big loop inside of some more complex scripts that process some data to be worried of.


    And as for result of AWK - it's printed as it goes from input (in this case, album title first, then artist and then song title) if not rearranged with internal variables as I did.
    Last edited by dk75; April 29th, 2012 at 10:35 AM.
    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. #19653
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by strungoutfan78 View Post
    The only problem I have with this thing now is sudo permissions to run aptitude update and aptitude -sy upgrade in order to feed the number of available updates to conky. Anyone know how to edit sudoers properly because I seem incapable at this point.
    Neither
    Code:
    neil     ALL=(ALL) NOPASSWD: /usr/bin/aptitude
    nor
    Code:
    neil     ALL=(ALL) NOPASSWD: /usr/bin/aptitude update
    work.
    You don't need to mess with SUDOERS and your system permissions if you use package 'update-notifier'.

    Security updates:
    Code:
    /usr/lib/update-notifier/apt-check 2>&1 |cut -d ';' -f 1
    Normal updates:
    Code:
    /usr/lib/update-notifier/apt-check 2>&1 |cut -d ';' -f 2

    or with one run (apt-check is sloooow to run in loop):
    Code:
    /usr/lib/update-notifier/apt-check 2>&1 |awk -F";" '{print "Security updates:", $1 "\nNormal updates:", $2}'
    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

  4. #19654
    Join Date
    Mar 2009
    Location
    Singapore
    Beans
    88
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by strungoutfan78 View Post
    Anyone know how to edit sudoers properly because I seem incapable at this point.
    Neither
    Code:
    neil     ALL=(ALL) NOPASSWD: /usr/bin/aptitude
    nor
    Code:
    neil     ALL=(ALL) NOPASSWD: /usr/bin/aptitude update
    work.
    Here's a script that I called from conky to display updates:
    Code:
    #!/bin/bash
    # Conky script for displaying available updates
    # in Ubuntu. This script assumes you are in the
    # sudo group and require no password for root
    # access. Add something as such to your conkyrc:
    #${color}APT: ${color D7D3C5}${execi 28800 /usr/local/bin/aptupdates.sh}
    
    sudo apt-get -qy update > /dev/null
    NUMOFUPDATES=$(sudo aptitude search "~U" | wc -l)
    echo You have $NUMOFUPDATES updates ready
    
    exit 0
    Save it in /usr/local/bin/aptupdates.sh then:
    Code:
    cd /usr/local/bin/
    Code:
    sudo chmod +sx aptupdates.sh
    et voila!
    Last edited by RichardCain; April 29th, 2012 at 03:17 PM. Reason: ammendment

  5. #19655
    Join Date
    Apr 2006
    Location
    NS, Can
    Beans
    36
    Distro
    Ubuntu 17.10 Artful Aardvark

    Talking Re: Post your .conkyrc files w/ screenshots

    Just finished the last few tweaks for now. This is a modified version of one I stumbled across (between pages 300 and 600, maybe) on this topic.

    ip.sh:
    Code:
    #!/bin/bash
    # From default conky config I think
    
    wget http://checkip.dyndns.org/ -q -O - |
    grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>'
    nvid.sh
    Code:
    #!/bin/bash
    # Created Apr 28, 2012
    # Last modified Apr 28, 2012
    
    total=1279
    used=`nvidia-smi -q | grep Used | cut -c34-37`
    
    #echo "$used/$total"
    
    #my_value=$(($used / $total))
    result=$(echo scale=4\; $used '/' $total '* 100' | bc -l)
    
    echo $result
    ping_test.sh
    Code:
    #!/bin/bash
    # http://linuxexpresso.wordpress.com/2009/12/20/conky-ip-monitor/
    
    if ping -c 1 -W 2 $1 > /dev/null; then
    echo "Up"
    else
    echo "Down"
    fi
    startupconky.sh:
    Code:
    #!/bin/bash
    conk_root="/home/$USER/.Conky"
    config="conky"
    
    case "$1" in
      now)
        conky -c $conk_root/$config &
      ;;
      test)
        echo "Test"
        echo "$log"
        echo "Done"
      ;;
      'stop' | 'kill')
        killall conky
      ;;
      login)
        sleep 30 &&	# 0 good for Xfce - use 20 to 30 for Gnome
        conky -c $conk_root/$config &
      ;;
      *)
        echo "usage: startconky [now|test|(stop|kill)|login]"
        echo "\"now\" start conky instantly"
        echo "\"login\" starts conky 30 seconds after it is called"
      ;;
    esac
    Attached Images Attached Images
    Attached Files Attached Files
    “Don’t Follow Your Passion, But Always Bring it With You.” ~Mike Rowe

  6. #19656
    Join Date
    Oct 2008
    Beans
    3,509

    Re: Post your .conkyrc files w/ screenshots

    Is it necessary to use sudo with aptitude search

    I have this line in my conky
    Code:
    Updates: ${color green}${execi 900 aptitude search "~U" | wc -l | tail}

    and for external ip address
    Code:
    ${execi 3600 curl ifconfig.me}
    Last edited by stinkeye; April 29th, 2012 at 05:30 PM.

  7. #19657
    Join Date
    Mar 2006
    Location
    South Africa, Secunda
    Beans
    125
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Post your .conkyrc files w/ screenshots

    Wow, this is a seriously long thread Spend the better half of the afternoon on it. Some amazing setups though!

  8. #19658
    Join Date
    May 2007
    Location
    San Diego, CA
    Beans
    116

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by stinkeye View Post
    Is it necessary to use sudo with aptitude search

    I have this line in my conky
    Code:
    Updates: ${color green}${execi 900 aptitude search "~U" | wc -l | tail}

    and for external ip address
    Code:
    ${execi 3600 curl ifconfig.me}
    Just tried aptitude search without sudo and you're right. I didn't realize that. Didn't know about the "~U" thing either. I was simply cutting the results from "aptitude -sy upgrade" where it lists the number of upgrades available at the bottom. Thank you and thanks to RichardCain for that info too.

    Didn't know about "wc" either. Handy little tool.
    Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect.

    --- Linus Torvalds

  9. #19659
    Join Date
    May 2007
    Location
    San Diego, CA
    Beans
    116

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by dk75 View Post
    Unless there is one benefit: with GREP and CUT you must load NYXMMS2 3 times from disk, then load GREP 3 times and then load CUT 3 times - so in one Conky loop you have 9 disk load operation just for XMMS2 status.

    With AWK you have 2.

    AWK don't only search or substitute - it's way more than that. It's like scripting shell with sophisticated REGEXP/string manipulation tools.

    So sometimes it's not efficient to use it because of it's complexity.
    But it is a problem of big loop inside of some more complex scripts that process some data to be worried of.


    And as for result of AWK - it's printed as it goes from input (in this case, album title first, then artist and then song title) if not rearranged with internal variables as I did.
    That's what I figured and what I meant by grep and cut being called more times. I guess if it was a really large script and the calls were getting into the thousands it would really make a huge difference. I'll have to relearn awk I guess. I used to use it alot but have since switched to sed for the most part. Kind of forgotten most of the syntax by now.
    Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect.

    --- Linus Torvalds

  10. #19660
    Join Date
    May 2007
    Location
    San Diego, CA
    Beans
    116

    Re: Post your .conkyrc files w/ screenshots

    Easy way to remember? Bookmark the variables page. (Thought I was going for something there didn't ya? No. Sorry. I'm not THAT clever.)
    I had a good chuckle at that. Thanks!
    Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect.

    --- Linus Torvalds

Page 1966 of 2348 FirstFirst ... 966146618661916195619641965196619671968197620162066 ... 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
  •