Archive for the ‘Linux’ Category

h1

Jaunty Lightscribe Labels

23 April, 2009

Well, Ubuntu, Kubuntu, and Xubuntu 9.04 (Jaunty Jackalope) were released today, amid joyous worldwide celebration [probably].

As we all know, one of the best parts of being a linux user and surely the best part of a new release is handing out liveCDs to hapless onlookers during airplane trips. See someone looking interestedly at your computer? Engage them in conversation! Extoll the virtues of an open source operating system! Convince them that they will surely go to hell unless they repent their proprietary sins and bask in the warm neon glow of a GNOME desktop!

But let’s face it, the average person off the street might be won over by your preaching, but the minute you hand them that memorex cd with sharpie scrawlings on it, they’re thinking “holy hell, these people are cheap!”

Well, we are. And that’s okay, it works for us. But people who are used to flashy microsoft boot disks may have a hard time taking a hand-burned liveCD seriously. Enter LightScribe, a neat bit of hardware that comes with a lot of computers that allows to you burn decorations on your cds. If your cd-rom drive isn’t LightScribe enabled you can get an external drive that is. You also need special media that tend to be a bit more expensive and difficult to find. The result is pretty cool, though.

So, without further ado, the labels I designed for the Jaunty, in Ubuntu, Kubuntu, and Xubuntu flavors. For more information on using lightscribe with Ubuntu, check out my previous post “Lightscribe for Ubuntu.”


Enjoy, and Happy Clicking!

Advertisements
h1

How to Fix Conky Flickering, Borders, and Drop Shadows

15 April, 2009

Conky is an awesome little program that displays a wide variety of system stats and is both lightweight and highly customizable.

I love Conky a lot, but it is known to have a bit of a temperament and if your script doesn’t contain some very specific commands it will fight with your window manager (compiz, metacity, etc) and nautilus, causing a wide variety of oddities, including but not limited to strange borders, flickering, disappearing desktop icons, and drop shadows where no drop shadows should be.

This quick how-to will explain how to fix these problems. It assumes that you have a basic working knowledge of how to edit the .conkyrc (aka conky config) file and how to restart conky. I’ve also included a copy of my personal .conkyrc for comparison or for your use should you wish.

There are two main causes of Conky malfunctions, conky conflicting with the window manager and conky conflicting with nautilus. You may have one or both, but luckily the solutions are quite easy.

If conky is repeatedly flickering, that means that it’s conflicting with nautilus. Add this string to the top section of your conky config to fix it:
# Use double buffering (reduces flicker)
double_buffer yes

If strange borders are appearing around conky, the desktop icons disappear, or conky casts a drop shadow, it means that conky is conflicting with your window manager. Add this string to the top section of your conky config to fix it:
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type override
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

You should also go through your config page and make sure none of these options are already present and set to different values. If so, delete them so only the ones above remain. Save the config file and restart conky!

I’ve found in 99% of cases, this fixes it. However, if you continue to have trouble, consult the conky man file for more troubleshooting tips. Conky also has it’s own irc channel on freenode, #conky, populated by people who are significantly more knowledgeable than me.

Now, here’s my conky config file, for your enjoyment.

