File: PipeRead.xml

package info (click to toggle)
fvwm 1%3A2.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,968 kB
  • sloc: ansic: 145,836; xml: 17,096; perl: 7,237; sh: 5,100; makefile: 1,101; yacc: 688; lex: 187; sed: 11
file content (78 lines) | stat: -rw-r--r-- 2,239 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  "../docbook-xml/docbookx.dtd"
[
<!ENTITY % myents SYSTEM "../fvwm.ent" >
%myents;
]>

<!-- $Id$ -->

<section id='PipeRead'>
<title>PipeRead</title>

<cmdsynopsis>
	<command>PipeRead</command
	><arg choice='plain'
		><replaceable>command</replaceable
	></arg
	><arg choice='opt'>quiet</arg>
</cmdsynopsis>

<para>Causes fvwm to read commands from the output of the
<replaceable>command</replaceable>.
This
<replaceable>command</replaceable>
is executed by
<filename>/bin/sh</filename>
as if you typed it on the command line.  If the command consists
of more than one word it must be quoted.  Useful for building up
dynamic menu entries based on a directories contents, for
example. If the keyword
<fvwmopt cmd="PipeRead" opt="Quiet"/>
follows the command no message is produced if the
<replaceable>command</replaceable>
is not found.</para>

<para>Example:</para>

<programlisting>
<fvwmref cmd="AddToMenu"/> HomeDirMenu
PipeRead 'for i in $HOME/*; \
  do echo "+ $i <fvwmref cmd="Exec"/> xterm -e vi $i"; done'
</programlisting>


<para>Note: The
<emphasis remap='B'>PipeRead</emphasis>
changes the pointer to a watch cursor by default during
execution.  However, some commands, for example xwd, need to take
control of the pointer themselves and do not work.  To disable the
watch cursor, use the command prior to
<emphasis remap='B'>PipeRead</emphasis></para>

<programlisting>
<fvwmref cmd="BusyCursor"/> <fvwmref cmd="BusyCursor" opt="Read"/> off
</programlisting>


<para>The
<emphasis remap='B'>PipeRead</emphasis>
command executes synchronously.  If you want to
<fvwmref cmd="Exec"/>
something, but need the command to run synchronously,
you might do something like:</para>

<programlisting>
PipeRead 'command 1&gt;&amp;2'
</programlisting>

<para>The redirection causes any output from the program to go to stderr
instead of being read as a sequence of commands by fvwm.
<emphasis remap='B'>PipeRead</emphasis>
returns 1 if the given command could be executed or -1 if not
(see the section
<fvwmref sect="conditionals" opt="conditional_commands" name="Conditional Commands"/>
for the meaning of return codes).</para>

</section>