Author Topic: Conky Tips and Tricks  (Read 30879 times)

lwfitz

  • DEFCON 1
  • Posts: 1757
  • sudo rm -rf /
    • View Profile
Re: Teo's Scripts in a nutshell
« Reply #30 on: March 21, 2013, 06:13:43 PM »
Exactly what I was looking for! Thanks buddy!

Sector11

  • Posts: 870
    • View Profile
Re: Teo's Scripts in a nutshell
« Reply #31 on: March 21, 2013, 11:54:13 PM »
You're welcome.

Maybe others will get something out of this as well.
Stay Home

Sector11

  • Posts: 870
    • View Profile
Re: Conky Tips and Tricks
« Reply #32 on: April 29, 2013, 05:34:51 PM »
loadgraph


Dobbie03 over on CrunchBang asked if anyone knew how to get a graph for RAM and CPU  - CPU was easy: cpugraph  ... but ram?  Then he edited his post and said he found it: loadgraph.  I have never seen that command used before and never gave it the light of day until today.  I did some reading and discovered things I had never really knew about "load average" ... interesting.  The noob in me surfaces again!

Anyway I made a test conky and had to work with it a bit and discovered a few things.  "Scale" isn't really explained and that it does matter whether you use the -t -l function AND in what order you use them.  I have added "loadgraph" to my daily conky on the right as well.  Also I stressed out my CPU usage a bit just to see results.

Another thing I found out: above TEXT:
Quote
# Specify a default width and height for graphs.
# Example: 'default_graph_size 0 25'.
# reverse to what is used under TEXT where it is height and width
# does not work with "loadgraph"
# default_graph_size 100 50

The business portion of the test conky on the left:
Code: [Select]
TEXT
loadgraph:
  (height),(width) (gradient colour 1) (gradient colour 2) (scale) (-t) (-l)

  Load1 average graph, similar to xload, with optional colours in hex, minus
the "hash". Uses a logarithmic scale (to see small numbers) when you use the -l
switch. Takes the switch '-t' to use a temperature gradient, which makes the
gradient values change depending on the amplitude of a particular graph value
(try it and see).

Clean
${loadgraph 30,518 0000ff fff000}
-t -l${goto 280}-tl
${loadgraph 30,250 0000ff fff000 -t -l}  ${loadgraph 30,250 0000ff fff000 -tl}
-l -t${goto 280}-lt
${loadgraph 30,250 0000ff fff000 -l -t}  ${loadgraph 30,250 0000ff fff000 -lt}
just -l${goto 280}just -t
${loadgraph 30,250 0000ff fff000 -l}  ${loadgraph 30,250 0000ff fff000 -t}

And from my daily conky (messed up my vnstats have to fix that):
Code: [Select]
Load Average ${color5}(minutes)
${alignc}1: ${color}${loadavg 1}  ${color5}5: ${color}${loadavg 2}  ${color5}15: ${color}${loadavg 3}
${alignc}${loadgraph 14,220 00ffff fff000 .2 -lt}

Maybe someone will find it useful.
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1757
  • sudo rm -rf /
    • View Profile
Re: Conky Tips and Tricks
« Reply #33 on: April 29, 2013, 05:50:03 PM »
Ohhhhhhh! I like it, in fact this is the exact idea I had but was wording the question wrong about having more than two colors in a network graph. Thanks Sector11, great work as always my friend!

Sector11

  • Posts: 870
    • View Profile
Re: Conky Tips and Tricks
« Reply #34 on: April 29, 2013, 07:47:18 PM »
You're welcome.  I don't recall you asking the question.

Mind reader I'm not!   ;D <-- Edit an oops!
Stay Home

Sector11

  • Posts: 870
    • View Profile
Re: Conky Tips and Tricks
« Reply #35 on: May 15, 2013, 03:10:00 PM »
Colour Coding Conky

New Medit v1.1.1 does things differently.

The old conkyrc.lang file is in the wrong spot and outdated.  Seems the new version of Medit wants to call conky a:
Document » Language » Scientific » Octive

The new conky.lang file location should be placed in:

/usr/share/medit/language-specs/conky.lang

It has been redone to include all Variables and Setting as they exist at Conky Docs as of 15 may 2013

 - it will recognize and conky file with "conky" in the name IE: ~/.conkyrc, /media/conky/VSIDO.conky

 - it will recognize a conky file that has "conky" in the first line of the file: IE: /media/5/my_weather

The new updated file conky.lang file is attached
EDIT:  If you use gedit could you test it please and let me know.
Stay Home

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: Conky Tips and Tricks
« Reply #36 on: May 15, 2013, 04:13:22 PM »
^ Thanks for the update, the new conky.lang will be included in the next ISO's

It seems they are reverting back to the original placement of the file. When I first found and implemented the conky.lang, it was also required to be placed in

/usr/share/medit/language-specs

I also did not have to choose anything in settings to have the lang file work on all conky files once I restarted Medit
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

Sector11

  • Posts: 870
    • View Profile
Re: Conky Tips and Tricks
« Reply #37 on: May 15, 2013, 05:12:44 PM »
YUP, just plain works as advertised.

