X Titles in tvtime
01:04 AM,
0 Comments
tvtime, my fave tv proggy for Linux, stuffs whacked "tagline" quips into its titlebar, like:
"tvtime: makes hamburgers taste like steakburgers",
"tvtime: plop, plop, fizz, fizz, oh what a relief it is!",
"tvtime: sometimes you feel like a nut. sometimes you don't",
"tvtime: nobody better lay a finger on my tvtime"...
Well, I'd rather have my program name display from XMLTV. Since tvtime is already parsing xmltv stuff, it's just a matter of dumping it to the window title.
I asked the tvtime people to do it, through a sourceforge bug report of sorts, but got sick of waiting. So, I looked around their code, and it actualy was pretty simple. Here's a context diff of the hack:
*** src/commands.c Sat Nov 1 14:11:15 2003
--- src/commands.c Thu Aug 5 00:56:08 2004
***************
*** 40,45 ****
--- 40,47 ----
#include "utils.h"
#include "xmltv.h"
#include "tvtimeglyphs.h"
+ #include "xcommon.h"
+ #include "taglines.h"
#define NUM_FAVORITES 9
#define MAX_USER_MENUS 64
***************
*** 259,264 ****
--- 261,268 ----
}
title = xmltv_get_title( cmd->xmltv );
+ if (title) xcommon_set_window_caption( title );
+ else xcommon_set_window_caption(taglines[ rand() % numtaglines ]);
if( xmltv_get_next_title( cmd->xmltv ) ) {
snprintf( next_title, sizeof( next_title ),