sm \- Displays a short text fullscreen
.SH SYNOPSIS
.B sm
-.RI [ text ]
+.RI [ text | - ]
.SH DESCRIPTION
.BR Screen\ Message
will display a given multi-line message as large as
.SH OPTIONS
.TP
.RI [ text ]
-Text to display at start up. Defaults to ":-)"
+Text to display at start up. Defaults to ":-)". If "-" is passed to sm,
+it will read the text to display from stdin.
.SH AUTHOR
This manual page was written by Joachim Breitner <nomeata@debian.org>,
tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
if (argc > 1)
- //tb.set_text(" ".join(sys.argv[1:]))
- gtk_text_buffer_set_text(tb, argv[1], -1);
+ if (!strcmp(argv[1], "-") ) {
+ // read from stdin
+ gchar text[1024];
+ int num = fread (text, sizeof(gchar),1024-1, stdin);
+ text[num] = '\0';
+ if (num>0 && text[num-1] == '\n') {
+ text[num-1] = '\0';
+ }
+ gtk_text_buffer_set_text(tb, text, -1);
+ } else {
+ gtk_text_buffer_set_text(tb, argv[1], -1);
+ }
else
gtk_text_buffer_set_text(tb, ":-)", -1);