Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xinitrc not recognized
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Fri Jun 13, 2003 6:11 pm    Post subject: xinitrc not recognized Reply with quote

just wondering why when i put ~/.xinitrc, anything inside it won't be recognized.

well...i was trying to execute a script that will set my mod4 keys.
so then in .xinitrc, i have :
"exec exec-keys", where exec-keys is the script.

is there any other way to run script at login time?

i'm using fluxbox + gnome.
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Fri Jun 13, 2003 6:47 pm    Post subject: Reply with quote

And do you have a program called exec?

I'm not sure what you are trying to do, execute a program called exec-keys, I suppose.

Try this:
1. chmod a+x exec-keys
2. change "exec exec-keys" to "exec-keys" if it is in you path, else "/full/path/to/exec-keys"

The try to start X again.

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Fri Jun 13, 2003 8:42 pm    Post subject: Reply with quote

ok. it didn't work.

the thing is i'm trying to get my keyboard keys to work, specifically "mod4" which is the windows key.

the way i do it, i 'd type :

xmodmap -e "clear mod4"
xmodmap -e "keycode 115 = Super_L"
xmodmap -e "keycode 116 = Super_R Multi_key"
xmodmap -e "add mod4 = Super_L Super_R"

i tried putting this is in a executable file called /bin/exec-keys , then put exec-keys in .xinitrc, but it didnt' work.

i tried just putting those 4 lines in .xinitrc, and it still didn't work.
did i do anything wrong here?
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Fri Jun 13, 2003 9:30 pm    Post subject: Reply with quote

lotusvale wrote:
ok. it didn't work.

the thing is i'm trying to get my keyboard keys to work, specifically "mod4" which is the windows key.

the way i do it, i 'd type :

xmodmap -e "clear mod4"
xmodmap -e "keycode 115 = Super_L"
xmodmap -e "keycode 116 = Super_R Multi_key"
xmodmap -e "add mod4 = Super_L Super_R"

i tried putting this is in a executable file called /bin/exec-keys , then put exec-keys in .xinitrc, but it didnt' work.

i tried just putting those 4 lines in .xinitrc, and it still didn't work.
did i do anything wrong here?


Not much experience with xmodmap.

Did you make sure the file was executable? chmod 755 /bin/exec-keys ?

If you run the xmodmap commands from the command prompt, do they work then?

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Fri Jun 13, 2003 9:42 pm    Post subject: Reply with quote

oh yeah..the command works perfectly fine. and the file is executable...via chmod a+x.
the problem is, it won't get executed automatically when login.
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Fri Jun 13, 2003 11:04 pm    Post subject: Reply with quote

Could you post the complete .xinitrc?

Also, how do you login? Through XDM/GDM/KDM or by running startx?

Erik
_________________
'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.'
Back to top
View user's profile Send private message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Sat Jun 14, 2003 1:04 am    Post subject: Reply with quote

well....see the whole .xinitrc is just either
Code:
 exec-keys

or
Code:
xmodmap -e "clear mod4"
xmodmap -e "keycode 115 = Super_L"
xmodmap -e "keycode 116 = Super_R Multi_key"
xmodmap -e "add mod4 = Super_L Super_R"



i'm using gnome login manager.
not by startx. so i believe if i can that global file, i can insert my little script in, and everything should be okay.
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
deathdruid
Guru
Guru


Joined: 25 Jul 2002
Posts: 343
Location: Philadelphia, PA, USA

PostPosted: Sat Jun 14, 2003 1:22 am    Post subject: Reply with quote

lotusvale,

.xinitrc is only read when using startx. If using gdm/xdm/kdm, you need to use .xsession. I usually do this:

Code:
ln -s .xinitrc .xsession


which works for both methods.

Hope this helps,
Rahul
Back to top
View user's profile Send private message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Sat Jun 14, 2003 1:56 am    Post subject: Reply with quote

k so i just modify .xsession right?
btw, where can i find .xsession?

EDIT

actually just created in ~/.xsession, but it doesn't override the global one.
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
deathdruid
Guru
Guru


Joined: 25 Jul 2002
Posts: 343
Location: Philadelphia, PA, USA

PostPosted: Sat Jun 14, 2003 5:02 pm    Post subject: Reply with quote

When logging into gdm, choose xsession as the session to start. It might be set to gnome right now.
Back to top
View user's profile Send private message
samokk
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jun 2003
Posts: 116
Location: Paris, France

PostPosted: Sat Jun 14, 2003 7:32 pm    Post subject: Reply with quote

are you using {X, G, K}DM, or plain startx ?

