Bug#140858: RFP: gtktrue -- gtk front-end for /bin/true
Package: wnpp
Version: N/A; reported 2002-04-01
Severity: wishlist
* Package name : gtktrue
Version : 0.1.2
Upstream Author : Joachim Nilsson <joachim.nilsson@mds.mdh.se>
* URL : http://www.mds.mdh.se/~dat95jnn/linux/gtrue/
* License : GPL
Description : gtk front-end for /bin/true
This package is unfortunately not being maintained upstream.
Perhaps a Debian developer would like to adopt it, and win the
unending gratitude of its users.
Also, I have an important patch. I include the email I sent to the
author about this patch. (The author has not responded.)
--- Begin forwarded mail ---
Joachim,
I ran into a problem using gtktrue in a script. The script would
not complete if the user was not around to click on "Ok". I think
power-users of gtktrue (such as myself) would like to be able to use
it non-interactively. So I made a patch for this. When invoked
with --batch-mode, gtktrue will display its message for a second,
then exit.
I understand that you are not very interested in maintaining gtktrue
anymore. However, I still hope you will accept this patch, as it is
critical for anyone using gtktrue in enterprise applications.
Andrew
PS. I oberved that there weren't enough code formatting styles in
the program, limiting its pedagogic value. I have made a small
effort towards correcting this.
--- ./src/main.c.orig Sun Nov 21 09:07:29 1999
+++ ./src/main.c Thu Mar 28 11:05:14 2002
@@ -49,6 +49,8 @@
_("Compatible mode"), NULL},
{ "display", 'd', POPT_ARG_STRING, &display, 3,
_("Dispay to be used."), _("host.domain:0.0")},
+ { "batch-mode", 'b', POPT_ARG_NONE, NULL, 4,
+ _("Batch mode"), NULL},
POPT_AUTOHELP
{ NULL, 0, 0, NULL, 0, NULL, NULL }
};
@@ -109,6 +111,10 @@
/* Set DISPLAY, but do not change system defaults ... */
if (0 != setenv ("DISPLAY", display, 0))
simulate_truth ();
+ break;
+
+ case 4:
+ batch_mode = 1;
break;
default:
--- ./src/callbacks.h.orig Thu Mar 28 10:58:25 2002
+++ ./src/callbacks.h Thu Mar 28 10:59:21 2002
@@ -22,6 +22,8 @@
#include <gtk/gtk.h>
+extern int batch_mode;
+
void take_over (void);
void whatisthematrix (char *truth);
void simulate_truth (void);
--- ./src/callbacks.c.orig Thu Mar 28 10:58:33 2002
+++ ./src/callbacks.c Thu Mar 28 10:59:38 2002
@@ -32,6 +32,7 @@
#include "support.h"
static int simulation_mode = 0;
+int batch_mode = 0;
static int no_absolute_truth = 1;
static char *optional_truth;
--- ./src/interface.c.orig Thu Mar 28 11:11:08 2002
+++ ./src/interface.c Thu Mar 28 11:10:16 2002
@@ -82,6 +82,10 @@
gtk_box_pack_start (GTK_BOX (hbox), text_label, FALSE, FALSE, 0);
gtk_label_set_justify (GTK_LABEL (text_label), GTK_JUSTIFY_LEFT);
+ if (batch_mode) {
+ gtk_timeout_add(1000, take_over, NULL);
+ } else {
+
hseparator = gtk_hseparator_new ();
gtk_widget_set_name (hseparator, "hseparator");
gtk_object_set_data (GTK_OBJECT (base_window), "hseparator", hseparator);
@@ -108,6 +112,7 @@
gtk_signal_connect (GTK_OBJECT (ok_button), "clicked",
GTK_SIGNAL_FUNC (on_ok_button_clicked),
NULL);
+ }
return base_window;
}
--- End forwarded mail ---
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux pimlott 2.2.20-madstop+ipsec+raid #4 Sat Feb 23 22:10:20 EST 2002 i586
Locale: LANG=C, LC_CTYPE=C
--
To UNSUBSCRIBE, email to debian-wnpp-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: