- To: Gary Lawrence Murphy <garym@xxxxxxxxxxx>
- Subject: login with speech output (was: fancylogin 0.99.7 - themeable console login program)
- From: Andreas Krennmair <a.krennmair@xxxxxxxxxxx>
- Date: Thu, 9 Nov 2000 15:46:04 +0100
- Delivered-To: garym@xxxxxxxxxxx
- Delivered-To: canada.com%garym@xxxxxxxxxxx
- In-Reply-To: <m3k8aebiw1.fsf@xxxxxxxxxxx>; from garym@xxxxxxxxxxx on Wed, Nov 08, 2000 at 10:09:18AM -0500
- User-Agent: Mutt/1.2.5i
> 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);