Saturday, September 19, 2009

GRUB2 Splash Images Must be DirectClass

Just a quick note that might save someone out there time. If you've upgraded to GRUB2 and can't get your custom splash image to work, try making sure your image is DirectClass

$ cd /boot/grub/images
$ convert robin.xpm -type truecolor -depth 8 robin.png
$ identify robin.png
robin.png PNG 640x480 640x480+0+0 8-bit DirectClass 26kb

If you don't specify the "-type truecolor" you'll get PseudoClass, which will silently not work.

Here's a article on how to upgrade to GRUB2 and enable splash images.

Friday, January 30, 2009

Wikipedia Picture of the Day as Wallpaper

This bash script downloads the Wikipedia Picture of the Day (POTD) and sets it as your KDE wallpaper. Works only with KDE 3.5 but probably could be adapted to KDE4 pretty easily. (Hint: Use dbus instead of dcop.) Written by Albert Thuswaldner. Wikipedia recently changed their POTD web pages, so I've made the necessary changes.

#!/bin/bash
# $Id: wikiwall 24 2007-09-02 20:00:08Z thuswa $
#
# Last modified Sun Sep 2 21:58:28 2007 on stalker
# Update count: 221
#
# Copyright (C) 2007 by Albert Thuswaldner, thuswa gmail com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the
# Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Purpose:
#
# Wikiwall is a bash script which will set the "picture of the day"
# (POTD) from en.wikipedia.org as your KDE desktop wallpaper.
# If you set it to autostart it will give you a new fresh background
# as you login in, on a daily basis.
# The wallpaper pictures are saved in the /tmp directory, a history of one
# week back in time is kept. The script does some basic checking
# if wikipedia is reachable and if the wallpaper already is the current one.
#
# Usage:
# 1.) put in ~/bin
# 2.) make executable
# 3.) test it!
# 4.) (at your option) run: wikiwall --set-auto
# to make it autostart at login
# 5.) Have a great time - all the time! ;)
#
# Tested:
#
# On OpenSUSE 10.2, should work on most Linux distros, and other UNIX flavours
# too albeit the arguments for the ping command have to be modified.
#
# Note #1: The file size of the POTD's at wikipedia are sometimes
# quite large (~10Mb), so you with a "broadband" connection,
# BE WARE!
#
# Note #2: The picture files that are downloaded will be stored in the
# /tmp/kde- directory. This script does not delete
# any of these files, so it is up to you. However,
# the way the file name is constructed:
# "wikiwall.00N", where N equals the current weekday (N=1..7),
# does so that only a maximum of one week of PTOD's will be
# stored on your computer.
#
# Note #3: It is up to you the user of this script to make sure that
# by doing this you honour the license of the artworks that
# you download. This should not be a problem in most cases
# since using a picture on your own private computer
# desktop is considered fair use.

# Get date in correct format
TD=`date +%F` #YYYY-MM-DD
WDN=`date +%u` #Weekday number

#Set temp file name
TMPTPL=/tmp/kde-$USER/wikiwall.00

# Set wikiwall to autostart
if [ "$1" = "--set-auto" ]
then
ln -s $PWD/wikiwall $HOME/.kde/Autostart/wikiwall
fi

# Revert back to yesterdays picture
if [ "$1" = "--revert" ]
then
WDN=`expr $WDN - 1`
if [ $WDN -eq 0 ]
then
WDN=7
fi
TMPFILE=$TMPTPL$WDN
dcop kdesktop KBackgroundIface setWallpaper $TMPFILE 8 # 8=Scale and crop
exit
fi

# Set wikipedia specifics
SITE[1]=en.wikipedia.org
SITE[2]=commons.wikipedia.org
PAGE[1]=${SITE[1]}/wiki/Template:POTD/$TD
PAGE[2]=${SITE[2]}/wiki/Commons:Picture_of_the_day

# get current wallpaper
CURRPIC=`dcop kdesktop KBackgroundIface currentWallpaper 0`
TMPFILE=$TMPTPL$WDN

echo $CURRPIC
echo $TMPFILE

if [ "$CURRPIC" != "$TMPFILE" ]
then

# check if wikipedia is reachable
if ping -c 1 -q -W 2 -w 2 ${SITE[1]} >/dev/null
then

for N in 1 2; do
# extract picture of the day url
POTD=`wget -qO - ${PAGE[$N]} | \
grep File: | sed -e "s,.*href=\",," -e "s,\",," | cut -d ' ' -f 1`

echo ${PAGE[$N]}

POTMP=${SITE[$N]}
POTDURL=$POTMP$POTD
# echo $POTDURL

# extract picture url
PICURL=`wget -qO - $POTDURL | \
grep Full\ resolution | sed -e "s,.*href=\",," -e "s,\",," | cut -d '>' -f 1`

if [ -n "$PICURL" ]
then
echo $PICURL

# get picture
wget -q -O $TMPFILE $PICURL

# set picture as desktop background
dcop kdesktop KBackgroundIface setWallpaper $TMPFILE 8 # 8=Scale and crop
exit
else
if [ $N -eq 1 ]
then
echo no PTOD found, fallback.
else
echo no PTOD found, no new wallpaper set.
fi
fi
done
else
echo wikipedia is unreachable, no new wallpaper set.
fi
else
echo wallpaper already set to current. Resetting.
dcop kdesktop KBackgroundIface setWallpaper $TMPFILE 8 # 8=Scale and crop
fi

Tuesday, November 14, 2006

Shovelware

Some of you may recognize the name Raymond Chen. He's a longtime Microsoft developer and a recognized expert on the Win32 API. It's his job to make sure that each new version of Windows is backwards compatible to the previous versions. Something he does extremely well and someone I admire.

I was reading his blog and happened on this entry.

After reading, my reaction was "Welcome to the world you helped create, Raymond!" Thinking about it more, that's not a fair statement, but I was amazed that he was unaware of what Windows users have to put up with. Or maybe he is aware but it just had never hit him so close to home.

Sure am glad that my computer is not 0wned by the PC vendors.

Bonus link just for grins: fearless.

Tuesday, October 03, 2006

A Pet Prayer

I hope the community will not mind a personal entry from me.

Early this morning, our dog's struggle with cancer ended.

Free Image Hosting at www.ImageShack.us

To you who fills my life with joy
And in whom I have placed my trust,
I ask for but a few kindnesses.
Count me as a member of the family,
Feeding me when I am hungry
And giving me a warm and comfortable place to sleep.
Keep me safe from harm
So I will have no cause to fear,
And tenderly care for me when I am sick.
Let me know by your voice and touch that you love me,
For your love is what sustains me.
Find time to play with me
And time to let me lie quietly by your side.
When I grow old and my days few,
Comfort me, treat me gently and humanely
And, please, do not let me suffer loneliness, indignities, or pain.
And when I have gone,
Think of me and of the friendship and happiness we have shared.
Do not be sad.
Smile at the memories
And share with me the ultimate peace
I have found in knowing and loving you.
--Anonymous


I wonder if I should change my IRC nickname. I think not. Send me your thoughts.

Tuesday, September 26, 2006

KTTS and the French Connection III

Over a year ago, I blogged about the sad state of free synthesizers for the French language. A few months ago, the Cicero synthesizer emerged as a solution. Since then, someone named JJL pointed me to his blog for another solution (French language). It uses a GPLed program called LLiaPhon to do text-to-phoneme conversion, and then uses mbrola to produce the audio. JJL even mentions how to get it working with KTTS - the KDE Text-to-Speech System.

Tuesday, July 18, 2006

"Pry-open source"

I think we all get stressed from time to time working on open source projects. "Why did they break the libs my app depends upon?" "I can't seem to convince the xyz team that they're making a mistake." "Why can't I get concensus on issue abc?" "I can't get any help from the 123 guys." etc. At times like these, it can be helpful to see how the other half lives in the closed source world.

Take a look at this hack for instance.

The article is well written, and the solution quite elegant, given the constraints the programmer is dealing with. But oh the pain! All so he can change one constant!

My heart goes out to him and other closed source developers. But I turn back to my KDE work and feel much better.

Sunday, June 25, 2006

KTTS and the French Connection II

Almost a year ago exactly, I blogged about the sad state of free synthesizers for the French language. Well, it seems finally someone has come up with a solution. Its called Cicero and you can get it here:

http://www.cam.org/~nico/cicero

I haven't tried it myself, but it should work with the KTTS Command plugin. Lemme know your successes/failures.