Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old July 22nd, 2008   #1
Bruce M.
Chocolate Ubuntu Mocha Blend
 
Bruce M.'s Avatar
 
Join Date: Sep 2007
Location: 34°35'S - 58°21'W
My beans are hidden!
HOW TO: A Beginners Guide to Setting up Conky

Hi Folks

Preamble:

First and foremost this thread isn't meant to be a place to display your screeshots of conky or to discuss the inner workings of the conky configuration itself. There are a couple of really good threads that will give you help in those areas:
  1. Post your .conkyrc files w/ screenshots
  2. Howto: Get a beautiful Conky 1.4.2 setup
  3. Howto: setup Conky in Hardy and Ibex

While this topic is discussed in those threads above, trying to find the information is difficult as it's spaced out over hundreds of pages and thousands of posts.

Here's some further reading to help you "configure" your conky if you are interested:
  1. ~.conkyrc settings
  2. Conky Variables
  3. Conky Manual

Fact is, I'm hoping that his will be a 1 post thread to keep it "uncomplicated". If you see and error, have an addition, please PM me and I'll pop it in here giving due credit.

So lets move on to: A Beginners Guide to Setting up Conky

CHAPTER I
Setting Up A Conky


CONKY - Conky is a system monitor for X originally based on the torsmo code.

Since its original conception, Conky has changed a fair bit from its predecessor. Conky can display just about anything, either on your root desktop or in its own window. Conky has many built-in objects, as well as the ability to execute programs and scripts, then display the output from stdout.

First you need the file "conky" and I'd suggest you look at curl, lm-sensors and hddtemp as well, described below. You may as well get them now, I'll bet you will in the future if you don't:
Code:
sudo aptitude install conky
CURL - Get a file from an HTTP, HTTPS or FTP server

curl is a client to get files from servers using any of the supported protocols. The command is designed to work without user interaction or any kind of interactivity.

curl offers a busload of useful tricks like proxy support, user authentication, ftp upload, HTTP post, file transfer resume and more.

LM-SENSORS - utilities to read temperature/voltage/fan sensors

Lm-sensors is a hardware health monitoring package for Linux. It allows you to access information from temperature, voltage, and fan speed sensors. It works with most newer systems.

This package contains programs to help you set up and read data from lm-sensors.

Homepage: http://www.lm-sensors.org

hddtemp - hard drive temperature monitoring utility

The hddtemp program monitors and reports the temperature of PATA, SATA
or SCSI hard drives by reading Self-Monitoring Analysis and Reporting
Technology (S.M.A.R.T.) information on drives that support this feature.

If you want all four, it's easy:
Code:
sudo aptitude install conky curl lm-sensors hddtemp
OK, so you have the file(s).

Now to use conky, open a terminal and type:
Code:
conky
and you'll see a little window open and display a basic conky. That's the default conky found in: /etc/conky/conky.conf

But you want it on your desktop all the time and customized for your system, not in a pop-up window.

I'm going to be using gedit, you may have mousepad or kate. I use Xfce, but have gedit installed because I open multiple files in a tabbed environment. I'm also suggesting a directory and file names, one is hidden, use whatever you like, I'm using my setup here as an example only.

STEP 1 - Create a conky
  • Create a directory in /home called /Conky
  • Create an empty file called; conkymain:
    Code:
    gedit ~/Conky/conkymain
  • Paste a conky file from one of the posts in the threads above that you like into that empty file and save it.

Believe it or not that's it, you now have a working (maybe not configured correctly) conky.

In terminal type (the -c is telling conky to load and run the file that follows):
Code:
conky -c ~/Conky/conkymain
and you'll see it, it may not be perfect for your setup, that's why I suggest you go to the threads mentioned above or even the default file: /etc/conky/conky.conf

The point is, you now have a working conky

STEP 2 - Setting up conky to autostart on boot.
  • Create a hidden file ~/.startconky
    Code:
    gedit ~/.startconky
  • In this empty file paste the following:
