FVWM: Hostname in root menu

From: Kevin Penrose <kpenrose_at_genesis.ml.com>
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 <joey_at_kite.preferred.com>
> Mime-Version: 1.0
> Content-Type: TEXT/PLAIN; charset=US-ASCII
>
> > 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?
>
> 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
> + ...
>
> --


--
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 majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Tue Sep 17 1996 - 14:47:21 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST