[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: menu: suggestions - extending the menu files



> The menu package is amazingly flexible. :-)


(thanks!). (And, BTW, I agree with all that you said and I didn't
repeat).

> >  wait="t" or wait="nil" - some programs exit after output, but I want
> >  to read it first. (like how mc says push a key after it runs a cmd.)
> 
> This is a good idea, and can be implemented simalarly to my example with
> geometry. Some programs already implement this themselves, but it makes
> sense to put this in the menu files. For example, if we do this, pdmenu will
> be able to run programs in it's "pause" mode. (But, please, not 't' or
> 'nil', let's use true or false; we're not all emacs fans. ;-)
> 
> Another idea, which I have been using for a while: it's possible, and
> sometimes desirable to make an xterm not show up in "who", when it's running
> some random program. For example, I don't want to get write messages in the 
> xterm where I'm playing bsdgame's go fish (heck, I don't even want casual 
> users of my system to see me playing it ;-), so it'd be nice to be able to 
> pass -ut to xterm. I suggest we add a visible="" flag to the menu files, 
> which if set to "false", makes xterm get -ut. 
> 
> Combining that and the geometry, I get this:
> 
> function term()=\
>     "xterm " ifeq($visible,"false","-ut") \
> 	ifnmpty($geometry,"-geometry ") $geometry \
> 	" -T \"" title() "\"" ifnempty(icon()," -n " icon()) " -e " $command

Uhm, there's a slight problem with ifeq($visable, "false",...). If we assign
booleans to the string variables ($visable etc are essentially strings),
then I'd prefer them to by default to have the "0" value. But as
"" (the default value of the strings) is unequal to "false" the booleans
will by default be "true". This is indeed what you intend to happen in the
above case, but I'd rather it be reversed. Add to that that there is
already a (rather poorly documented --  I had to look for it
in the sources myself) "false" value for the strings (it's called "none", for
compatibilty reasons with the very old (pre menu-0.0) programmes), I'd 
prefer the following:

function term()=\
    "xterm " ifnempty($visible,"-ut") \
        ifnempty($geometry,"-geometry ") $geometry \
        " -T \"" title() "\"" ifnempty(icon()," -n " icon()) " -e " $command

> Maybe if Joost isn't too busy, we'll see something similar in menu someday..

The above is added to my menu.h (for the next release of menu). There
I've also added the following to menu.sgml ("+-"=changed, "+"= added):


+-  Preferred variables:
    The following aren't special for install-menus, but it's nice 
    (read: essential) to use the same variables for the same things.
    So, I'll suggest some here. If you want to invent new ones, please
    do so and mail them to me so that I can include them here.

    icon:    The location of the iconfile for this menuentry.
             If you don't have an iconfile, just leave out the icon=
	     in the menuentry.
    longtitle: For people that like descriptive titles (about one line)
             It is probably best to include this in your menuentries,
	     while the window-managers don't (by default) put it in the
	     menus. That way, people who want descriptive titles can
	     turn them on, but others don't need to use them.
    description:An even longer description (about 5 lines).
             For example, a description of the documentation in
	     the dwww generated html pages.

+  Suggested variables:
+    The following variables probably shouldn't appear often (or at
+    all) in the menu files supplied with packages. They are mostly
+    intended for use by local system managers. Nevertheless, it is
+    adviced that all debian systems use the following variable names:    
+    
+    visable: Some apps add entries to utmp the utmp file, so that
+	      "who" and friends know they are running (this is
+	      especially true for xterms etc). If $visable set
+	      (to anything other than "" or "none"), xterms &c will
+	      not write logging info to utmp. (may not work for
+	      your window manager).
+    geometry: For X apps, this will be the size of the (main) window
+	      that will be created (units in eighter chars or pixels,
+	      depending on type of main window (xterm or graphic)).
+	      If you as package maintainer want to use this, you should
+	      probably think about setting this variable somewhere
+	      in an Xresources file.
	      

--------------------------------------

Welcomming comments, typing errors, sweets, etc,

joostje
-- 
joost witteveen, joostje@debian.org

Potentially offensive files, part 5: /dev/random.
`head -c 4 /dev/random` may print 4-letter words (once every approx 4e8 tries).


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: