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 Sat 25 Oct 2014, 11:31
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 Posts_count  
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_website 
ICQ 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0688s ][ Queries: 11 (0.0213s) ][ GZIP on ]