ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] Time - A bad command


From: Christian Gennerat
Subject: [RP] Time - A bad command
Date: Mon Mar 25 05:12:16 2002

The problem with the "time" command is that the
date and time displayed are not compliant with the
LC_TIME setting.

And "time" cannot be re defined by an alias, because
it is a command
So, delete the "time" command (RatPoison gets smaller)
and define an alias:
# Display date according LC_TIME
alias time exec ratpoison -c "echo $(date)"
or
# Display date with a personal format
alias time exec ratpoison -c "echo $(date '+%A %e %B %Y  -  %T')"

--- ratpoison-1.1.0/src/actions.c.orig Thu Feb 14 19:24:23 2002
+++ ratpoison-1.1.0/src/actions.c Fri Mar 22 18:52:58 2002
@@ -22,7 +22,6 @@
 #include <sys/wait.h>
 #include <X11/keysym.h>
 #include <string.h>
-#include <time.h>

 #include "ratpoison.h"

@@ -35,7 +34,6 @@ static user_command user_commands[] =
     {"abort",  cmd_abort, arg_VOID},
     {"banish",          cmd_banish,     arg_VOID},
     {"bind",  cmd_bind, arg_VOID},
-    {"time",   cmd_time,  arg_VOID},
     {"colon",   cmd_colon, arg_STRING},
     {"curframe",        cmd_curframe,   arg_VOID},
     {"delete",   cmd_delete,  arg_VOID},
@@ -1027,27 +1008,6 @@ char *
 cmd_quit(int interactive, void *data)
 {
   kill_signalled = 1;
-  return NULL;
-}
-
-/* Show the current time on the bar. Thanks to Martin Samuelsson
-   <address@hidden> for the patch. Thanks to Jonathan Walther
-   <address@hidden> for making it pretty. */
-char *
-cmd_time (int interactive, void *data)
-{
-  char *msg, *tmp;
-  time_t timep;
-
-  timep = time(NULL);
-  tmp = ctime(&timep);
-  msg = xmalloc (strlen (tmp));
-  strncpy(msg, tmp, strlen (tmp) - 1); /* Remove the newline */
-  msg[strlen(tmp) - 1] = 0;
-
-  marked_message_printf (0, 0, " %s ", msg);
-  free (msg);
-
   return NULL;
 }







reply via email to

[Prev in Thread] Current Thread [Next in Thread]