3 # extract_icon_back [<default pixmap name>]
5 # Uses WindowMaker's getstyle command to extract the icon pixmap from
6 # preferences, and print it.
7 # If the name returned by getstyle is not absolute, the right pixmap path
8 # is supposed to be declared in wmmenu's defaults file.
9 # If no pixmap is found in WindowMaker's preferences (f.e. in case of
10 # pixmap-less gradient), the string provided as command line argument is
11 # used instead (and is possibly empty or unspecified).
12 # NB: This script expects a POSIX / X/Open compatible AWK. Be aware that
13 # some GNU awk versions do not fulfill this requirement.
25 # Search first line marked "IconBack"
26 while (Ok =
((Command
| getline) ==
1)) {
27 if ($
1 ==
"IconBack") {
32 ReturnDefaultIfNot
(Ok
)
34 # Accumulate while not closed
35 while (IconBackLine !~
/\
);$
/) {
36 Ok =
((Command
| getline) ==
1)
38 IconBackLine=IconBackLine $
0
40 ReturnDefaultIfNot
(Ok
)
45 # analyze what we have: split on '= (' and ', "' or ', '
46 FS=
"(, ([\"]?))|(= \()"
49 if(TextureType ==
"spixmap" || TextureType ~
/^t
[hvd
]gradient$
/) {
56 function ReturnDefaultIfNot
(ok
) {