LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-11-2006, 04:10 PM   #1
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 647

Rep: Reputation: 38
xmodmap: at which script should i add the command?


hello everyone.
i have an 5-button MS intelliOptical mouse.. so i configured the xorg.conf as:
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/mouse"
Option "Buttons" "7"
Option "ZAxisMapping" "6 7"

then when i run kde, i have to run the command from console
xmodmap -e "pointer = 1 2 3 6 7 4 5" and the mouse works properly..
however i would like to add this command in some kde startup script to do this automatically everytime i startx.

searchin the forums i found :
http://www.linuxquestions.org/questi...+mouse+buttons
which basically says that i should put the command in a ~/.xsession file but i dont have that file, nor creating it help me (note that i didnt forget to invoke the bash shell b4 typing in the xmodmap command).

and also:
http://www.linuxquestions.org/questi...+mouse+buttons
where it said to place the xmodmap command in /etc/X11/xinit/xinitrc.d/Xmodmap which doesn't exist either.

where should i place the command????
thank you for your help
nass

ps im running slackware 10.2

Last edited by nass; 05-11-2006 at 04:54 PM.
 
Old 05-12-2006, 09:21 AM   #2
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 31
If you are using kde, the easiest place to put it is in /etc/X11/xinit/xinitrc.kde.

My understanding is that ~/.xsession is only used if full control of the X startup is passed to that file. Since it's the above script that is called when you start kde, your ~/.xsession is ignored, as far as I can tell.
 
Old 05-13-2006, 04:00 AM   #3
nass
Member
 
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 647

Original Poster
Rep: Reputation: 38
here is my xinitrc.kde:
#!/bin/sh
# $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
xmodmap $sysmodmap
fi

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

if [ -f $usermodmap ]; then
xmodmap $usermodmap # the default
fi
xmodmap -e "pointer = 1 2 3 6 7 4 5"


# Start the window manager:
startkde

I also tried replacing the "xmodmap $usermodmap # the default" with "xmodmap -e "pointer = 1 2 3 6 7 4 5"" and run it within the if statement.. no luck

it seems that i have to run it after kde has started. (perhaps after the "startkde" line) but startkde is binary so it can't be tweaked. You know of any one script that is run once the session has started?
nass
 
Old 05-13-2006, 05:52 AM   #4
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 31
Hmm, that's odd, that should have worked. I wonder if kde changes the pointer config? It shouldn't but you never know. One thing you could try is to put it in a script in ~/.kde/Autostart/. I assume that kde will run any script in there when it starts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/X11/xinit/.Xmodmap; run level 4 won't init script Potatopopper Slackware 5 11-27-2005 08:37 PM
xmodmap å, ä, ö, and ø - or how to add Compose to X BroX Slackware 3 10-31-2005 09:34 AM
command xmodmap not found during boot MatthiasOtto Linux - Software 4 02-17-2005 07:09 AM
bash: xmodmap: command not found Jalalabee Linux - Newbie 4 08-16-2003 10:41 PM
Bash script: add all numbers from command output wi-Z-art Programming 2 08-06-2003 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:41 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration