Re: using TWM_VERSION

From: Rudolph Todd Maceyko (rm55+@pitt.edu)
Date: Sun Jun 16 1996 - 06:17:35 CEST


I'm replying to my own message because the dots didn't make it in the
first attempt...

-Rudy

Rudolph Todd Maceyko <rm55+@pitt.edu> writes:
> How do other people do it?
>
> I have the same home directory on many machines, some of which have
> differing versions of ctwm installed. Sometimes, there isn't even any
> ctwm.
>
> So I have conditionalized my .ctwmrc first by TWM_TYPE (useful like
> this: m4 .ctwmrc > .twmrc), and now my TWM_VERSION. *But*, m4
> apparently doesn't do floating-point operations, so I have to munge
> TWM_VERSION to usefully compare it.
>
> This is what I'm doing. What are *you* doing?
>
> Thanks,
> -Rudy
>
> --
> Rudy Maceyko <rm55+@pitt.edu>
> Computing & Information Services
> University of Pittsburgh
>
>
> divert(-1)dnl
> # protect shell commands against m4
> #
> changequote(,)
> changequote(%[,]%)
> ifdef(%[TWM_TYPE]%, %[]%, %[define(%[TWM_TYPE]%, %[twm]%)]%)
> ifdef(%[TWM_VERSION]%,
> %[define(%[dotpos]%, index(TWM_VERSION,%[.]%))
> ifelse(dotpos, -1,
> %[define(%[MY_TWM_VERSION]%, TWM_VERSION)]%,
> %[define(%[majorver]%, substr(TWM_VERSION, 0, dotpos))
> define(%[minorver]%, substr(TWM_VERSION, eval(dotpos + 1), eval(len(TWM_VE\
> RSION) - dotpos)))
> ifelse(eval(minorver < 10), 1, define(%[minorver]%, 0%[]%minorver))
> define(%[MY_TWM_VERSION]%, majorver%[]%minorver)]%)]%,
> %[define(%[MY_TWM_VERSION]%, 0)]%)
> define(%[SU]%, syscmd(test -f /usr/pitt/bin/asu)ifelse(sysval, 0, /usr/pitt/bi\
> n/asu, su))
> divert(0)dnl
> define(%[CONCAT]%, %[$1$2$3$4$5$6$7]%)dnl
>
> .
> .
> .
>
> Color {
> .
> .
> .
> ifelse(TWM_TYPE, %[ctwm]%, %[dnl
> MapWindowBackground "medium purple"
> MapWindowForeground "black"]%, %[dnl]%)
> }
>
> .
> .
> .
>
> TitleFont "6x13"
> ifelse(eval(MY_TWM_VERSION >= 304), 1,
> %[WorkSpaceFont "5x8"]%)
> .
> .
> .
> etc.



This archive was generated by hypermail 2.1.2 : Sat Jun 22 2002 - 06:45:02 CEST