Subject: FVWM: Again: desktop wishes

From: Kay Winkler <[email-masked]>
Date: Thu, 30 May 1996 12:17:52 +0200

... and is it possible to dynamically change the desktop names?

			Gruss
				Kay
============================================================
Kay Winkler        Planckstrasse 1         D-64291 Darmstadt
(49)6159/71-2551   Fax: (49)6159/71-2785   [email-masked]
============================================================
--
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: Kai Grossjohann <[email-masked]>
Date: 30 May 1996 13:43:21 +0200

>>>>> On Thu, 30 May 1996 12:17:52 +0200, Kay Winkler
>>>>> <[email-masked]> said:

  Kay> ... and is it possible to dynamically change the desktop names?

When I enter the following into FvwmTalk it produces an error:
    *FvwmPagerLabel 0 Bla
The error is (line continuation added for easier reading):
    [FVWM][executeModule]: <<ERROR>> No such module \
               /usr/local/ls6/lib/X11/fvwm2/sun4-sunos *FvwmPagerLabel

I would consider this to be a bug.  What do you all think?

kai
-- 
Life is hard and then you die.

---

From: <[email-masked]> (Charles Hines)
Date: Thu, 30 May 1996 09:03:58 -0400

>>>>> "Kay" == Kay Winkler <[email-masked]> writes:

Not currently, no.  But the next beta, theoretically.  FVWM doesn't
keep track of desktop names currently, only numbers.  The pager module
associates names with these numbers, so since the next beta version
should have code to support deleting of module configuration items,
you should be able to delete that pagers saved names, rename them,
then start a new FvwmPager, which would then have the new names.

Also, you can find this in the TO-DO list:

  - Improved FvwmPager (add/rename desktops on fly)

>>>>> "Kai" == Kai Grossjohann <[email-masked]> writes:

Kai> When I enter the following into FvwmTalk it produces an error:
Kai>     *FvwmPagerLabel 0 Bla
Kai> The error is (line continuation added for easier reading):
Kai>     [FVWM][executeModule]: <<ERROR>> No such module \
Kai>                /usr/local/ls6/lib/X11/fvwm2/sun4-sunos *FvwmPagerLabel

Kai> I would consider this to be a bug.  What do you all think?

Yup.  This is a long standing bug that I actually meant to fix in the
last release, but it was one of the things that got pushed back.  It
would be required for my above suggestion and I should have it fixed
in the next beta.

Actually, it could be done now if done in a separate file loaded w/ a
Read from the FvwmTalk, or via a variation of that little dynamic-menu
trick I posted a ways back (this is off the top of my head, so there
may be small mistakes here, but you should get the drift):

AddToMenu Utilities "Restart Pager" RunNewPager

AddToFunc RunNewPager "I" KillModule FvwmPager
+                     "I" Read .fvwm2rc-pagerdef
+                     "I" Module FvwmPager 0 5

And .fvwm2rc-pagerdef would just contain the module config for
FvwmPager, so you could edit it then just hit the menu item to get the
new pager.  Combine this with a simple FvwmForm window perhaps to
change the number of desks...hmmm...

And actually, if I make those changes I mentioned above, a nice
FvwmForm window could probably be created to do all that for you so
you wouldn't even have to edit any file manually (it'd all be done in
memory).

Although, maybe you can make an FvwmForm window that could create &
reread the file using existing functions...  I don't have time to play
with this right now (in fact, I've used up too much writing this note
as it is) but if anyone toys around with this idea, be sure to post it
to the list.

Chuck

---

From: Toshi Isogai <[email-masked]>
Date: Thu, 30 May 1996 09:12:34 -0600 (MDT)

>                /usr/local/ls6/lib/X11/fvwm2/sun4-sunos *FvwmPagerLabel

Here is a patch I made a while ago.
------

I made a patch for 2.0.42 to add commands to add and delete 
module configurations. From FvwmTalk, FvwmConsole or equivallent,

       DestroyModuleConfig <config>

will search lines starting with '*<config>' as a first word, delete 
them.  You can use Fvwm style wildcards. For example,

       DestroyModuleConfig FvwmWinListFont

will delete lines start with 'FvwmWinListFont' as a whole word.

       DestroyModuleConfig FvwmButtons*

will delete all lines starting '*FvwmButtons'.

To add new config lines, just like .fvwm2rc file,

       *FvwmButtonsRows 12

with no leading spaces.

You can easily re-customize modules with these commands without restarting
fvwm (Even easier with FvwmConsole).

Here is the patch. 
==================================
diff fvwm-dist/builtins.c fvwm/builtins.c
26a27,28
> char *sys_errlist[];
> #define strerror(e) sys_errlist[e]
diff fvwm-dist/functions.c fvwm/functions.c
51a52
>   {"DestroyModuleConfig", DestroyModConfig,  F_NOP,         FUNC_NO_WINDOW},
153,160c154,169
< 
<   while((!matched)&&(strlen(func_config[j].keyword)>0))
<     {
<       if(mystrcasecmp(function,func_config[j].keyword)==0)
< 	{
< 	  matched=TRUE;
< 	  /* found key word */
< 	  func_config[j].action(eventp,w,tmp_win,context,action, &Module);
---
>   
>   if( function[0] == '#' ) {
> 	/* skip comments */
> 	matched=TRUE; 
>   } else if ( function[0] == '*' ) {
> 	matched=TRUE;
> 	AddModConfig( eventp, w, tmp_win, context, taction, &Module);
>   } else {
> 	while((!matched)&&(strlen(func_config[j].keyword)>0))  {
> 	  if(mystrcasecmp(function,func_config[j].keyword)==0)		{
> 		matched=TRUE;
> 		/* found key word */
> 		func_config[j].action(eventp,w,tmp_win,context,action, &Module);
> 	  }
> 	  else
> 		j++;
162,164c171
<       else
< 	j++;
<     }
---
>   }
diff fvwm-dist/misc.h fvwm/misc.h
469a470,473
> void DestroyModConfig(XEvent *eventp,Window junk,FvwmWindow *tmp_win,
> 		unsigned long context, char *action,int* Module);
> void AddModConfig(XEvent *eventp,Window junk,FvwmWindow *tmp_win,
>  		unsigned long context, char *action,int* Module);
diff fvwm-dist/read.c fvwm/read.c
174a175,217
> 
> void AddModConfig(XEvent *eventp,Window junk,FvwmWindow *tmp_win,
> 		unsigned long context, char *action,int* Module)
> /* interface function for AddToModList */
> {
> AddToModList( action );
> }
> 
> /**************************************************************/
> /* delete from module configuration                           */
> /**************************************************************/
> void DestroyModConfig(XEvent *eventp,Window junk,FvwmWindow *tmp_win,
> 		unsigned long context, char *action,int* Module)
> {
>   struct moduleInfoList *this, *that, *prev;
>   char *info;   /* info to be deleted - may contain wildcards */
>   char *mi;
> 
>   action = GetNextToken(action,&info); 
>   if( info == NULL ) {
> 	return;
>   }
> 
>   this = modlistroot;
>   prev = NULL;
> 
>   while(this != NULL)    {
> 	GetNextToken( this->data, &mi);
> 	that = this->next;
> 	if( matchWildcards(info, mi+1) ) {
> 	  free(this->data);
> 	  free(this);
> 	  if( prev ) {
> 		prev->next = that;
> 	  } else {
> 		modlistroot = that;
> 	  }
> 	} else {
> 	  prev = this;
> 	}
> 	this = that;
>   }
> }        

==========end of patch======================================

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Toshi Isogai   磯貝利明

-- I am an ASIC engineer, not a sick engineer --

‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