LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   impossibility of loading xmodmap on startup X .initrc? (https://www.linuxquestions.org/questions/linux-newbie-8/impossibility-of-loading-xmodmap-on-startup-x-initrc-918925/)

Foxbat1155 12-15-2011 12:30 PM

impossibility of loading xmodmap on startup X .initrc?
 
I simply cannot make the .initrc file or other attempts load my .xmodmap preferences.

My laptop is a new squeeze installation.

I followed this site:

http://fluxbox-wiki.org/index.php?title=.xinitrc

I added:

Code:

xmodmap ~/.xmodmap
As I do in my xterm after login and startx command for fluxbox start.

In xterm after I start fluxbox it always works.

Why is this not working?

What (dot)file should I use for my startup preferences/commands?

Thankyou.

MTK358 12-15-2011 02:36 PM

Quote:

Originally Posted by Foxbat1155 (Post 4550827)
I simply cannot make the .initrc file or other attempts load my .xmodmap preferences.

Is that a typo, or did you actually put the line in in ".initrc" instead of ".xinitrc"? If so, that's the problem.

Quote:

Originally Posted by Foxbat1155 (Post 4550827)
I added:

Code:

xmodmap ~/.xmodmap
As I do in my xterm after login and startx command for fluxbox start.

In xterm after I start fluxbox it always works.

I don't understand it the way you wrote it. Could you exaplin more clearly?

Cedrik 12-15-2011 05:03 PM

It should be .Xmodmap rather than .xmodmap, no ?

edit:

yes, in my .xinitrc, it tests for .Xmodmap :
Code:

$ grep -i xmodmap ~/.xinitrc

test -r /etc/X11/xinit/.Xmodmap && xmodmap /etc/X11/xinit/.Xmodmap
test -r $HOME/.Xmodmap && xmodmap $HOME/.Xmodmap


MTK358 12-15-2011 06:50 PM

Quote:

Originally Posted by Cedrik (Post 4551042)
It should be .Xmodmap rather than .xmodmap, no ?

Why does it matter when the OP is specifying it by name?

Cedrik 12-15-2011 07:07 PM

It matters if you use stock xinitrc file...

MTK358 12-15-2011 07:35 PM

The OP said that he entered the line "As I do in my xterm after login and startx command for fluxbox start", whatever that means. I would assume that he means .xinitrc, but I would wait for a reply first.

Foxbat1155 12-16-2011 02:55 AM

xinitrc
 
Indeed, I miss typed.

I have been always using .xinitrc and not initrc.

Also I have written the preferences in a .xmodmap file.

I have seen that alot of user write as .Xmodmap but I reckon this is irrelevant or is it not?

It works when I enter the command
Code:

xmodmap .xmodmap
in my xterm.

Foxbat1155 12-16-2011 03:05 AM

solved
 
Sirs this problem has just been solved, a friend of mine has provided me his .xsession file and these lines seem to solve it:

Code:

#/usr/bin/setxkbmap pt && /usr/bin/xmodmap ~/.xmodmap
/usr/bin/xmodmap ~/.xmodmap

Thankyou.

Foxbat1155 12-16-2011 03:14 AM

results
 
I would like to point out that what, more rigorously, I did was:

created the .xmodmap with my personal preferences.

created the .xsession file and included the line I inserted in my previous reply.

For future reference, these are the .xsession and .xmodmap files:

.xsession:

Code:

#!/bin/sh

#/usr/bin/xpad &
#/usr/bin/gkrellm -w &
/usr/bin/conky &
/usr/bin/xscreensaver &


/usr/bin/xrandr --output LVDS1 --auto --output VGA1 --auto &


#/usr/bin/setxkbmap pt && /usr/bin/xmodmap ~/.xmodmap
/usr/bin/xmodmap ~/.xmodmap

exec fluxbox

.xmodmap:

Code:

!
! Swap Caps_Lock and Control_L
!
!remove Lock = Caps_Lock
!remove Control = Control_L
!!keysym Control_L = Caps_Lock
!keysym Caps_Lock = Control_L
!add Lock = Caps_Lock
!!add Control = Control_L
!keycode 66 = Control

!keycode 176 = XF86AudioRaiseVolume
!keycode 174 = XF86AudioLowerVolume


!keycode 122 = XF86AudioLowerVolume
!keycode 123 = XF86AudioRaiseVolume

remove Lock = Caps_Lock
remove Control = Control_L
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

Thankyou.

Foxbat1155 12-16-2011 07:03 AM

unsolved on squeeze HP Compaq nc6320
 
Although I have solved this issue on my desktop pc, I have not been able to solve this xmodmap problem on my laptop HP Compaq nc6320 with squeeze fluxbox.

Therefore I ask if anyone can help me run xmodmap with my .xmodmap file automatically everytime I start.

My xmodmap .xmodmap works perfectly every time I use it after starting fluxbox when I execute this in xterm.

How can I make this command be executed automatically?

My .xsession already has
Code:

xmodmap ~/.xmodmap
Thankyou.

Cedrik 12-16-2011 07:34 AM

It is your religion or something that force you to use .xmodmap instead of .Xmodmap ?

I mean for example in my system, the xinitrc search for .Xmodmap, not .xmodmap by default
Ok you could modify each xinitrc for various wm, and modify them again after wm upgrade but...

See it for yourself:
Code:

grep .xmodmap /etc/X11/xinit/*
grep .Xmodmap /etc/X11/xinit/*

Edit:
Sorry, after some reading I think it is not the same xinit scripts in ubuntu

I don't know if it is relevant but some advise to
Code:

ln -s ~/.xinitrc ~/.xsession
If you plan to use gdm instead of startx
(startx will read .xinitrc and gdm will read .xsession)

Foxbat1155 12-16-2011 07:56 AM

no output
 
Quote:

Originally Posted by Cedrik (Post 4551587)
It is your religion or something that force you to use .xmodmap instead of .Xmodmap ?

I mean for example in my system, the xinitrc search for .Xmodmap, not .xmodmap by default
Ok you could modify each xinitrc for various wm, and modify them again after wm upgrade but...

See it for yourself:
Code:

grep .xmodmap /etc/X11/xinit/*
grep .Xmodmap /etc/X11/xinit/*

Edit:
Sorry, after some reading I think it is not the same xinit scripts in ubuntu

I don't know if it is relevant but some advise to
Code:

ln -s ~/.xinitrc ~/.xsession
If you plan to use gdm instead of startx
(startx will read .xinitrc and gdm will read .xsession)


there was no output to both greps. I do not plan to use gdm

Cedrik 12-16-2011 08:08 AM

Did you try to link your .xsession to .xinitrc just for testing ?
(startx will read .xinitrc and gdm will read .xsession)
Code:

ls -s ~/.xsession ~/.xinitrc

Foxbat1155 12-23-2011 06:38 PM

Quote:

Originally Posted by Cedrik (Post 4551608)
Did you try to link your .xsession to .xinitrc just for testing ?
(startx will read .xinitrc and gdm will read .xsession)
Code:

ls -s ~/.xsession ~/.xinitrc


Sir Cedrik,
I have gotten around the time to test your solution but this did not work.

Foxbat1155 02-15-2012 10:05 PM

solution
 
I would like to point out that I have found a solution in an emacs site for this problem

Instead of using xmodmap I am now using this:

Code:


setxkbmap -option ctrl:nocaps

on my fluxbox startup file and it works perfectly =)


All times are GMT -5. The time now is 01:34 PM.