Linux Blog

Become independent of the system tray using conky.

Filed under: General Linux,The Linux Blog News — Kaleb at 9:19 pm on Thursday, February 7, 2008

Hello everybody it is I Kaleb from over at http://kpstuff.servebeer.com again come to talk today about an app that I have been using for a while but just recently decided to make it fix my dependence of the system tray all together.

If you read my blog regularly you would know that I am not a fan of GUI applications, I use as few of them as possible. I prefer to use command line programs instead for many reasons: one they are faster, two they are easier and quicker to use/access the features that I want from them, and three I just like the way they look.

For a long time I have used the Fluxbox window manager because it is small lightweight and over all pretty. But no matter what window manager I use: Gnome, KDE, Xfce, FluxBox or OpenBox I have always had some dependence on the system tray, which annoyed me a lot.

Some of them things that I liked a system tray for were a static clock that was always in the same spot and I could always look down and see it, also it had a few nice little icons over there for me to use at my will, like for instance, Gmail-Notify which is a little systray applet that will tell you if you have gmail or not and give you a little pop-up if you get new mail. Also this was for a while how i was telling if I had a new message in pidgin.

Then I started thinking to myself,

“All of these things could be done with Conky and I could use Conky for even more.”

So began the transformation.

If you don’t know already what Conky is, it is a little application that will put text in any format and of almost any type of data you want, weather it be the weather report for the day or the week, or your battery status, the day of the week, or your wireless link quality. It blends into your desktop very well and will give you that sweet geekish look that everybody looks for in a desktop.

First we need to install it.

Gentoo:

emerge -av conky

Make sure that you check out the use flags in Gentoo for things like “wifi” and others

Arch Linux:

pacman -S conky

Ubuntu:

apt-get install conky

Now that you have Conky installed it is time for you to figure out where on your screen you want to put it and also how you want it to look. I wont get into to much detail about how to set it up because those things can be figured out by the most green of Linux users. Also there should be an example config file for Conky that came with the install for Gentoo it is /etc/conky/conky.conf. You need to copy this file to ~/.conkyrc and then edit it at your leisure.

It is quite simple to figure out first you decided the main variables for the program then after the word TEXT you decide how your Conky will look on your desktop. What “text” you would like to see and in what fashion. It is here where you will replace your systray.The first thing I wanted my replacement system tray to display was my gmail messages, weather I had emails or not and how many. So I put together a little script that you can obtain from http://kpstuff.servebeer.com/~admin/check_gmail.sh in order to use this script you need to download it. I suggest to put it into a folder such as ~/scripts/ also make it executable with either “chmod 755 check_gmail.sh” or “chmod +x check_gmail.sh” and remember to edit check_gmail.sh for your username and password. Then you need to edit your ~/.conkyrc file under the TEXT area to resemble this

${texeci 60 ~/scripts/check_gmail.sh}

After this I wanted a clock obviously. Now the time variable has almost a million different options for the format that it gives so I will give you an example of how to set it up but you should run “man strftime” to see a full list of formatting options.

${time %I:%M%p}

This will put a time format on your Conky that resembles “02:19PM”

Yes that is right it is that easy and you can almost print anything you want on Conky even RSS feeds, I suggest you try it out at least once, but not just a little install it and run it and it doesn’t work try.

There are literally hundreds of variables that can be used in Conky and those that are not variables can be created using shell/perl/php/and ruby scripts.

For a list of variables go to http://conky.sourceforge.net/config_settings.html and http://conky.sourceforge.net/variables.html

Thank you once more for your time and remember to leave comments for any of the writers for the Linux blog because each of us would sure appreciate feedback on our writings, whether it be good or bad.

Links -g Graphical links

Filed under: General Linux,Linux Software — Kaleb at 12:01 am on Tuesday, February 5, 2008

Hello I am Kaleb Porter from http://kps-blog.blogspot.com writing a post here about links -g, the graphical text web browser. I am sure your asking your self by now, “graphical text web browser? that makes no sense.” well your pretty much right.

What links -g is, is the text based web browser “links” in it’s own X window. This gives it the ability to display images which is very neat actually.

links -g google
Neat right?
Links -g still uses the same old links keys that we are used to from our cli versions that we love so dear. And if you don’t use gpm, you can now use your mouse along with your browser. However if your experienced with gpm this feature may be old news to you.So your asking yourself, “Why the hell do I care about this?” well links -g is an amazingly fast web browser. So if your like me and completely upset at the horrid speed of today’s full featured web browsers… Opera, Firefox, or if your in MacOS Safari, and IE for Windows, then you will love the super fast speed of links -g. Also if your the type of person I am who just flat out likes the simple stuff, or the power user using a nice tiling window manager like dwm or something and you want to be able to display images in your web browser, then you will love links -g.

