LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   fluxbox and .xinitrc (http://www.linuxquestions.org/questions/linux-software-2/fluxbox-and-xinitrc-272631/)

littlemidget 01-01-2005 01:24 PM

fluxbox and .xinitrc
 
I am currently running fluxbox under debian sarge, and i want to have a few things started when X starts. I have read the FAQ at fluxbox.org, so I know that I am supposed to use .xinitrc or .xsession - I have tried both.

I tried writing "xbindkeys" in .xinitrc, and I also tried writing "exec xbindkeys", it still did not work. So i tried the same with .xession - result: X refused to start.

I was hoping that someone here could help me out :-)

mijenks 01-01-2005 01:41 PM

make sure all your commands are before 'exec fluxbox'

also, you don't use the exec commands. type them in the .xinitrc file just as you would on a commandline.

you'll want to add '&' after each command, too, so they run in the background and allow .xinitrc to finish out (i.e. allow it to reach 'exec fluxbox')

littlemidget 01-01-2005 01:56 PM

Quote:

Originally posted by mijenks
make sure all your commands are before 'exec fluxbox'

I didn't have an .xinitrc file until I wanted xbindkeys to start automaticly, so fluxbox gets executed from somewhere else.. I now tried with "xbindkeys &", which still did not work.

darkleaf 01-01-2005 02:29 PM

Then the systemwide xinitrc is used. It's in /etc/X11. Copy it to ~/.xinitrc and then change it. So add the lines you want to it before the command that executes fluxbox.

littlemidget 01-02-2005 05:34 AM

Quote:

Originally posted by darkleaf
Then the systemwide xinitrc is used. It's in /etc/X11. Copy it to ~/.xinitrc and then change it. So add the lines you want to it before the command that executes fluxbox.
This is what I did:
cp /etc/X11/xinit/xinitrc /home/midget/
mv /home/midget/xinitrc /home/midget/.xinitrc
chown midget.midget .xinitrc

This is what I now have in .xinitrc
Code:

#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)

xbindkeys &
torsmo &
xmms &

# invoke global X session script
. /etc/X11/Xsession

xbindkeys, torsmo and xmms are all added by me. It still doesn't work, though. What am I doing wrong?

darkleaf 01-02-2005 07:36 AM

What I thought was wrong I looked at mine which works. It should be like that.

I don't have that Xsession stuff in there. Mine looks like this:

Quote:

#!/bin/sh


xscreensaver -no-splash &
gkrellm &

/usr/bin/fluxbox
Do you need the xsession stuff?

littlemidget 01-02-2005 10:29 AM

I your .xinitrc owned by your user or root? I did "chown midget.midget .xinitrc" earlier.
I still does not work, though:

Code:

#!/bin/sh

xbindkeys &
xmms &

/usr/bin/fluxbox


jonr 01-02-2005 11:23 AM

Quote:

Originally posted by littlemidget
I your .xinitrc owned by your user or root? I did "chown midget.midget .xinitrc" earlier.
I still does not work, though:

Code:

#!/bin/sh

xbindkeys &
xmms &

/usr/bin/fluxbox


That looks as though it should work.

How are you executing the .xinitrc file? What I do is login in a console (runlevel 3, not graphic) and then
issue "startx" to start up X and whatever programs I want. I have done this with fluxbox just as you have
yours written here.

Do you have permission to run /usr/bin/fluxbox? That would be the next question that occurs to me.

By the way, you don't need an .xsession file unless you're using a session manager such as xsm--that's my understanding.

littlemidget 01-02-2005 11:25 AM

Quote:

Originally posted by jonr
Do you have permission to run /usr/bin/fluxbox? That would be the next question that occurs to me.

I do have permission, so..

lfur 01-02-2005 11:33 AM

Quote:

Originally posted by jonr

How are you executing the .xinitrc file? What I do is login in a console (runlevel 3, not graphic) and then
issue "startx" to start up X and whatever programs I want. I have done this with fluxbox just as you have
yours written here.

Try running

xinit

instead of

startx

It works fine with me. Never got used to startx. Now I just put stuff I need to my .xinitrc in my $HOME and run xinit
If it fails, there should be some error messages. Can you post them?

Enjoy

littlemidget 01-02-2005 11:41 AM

Quote:

Originally posted by lfur
Try running

xinit

instead of

startx

It works fine with me. Never got used to startx. Now I just put stuff I need to my .xinitrc in my $HOME and run xinit
If it fails, there should be some error messages. Can you post them?

Enjoy

When I boot, the debian-x-manager (xdm?) starts automaticly, so if I try xinit or startx, I get a message saying that the screen (or whatever) is in use. I do want to have xdm, so I don't have to log into console first, every time I boot..

jonr 01-02-2005 11:48 AM

Quote:

Originally posted by littlemidget
When I boot, the debian-x-manager (xdm?) starts automaticly, so if I try xinit or startx, I get a message saying that the screen (or whatever) is in use. I do want to have xdm, so I don't have to log into console first, every time I boot..
Ah! Then you DO need the .xsession file after all.

You might try just renaming your .xinitrc to .xsession to see if that works.

(I prefer having just the console come up for logging in, so that I can do routine things outside of X Window system
if I want to--and I often do. Just a preference.)

lfur 01-02-2005 11:55 AM

As it seems from http://packages.debian.org/stable/vi...window-manager the debian x manager just creates a list of window managers you wish to run. If that's the way, you should define programs to run when wm starts in some sort of file that your wm uses - if I'm not wrong.

But than again, if you don't want to start in the console, you can always put xinit command at the end of your shell startup script (.bashrc, .bash_profile for BASH, .cshr for C Shell ...) so it starts every time you log in your system - of cours that means getting rid of debian x manager.

Enjoy

jonr 01-02-2005 12:08 PM

I never could get xsm to work for me in MandrakeLinux. As for xdm, it comes up standard when you install Mandrake, but I don't like it because (1) when you log out, it wants to log you right back in, making it difficult to shut down the computer! (2) as mentioned earlier, I like having a bare console to work with before I actually start an X session, partly because I often become aware of some problem easier to solve outside of X than inside it, and that way I can take care of it before starting up X again. This is just a personal preference.

I think .xsession works along with xdm regardless of whether it's Debian or Mandrake. It can't hurt to try. You're not going to mess anything up unless you do something really bizarre in your experiments.

Good luck and please post further results.

(Edit) Oh, and if you try starting via ".xsession," don't forget the dot before "xsession" otherwise it won't "see" the so-called hidden file. And make sure you're either in your home directory when you start it up, or else use the full path to the file.


littlemidget 01-02-2005 03:56 PM

Quote:

Originally posted by jonr
Ah! Then you DO need the .xsession file after all.
You might try just renaming your .xinitrc to .xsession to see if that works.

It worked! :-)
Last time I tried it, X refused to start, but now it works just fine. Thanks :-)


All times are GMT -5. The time now is 09:17 PM.