LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-01-2003, 07:53 PM   #16
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30

Hm...i did it. it dounded like it should have worked but didnt..

here's the snippet..

# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
if [ -x /usr/share/apps/switchdesk/Xclients.$1 ]; then
exec -l $SHELL -c "$SSHAGENT /usr/share/apps/switchdesk/Xclients.$1";
fi;
# This is inserted by me..help of wapcaplet from LQ
if [-x "$HOME/.xprofile" ]; then
.$HOME/.xprofile
fi
case $1 in
failsafe)
exec -l $SHELL -c "xterm -geometry 80x24-0-0"
;;
gnome)
exec -l $SHELL -c "$SSHAGENT gnome-session"
;;
kde|kde1|kde2)
exec -l $SHELL -c "$SSHAGENT /usr/share/apps/switchdesk/Xclients.kde"
;;

Whe i restarted, my wheel didnt work, but when i typed
./.xprofile in my home dir, the script ran and it worked..

I don't really know how scripting works, but ti LOOKS like it should have!
 
Old 11-01-2003, 08:12 PM   #17
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
maybe you should try out the original idea. Add

xmodmap -e "pointer = 1 2 3 6 7 4 5"

to /etc/xinit/xinitrc.

BUT backup the file (maybe even the whole /etc/X11 tree) before you do it and be sure you know how to deal if X fails to start up (you'll have to put back the file and startx).
 
Old 11-01-2003, 08:20 PM   #18
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
:O

I'm not sure I'm ready to try that yet


You'd think there would be an easier way to get a script to run at startup!
 
Old 11-01-2003, 08:33 PM   #19
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
Look here:
http://www.linuxquestions.org/questi...hreadid=102349
I thought I had heard the same problem before. The solution is to place the line in
/etc/X11/Xsession

I would still backup the x config files just in case. It should be all right though. You're not trying to do something major. But I won't guarantee it :P
 
Old 11-01-2003, 08:55 PM   #20
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
Alrite, trying it, will post after rebooted...

I know everyone will be on the edge of your seats!
 
Old 11-01-2003, 09:08 PM   #21
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
If you can believe it, it still doesn't get run..
I did this:
went to /etc/X11/xdm

edited Xsession

# now, we see if xdm/gdm/kdm has asked for a specific environment
case $# in
1)
if [ -x /usr/share/apps/switchdesk/Xclients.$1 ]; then
exec -l $SHELL -c "$SSHAGENT /usr/share/apps/switchdesk/Xclients.$1";
fi;
# This is inserted by me..help of wapcaplet from LQ
if [-x "$HOME/.xprofile" ]; then
.$HOME/.xprofile
fi


xmodmap -e "pointer = 1 2 3 6 7 4 5"
case $1 in
failsafe)
exec -l $SHELL -c "xterm -geometry 80x24-0-0"
;;
gnome)
exec -l $SHELL -c "$SSHAGENT gnome-session"
;;
kde|kde1|kde2)
exec -l $SHELL -c "$SSHAGENT /usr/share/apps/switchdesk/Xclients.kde"
;;
twm
...

funny that it worked for the guy in the other post..

Last edited by Tyir; 11-01-2003 at 09:09 PM.
 
Old 11-01-2003, 09:40 PM   #22
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
hmm. How about adding it to /etc/xinit/xinitrc, then? BTW, you don't have to reboot. Just restart X which should happen if you log out.
 
Old 11-01-2003, 09:53 PM   #23
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
for me, there is no /etc/xinit (?)
Im running RH9...

heres a section of the ls -a
X11
gtk pango xinetd.conf
gtk-2.0 paper.config xinetd.d
host.conf passwd xml
hosts passwd- xpdfrc
hosts.allow passwd.lock yp.conf
hosts.deny pbm2ppa.conf
hotplug pcmcia
[robert@localhost etc]$
 
Old 11-01-2003, 10:06 PM   #24
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
Sorry, I meant /etc/X11/xinit/xinitrc. The thing you mention in the first post. Beware, though. I am shooting in the dark...

If all else fails, you could create a script, make it *executable* and then place it on the desktop so you just have to double click it. Maybe there is also a way to autostart something in gnome. The script would be

#!/bin/bash
xmodmap -e "pointer = 1 2 3 6 7 4 5"
 
Old 11-01-2003, 10:12 PM   #25
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
Does it LOOK like i have TIME to double click a file!??!

I guess me wasting all this time is a little silly, but it SHOULD be able to be done, right?

Hey, if I wanted ot do it the eays way I still be running 2k wouldn't i :P


yea, i was being silly about not ebing able to find it....Except I don't know where in the script I should put it...


#!/bin/sh
# (c) 1999-2002 Red Hat, Inc.

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources
sysmodmap=/etc/X11/Xmodmap
sysxkbmap=/etc/X11/Xkbmap

# merge in defaults
if [ -f "$sysresources" ]; then
xrdb -merge "$sysresources"
fi

if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi

# merge in keymaps
if [ -f "$sysxkbmap" ]; then
setxkbmap `cat "$sysxkbmap"`
XKB_IN_USE=yes
fi

if [ -f "$userxkbmap" ]; then
setxkbmap `cat "$userxkbmap"`
XKB_IN_USE=yes
fi

if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config`
if [ -n "$xkbsymbols" ]; then
setxkbmap -symbols "$xkbsymbols"
XKB_IN_USE=yes
fi
fi
fi
# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
if [ -f "$sysmodmap" ]; then
xmodmap "$sysmodmap"
fi

if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi
fi

unset XKB_IN_USE

# run all system xinitrc shell scripts.
for i in /etc/X11/xinit/xinitrc.d/* ; do
if [ -x "$i" ]; then
. "$i"
fi
done

# The user may have their own clients they want to run. If they don't,
# fall back to system defaults.
# set up ssh agent environment if available.

if [ -f $HOME/.Xclients ]; then
[ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
exec ssh-agent $HOME/.Xclients || \
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
[ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
exec ssh-agent /etc/X11/xinit/Xclients || \
exec /etc/X11/xinit/Xclients
else
# failsafe settings. Although we should never get here
# (we provide fallbacks in Xclients as well) it can't hurt.
xclock -geometry 100x100-5+5 &
xterm -geometry 80x50-50+150 &
if [ -x /usr/bin/netscape -a -f /usr/share/doc/HTML/index.html ]; then
netscape /usr/share/doc/HTML/index.html &
fi
if [ -x /us exec fvwm2
else
exec twm
fi
fi
r/X11R6/bin/fvwm2 ]; then
 
Old 11-01-2003, 10:13 PM   #26
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
Am i wrong when this part

if [ -f $HOME/.Xclients ]; then
[ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
exec ssh-agent $HOME/.Xclients || \
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
[ -x /usr/bin/ssh-agent -a -z "$SSH_AGENT_PID" ] && \
exec ssh-agent /etc/X11/xinit/Xclients || \
exec /etc/X11/xinit/Xclients

looks like all I have to do is name the script .Xclients and put in in my home?
 
Old 11-01-2003, 11:43 PM   #27
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
ughuhhhuuuu. Dunno. You can try it with a ~/.Xclients. If it doesn't work, you can always erase it. I would try placing xmodmap thing right before the part you quote - only because if you place it after, it won't get executed if I'm understanding it right.
 
Old 11-01-2003, 11:45 PM   #28
quatsch
LQ Addict
 
Registered: Aug 2003
Location: New York, NY
Distribution: gentoo, gentooPPC
Posts: 1,661

Rep: Reputation: 48
Another thing that came to mind. If you are booting straight into graphical login or even use auto login, maybe you could place that line in
/etc/rc.d/rc.local
this is the startup script taht gets run after everything else is run so maybe it'll work.
 
Old 11-02-2003, 03:33 AM   #29
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
Tyir, in the code snippet I gave you, you need to have a space between the "." and "$HOME". I think that may be the reason it's not working.
 
Old 11-02-2003, 03:45 PM   #30
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
I did both...added the space and added the line in /etc/rc.d/rc.local..
still no......
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I edit .xinitrc? JohnStormrider Linux - Newbie 6 09-02-2005 06:19 PM
xinitrc in libranet? how do i execute a command on x startup? bleargh Linux - Software 6 12-11-2004 11:00 PM
make a command run at startup? cheater1034 Linux - General 2 09-12-2004 05:51 AM
How can I run a command automatically at startup? luwigie Linux - General 8 08-26-2004 09:05 PM
When I edit .xinitrc, X will not start... QtCoder Slackware 2 11-09-2003 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration