Swimming in Wine

April 17th, 2007

I finally got a chance to play with editing beryl source code today. I read up on thedarkmaster’s blog, a tutorial about how to setup Dream Aquarium on Beryl. Only problem is, it takes up the entire screen and nothing can run above it. So, I’ve played with the state plugin within beryl to edit the attributes of the window so I can put it on the bottom of all the windows, full screened, and sticky. Here’s what I got so far:

screenshot.png

screenshot-4.png

Vista Installation Black Screen of Death

April 10th, 2007

Got a nice taste of the wonderful world of Vista today. I tried to install it on my Raid 0 (hpt374). I was excited that it let me load the drivers from a CD instead of a floppy disk. Progress! All goes well except once I reboot it tells me the install is corrupt. Can’t seem to find the winload.exe file. Of course it can’t, it hasn’t loaded the drivers for the raid yet! Went to the recovery console and I was right. No drivers were copied over. How does that make sense? So, I don’t know too much about how windows works and definitely not a lot about how Vista works, so I said forget it, I’ll install it on my regular old ATA drive.

Of course, I need to partition it. So I use ntfsresize (in linux) and fdisk (quick tutorial coming next post). Pop in the vista CD and… nothing. Sweet sweet blackness. OK, maybe more than nothing, it says its loading, I see the word “Microsoft” and a status bar, and then that disappears and then nothing. How convenient. Maybe I was supposed to just sit around and wait for a while, but I didn’t hear anything spinning around so I figured it was dead. Must have been the ntfsresize. I know I’m supposed to run chkdsk on the drive after I use ntfsresize, but I didn’t expect this kind of result.

So, to fix it, I pop in the Windows XP cd (thanksfully I had it around). Go into the command line, run chkdsk on the drive. Reboot using the Vista disk and voila, now it works. Finally got it working. All 7.5GBs of it.

Progress indeed.

Gaim Function Hijacking

April 9th, 2007

Although gaim allows plugins to do a lot of different things, sometimes it’s necessary to do something that I don’t think the developers ever intended. Gaim sends out signals to plugins when certain events happen, but sometimes those signals aren’t enough.

In my upcoming facebook plugin, I need to add info to the “Get Info” dialog (for away message stalking). Since there is no signal, I ended up hijacking the notify_userinfo function within the GaimNotifyUiOps structure. Details:

Code (c)

//NOTE: this isn’t a full plugin, so don’t try to compile this

//Will contain the notify_userinfo function we steal control from
void *(*hijacked_notify_userinfo) (GaimConnection *gc,
        const char *who, GaimNotifyUserInfo *user_info);

//this is my notify userinfo, this gets control after a GaimNotifyUserInfo
//is created and is about to be shown
static void *
my_notify_userinfo(GaimConnection *gc, const char *who, GaimNotifyUserInfo *user_info)
{
        //Do what we want to the user_info
        gaim_notify_user_info_prepend_pair(user_info, "Hijacked by", "Neaveru");

        //Now pretend like nothing happened, send control back to where its supposed to go
        return hijacked_notify_userinfo(gc, who, user_info);
}

static gboolean
plugin_unload(GaimPlugin *plugin)
{
        //Here we just return control to the normal notify_userinfo
        GaimNotifyUiOps *ops = gaim_notify_get_ui_ops();

        if (ops) //dunno why this wouldn’t be true
                ops->notify_userinfo = hijacked_notify_userinfo;

}

static gboolean
plugin_load(GaimPlugin *plugin)
{
        //Take a look at libgaim/notify.h for definitions of this var
        GaimNotifyUiOps *ops;
        ops = gaim_notify_get_ui_ops();

        //Check that ops and notify_userinfo exist, this is important
        //since technically if someone isn’t using the default gtkgaim,
        //they could have no notify_userinfo function
        if (ops && ops->notify_userinfo)
        {
                hijacked_notify_userinfo = ops->notify_userinfo;
                ops->notify_userinfo = my_notify_userinfo;
        }
        return TRUE;
}

And there you have it, now the order of events when you click on “get info” over a buddy:
1) The protocol plugin (ie oscar, irc etc) will generate a userinfo with all the info to show
2) The user info is sent to the ops->notify_userinfo function, which is now our function
3) Our function has its way with the userinfo. We then send it to the original notify_userinfo
4) The original notify_userinfo does whatever it was going to do before.

Take a look at libgaim/notify.h and libgaim/notify.c for more info

The nice thing about this is that you don’t even have to worry about other plugins stealing control of the user info before or after you. This will just chain them along.

gnome-dock

April 9th, 2007

Finally managed to get gnome-dock working on here.
Quick screenshot:

screenshot-cairo-dock.png

Quick how-to:
1) Get cairo from http://cairographics.org/download. I was able to just get the source and ./configure && make && make install, though some dependencies may be required. I also believe they have a deb file which I should have probably looked into.
2) Get Gnome-dock (cairo-dock) from http://www.gnome-dock.org/trac/browser/trunk
This I just downloaded the zip from the “Zip Archive” link at the bottom. I didn’t feel like messing with yet another source repository program.
3) I had had GL linking issues, so I had to install nvidia-glx-dev.
4) For whatever reason, in this version, the execute command was commented out. Uncomment this line:
g_spawn_command_line_async (icon->acCommand, &pError);
5) make
6) If all goes well this far, then run: mkdir ~/.cairo-dock and then copy some .desktop files over. (I just did a cp ~/Desktop/*.desktop ~/.cairo-dock

Facebook Status

April 9th, 2007

I’m currently writing a plug-in to integrate facebook into gaim. More details on it later, but I did manage to reach a minor milestone today:

screenshot-buddy-list.png

Notice between “Logged In:” and “Away Message:” there is a “Facebook Status”? Clearly, it needs a lot of work, but it’s a start. (By the way, the above away isn’t mine. Notice the logged in time of 21 hours? No chance. I’ve managed to crash gaim so many times, I don’t think I’ve been logged in for more than an hour straight)

Desktop

April 9th, 2007

As a first post, here’s what I’m working with:

desktop.png

This is a fresh install of Ubuntu Edgy Eft (6.10) with Beryl.