Code:
#!/bin/bash
sleep 0 &&	# 0 good for Xfce - use 20 to 30 for Gnome
conky -c ~/Conky/conkymain &
#sleep 0 &&
#conky -c ~/Conky/conkyforecast &
If you are using GNOME or KDE you'll need to change sleep 0 to sleep 20 or better, depending on your system. This gives your desktop (Metacity, Compiz, etc.) time to load itself and not over write an existing conky. The start conky command will be delayed by that time and not start until after your desktop is running.

I left two extra lines in there (commented out) for future reference if you ever want to run more than one conky. That's why I'm suggesting the ~/.startconky here. Once you start with conky, in my opinion, it's addictive and you may want more than one running. This way you are prepared.

Now you must make ~/.startconky executable. There are two methods:

Terminal:
Code:
chmod a+x ~/.startconky
File Manager:
Right click on ~/.startconky > Properties > Permissions > check the box necessary to make it executable.

OK, so now you have conkymain working and a way to start it and a second one for future reference inside your ~/.startconky file.

Getting Ubuntu to Autostart conky.

In Ubuntu:
  1. System -> Preferences -> Sessions -> Startup Programs
  2. Click on the ADD button:
In Xubuntu:
  1. Applications > Settings > Settings Manager > Autostarted Apps
  2. Click on the ADD button:
    Continuing in Ubuntu and Xubuntu:
  3. Name: Conky <<-- anything you want
  4. Description: <<--- anything you want (mine is blank)
  5. Command: <<-- see the "Open Icon" click on that. When your home folder shows, right click to show hidden files if not visible ... and find the hidden file: .startconky. Highlight it and click [ OK ].
  6. Close
  7. Now: [Ctrl]+[Alt]+[Backspace] to restart your session and conky will start in xx seconds, depending on your sleep command.

In Kubuntu

I am NOT a KDE user and have never seen it but I found this at the bottom of; http://ubuntuforums.org/archive/index.php/t-19154.html from 2006. Crinos512 has come up with an easy way to do this in KDE:

Quote:
Originally Posted by Crinos512 View Post
As I promised I have come by to help out on autostarting conky in KDE 4.

it actually is just as easy as under Gnome, make your startconky script and make it executable.... as before.

Then in the Kick Off panel, click the big blue K, select the Computer tab and then System Settings.

In the system settings App select the Advanced Tab and then AutoStart in the top section.

Click "Add Script" and browse to your startconky script.

Close system settings, you are done.
Well, that looks easy, Thank you Crinos512

Having a problem with a transparent conky in KDE 4, Crinos512 has a fix for you in Post #24

Don't forget to thank him if you need it.

Here's another one for KDE users by Ng Oon-Ee, Post #29 for those times when:
Quote:
Originally Posted by Ng Oon-Ee View Post
1. if login time takes unusually long somehow (increased startup programs or low battery situation) the time may not be enough
2. When relogging-in without shutdown, the delay is much much longer than needed.
Again, Thank you Ng Oon-Ee for your support, and if you find it useful, don't forget to thank him.

CHAPTER II
A Multiple Conky Setup


Ok, you have your conky set up, you've configured it the way you want it's working properly for your system.

Now you want to put a second conky on your desktop, for example: weather. If you followed the example above you have a ~/.startconky file with a second entry commented out, called conkyforecast. Uncomment those lines and you are ready to create an run a second conky.

Create that file the same way you created conkymain. When you get the blank file up I "suggest" copying your "conkymain" file into it and deleting everything below TEXT and change the "alignment" line for example:
Code:
alignment top_right  # top_right, top_left, bottom_left, bottom_right
to:
Code:
alignment bottom_left  # top_right, top_left, bottom_left, bottom_right
so they don't overlap each other.

Add what ever you want conky to display below TEXT, save it. Then edit the ~/.startconky file removing the # before the last two lines and make sure the last line points to your second file:

Code:
#!/bin/bash
sleep 0 &&	# 0 good for Xfce - use 20 to 30 for Gnome
conky -c ~/Conky/conkymain &
sleep 0 &&
conky -c ~/Conky/conkyforecast &
Now:
Code:
killall conky
conky -c ~/.startconky
to see the results.

More on conky:
  1. ARCHIVED & LOCKED: Conky Weather Python Script: Can be configured to use English (default), Spanish or French. (Good for historical purposes ONLY)
  2. The New one: Conky Weather Forecast Python Script - Same script in a new thread so we can post suggestions and requests.
  3. Conky Google Calendar Python Script
  4. Conky SSL Email Python Script
  5. conkyDeluge
  6. conkyExaile
  7. conkyPidgin
  8. conkyRhythmbox
  9. Conky Gmail Revisited
  10. How To: Configuring Conky - Thank you Sealbhach
  11. HTML Color Names - Thank you Sealbhach

OK that will get you started, now comes the fun part ... configuring it to your own personal tastes and machine.

Have a Nice day
Bruce

PS: If you see errors or have other conky resources that you feel might be helpful here please PM me.

-----
Dedicated to all the wonderful people that helped me with conky, you know who you are. Thank you !

EDITS:
  • 31 Jul 08 - Corrected ~/.startconky
  • 01 Aug 08 - Added: Conky Gmail Revisited
  • 15 Aug 08 - Added: "Getting Ubuntu to Autostart conky" section title.
  • 06 Nov 08 - Added more scripts to the list
  • 26 Nov 08 - Added info for running two or more scripts.
  • 27 Nov 08 - Added links, better late than never. Thanks Sealbhach
  • 28 Nov 08 - Added hddtemp. Thanks Crinos512
  • 02 Jan 09 - Added Link to: Howto: setup Conky in Hardy and Ibex
  • 04 Feb 09 - Thanks to Crinos512, an easy way to autostart in KDE
  • 04 Feb 09 - Fix for a transparent conky in KDE 4 Thanks Crinos512
  • 27 Feb 09 - Added Link to Ng Oon-Ee's post #29 Thanks Ng Oon-Ee

Last edited by Bruce M.; February 27th, 2009 at 12:05 PM.. Reason: Added Information
Bruce M. is offline   Reply With Quote
Old July 22nd, 2008   #2
jjgomera
Way Too Much Ubuntu
 
jjgomera's Avatar
 
Join Date: Jul 2007
Location: Segura, Spain
Beans: 238
Send a message via MSN to jjgomera Send a message via Yahoo to jjgomera
Re: HOW TO: A Beginners Guide to Setting up Conky

good work

how to in how to, isnt it?

More in conky: really all you can obtain in a terminal, all dbus program, all dcop program, all daemon, infinite posibilities...
__________________
mujeres y hombres de esta tierra
un otro mundo es posible
otro mundo diferente
justo si, y sin miedo de su gente
jjgomera is offline   Reply With Quote
Old July 22nd, 2008   #3
Dr Small
░▒▓»§«▓▒░
 
Dr Small's Avatar
 
Join Date: Nov 2006
Location: benkoda
My beans are hidden!
Send a message via ICQ to Dr Small Send a message via MSN to Dr Small
Re: HOW TO: A Beginners Guide to Setting up Conky

Em, maybe I am missing something here, but what is the point of the ~/.startconky, and 'sleep 0 &' eh?
__________________
“It is a capital mistake to theorize before you have all the evidence. It biases the judgment." - Sherlock Holmes
Linux User #441960 | Beginners Team | Wiki: DrSmall
Dr Small is offline   Reply With Quote
Old July 22nd, 2008   #4
bodhi.zazen
Ubuntu Guru
 
bodhi.zazen's Avatar
 