# Use Xft?
use_xft yes
xftfont Gentium:size=8
xftalpha 0.8
text_buffer_size 2048
# Update interval in seconds
update_interval 1
# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0
# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type override
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
# Use double buffering (reduces flicker)
double_buffer yes
# Minimum size of text area
minimum_size 180 0
#maximum_width 200
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_margin 5
# border width
border_width 1
# Default colors and also border colors
default_color white
#default_shade_color black
#default_outline_color white
own_window_colour white
# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 35
gap_y 50
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2
# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2
# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
TEXT
${font Unnamed Melody:size=16}S${color B8A0C8}tatus${color}${font}
Operating System: ${alignr}Ubuntu 8.10
Kernel: ${alignr}${kernel}
CPU1: ${alignr}${cpubar cpu1 8,60}
CPU2: ${alignr}${cpubar cpu2 8,60}
RAM: ${alignr}${membar 8,60}
SWAP: ${alignr}${swapbar 8,60}
HDD: ${alignr}${fs_bar 8,60 /home}
Battery: ${alignr}${battery_bar 8,60 BAT0}
Temp: ${alignr}${acpitemp}°C
Uptime: ${alignr}${uptime}
${font Unnamed Melody:size=16}T${color B8A0C8}op${color} P${color B8A0C8}rocesses${color}${font}
1. ${top_mem name 1} ${alignr}${top_mem mem 1}
2. ${top_mem name 2} ${alignr}${top_mem mem 2}
3. ${top_mem name 3} ${alignr}${top_mem mem 3}
4. ${top_mem name 4} ${alignr}${top_mem mem 4}
5. ${top_mem name 5} ${alignr}${top_mem mem 5}
${font Unnamed Melody:size=16}N${color B8A0C8}etwork${color}${font}
${if_existing /proc/net/route wlan0}
Up: ${alignr}${upspeedgraph wlan0 8,60 8434A4 A672CF}
Down: ${alignr}${downspeedgraph wlan0 8,60 8434A4 A672CF}
Upload: ${alignr}${totalup wlan0}
Download: ${alignr}${totaldown wlan0}
Signal: ${wireless_link_qual eth1}% ${alignr}${wireless_link_bar 8,60 eth1}
Local Ip: ${alignr}${addr wlan0}
${else}${if_existing /proc/net/route eth0}
Up: ${alignr}${upspeedgraph eth0 8,60 8434A4 A672CF}
Down: ${alignr}${downspeedgraph eth0 8,60 8434A4 A672CF}
Upload: ${alignr}${totalup eth0}
Download: ${alignr}${totaldown eth0}
Local Ip: ${alignr}${addr eth0}
${endif}${else}${if_existing /proc/net/route eth1}
Up: ${alignr}${upspeedgraph eth1 8,60 8434A4 A672CF}
Down: ${alignr}${downspeedgraph eth1 8,60 8434A4 A672CF}
Upload: ${alignr}${totalup eth1}
Download: ${alignr}${totaldown eth1}
Local Ip: ${alignr}${addr eth1}
${endif}${else}
Network Unavailable
${endif}
${font Unnamed Melody:size=16}W${color B8A0C8}eather${color}${font}
Station: ${alignr}Auke Bay, AK
Current: ${alignr}${execi 600 conkyForecast --datatype=CC --location=USAK0024 --imperial --night}
Temp/Chill: ${alignr}${execi 600 conkyForecast --datatype=HT --location=USAK0024 --imperial --night}/${execi 600 conkyForecast --datatype=LT --location=USAK0024 --imperial --night}
Wind: ${alignr}${execi 600 conkyForecast --datatype=WD --location=USAK0024 --imperial --night --hideunits} ${execi 600 conkyForecast --datatype=WS --location=USAK0024 --imperial --night}
Sun: ${alignr}${execi 600 conkyForecast --datatype=SR --location=USAK0024 --imperial --night}-${execi 600 conkyForecast --datatype=SS --location=USAK0024 --imperial --night}
Forecast:
${voffset 0}${alignc 43}${execpi 600 conkyForecast --location=USAK0116 --datatype=DW --startday=1 --shortweekday --imperial --night} ${alignc 8}${execpi 600 conkyForecast --location=USAK0116 --datatype=DW --startday=2 --shortweekday --imperial --night} ${alignc -29}${execpi 600 conkyForecast --location=USAK0116 --datatype=DW --startday=3 --shortweekday --imperial --night} ${alignc -64}${execpi 600 conkyForecast --location=USAK0116 --datatype=DW --startday=4 --shortweekday --imperial --night}
${voffset 0}${alignc 75}${font ConkyWeather:size=28}${color BEA3EF}${execpi 600 conkyForecast --location=USAK0116 --datatype=WF --startday=1 --endday=4 --spaces=1 --imperial --night}${color}${font}
${voffset 0}${font Gentium:size=7}${alignc 48}${execpi 600 conkyForecast --location=USAK0116 --datatype=HT --startday=1 --hideunits --centeredwidth=3 --imperial --night}/${execpi 600 conkyForecast --location=USAK0116 --datatype=LT --startday=1 --hideunits --centeredwidth=3 --imperial --night} ${alignc -14}${execpi 600 conkyForecast --location=USAK0116 --datatype=HT --startday=2 --hideunits --centeredwidth=3 --imperial --night}/${execpi 600 conkyForecast --location=USAK0116 --datatype=LT --startday=2 --hideunits --centeredwidth=3 --imperial --night} ${alignc -40}${execpi 600 conkyForecast --location=USAK0116 --datatype=HT --startday=3 --hideunits --centeredwidth=3 --imperial --night}/${execpi 600 conkyForecast --location=USAK0116 --datatype=LT --startday=3 --hideunits --centeredwidth=3 --imperial --night} ${alignr 6}${execpi 600 conkyForecast --location=USAK0116 --datatype=HT --startday=4 --hideunits --centeredwidth=3 --imperial --night}/${execpi 600 conkyForecast --location=USAK0116 --datatype=LT --startday=4 --hideunits --centeredwidth=3 --imperial --night}${font}
${font Unnamed Melody:size=16}N${color B8A0C8}ow${color} P${color B8A0C8}laying${color}${font}
Title: ${alignr}${exec conkyRhythmbox --datatype=TI}
Artist: ${alignr}${exec conkyRhythmbox --datatype=AR}
Album: ${alignr}${exec conkyRhythmbox --datatype=AL}

If you want it exactly as is, you’ll need to download a few things:

Font: Unnamed Melody
Font: Gentium
Script: Conky Weather
Script: Conky Rythymbox

Make sure to follow the instructions carefully for the conky weather script, it’s a little fickle to set up.
Happy Clicking!

conky3

h1

HP Pavillion TX series Audio

8 April, 2009

I have an HP Pavillion tx2000z, and from a fresh install the audio was completely nonfunctional. After a goodly amount of work I have gotten pretty much everything working. Here’s how:

Firstly, we need to change our sound server. Intrepid (and presumably Jaunty) uses PulseAudio as the default audio server, but pulseaudio is not properly compatible with the realtek audio card in HP’s tx series. ALSA (Advanced Linux Sound Architecture) works much better.
Open up the Sound Preferences (System>Preferences>Sound) and change all the options to ALSA. For default mixer tracks, you want HDA NVidia (Alsa Mixer). Highlight the master track.
soundprefs

Next, a little bit of tweaking to ensure that all of our volume controls are on the same page.
Right click the volume control icon in the status tray and select preferences. Make sure it says HDA NVidia (Alsa Mixer) and that master is highlighted. Close that dialogue box and double click on the volume control icon to open up the channel mixer. “Headphone,” “PCM,” and “Front” should all be at max. The “Master” channel is the variable, that is when you want your audio soft you turn it down and when you want your audio loud you turn it up. The volume control icon in your status tray controls the master channel.
channelmixer1

Finally, just a little bit of command line work and we’ll be ready to jam.
sudo gedit /etc/modprobe.d/alsa-base
Scroll to the very bottom and add this string:
options snd-hda-intel model=hp
Save the file and restart your computer. When it’s back in the land of the living, your built-in speakers and headset jacks will be working, and it will automatically switch between them when you plug something in. I haven’t tested the built in mic- never had a reason to use it.

Happy Clicking!

h1

Lightscribe for Ubuntu

5 April, 2009

lightscribe labeled disk
[Photo Courtesy Wikimedia Commons]

My laptop came with a lightscribe enabled CD/DVD-RW drive. After I switched to Ubuntu I set about looking for a program that would allow me to burn labels to my discs. It took a lot of digging and several tries to find a solution that worked, so I’ll share it with you.

First, we need the lightscribe driver that allows your computer to talk with the hardware. Download it and install as you would any other .deb.

Next, we need the labeling software. After trying a few different programs I’ve settled on the LaCie labeler (download). It’s only available in .rpm format, so after it’s downloaded we’re going to need to do a little terminal work.
To convert a .rpm to a .deb, we need a program called alien:
sudo apt-get install alien
Now we can use alien to run the conversion:
cd ~/Desktop
sudo alien -k 4L-1.0-r6.i586.rpm

A .deb package will appear on the desktop and you can install it normally.

Cool, now we have our labeler installed. Just a quick test to insure everything’s ready to go, and you can start burning labels.
Run the labeler:
gksudo 4L-gui
The gksudo is important because printing disks requires root access. Watch your terminal: if, like for me, it starts to whine about libstdc++.so.5, you need to install one more thing:
sudo apt-get install libstdc++5

Finally, we need to add an icon to the applications menu so we can open the labeler easily. Right click on the applications menu and choose “edit menu”. Pick a submenu to place it (I chose graphics but it’s really up to you) then click “new item.” Think up a snappy name and enter “gksudo /usr/4L/4L-gui” in the command box. Hit close and then exit out of the menu editor.

Now you’re ready to start burning labels! A few hints to make your labeling as smooth as possible:

1. Lightscribe discs are specially coded so that they always start burning in the same place. If your label isn’t quite as dark as you want, just burn it again right over the existing label- it will line up perfectly.

2. Don’t leave lightscribe discs out in the sun or in excessive heat or they may fade. Because of the heat generated by computers, it may not be a good idea to use lightscribe for discs that are going to be sitting in your computer for long times, like music cds or dvds: nothing bad will happen to them except fading, though.

3. You can use any picture you want for a label but remember it’s grayscale only and the resolution isn’t great, so it’s best to use as simple an image as possible.

4. Hewlett-Packard (the kind corporate folks who make lightscribe) has a massive amount of disc designs for you to download free of charge in their Ideas and Design Center. Pick a theme pack and download the linux version, which is essentially a collection of image files that fit on a disc perfectly. Très magnifique!

COMING SOON: Lightscribe Labels for your Jaunty Jackalope LiveCDs!

UPDATE: If, after having followed the instructions above your lightscribe drive is not recognized, enter the following into your terminal:
sudo ln -s /usr/lib/liblightscribe.so.1 /usr/lib32/
sudo ln -s /usr/lib/liblightscribe.so /usr/lib32/
sudo ldconfig

h1

Uninstalling .deb Packages

29 March, 2009

.deb packages, for the uninitiated, are functionally equivalent to .exe’s in Windows. You download them and then run them and they install software, drivers, etc on your computer. They are somewhat more convenient than using apt-get in many situations and they often seem friendlier to newcomers. But beware, the .deb has a dark side.

Just like with apt-get, .deb’s each have a unique package name, and you need to know this to uninstall them. Unlike apt-get, there is no handy-dandy GUI equivalent to provide you with a list of packages currently installed should you forget this name. So, if you want to uninstall a .deb file but can’t remember the exact package name, be prepared to do some digging.

The first, fastest, and probably most painless way may seem a little unintuitive; download the package again. Go back to where you got it, download it again, and open it with gdebi package installer. It will show the package name along with various other tidbits of information. Once you have the package name you can delete the newly downloaded file, and then go seek and destroy the installed version. If this option is available to you, do it- it will save you many a headache. However, there may be times when it is not; if you don’t remember where you got it or it’s no longer available, etc. Don’t worry, it’s still possible to uninstall the file, I just can’t guarantee that you won’t want to kill yourself by the time it’s done.

Second method is to run a wildcard search using dpkg. This is also fairly painless, but it only works if the package name is somewhat obvious- which they aren’t always. The command to use:

dpkg -l '*keyword*'

Where keyword is any word or bit of word that might be in or close to the package name. Say I wanted to uninstall Open Office: a good keyword here would be open. The list of packages that comes up is pretty long, but Open Office is indeed there. You can narrow it down more but you risk accidentally cutting out the package you want. So keep your keywords as basal as possible.

If after running a wildcard search you still have not found your package name you will need to get somewhat medieval and search the installed packages by hand. It’s tedious, but there are a few tricks to  speed it up. If you think you know the first letter of the package, you can use a permutation of the previous command to narrow your list:
dpkg -l 'x*'
Where  x is your letter of choice.

You can also search through the packages using a semi-gui called aptitude. In your terminal:
gksudo aptitude
While not exactly intuitive, aptitude at least separates the installed packages into categories. The first place to check is the upper-level category “Obsolete and Locally Created Packages”. Chances are good your package is in there, but if it’s not you’ll need to sift through the other categories to find it.

Okay, so, assuming you haven’t just chucked your computer out the window by now, you probably have your package name. Now you can finally delete it! This may be a bit anticlimactic, but geekdom isn’t exactly known for edge-of-your-seat thrills. Here’s the command to nuke that son of a bitch:
sudo dpkg -r package

The whole process of uninstalling .deb’s is really quite annoying and I’m surprised some programmer hasn’t come up with a little tool to at least search packages efficiently. In all honestly, probably the best way to handle this is to keep a text file with the names of all packages you install via .deb. It’s inconvenient, but should the time come to delete the file you will be very happy you did it.