Sounds great eh? Well it truly is there are drawbacks however most of who will want to use links -g don’t mind these so called drawbacks.
1. Flash.
OK OK so it doesn’t support flash playback…big deal, hey it’s a TEXT based web browser that just happens to be running in X so to support images. You have to give it credit for doing that. And doing that very well.
2. No built in file browser.
OK for this you might be wondering, “What file browser in my web browser?” Well there is a file browser in Web browsers such as Firefox and Opera. These file browsers allow you do do things like pick a file you want to upload to say Photobucket or something. It can still be done, you just need to know where on your system, the file you want to upload is.
3. Other animation software (Java… etc.)
Well you can’t just expect this thing to have support for super cool animation effects from Java because it just doesn’t have a Java plug-in. Note that this is NOT Javascript. Javascript and Java are two different technologies. Javascript is fully supported under links -g.

To install:

In Gentoo:
Make sure you have the proper use flags set up….(png, jpeg, svga, tiff, javascript, X, and ssl if you want it.

emerge -av links

In Arch Linux:
Everything should be set up for you on Arch so just make sure you have libsvga installed (it may be installed when you install links as a dependency).

pacman -Sy links

To run links in graphical mode:

links -g

or

links2 -g

Have fun!

Linux Guest Bloggers

Filed under: The Linux Blog News — TheLinuxBlog.com at 10:14 pm on Monday, February 4, 2008

Hello readers! Do you enjoy reading this blog? Let us know!

If you are interested in writing guest blog posts or becoming a writer for The Linux Blog doing so is quite simple! I am looking for Linux Bloggers of all levels that are interested in writing about anything Linux related.

Along with this I have a guest blog post from a blogger called Kaleb. You can visit his blog at http://kps-blog.blogspot.com. His first post will be posted in the early hours of tomorrow morning. Check it out and leave him some feedback!

Creating Dialogs with Dialog

Filed under: Shell Script Sundays — TheLinuxBlog.com at 5:48 pm on Sunday, October 21, 2007

Have you ever seen those pretty dialogs used in Shell Scripts such as the Slackware installation, the slackpkg program or even the NVIDIA driver installer? Well, my friends to display dialog boxes from shell scripts is very easy with… you guessed it – Dialog.

First of all, there are many different types of dialogs that you can create they are as follows: calendar, checklist, fselect, gauge, infobox, inputbox, menu, msgbox (message), password, radiolist, tailbox, tailboxbg, textbox, timebox, and yesno (yes/no).

This blog post is intended to be a primer on using dialog. More examples will be posted in future blog posts in the Shell Script Sunday’s column.

The simplest form of a dialog in a shell script is probably the msgbox. All this really does is displays text. To display text in a dialog you would do the following:

owen@the-linux-blog:$ dialog –msgbox “Hello from the Linux Blog!” 5 50

The numbers after the text in quotes are the widths and heights of the box. The minimum height that I like to use is 5. The width doesn’t really matter as long as it is big enough. It is good to keep the box sizes standard across a whole script because it gets annoying with constantly resizing boxes.
If the text in a message box is too long it will auto wrap around and give you a type of scroll bar. As follows:

owen@the-linux-blog:$ dialog –msgbox “Hello from The Linux Blog. This text is so long it wraps it to a New Line” 5 50

Dialogs can be canceled. Clicking Ok or pressing enter/return returns “true” and pressing escape or Ctrl+C returns a false.
The simple shell scripting syntax shown in Shell Scripting 101

is used for this:

owen@the-linux-blog:$ dialog –msgbox “Dialog Exit Example” 5 50 && echo “ok” || echo “false”

Another simple dialog example is the Yes/No box. The syntax for this is exactly the same as the msgbox example except instead of using –msgbox, –yesno is used. The difference between a msgbox and a yesno box is that there a two buttons. It is pretty obvious as to what they are labeled, but for those in the back, I’ve included an example and some screen shots anyway.

owen@the-linux-blog:$ dialog –yesno “Are you learning anything from this blog” 5 50 && echo “Yes, thanks Owen.” || echo “No, Write some better Linux Related Posts”

The Linux Blog - Dialog Example - Yes / No

Thats about all I have time for this week. Check back next week!