Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 01 Sep 2014, 22:50
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Run an X app as another user (e.g. spot)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
rssnow

Joined: 01 Oct 2005
Posts: 1

PostPosted: Sat 01 Oct 2005, 13:09    Post subject:  Run an X app as another user (e.g. spot)  

Code:

#!/bin/sh

if [ $# -lt 2 ]
then echo "usage: `basename $0` clientuser command" >&2
     exit 2
     fi
     
     CLIENTUSER="$1"
     shift
     
     # FD 4 becomes stdin too
     exec 4>&0
     
     xauth list "$DISPLAY" | sed -e 's/^/add /' | {
     
         # FD 3 becomes xauth output
             # FD 0 becomes stdin again
                 # FD 4 is closed
                     exec 3>&0 0>&4 4>&-
                     
                         exec su - "$CLIENTUSER" -c \
                                  "xauth -q <&3
                                            exec env DISPLAY='$DISPLAY' "'"$SHELL"'" -c '$*' 3>&-"
                                           
                                            }


This script, saved as su.sh, and chmod +x su.sh can be used for example
to run xchat as user spot:

./su.sh spot xchat

Richard Snow
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Sat 01 Oct 2005, 14:43    Post subject:  

that's a useful script ... but Puppy does not have xauth ... and it won't run rxvt as spot
Back to top
View user's profile Send private message 
informix

Joined: 28 Mar 2006
Posts: 2

PostPosted: Tue 28 Mar 2006, 05:29    Post subject: xauth missing  

Hey .... and where do I get a dotpup that includes xauth ?

It damn neccessary for e.g. nxclient.

And I also wonder why there is no libstdc++-6.X already in puppylinux. I found a package that is 88Kb big and should fit into the def. distribution.
Back to top
View user's profile Send private message Visit poster's website 
ICQ Number 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0496s ][ Queries: 12 (0.0112s) ][ GZIP on ]