Subject: FVWM: Hostname in root menu

From: [email-masked] (Kevin Penrose)
Date: Tue, 17 Sep 96 14:22:45 EDT

Greetings:

I am trying to have the root menu (pop-up) have as its title
the name of the machine it's running on.  I assume I might have
to do something with M4 or CPP but I can't figure out what.  I
don't see anything in the fvwm doc's about putting something in 
the title dynamically.  Anyone know if it can be done?

TIA,

Kevin

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Joey Hess <[email-masked]>
Date: Tue, 17 Sep 1996 15:28:55 -0400 (EDT)

> the title dynamically.  Anyone know if it can be done?

I've done this with M4. I have 3 machines that all use the same fvwmrc
files, and I set up a hostname (and a host icon) in the FvwmButtons bar.
Warning: I am just learning M4, there are probably much better ways to
handle this.

# Handy capitalization functions from the M4 info pages:
define(`UPCASE', `translit(`$*', `a-z',`A-Z')')
define(`DOWNCASE', `translit(`$*', `A-Z', `a-z')')
define(`CAPITALIZE_WORD',`regexp(`$1', `^\(\w\)\(\w*\)',`UPCASE(`\1')`'DOWNCASE(`\2')')')

# Get base hostname, and capitalize 1st letter.
define(NAME_LEN,index(HOSTNAME,`.'))
# If NAME_LEN=-1, there isn't a fqdn.
define(BASENAME,ifelse(NAME_LEN,-1,HOSTNAME,substr(HOSTNAME,0,NAME_LEN)))
define(BASENAME,CAPITALIZE_WORD(BASENAME))
undefine(NAME_LEN)

Then it's just a matter of using BASENAME at some point in the menu
definition. I guess something like this:

AddToMenu "Desktop" "BASENAME" Title
+ ...

-- 
#!/usr/bin/perl -i\$q='$q',\$p='$p';eval\$q.\$\^I\n"#  #  [email-masked]
$q='print"$p$^I\n',$p='#!/usr/bin/perl -i';eval$q.$^I  #          Joey Hess
      "How appropriate, you fight like a cow." - - Guybrush Threepwood

---

From: [email-masked] (Kevin Penrose)
Date: Tue, 17 Sep 96 15:41:09 EDT

Thanks for your information on putting the hostname in the pop-up root
menu as the title.  However, I tried this and it doesn't seem to work.
Do the lines you sent go in the .fvwm2rc file or somewhere else?

Kevin

>     Date: Tue, 17 Sep 1996 15:28:55 -0400 (EDT)
>     From: Joey Hess <[email-masked]>
>     Mime-Version: 1.0
>     Content-Type: TEXT/PLAIN; charset=US-ASCII
>

---

From: Joey Hess <[email-masked]>
Date: Tue, 17 Sep 1996 17:57:30 -0400 (EDT)

> Do the lines you sent go in the .fvwm2rc file or somewhere else?

They go in .fvwm2rc, but you have to make sure the file is being processed
by fvwmM4. Man FvwmM4 for details.

-- 
#!/usr/bin/perl -lisubstr($_,39+38*sin++$y/9,2)=$s # [email-masked]
for($s='  '||McQ;$_='JOEY HESS 'x8;print){eval$^I} #         Joey Hess
               "true - do nothing, successfully" - - true (1)