|
12 years ago 57 |
Ever since I've really started to use Linux as an OS, I've been using this wonderful application called Conky. This application monitors various things going on around your machine (disk space, processor usage, now playing, battery power left, processes running, network statistics, just to name a few) and draws the information retrieved directly to your desktop, meaning that it becomes part of the background (cool, eh? :D). Well, I'm going to give you a short intro into exactly what Conky is and what it can do.
First of all, conky is a package you can get from apt/aptitude/synaptic/pacman/. You install it using that, or if you really want to stay on top of the game (like me) you can download the source tarball from the SourceForge page, which is located here. I will also be providing all links at the bottom of this article for reference. :)
After installation, you can find the default configuration file under ~/.conkyrc, which is a hidden file in your home folder. Open that up using gedit, mousepad, nano, vi, or whatever editor suits your fancy. You'll then see a bunch of configuration variables that are a little confusing at first. We're gonna skip over those for now, and just pay attention to the part of the file that tells conky what to acutally display, which is located below the line "TEXT". This is where the fun begins.
Built-in variables are called with possible arguments by using the following format: ${variablename }. Let's go over a few examples. The variable "nodename" displays your hostname (such as kittykatt-laptop or arch-desktop) and requires no arguments. When a variable needs no arguments, it can be called without the curly brackets like so: $nodename. A variable that does require arguments is "cpu" (called using ${cpu }), which will display the percent usage of the cpu# specified.
A very nifty little variable is the exec variable. This allows conky to call external scripts. This is called in conky by using the following format: ${exec execi is to perform the supplied command/script at a certain interval. Format for execi is "${execi }". The purpose of of execp is to call a command/script and parse it's output for conky variables. This is useful when inputting $color variables in the script itself. A common use for the exec variable that is most often used beside the nodename variable is ${exec whoami}, which will report your username. This can be used to report your "username@host" using the following format: ${exec whoami}@${nodename}.
Below is an image of a sample config made by me in about 10 seconds that shows a couple of things and doesn't call any external scripts (An old conkyrc file of mine called a total of 7 external scripts. xD):
Computer Name, Kernel, and Uptime
Battery Power Info
Disk Space on HDD
RAM and Swap usage
Processor Usage
Network Statistics (including up and down)
And the .conkyrc for that configuration can be found here (it's really long and I don't want to paste it here.)
Once you've done all of your configuring, if you saved the file as ~/.conkyrc then all you need to do is execute the command "conky" in a terminal or application launcher. If you saved it under another name, you will need to use "conky -c /path/to/config/file". Many users don't want to do this everytime they start up their system, so they add it to their auto-start applications. There are different ways of going about this based on what DE (GNOME, KDE, XFCE, LXDE, None) you're running. Most Desktop Environments will have a dialog for it somewhere in the main menu under "Preferences".
Once you get past the basic stuff, you can start REALLY having fun with this little application. I rework my conky config(s) almost daily and continue to upgrade/supplement them as I learn more and more uses for conky. Following is a screenshot of my current conkyrc(s) in action:
In that screenshot I'm using conky to report the following: system information, processor usage, RAM and swap usage, battery power info, local repository status, top processes, network/connection statistics, HDD and mounted device space information, MPD now playing, calendar/clock combo, and one in the bottom right corner that displays what desktop I'm on currently and the name of said desktop.
Well, I've had fun writing this, and I hope you have a much better understanding now of what conky really is and what it can do. I also hope to see you whipping up your own conky configurations soon. ^^ If you have any conky questions, head on over to #conky on the FreeNode IRC network. Or stop by our network, SilverIRC, and ask shoot a few questions at yours truly. I'm far from knowing all of the answers, but I can usually answer most conky-related questions.
External Links:
Conky - Conky SourceForge page. All variables and config options are listed here in the documentation.
Sample Conky - Link to the sample conky config provided in this tutorial.
Samples [Conky Site] - A bunch of sample configurations with screenshots provided by conky users.
Samples [Ubuntu Forums] - A bunch of sample configurations provided by Ubuntu users.
Ever since I've really started to use Linux as an OS, I've been using this wonderful application called Conky. This application monitors various things going on around your machine (disk space, processor usage, now playing, battery power left, processes running, network statistics, just to name a few) and draws the information retrieved directly to your desktop, meaning that it becomes part of the background (cool, eh? :D). Well, I'm going to give you a short intro into exactly what Conky is and what it can do.
First of all, conky is a package you can get from apt/aptitude/synaptic/pacman/. You install it using that, or if you really want to stay on top of the game (like me) you can download the source tarball from the SourceForge page, which is located here. I will also be providing all links at the bottom of this article for reference. :)
After installation, you can find the default configuration file under ~/.conkyrc, which is a hidden file in your home folder. Open that up using gedit, mousepad, nano, vi, or whatever editor suits your fancy. You'll then see a bunch of configuration variables that are a little confusing at first. We're gonna skip over those for now, and just pay attention to the part of the file that tells conky what to acutally display, which is located below the line "TEXT". This is where the fun begins.
Built-in variables are called with possible arguments by using the following format: ${variablename }. Let's go over a few examples. The variable "nodename" displays your hostname (such as kittykatt-laptop or arch-desktop) and requires no arguments. When a variable needs no arguments, it can be called without the curly brackets like so: $nodename. A variable that does require arguments is "cpu" (called using ${cpu }), which will display the percent usage of the cpu# specified.
A very nifty little variable is the exec variable. This allows conky to call external scripts. This is called in conky by using the following format: ${exec execi is to perform the supplied command/script at a certain interval. Format for execi is "${execi }". The purpose of of execp is to call a command/script and parse it's output for conky variables. This is useful when inputting $color variables in the script itself. A common use for the exec variable that is most often used beside the nodename variable is ${exec whoami}, which will report your username. This can be used to report your "username@host" using the following format: ${exec whoami}@${nodename}.
Below is an image of a sample config made by me in about 10 seconds that shows a couple of things and doesn't call any external scripts (An old conkyrc file of mine called a total of 7 external scripts. xD):
Computer Name, Kernel, and Uptime
Battery Power Info
Disk Space on HDD
RAM and Swap usage
Processor Usage
Network Statistics (including up and down)
And the .conkyrc for that configuration can be found here (it's really long and I don't want to paste it here.)
Once you get past the basic stuff, you can start REALLY having fun with this little application. I rework my conky config(s) almost daily and continue to upgrade/supplement them as I learn more and more uses for conky. Following is a screenshot of my current conkyrc(s) in action:
In that screenshot I'm using conky to report the following: system information, processor usage, RAM and swap usage, battery power info, local repository status, top processes, network/connection statistics, HDD and mounted device space information, MPD now playing, calendar/clock combo, and one in the bottom right corner that displays what desktop I'm on currently and the name of said desktop.
Well, I've had fun writing this, and I hope you have a much better understanding now of what conky really is and what it can do. I also hope to see you whipping up your own conky configurations soon. ^^ If you have any conky questions, head on over to #conky on the FreeNode IRC network. Or stop by our network, SilverIRC, and ask shoot a few questions at yours truly. I'm far from knowing all of the answers, but I can usually answer most conky-related questions.
External Links:
Conky - Conky SourceForge page. All variables and config options are listed here in the documentation.
Sample Conky - Link to the pastebin containing the configuration for the sample config shown here.
I'm terribly sorry that I haven't kept up with the links. Since making this tutorial, I have changed domain names three times and hosting twice. Sometimes, I'm not able to keep all of my stuff up to date everywhere on the net. Obviously, there are going to be links that I miss.
Nevertheless, I have located the sample conky config on my server that I originally linked to and have fixed the link to it in both locations in this tutorial. Thank you for your comment and very constructive criticism.
Broken links and images may have been fixed 5 months ago, KittyKatt, but the blue "here" in the following bit of your tutorial presentation
"And the .conkyrc for that configuration can be found *here* (it's really long and I don't want to paste it here.)"
which is reminiscent of Fermat's excuse for the absence of the proof of his Last Theorem, takes one to a broken link - LinuxMint he say 404 - Not Found.
Same happens with "Sample Conky - Link to the sample conky config provided in this tutorial.", but your signposting to the SourceForge pages is kosher, both for the SourceForge Conky home page and the screen shots page, and the link to the Ubuntu Conky comment/samples page is also useful - dare I say it, at the moment more useful than your Tutorial !
Sadly, the link to ArcherSeven's site now also gives 404 - Not Found.
I've fixed the broken links and images. :)
If you really want to see some nice work take a look here in the forums
http://forums.linuxmint.com/viewtopic.php?f=60&t=30209&p=392703&hilit=conky+sector+11#p392703
I cant seem to fine the config files under my home directory, can see everything else bar conky
nice job
+1
I agree; a couple screen shots and sample .conkyrc files would be great. An odd, or normal, occurrence: I got the impression that a ~/.conkyrc would be created. It was not. Maybe after building the source code, but that never worked, so I apt-get got it. I had to read then copy one that threw errors from one of the links you provided, thanks. Then after much trial and error I was modifying/saving and changing the display on he fly. Then it got to be fun. Thanks, just a little tweaking of the tutorial for the newbies and it'll be spot on. :)
Thanks, Conky really made my day! :D
Thanks for the introduction.
Perhaps you may consider to describe the integration into gnome in detail since gnome is Mint's default WM.
This is a very good tutorial. I have just started playing with conky and it is due in large part to your tutorial. It's a sound start for conky beginners like myself, and makes me want to gain a better understanding of all the in's-and-out's of the program. But from what I have read this isn't even the tip of the iceberg...
Thanks again for a great tutorial KittyKatt!
Good tutorial! It's a good primer to get someone thinking about Conky as a software and encourages exploration. There is difficulty with making a concise tutorial about a software as large as Conky, since it's unique to each person (and in truth a walkthrough would be huge) but this one does well.
I would post more screenshots and example configs to tinker with, and leave out more of the hard code, if nothing else because it looks daunting to end users at times. :)
Great job KittyKatt, looking forward to more stuff from you!
What more does it need? I'm attempting to get a few more configs posted, as well as screenshots, but I'm sure you mean something else. I'm more than willing to take suggestions and implement them. ^^;
Nice. Gotta agree though, not "intro" enough for an "intro" article. :)
I'll be including a couple more screenshots soon, as well as a couple of external scripts that I recommend.
That's a great step further towards helping me getting acquainted with this very interesting but also very elaborate app.
KittyKatt,Good article, thank you! just learned a little more about conky.
however this tutorial is still for an intermediate user, who already knows about conky.
if you could add some info about how to start/stop conky,how to make it auto load with system, how to efficiently edit it,some examples of different configurations, some list of scripts, possibly some more screenshots, it would be grate.
i could try helping you a little, even if i'm new here.
thanks you again!