This is a patch file for "wmfishtime" 1.24. It modifies the program's default behavior and adds some new option switches. Partial list of changes: * Add option switch to remove date (-d or --nodate) * Add option switch to remove fish (-f or --nofish) * Disable "seconds" hand by default * Add option switch to enable "seconds" hand (-s or --seconds) --- wmfishtime-1.24.old/fishmon.c +++ wmfishtime-1.24/fishmon.c @@ -24,7 +24,7 @@ */ #define _GNU_SOURCE -#define VERSION "1.23" +#define VERSION "1.23-mod-060227" /* general includes */ #include @@ -80,7 +80,11 @@ static FishMonData bm; static int enable_check_mail = 0; /* no mail check for default !!! */ static int new_mail = 0; /* no new mail for default !!! */ -static int broken_wm = 0; /* need broken windowmanager fix? */ + +static int broken_wm = 2; /* need broken windowmanager fix? */ +static int no_date = 0; /* suppress date? */ +static int no_fish = 0; /* suppress fish? */ +static int no_seconds = 1; /* suppress "seconds" hand? */ /* 34 sprites: * 0, 2, 4, 6, 8, 10, 12, 14 - fish left @@ -171,6 +175,7 @@ /* parse command line options */ parse_options(argc, argv); + if (no_fish) proximity = 1; /* zero main data structure */ memset(&bm, 0, sizeof(bm)); @@ -201,11 +206,13 @@ /* printf("button press\n"); */ break; case GDK_ENTER_NOTIFY: + if (no_fish) break; proximity = 1; for (ch = 0; ch < NRFISH; ch++) bm.fishes[ch].speed += (rand() % 2) + 1; break; case GDK_LEAVE_NOTIFY: + if (no_fish) break; proximity = 0; /* get fish moving again, but slowly - checking out */ for (ch = 0; ch < NRFISH; ch++) @@ -341,8 +348,7 @@ /* must redraw each frame */ anti_line(28, 24, hdx, hdy, 1, 0xbf0000); anti_line(28, 24, mdx, mdy, 1, 0x00aa00); - anti_line(28, 24, sdx, sdy, 1, 0xc79f2b); - + if (!no_seconds) anti_line(28, 24, sdx, sdy, 1, 0xc79f2b); } static void weed_update(void) @@ -567,7 +573,7 @@ sprintf(buffer, "%s %02d-%s", weekday[data->tm_wday], data->tm_mday, month[data->tm_mon]); - draw_string(2, 47, buffer); + if (!no_date) draw_string(2, 47, buffer); /* copy it to the "frequent use" buffer */ memcpy(&bm.bgr, &bm.rgb, RGBSIZE); @@ -1020,14 +1026,21 @@ { static int ch = 0; static struct option long_opts[] = { - { "h", no_argument, NULL, 1 }, - { "help", no_argument, NULL, 1 }, - { "v", no_argument, NULL, 2 }, - { "version", no_argument, NULL, 2 }, - { "c", no_argument, &enable_check_mail, 1 }, - { "check-mail", no_argument, &enable_check_mail, 1 }, - { "b", no_argument, &broken_wm, 1 }, - { "broken", no_argument, &broken_wm, 1 }, + { "h" , no_argument, NULL, 1 }, + { "help" , no_argument, NULL, 1 }, + { "v" , no_argument, NULL, 2 }, + { "version" , no_argument, NULL, 2 }, + { "c" , no_argument, &enable_check_mail, 1 }, + { "checkmail" , no_argument, &enable_check_mail, 1 }, + { "check-mail" , no_argument, &enable_check_mail, 1 }, + { "d" , no_argument, &no_date , 1 }, + { "nodate" , no_argument, &no_date , 1 }, + { "no-date" , no_argument, &no_date , 1 }, + { "f" , no_argument, &no_fish , 1 }, + { "nofish" , no_argument, &no_fish , 1 }, + { "no-fish" , no_argument, &no_fish , 1 }, + { "s" , no_argument, &no_seconds , 0 }, + { "seconds" , no_argument, &no_seconds , 0 }, { 0, 0, 0, 0 } }; @@ -1048,13 +1061,15 @@ static void do_help(void) { printf("Usage: wmfishtime [options]\n\n" - " -h\t--help\t\tshow this message and exit\n" - " -v\t--version\tshow version and exit\n" - " -c\t--check-mail\tenables check for new mail\n" - " -b\t--broken\tactivates broken window manager fix\n\n" + " -c\t--checkmail\tEnable check for new mail\n" + " -d\t--nodate\tDon't show date\n" + " -h\t--help\t\tDisplay this message and exit\n" + " -f\t--nofish\tDon't show fish\n" + " -s\t--seconds\tAdd a \"seconds\" hand\n" + " -v\t--version\tDisplay version and exit\n\n" "Yet Another Waste of CPU Cycles! Dock app clock with\n" - "shy fish, bubbles and mail check functionality (disabled by default).\n" - "Try out the man page wmfishtime (1x).\n"); + "shy fish, bubbles, and mail-check functionality\n" + "Mail-check is disabled unless -c or --checkmail is used.\n\n"); } static void do_version(void)