Join Date: Apr 2006
Location: Montana
My beans are hidden!
Xubuntu Development Release
Send a message via Yahoo to bodhi.zazen
Re: HOW TO: A Beginners Guide to Setting up Conky

Nice write up, moved to tips and tutorials.
__________________
A person with ubuntu is open and available to others, affirming of others, does not feel threatened that others are able and good, for he or she has a proper self-assurance that comes from knowing that he or she belongs in a greater whole and is diminished when others are humiliated or diminished, when others are tortured or oppressed. ~ Archbishop Desmond Tutu, 1999

bodhi.zazen is offline   Reply With Quote
Old July 22nd, 2008   #5
Bruce M.
Chocolate Ubuntu Mocha Blend
 
Bruce M.'s Avatar
 
Join Date: Sep 2007
Location: 34°35'S - 58°21'W
My beans are hidden!
Re: HOW TO: A Beginners Guide to Setting up Conky

Quote:
Originally Posted by Dr Small View Post
Em, maybe I am missing something here, but what is the point of the ~/.startconky, and 'sleep 0 &' eh?
Edited to reflect your questions.

Thank you.
Bruce
Bruce M. is offline   Reply With Quote
Old July 22nd, 2008   #6
Bruce M.
Chocolate Ubuntu Mocha Blend
 
Bruce M.'s Avatar
 
Join Date: Sep 2007
Location: 34°35'S - 58°21'W
My beans are hidden!
Re: HOW TO: A Beginners Guide to Setting up Conky

Quote:
Originally Posted by jjgomera View Post
good work

how to in how to, isnt it?

More in conky: really all you can obtain in a terminal, all dbus program, all dcop program, all daemon, infinite posibilities...
It's been moved to Tips and Tutorials.

I'm happy.

Have a nice day.
Bruce
Bruce M. is offline   Reply With Quote
Old July 22nd, 2008   #7
Bruce M.
Chocolate Ubuntu Mocha Blend
 
Bruce M.'s Avatar
 
Join Date: Sep 2007
Location: 34°35'S - 58°21'W
My beans are hidden!
Re: HOW TO: A Beginners Guide to Setting up Conky

Quote:
Originally Posted by bodhi.zazen View Post
Nice write up, moved to tips and tutorials.
Thank you for this.

CHIMO!
Bruce
Bruce M. is offline   Reply With Quote
Old July 22nd, 2008   #8
Dr Small
░▒▓»§«▓▒░
 
Dr Small's Avatar
 
Join Date: Nov 2006
Location: benkoda
My beans are hidden!
Send a message via ICQ to Dr Small Send a message via MSN to Dr Small
Re: HOW TO: A Beginners Guide to Setting up Conky

Quote:
Originally Posted by Bruce M. View Post
Edited to reflect your questions.

Thank you.
Bruce
Oh. Ok, Thanks. It didn't make sense, since I don't use Gnome / Metacity
__________________
“It is a capital mistake to theorize before you have all the evidence. It biases the judgment." - Sherlock Holmes
Linux User #441960 | Beginners Team | Wiki: DrSmall
Dr Small is offline   Reply With Quote
Old August 12th, 2008   #9
monjope
First Cup of Ubuntu
 
monjope's Avatar
 
Join Date: Jul 2008
Beans: 6
Re: HOW TO: A Beginners Guide to Setting up Conky

Good work!!

Thank you.
monjope is offline   Reply With Quote
Old August 12th, 2008   #10
Bruce M.
Chocolate Ubuntu Mocha Blend
 
Bruce M.'s Avatar
 
Join Date: Sep 2007
Location: 34°35'S - 58°21'W
My beans are hidden!
Re: HOW TO: A Beginners Guide to Setting up Conky

Quote:
Originally Posted by monjope View Post
Good work!!

Thank you.
You're welcome and Thank you.
Enjoy.
Bruce
Bruce M. is offline   Reply With Quote

Bookmarks

Tags
beginner's guide, conky, howto, setup

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:59 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry