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

FWD: console login with speech output




I thought this might be useful: Fancylogin is a customizable replacement
for the console login prompt and when I asked about this before, the
best answer was to put a beep in the /etc/issue file ...


---- Begin included message ----
> a beep code in the issue file, but what would be simple to implement
> is if the text prompts and errors could be echoed to a named pipe or
> piped to a shell command; maybe it would fit in as part of the logging
> code.
I just added some support for speech output to fancylogin, but since Richard
Bergmair, our project leader, is not very happy with the speech output
support, I created a diff file that you can patch into the fancylogin 0.99.7
sources. It simply writes strings to /dev/speech (yesterday I installed 
festival and speechd to try that out), these strings can be customized by
editing the corresponding constants in login/config.h in the source tree.
Please tell me what you think about it, and what could eventually be improved.

Best regards,
Andreas Krennmair
-- 
Be careful with water -- it's full of hydrogen and oxygen!
diff -uNr fancylogin-0.99.7/login/config.h fancylogin-0.99.7-speech/login/config.h
--- fancylogin-0.99.7/login/config.h    Mon Oct 30 21:23:09 2000
+++ fancylogin-0.99.7-speech/login/config.h Thu Nov  9 15:31:04 2000
@@ -156,7 +156,15 @@
 #define MSG_SEENMAIL "You've got old mail."
 #define MSG_NOMAIL "No mails for you."
 
+#define HAVE_SPEECH
 
+#ifdef HAVE_SPEECH
+
+#define SPEECH_NAME_PASS "Please enter your username and password."
+#define SPEECH_FAILED_LOGIN "Log in failed. Please try again."
+#define SPEECH_LOGIN_SUCCESS "Log in successful."
+
+#endif
 
 
 #endif
diff -uNr fancylogin-0.99.7/login/login.c fancylogin-0.99.7-speech/login/login.c
--- fancylogin-0.99.7/login/login.c Mon Oct 30 18:56:37 2000
+++ fancylogin-0.99.7-speech/login/login.c  Thu Nov  9 15:30:31 2000
@@ -153,6 +153,15 @@
   while (1)
 #endif
     {
+#ifdef HAVE_SPEECH
+     FILE * f;
+     f = fopen("/dev/speech","a");
+     if (f!=NULL)
+       {
+         fprintf(f,SPEECH_NAME_PASS);
+         fclose(f);
+       }
+#endif
       fancy_prompt (username, password);
 
       if ((user = authenticated (username, password, rmthost))!=NULL)
@@ -167,20 +176,42 @@
           break;
         }
       else
-        draw_faillogon ();
-
+   {
+#ifdef HAVE_SPEECH
+     FILE * f;
+     f = fopen("/dev/speech","a");
+     if (f!=NULL)
+       {
+         fprintf(f,SPEECH_FAILED_LOGIN);
+         fclose(f);
+       }
+#endif
+     draw_faillogon ();
+   }
       cntwrong++;
       sprintf (errormsg, "login failed %d times", cntwrong);
       log_message (20000+cntwrong, errormsg);
     }
 
+#ifdef HAVE_SPEECH
+  {
+    FILE * f;
+    f = fopen("/dev/speech","a");
+    if (f!=NULL)
+      {
+   fprintf(f,SPEECH_LOGIN_SUCCESS);
+   fclose(f);
+      }
+  }
+#endif
+
 #ifdef TIMEOUT
   signal (SIGALRM, SIG_IGN);
   alarm (0);
 #endif
 
   close_prompt ();
-
+  
   if (user != NULL)
     {
       system_logon (user, rmthost, preserve);
---- End included message ----



-- 
Gary Lawrence Murphy <garym@xxxxxxxxxxx> TeleDynamics Communications Inc
Business Innovations Through Open Source Systems: http://www.teledyn.com
"Computers are useless.  They can only give you answers."(Pablo Picasso)


Emacspeak Files | Subscribe | Unsubscribe