Categories
Linux Programming Science and Technology

Conky, Dell i8k Modules, and My First Ubuntu Bash Script

Conky Screenshot

Well, I started playing around with Conky yesterday — if you haven’t heard of it before, just know that it’s a neat little Linux program that runs in your background and uses very little resources that displays a very neat desktop overlay.  (Like in the picture in the Lifehacker article.)

Now, some of the stock Conky scripts were more than adequate, but I had always wanted my laptop’s CPU temperature to be displayed as well, so I had to figure out a way to do that.

Now, if you’re somewhat familiar with tinkering in Linux, you’ve probably heard of the wonderful “lm_sensors” package — it’s a neat package for Linux that helps display lots of information about motherboard temps and whatnot.  Unfortunately, due to most laptops “prorietary-ness,” lm_sensors does very little for you if you’re trying to get it to work on a laptop.

Now, I had heard of the “i8kutils” package for Linux — this was a package designed for Dell laptops in particular, to display and control fan and temperature information.

So, with that, I was off to work!

(Note — these instructions are mostly for Ubuntu/Debian installations, because that’s what I use.)

First, install the package “i8kutils” using your Linux computer’s package manager (Synaptic, if you’re using Ubuntu).

Second, add the module “i8k” to your “/etc/modules” file.  (This will start the process at boottime.)  Restart your laptop.

Third, you’ll have to create some Conky script files.  I assume you’ve already had a bit of experience at least installing Conky and starting it up.  If not, play around with the instructions in that Lifehacker article and come back here afterwards.

Now, I noticed that one of my conky script files was a file called “hddmonit.sh” which contained the text:

#!/bin/bash
echo “$(nc localhost 7634 | cut -d’|’ -f4)”

Now, using a little bit of deduction, I figured that this file used a command called “nc localhost 7634” to display a little bit of information, and then used pipe commands (the little “|” symbol) to further splice the info, extracting just the temperature of my laptop’s hard drive.

So, while “nc localhost 7634” outputted this:

|/dev/sda|ST980815A|43|C|

Using the command “(nc localhost 7634 | cut -d’|’ -f4” would output just “43”, which was the temperature of my hard drive.

(The “cut” command splices out specific text from a string it’s given, in this case the fourth (-f4) chunk of text seperated by a “|” chracter.)

Now, I learned that the “i8k” module, once loaded, could be accessed with the file at  “/proc/i8k”, which just contains a string like:

1.0 A32 7GGGGGG 53 -22 1 -22 90300 -1 2

From this you can see various Dell-specific information, the important part being “53”, which was my current processor temp.  (The items in the string are separated by spaces.)

So, I quickly made myself a new script file called “i8ktemps.sh” copying the contents of “hddmonit.sh” and changing them to:

#!/bin/bash
echo “$(head /proc/i8k | cut -d’ ‘ -f4)”

This file, when executed, will just output the fourth “chunk” in the file “/proc/i8k”, which as you remember is my current processor temp.

Now, I needed to edit my Conky configuration file, which is located in your home folder and is called “.conkyrc”.

Then I simply located the line:

${font weather:size=28}x ${font}HDD ${execi 1 ~/scripts/hddmonit.sh}C

Which displayed my hard drive temperature, and changed it to:

${font weather:size=28}x ${font}CPU ${execi 1 ~/scripts/i8ktemps.sh}C HDD ${execi 1 ~/scripts/hddmonit.sh}C

Which, when Conky was restarted, would display my hard drive temperature and my current processor temperature.

See?  It’s not that hard to program this stuff!  I did this all, both programming in the Linux “Bash” shell and coding in Conky’s personal configuration code, without any experience in either.  I just looked at what was there, and changed it.

Relevant Links:

http://www.arachnoid.com/linux/shell_programming.html

http://ubuntuforums.org/showthread.php?t=411800

http://www.linuxcommand.org/wss0010.php

Categories
Life Linux Science and Technology

My Great New Phone with Several Horrendous Shortcomings

Would you buy a cell phone if it was really, really, really cool, and could help organize your life, and had web connectivity and GPS and all sorts of other neat stuff, but couldn’t make calls inside your house because of service problems?

Oh — you wouldn’t? Well, screw you, no one cares what you think anyway!

Well, I did it — I went and bought a G1. If you don’t know what a G1 is, it’s Google’s first foray in to the world of cellular telephones — a cell phone, made by a company called HTC, running Google’s Android mobile phone operating system.

It really is a great phone — more like a tiny computer. It links up and syncs completely with your Google account (a great boon for disorganized people like myself — now my cell phone, which is with me always, can remind me of things I set on my computer, which is not with me always).

It has built-in WIFI access, built-in GPS, and to top it all off, the entire thing is running on top of a Linux installation (that you can hack the shit out of if you want to).

That being said, there are certain… issues with the G1.

Number one:  the battery life, or lack thereof. And this isn’t just the usual “Oh, my battery doesn’t last for 15 days, therefore it stinks.” No, no, no. I can fully charge my G1, let it sit there, maybe browse the net a few times, poke around here and there, and 22 hours later it’s dead. And this isn’t even with me even really doing anything on the phone. I’m just practically letting it sit there.

In converse, Nina can sit there with her Blackberry Curve browsing the net, sending SMS, Twittering, and her battery lasts for about three days.

Of course — I can live with that. It’s a powerful device — it needs a lot of power. It’s like a small computer, like I said — if I had a laptop with a battery that lasted for 22 hours, I’d be really happy!

However, here’s the practical dealbreaker — the G1 has no UMA. What’s that, you may ask? It’s a technology that allows (modern) cell phones to make calls over your home’s WIFI internet, using your regular cell phone minutes — it’s kinda of like having a super-strong cell phone tower in your house, with unlimited reception.

Never a dropped call, crystal clear connection — it’s amazing.

More importantly, if you live in an area with poor cell phone reception (say, you can receive calls outside your house but not inside, or you’re roaming inside your house, or whatever), UMA pretty much fixes that.  And it’s seamless, too — you can make a call inside your house, go outside, and it doesn’t get dropped, and vice-versa.

The G1 not having this, in the area where we live, makes it almost useless inside our home (where I’m spending most of our time if I’m not at work, and thus too busy to use my phone).

Sigh.

(Still deciding what to do about this.)

Categories
Linux Programming Science and Technology

Google Earth 5.0 Installation Problems

Nabble – ubuntu-users – Google Earth 5.0 Installation Problems.

Wondering why your brand new installation of Google Earth 5.0 isn’t working in Ubuntu?  Is it crashing after it gets done with the splash screen, or generally just not starting up?

An odd problem, but one with an easy fix — just go to the folder where you installed Google Earth (the program files, not the shortcut), and delete or move the file called “libcrypto.so.0.9.8”.

And that’s it — wierd, but it works.