coz, AFAIK, .xsession is to be used instead of .xinitrc for use with gdm and the like

sam
Back to top
View user's profile Send private message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Sat Jun 14, 2003 8:26 pm    Post subject: Reply with quote

samokk wrote:
are you using {X, G, K}DM, or plain startx ?

coz, AFAIK, .xsession is to be used instead of .xinitrc for use with gdm and the like

sam


read my previous posts. i've mentioned that i'm using gdm login manager
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
JeroenV
Guru
Guru


Joined: 16 Jul 2002
Posts: 447
Location: Amsterdam / Hamburg

PostPosted: Sat Jun 14, 2003 10:21 pm    Post subject: Reply with quote

Ok, some light into chaos :wink:

if you use gdm, the session types you can choose from (Gnome, KDE, ...) are determined by the files listed in /etc/X11/Sessions/. In my case:
Code:

bonzai Sessions # ls
Gnome  Xsession  enlightenment  enlightenment.cn  kde-3.1.2  kde-3.1.2.cn  waimea

These files can be seen as "global xinitrc" scripts (executable), i.e. they are configured systemwide. However, you can execute the user's .xsession by calling it from within these scripts. My /etc/X11/Sessions/enlightenment looks like this:
Code:
#!/bin/sh
. ~/.xsession
/usr/bin/enlightenment


Note: in my case deathdruid's method didn't work (i.e. .xsession was ignored (or was this just my enlightenment script?), so I just forced its execution). I'd say it's good practice in general to just symlink .xsession to .xinit anyway. If you look into above scripts, you can see what is executed while starting X, so you may conclude that you might also hack eg. .gnomerc or something like that.

The above script will execute each user's own .xsession, and finally enlightenment.
Using this you can fill your .xsession whith whatever you like.
_________________
Cheers 8)
Jeroen
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
May The Source be with you!
Back to top
View user's profile Send private message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Sun Jun 15, 2003 12:01 am    Post subject: Reply with quote

thx man..it works!
except i'm not sure what you meant in your script though.

it says " . ~/.xsession"
what does the first dot in this case do?
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
JeroenV
Guru
Guru


Joined: 16 Jul 2002
Posts: 447
Location: Amsterdam / Hamburg

PostPosted: Sun Jun 15, 2003 7:49 am    Post subject: Reply with quote

In sh or bash ". <command>" executes command in the current shell environment (the one the main script), afaik it's the same as "source command".

So if you do this:

(script1):

Code:

. script2
echo $BLAH


and (script2)

Code:

BLAH="blabla"


the output of script1 will be:
Code:
blabla

_________________
Cheers 8)
Jeroen
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
May The Source be with you!
Back to top
View user's profile Send private message
samokk
Tux's lil' helper
Tux's lil' helper


Joined: 13 Jun 2003
Posts: 116
Location: Paris, France

PostPosted: Sun Jun 15, 2003 8:57 am    Post subject: Reply with quote

lotusvale wrote:
thx man..it works!
except i'm not sure what you meant in your script though.

it says " . ~/.xsession"
what does the first dot in this case do?


Hmm, ok, that's cool but... isn't there a cleaner method ?

aren't global xinit scripts supposed to source .xsession by default ?
Is that a bug or a feature ?

sam
Back to top
View user's profile Send private message
lotusvale
Guru
Guru


Joined: 06 Mar 2003
Posts: 339
Location: Canada

PostPosted: Sun Jun 15, 2003 2:38 pm    Post subject: Reply with quote

JeroenV wrote:
In sh or bash ". <command>" executes command in the current shell environment (the one the main script), afaik it's the same as "source command".

So if you do this:

(script1):

Code:

. script2
echo $BLAH


and (script2)

Code:

BLAH="blabla"


the output of script1 will be:
Code:
blabla

yea i knew that, but i just thought you just needed to do
"~/.xsession" instead of ". ~/.xsession".
anyway, thx
_________________

-SuSe shot-
| -G shot-

Shadowrider's Lair
Back to top
View user's profile Send private message
mlybarger
Guru
Guru


Joined: 04 Sep 2002
Posts: 475

PostPosted: Wed Jul 02, 2003 11:01 pm    Post subject: Reply with quote

i gotta re-ask the question b/c this is kinda troublesome. isn't there a cleaner method than updating the files in etc? first off, these can get wiped out during an upgrade, and secondly, they're not guaranteed to start an application each time i log into x, only for the wm that i've edited the /etc start srcipt.

me personally, i'm looking to put numlockx into a startup script so it works when i login. i don't use startx, i use xdm (using kdm currently).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
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