Page 2292 of 2301 FirstFirst ... 1292179221922242228222902291229222932294 ... LastLast
Results 22,911 to 22,920 of 23005

Thread: Post your .conkyrc files w/ screenshots

  1. #22911
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: CPU model

    @ syntaxerror74

    Ooooooo thank you!!!
    Love the | cut -f3- '-d ' shortcut.
    Quote Originally Posted by syntaxerror74 View Post
    Code:
    ${pre_exec grep 'model ' /proc/cpuinfo | cut -f3- '-d '}
    That 'almost' works for me too, I still need the "|unuq" in there or I get 3:
    Code:
     23 Aug 14 | 10:53:12 ~
        $ grep 'model ' /proc/cpuinfo | cut -f3- '-d '
    AMD Athlon(tm) II X3 450 Processor
    AMD Athlon(tm) II X3 450 Processor
    AMD Athlon(tm) II X3 450 Processor
     
     23 Aug 14 | 10:53:15 ~
        $ grep 'model ' /proc/cpuinfo | cut -f3- '-d '|uniq
    AMD Athlon(tm) II X3 450 Processor
     
     23 Aug 14 | 10:53:45 ~
        $
    Prior to "pre_exec" coming in to play I used:
    Code:
    ${execi 86400 command}
    which reduced update to once a day.

  2. #22912
    Join Date
    Oct 2013
    Location
    europe
    Beans
    76
    Distro
    Lubuntu Development Release

    Re: Post your .conkyrc files w/ screenshots

    Love the | cut -f3- '-d ' shortcut.
    Sneaky stuff, eh?

    Thanks for the uniq info. Yes I do not need it here, but it looks that /proc/cpuinfo has a habit of displaying dupes (perhaps per CPU core? I have a single-core CPU...)

  3. #22913
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by syntaxerror74 View Post
    Sneaky stuff, eh?

    Thanks for the uniq info. Yes I do not need it here, but it looks that /proc/cpuinfo has a habit of displaying dupes (perhaps per CPU core? I have a single-core CPU...)
    Yes, one section per core - as seen I have an AMD X3

    Code:
     24 Aug 14 | 09:53:31 ~
        $ cat /proc/cpuinfo
    processor	: 0
    vendor_id	: AuthenticAMD
    cpu family	: 16
    model		: 5
    model name	: AMD Athlon(tm) II X3 450 Processor
    stepping	: 3
    microcode	: 0x10000c8
    cpu MHz		: 3214.697
    cache size	: 512 KB
    physical id	: 0
    siblings	: 3
    core id		: 0
    cpu cores	: 3
    apicid		: 0
    initial apicid	: 0
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 5
    wp		: yes
    flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
    bogomips	: 6429.39
    TLB size	: 1024 4K pages
    clflush size	: 64
    cache_alignment	: 64
    address sizes	: 48 bits physical, 48 bits virtual
    power management: ts ttp tm stc 100mhzsteps hwpstate
    
    processor	: 1
    vendor_id	: AuthenticAMD
    cpu family	: 16
    model		: 5
    model name	: AMD Athlon(tm) II X3 450 Processor
    stepping	: 3
    microcode	: 0x10000c8
    cpu MHz		: 3214.697
    cache size	: 512 KB
    physical id	: 0
    siblings	: 3
    core id		: 1
    cpu cores	: 3
    apicid		: 1
    initial apicid	: 1
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 5
    wp		: yes
    flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
    bogomips	: 6429.20
    TLB size	: 1024 4K pages
    clflush size	: 64
    cache_alignment	: 64
    address sizes	: 48 bits physical, 48 bits virtual
    power management: ts ttp tm stc 100mhzsteps hwpstate
    
    processor	: 2
    vendor_id	: AuthenticAMD
    cpu family	: 16
    model		: 5
    model name	: AMD Athlon(tm) II X3 450 Processor
    stepping	: 3
    microcode	: 0x10000c8
    cpu MHz		: 3214.697
    cache size	: 512 KB
    physical id	: 0
    siblings	: 3
    core id		: 2
    cpu cores	: 3
    apicid		: 2
    initial apicid	: 2
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 5
    wp		: yes
    flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
    bogomips	: 6429.18
    TLB size	: 1024 4K pages
    clflush size	: 64
    cache_alignment	: 64
    address sizes	: 48 bits physical, 48 bits virtual
    power management: ts ttp tm stc 100mhzsteps hwpstate
    So we both gained, you got grep and |uniq I got the |cut -f3- 'd ' trick.

  4. #22914
    Join Date
    Aug 2014
    Location
    The Beach
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Post your .conkyrc files w/ screenshots

    Code:
    cut -f3- '-d '
    anyone care to explain this...in particular what a delimiter is?

  5. #22915
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by CantankRus View Post
    Code:
    cut -f3- '-d '
    anyone care to explain this...in particular what a delimiter is?
    delimiter can be anything defined in a script to break up a line into "sections" or fields or in this case defined within "cut"

    If ; was defined as a delimiter:
    Code:
    tuna;12oz;2.49
    or tabs:
    Code:
    tuna	12oz	2.49
    that way one can use just a certain part of a line.

    Been staring me in the face since forever but it took syntaxerror74 to put focus on it ...
    Code:
    man cut
    Shows us:
    Code:
           -c, --characters=LIST
                  select only these characters
    
           -d, --delimiter=DELIM
                  use DELIM instead of TAB for field delimiter
    
           -f, --fields=LIST
                  select only these fields;  also print any line that contains no delimiter character, unless the
                  -s option is specified
    ... among other things of course:

    -f --field = field

    What I got use to and stuck with was -c --character.

    But "field" is much neater:
    Code:
     24 Aug 14 | 10:31:11 ~
        $ grep 'model ' /proc/cpuinfo | cut -f1- '-d '
    model name	: AMD Athlon(tm) II X3 450 Processor
    model name	: AMD Athlon(tm) II X3 450 Processor
    model name	: AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:32:08 ~
        $ grep 'model ' /proc/cpuinfo | cut -f2- '-d '
    name	: AMD Athlon(tm) II X3 450 Processor
    name	: AMD Athlon(tm) II X3 450 Processor
    name	: AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:32:19 ~
        $ grep 'model ' /proc/cpuinfo | cut -f3- '-d '
    AMD Athlon(tm) II X3 450 Processor
    AMD Athlon(tm) II X3 450 Processor
    AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:32:27 ~
        $
    --character
    Code:
     
     24 Aug 14 | 10:38:10 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 1-
    model name	: AMD Athlon(tm) II X3 450 Processor
    model name	: AMD Athlon(tm) II X3 450 Processor
    model name	: AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:38:18 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 3-
    del name	: AMD Athlon(tm) II X3 450 Processor
    del name	: AMD Athlon(tm) II X3 450 Processor
    del name	: AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:38:27 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 10-
    e	: AMD Athlon(tm) II X3 450 Processor
    e	: AMD Athlon(tm) II X3 450 Processor
    e	: AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:38:35 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 12-
    : AMD Athlon(tm) II X3 450 Processor
    : AMD Athlon(tm) II X3 450 Processor
    : AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:38:48 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 13-
     AMD Athlon(tm) II X3 450 Processor
     AMD Athlon(tm) II X3 450 Processor
     AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:38:54 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 14-
    AMD Athlon(tm) II X3 450 Processor
    AMD Athlon(tm) II X3 450 Processor
    AMD Athlon(tm) II X3 450 Processor
     
     24 Aug 14 | 10:38:59 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 14-23
    AMD Athlon
    AMD Athlon
    AMD Athlon
     
     24 Aug 14 | 10:39:35 ~
        $ grep 'model ' /proc/cpuinfo |cut -c 14-23|uniq
    AMD Athlon
     
     24 Aug 14 | 10:39:47 ~
        $
    Which I guess is just as short. Either way, it got rid of sed
    Last edited by Sector11; August 24th, 2014 at 02:49 PM.

  6. #22916
    Join Date
    Oct 2013
    Location
    europe
    Beans
    76
    Distro
    Lubuntu Development Release

    Re: Post your .conkyrc files w/ screenshots

    The sneakiest bit of it all is the dash after the number or field identifier, e. g. '12-' or the '-f3-'. It's somewhat powerful, for it will mean "'til the end of line". Whilst "-f3" will mean "field 3 only", "-f3-" will stand for "3rd field to n-th field" (delimited (=separated) by the delimiting character specified by -d)
    Last edited by syntaxerror74; August 29th, 2014 at 09:52 AM.

  7. #22917
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    As for 'UNIQ' command and 'GREP', it's redundant. 'GREP' have it's own option to stop after number of pattern matched:
    Code:
    grep  -m1 'model ' /proc/cpuinfo |cut -c 14-23
    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

  8. #22918
    Join Date
    May 2014
    Location
    Edmonton
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Post your .conkyrc files w/ screenshots

    Quote Originally Posted by CantankRus View Post
    Code:
    cut -f3- '-d '
    anyone care to explain this...in particular what a delimiter is?
    I ran across this a couple of weeks ago. After experimenting with iwconfig to grep to sed and then iwconfig to grep to cut I finally settled on iwlist to grep to cut.

    From terminal I can see my bit rate with:
    Code:
    ~$ iwlist wlan4 bitrate
    wlan4     unknown bit-rate information.
              Current Bit Rate:86.7 Mb/s
    To display it in Conky with "Speed:" in blue and "86.7 Mb/s" in green the following code was used:

    Code:
    ${execpi .01 iwlist wlan4 bitrate | grep -o 'Rate:[^\n]*' | cut -f2- -d':'
    .01 means the code is executed 100 times per second but in reality it's restricted to the normal Conky refresh cycle which at 20 times per second (.05) severely slows down Chrome HD broadcasts on a Core 2 Duo Centrino running at 2 GHz. .05 is fun to test but normal operation of 1 or 2 (every 1 or 2 seconds) is ideal.

    Relevant screen shot attached.
    Attached Images Attached Images

  9. #22919
    Join Date
    Feb 2010
    Beans
    Hidden!

    Re: Post your .conkyrc files w/ screenshots

    ↑ @ WinEunuchs2Unix - NICE one!

    Quote Originally Posted by dk75 View Post
    As for 'UNIQ' command and 'GREP', it's redundant. 'GREP' have it's own option to stop after number of pattern matched:
    Code:
    grep  -m1 'model ' /proc/cpuinfo |cut -c 14-23
    I always learn something new with you dk75.
    Thank you!
    Last edited by Sector11; August 26th, 2014 at 06:53 PM.

  10. #22920
    Join Date
    Oct 2013
    Location
    europe
    Beans
    76
    Distro
    Lubuntu Development Release

    Re: Post your .conkyrc files w/ screenshots

    Besides, does anyone of you guys know a PPA for conky (git) version 1.9.1 that currently works?
    While I could compile it myself, I'd rather install a binary to save lots of time.
    I've searched high and low, but V. Cheng's builds on launchpad are outdated by miles. I must have 1.9.1 to have /dev/disk/by-*/* finally working.
    (Wait, you think, you are easily going to make that work under 1.9.0 as well?
    No, you aren't. Never ever. See https://github.com/brndnmtthws/conky/pull/16/files .)

Page 2292 of 2301 FirstFirst ... 1292179221922242228222902291229222932294 ... 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
  •