FVWM: Patch for FvwmTaskBar

From: Victor Vislobokov <victor_v_at_permonline.ru>
Date: Wed, 31 Oct 2001 04:59:02 +0500

Hi All!

There is little patch for FvwmTaskBar module.
It is allow locale depending tip for FvwmTaskBar clock and
change date format in this tip.

There is new configuration parameter FvwmTaskBarDateFormat.
Man page is updated too.


With best wishes
Victor Vislobokov
Perm, Russia

diff -u -r FvwmTaskBar/FvwmTaskBar.1 FvwmTaskBar.new/FvwmTaskBar.1
--- FvwmTaskBar/FvwmTaskBar.1 Tue Jul 3 13:21:14 2001
+++ FvwmTaskBar.new/FvwmTaskBar.1 Wed Oct 31 04:35:46 2001
_at_@ -215,7 +215,14 @@
 .IP "*FvwmTaskBar: ClockFormat \fIformat-string\fP"
 This option specifies the time format for the digital clock.
 It is a \fIstrftime(3)\fP compatible format string.
-By default it is "%R".
+By default it is "%R". There is 24 characters limit for string
+expansion. The string depends of locale settings now.
+
+.IP "*FvwmTaskBar: DateFormat \fIformat-string\fP"
+This option specifies the date and/or time format for clock tip.
+It is a \fIstrftime(3)\fP compatible format string.
+By default it is "%A, %B %d, %Y". There is 40 characters limit for
+string expansion. The string depends of locale settings now.
 
 .IP "*FvwmTaskBar: UpdateInterval \fIseconds\fP"
 Specifies how often the clock display should be refreshed, so that times of
diff -u -r FvwmTaskBar/FvwmTaskBar.c FvwmTaskBar.new/FvwmTaskBar.c
--- FvwmTaskBar/FvwmTaskBar.c Tue May 15 19:39:18 2001
+++ FvwmTaskBar.new/FvwmTaskBar.c Wed Oct 31 04:10:46 2001
_at_@ -50,6 +50,7 @@
 #include <sys/time.h>
 #include <sys/stat.h>
 #include <stdarg.h>
+#include <locale.h>
 
 #include <unistd.h>
 #include <ctype.h>
_at_@ -238,6 +239,8 @@
   char *s;
   int i;
 
+ setlocale(LC_ALL, "");
+
   for (i = 3; i < NUMBER_OF_MOUSE_BUTTONS; i++)
   {
     ClickAction[i] = DEFAULT_CLICK_N;
diff -u -r FvwmTaskBar/Goodies.c FvwmTaskBar.new/Goodies.c
--- FvwmTaskBar/Goodies.c Sun Dec 3 20:56:08 2000
+++ FvwmTaskBar.new/Goodies.c Wed Oct 31 04:24:26 2001
_at_@ -74,6 +74,7 @@
 int fontheight, clock_width;
 char *mailpath = NULL;
 char *clockfmt = NULL;
+char *datefmt = NULL;
 int BellVolume = DEFAULT_BELL_VOLUME;
 Pixmap mailpix = None;
 Pixmap wmailpix = None;
_at_@ -168,6 +169,7 @@
   "MailCommand",
   "IgnoreOldMail",
   "ShowTips",
+ "DateFormat",
   NULL
 };
 
_at_@ -237,6 +239,9 @@
   case 10: /* ShowTips */
     ShowTips = True;
     break;
+ case 11: /* DateFormat */
+ UpdateString(&datefmt, rest);
+ break;
   default:
     /* unknow option */
     return False;
_at_@ -392,7 +397,11 @@
 
   time(&timer);
   tms = localtime(&timer);
- strftime(str, 40, "%A, %B %d, %Y", tms);
+ if (datefmt) {
+ strftime(str, 40, datefmt, tms);
+ } else {
+ strftime(str, 40, "%A, %B %d, %Y", tms);
+ }
   last_date = tms->tm_mday;
 
   PopupTipWindow(win_width, 0, str);


--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Oct 30 2001 - 12:59:14 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:52 BST