twm dynamic configuration files
Submitted by Preston Crow
Assigned to Xorg Project Team
Created attachment 89117 twm open .twmrc with popen() if executable
I've long wanted to use the same .twmrc on all the systems I use, but have been thwarted by the lack of any way to adjust it automatically for the needs of each particular system. I thought about adding some sort of include mechanism, passing the file through the C preprocessor, or something else, but I realized that the simplest solution is to use a script that generates the file. The simplest way to handle such a script is to have twm open the file with popen() to run it and parse the output instead of with fopen(). The attached patch does just this if the file is executable.
I'm sure this breaks on non-Unix file systems where there is no executable permission bit, but I've found the patch to be very useful to me, so this seemed like a good place to share it, and perhaps someone has a good general solution for those file systems.
Attachment 89117, "twm open .twmrc with popen() if executable":