Re: Gnome 1.4 Panel Launcher -- Netscape



On Friday 08 February 2002 02:43 pm, Bob Giesen wrote:
>    Before taking that step, I decided to try to figure out what
> xalf was doing with my commands.  So, I put my own "xalf" script
> earlier in my PATH and just had it print out its arguments.  It got
> "--title <Name field from launcher> /bin/sh -c <Command field from
> launcher>" as args.  I then simply modified my dummy xalf so that
> it would just strip off the title (in a roundabout way) and just
> run the command in a new shell.  The script looks like this:
>
> command=`echo "${*}" | sed 's/.* -c //'`
> /bin/sh -c "$command"
>
>    So, I've effectively removed xalf, if not physically -- and my
> launchers now work like a charm... which begs the question of what
> xalf would buy me if it behaved with all of my app's.  So, I'm
> wondering if I'm better off using xalf with those things with which
> it woll work and, if so, how else I might get around this problem
> with running Netscape 4.51...

   FYI, I came up with a script that will only bypass the "real" xalf 
for the desired app's.  I'll paste the contents here for anyone who 
wants it.  Just name it "xalf" and put it in your PATH before the 
other one gets called.  Use it -- or abuse it -- as you see fit. :-)

-- Bob


-- "I'm not a member of any organized political party, I'm a 
Democrat!" -- Will Rogers (1879-1935)



#!/bin/sh

# xalf -- dummy script for handling commands that /usr/X11R6/bin/xalf 
won't.
# Put this earlier in path than /usr/X11R6/bin/xalf.
# - If it finds a command that /usr/X11R6/bin/xalf is known to have
# trouble with, it strips " --title <launcher Name> /bin/sh -c " and
# just runs the <launcher Command> in a new shell.
# - Otherwise, /usr/X11R6/bin/xalf is called with the original 
arguments.
# Bob Giesen; February, 2002

# Put bar-separated (for egrep) list of app names in finnicky_list:
finnicky_list="netscape|ns"

# Get the whole command line, as entered in the launcher's Command 
field:
CommandLine=$(echo "${*}" | sed 's/.* -c //')

# Now, let's see what the executable is:
Command=$(echo $CommandLine | awk '{print $1}')

# Check to see if it's on our list of "troublesome" executables:
# If it's on the list, just call it without involving the "real" xalf;
# otherwise, call that xalf just as this script was called.
echo $Command | egrep "$finnicky_list"
if [ $? -eq 0 ]; then
    exec /bin/sh -c "$CommandLine"
else
    exec /usr/X11R6/bin/xalf "${ }"
fi



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