There are new commands added and some that are old (indented) along with other commands that while not something a user may use it is something conky uses.

Some Examples:

      <keyword>texeci</keyword>
         <keyword>text_and_other_conky_vars</keyword>
         <keyword>textfile</keyword>
         <keyword>thebittorrentportrange</keyword>
      <keyword>threads</keyword>



and some new stuff that will now show colour coded (there is more) where it didn't before:

      <keyword> +fahrenheit</keyword>
      <keyword> +celsius</keyword>


as in:
Code: [Select]
temperature_unit fahrenheit
TEXT


Stay Home

PackRat

  • Posts: 1970
    • View Profile
Re: Conky Tips and Tricks
« Reply #38 on: May 18, 2013, 04:46:13 PM »
Using the most recent VSIDO build and have discovered that, with Sid, update-notifier has a whole bunch of gnome dependencies now - like pulseaudio - that weren't included before (not that I recall anyway). So to check for updates, I am using the:

Code: [Select]
aptitude search "~U" | wc -l
method in conky that many are familiar with. Found a variation a while back that I like though - these are not my scripts:

This script checks for updates:

chkupdates.sh

Code: [Select]
#!/bin/bash

sudo apt-get -qy update > /dev/null
NUMOFUPDATES=$(aptitude search "~U" | wc -l)
echo $NUMOFUPDATES System Updates Available
if [ "$NUMOFUPDATES" -ge "1" ]
then uxterm -e ~/bin/ask-aptitude-updates.sh
fi
exit

and for the purpose of this example, will launch uxterm if there is more than 1 update available - change the "1" to "20" for 20 updates and so on ...

ask-aptitude-updates.sh

Code: [Select]
#!/bin/bash

echo "Aptitude Update System? y or n"
read -t 12 userconfirm
if [ "$userconfirm" != "y" ]; then
echo "Aptitude Update Cancelled"
exit 1
else
echo "aptitude updating system..."
sudo aptitude update
# sudo aptitude -y safe-upgrade
sudo aptitude safe-upgrade
echo ""
killall -SIGUSR1 conky
echo "aptitude update complete. Will now exit..."
sleep 3s
fi
exit

will launch uxterm (any terminal will work) and has a 12 second usercomfirm to update the system or it terminates. So the whole process is interactive and will not update your system unless prompted to do so.

If you just want to check for updates:

apt-update.sh
Code: [Select]
#!/bin/bash

sudo apt-get -qy update > /dev/null
NUMOFUPDATES=$(aptitude search "~U" | wc -l)
echo $NUMOFUPDATES

exit

Since the output is an integer only, it can be used with if_match, else, endif to give it some colour.

The result:



I suspect an interactive conky could be made out of these so that clicking on the updates would launch the update terminal.

Edit - changed " sudo aptitude -y safe-upgrade" to "sudo aptitude safe-upgrade"
Normally use this script with stable/testing; the -y flag probably not wise with sid.
I am tired of talk that comes to nothing.
-- Chief Joseph

...the sun, the darkness, the winds are all listening to what we have to say.
-- Geronimo

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: Conky Tips and Tricks
« Reply #39 on: May 18, 2013, 05:05:36 PM »
^ Nice conky tips and even better examples of the greater powers of aptitude

Thanks for sharing these...  8)
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

Sector11

  • Posts: 870
    • View Profile
Re: Conky Tips and Tricks
« Reply #40 on: May 18, 2013, 08:21:45 PM »
I am using the:

Code: [Select]
aptitude search "~U" | wc -l
I suspect an interactive conky could be made out of these so that clicking on the updates would launch the update terminal.

I'd bet money mrpeachy or falldown could do that too.

Made me go looking in my aliases file, and there they were, hold outs from years back when I used aptitude, lines 138, 139 and 140:

Code: [Select]
alias search='aptitude search'
alias show='aptitude show'
alias avail='aptitude search "~U" | wc -l | tail'

not being "bash literate" I would never have thought of a bash script ... must look at that closer.

Code: [Select]
18 May 13 | 17:15:34 ~
    $ avail
2
 
 18 May 13 | 17:20:56 ~
    $
NOTE: The two being held back
Stay Home

lwfitz

  • DEFCON 1
  • Posts: 1757
  • sudo rm -rf /
    • View Profile
Re: Conky Tips and Tricks
« Reply #41 on: May 23, 2013, 06:06:18 AM »
New one Im working on..... Ill post the config once its done  ;D


VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: Conky Tips and Tricks
« Reply #42 on: May 23, 2013, 06:10:18 AM »
^ WOW.. that is very cool!

Nice one lwfitz...!
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO

lwfitz

  • DEFCON 1
  • Posts: 1757
  • sudo rm -rf /
    • View Profile
Re: Conky Tips and Tricks
« Reply #43 on: May 23, 2013, 06:21:43 AM »
Thanks buddy..... just realized I posted in the wrong thread  ??? ??? Oops

VastOne

  •      v-ger
  • Posts: 3961
    • View Profile
    • VSIDO Community
Re: Conky Tips and Tricks
« Reply #44 on: June 25, 2013, 03:01:08 PM »
FluxBox and 2 Conky's

VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO