Thanks again Tony.

I have been playing with variations of your notes and now have a much better
feel for what I really want.  I would like to have user 'parts' log into an
xwindow screen and see the normal gnome screen.  Then, I would like to add
an icon the says 'Parts Dept'.   When the icon is clicked on, I would like
the parts application (ie, myprogram) to execute.  So, my real question is,
how do I add a fresh icon and startup script file to the gnome window?

Also, some time back, I found that .bash_profile in the users home directory
would not allow me to start the text based application properly. But I found
that if I disabled .bash_profile (by renaming it), this caused the users
.profile file to execute at login, and it brought the application up
properly.   That fixed my text logon problem, but now when I logon to the
gnome window, .profile does NOT get executed, and none of my application
flags get set.  What does the gnome logon default to when it cannot find
.bash_profile in the users home directory?

Thanks for all of your help.  This thing is starting to look very promising.
Billy Davis


----- Original Message -----
From: "Anthony E. Greene" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 1:37 AM
Subject: Re: Fw: Running text based application in a Window


> On 21-Jan-2003/09:53 -0500, Billy Davis <[EMAIL PROTECTED]> wrote:
> >Thanks Tony.  This looks like what I want, except  how do I specify a
> >different 'myprogram' for each login account?
>
> The GNOME session settings are inherently per-user. There is no way to set
> it once and have it apply to all users. You have to set it for each user,
> so setting the desired program is not a problem... except that this could
> be a lot of work if there are a lot of users.
>
> Another way to do this is to call a script from within each user's
> ~/.bash_profile. The script would check to see if it's running under X,
> then call the app appropriately.
>
> #!/bin/bash
> if [ -n "$DISPLAY" ]; then
>   gnome-terminal --title 'My Program' -x myprogram &
> else
>   myprogram
> fi
>
>
> Ideally, you'd put the users into groups and have the script run the
> correct app based on the user's group membership.
>
> #!/bin/bash
> for groupname in `grep $LOGNAME /etc/group | cut -f 1 -d :`
> do
>   case $groupname in
>     sales)
>       appname=salesapp;;
>     production)
>       appname=prodapp;;
>     execs)
>       appname=execapp;;
>   esac
> done
>
> if [ -n "$DISPLAY" ]; then
>   gnome-terminal -x $appname &
> else
>   $appname
> fi
>
>
> The way I wrote this, if more than one group matches, the app will be
> based on the last group to match. You can use the first match by adding an
> 'if' test before the 'case' statement:
>
> do
>   if [ -z "$appname ]; then
>     case...
>     esac
>   fi
> done
>
> I don't know of a way to use the "most significant" match. You basically
> have to manage group memberships in order for this to work.
>
> Tony
> --
> Anthony E. Greene <mailto:[EMAIL PROTECTED]%3E>
> OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
> AOL/Yahoo Messenger: TonyG05    HomePage: <http://www.pobox.com/~agreene/>
> Linux. The choice of a GNU generation <http://www.linux.org/>
>
>
>
> --
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to