You are not logged in.

#1 2008-10-06 19:42:42

monstermudder78
Member
Registered: 2008-05-18
Posts: 120

Openbox and autostart.sh or .xinitrc?

Which would be the better option or a "more correct" way to set the background in openbox,  running feh from .xinitrc or autostart.sh?  This is not a "How-To" question so much as it is a philosophy question.  I have used both options successfully and am currently only starting openbox with .xinitrc then starting conky and feh with autostart.sh.  Any opinions on this?  Which one is more correct and WHY?  What was the original intention of each file?

Thanks,
Monstermudder78

Last edited by monstermudder78 (2008-10-06 19:43:22)

Offline

#2 2008-10-06 20:10:52

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: Openbox and autostart.sh or .xinitrc?

autostart.sh is a good choice if you are running a full openbox-session. It's the built-in session script explicitly for Openbox.

Technically speaking there is no difference between using xinitrc and autostart.sh to autostart your applications. As far as the original intentions go, xinitrc predates openbox and they aren't quite the same thing.  xinitrc is intended to start session files for Xorg as a whole, while autostart.sh will only be parsed once openbox-session is already run (e.g. via xinitrc).

Strategically, there are some good practises to follow.  For example, if you run several window managers and want to start certain applications only when Openbox is running, you can add them to autostart.sh.  Then put everything else, such as wallpaper settings, in your xinitrc. This way items like wallpaper are set regardless of which WM is running.  For a real example, I used to put my conky and xcompmgr executions in autostart.sh so they wouldn't start if I ran Awesome or Xmonad.

Last edited by thayer (2008-10-06 20:15:31)


thayer williams ~ cinderwick.ca

Offline

#3 2008-10-06 20:16:22

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: Openbox and autostart.sh or .xinitrc?

I don't think there is a really "more correct" way to do anything in linux, IMHO.  When using openbox, I now use the .xinitrc option to eval`cat~/.fehbg` for my background transparency.  I used to have it in autostart.sh and both ways work so I don't know if philosophical arguments even really need to apply.  The nice thing about having it in .xinitrc is sometimes I want to use e17 instead of openbox and my conky transparency will still work whereas not so if I used the openbox/autostart.sh option.  Keeps it simple. smile

Edit: Sorry if I sound like I'm repeating thayer.  He beat me to the punch.  I must type too slow--more likely think too slow. tongue

Last edited by bgc1954 (2008-10-06 20:53:48)


Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz

Offline

#4 2008-10-06 22:42:33

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Openbox and autostart.sh or .xinitrc?

autostart.sh: when using login manager like k,g-dm
.xinitrc: when using startx from console (or xdm)

Last edited by DonVla (2008-10-06 22:42:59)

Offline

#5 2008-10-07 06:16:31

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: Openbox and autostart.sh or .xinitrc?

DonVla wrote:

autostart.sh: when using login manager like k,g-dm
.xinitrc: when using startx from console (or xdm)

Session managers will also read either .xressources or .xinitrc


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#6 2008-10-07 07:24:55

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: Openbox and autostart.sh or .xinitrc?

I use openbox-gnome-session, and have used GNOME's session manager to create a new startup item: ~/.startup. This is a script I've made executable like any other, and I treat it like .xinitrc - I put whatever I want to exec at startup in it.

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#7 2008-10-08 15:48:51

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: Openbox and autostart.sh or .xinitrc?

Rasi wrote:
DonVla wrote:

autostart.sh: when using login manager like k,g-dm
.xinitrc: when using startx from console (or xdm)

Session managers will also read either .xressources or .xinitrc

xressources yes, xinitrc no.

Offline

#8 2008-10-08 16:27:37

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Openbox and autostart.sh or .xinitrc?

What Thayer said.

Oh, and, FWIW, SLiM reads .xinitrc, DonVla. wink

Offline

#9 2008-10-08 18:12:34

burnside
Member
From: Asheville, NC
Registered: 2008-09-27
Posts: 45

Re: Openbox and autostart.sh or .xinitrc?

Misfit138 wrote:

What Thayer said.

Oh, and, FWIW, SLiM reads .xinitrc, DonVla. wink

GDM and WDM too. Select 'default' from the sessions menu. smile

I'm not sure about KDM but I assume it's much the same.

Offline

#10 2008-10-08 19:15:04

JeremyTheWicked
Member
From: Poland
Registered: 2008-05-23
Posts: 193

Re: Openbox and autostart.sh or .xinitrc?

burnside wrote:
Misfit138 wrote:

What Thayer said.

Oh, and, FWIW, SLiM reads .xinitrc, DonVla. wink

GDM and WDM too. Select 'default' from the sessions menu. smile

I'm not sure about KDM but I assume it's much the same.

Whether they read it or not depends on .xsession. The standard .xsession file in Arch looks like this:

#!/bin/sh

#
# ~/.xsession
#
# Executed by xdm/gdm/kdm at login
#

/bin/bash --login -i ~/.xinitrc

So, the answer is - if you haven't tinkered too much, .xinitrc gets read by login managers.


arch(3) adj amused because you think you understand something better than other people ;P

Offline

#11 2008-10-09 13:44:36

RobbeR49
Member
From: Columbus, OH
Registered: 2006-01-17
Posts: 178

Re: Openbox and autostart.sh or .xinitrc?

One thing I like about autostart.sh is that at least for me I don't have to put "sleep &&" in front of a lot of stuff to get them to start like I did in .xinitrc. It's a very minor little thing, but at the very least it saves typing a few keystrokes.

Offline

#12 2008-10-09 15:43:58

monstermudder78
Member
Registered: 2008-05-18
Posts: 120

Re: Openbox and autostart.sh or .xinitrc?

Thanks for all the input and discussion.  For the sake of simplicity I have chosen to start openbox from .xinitrc, then everything else in autostart.sh, just so I only need to look in one place instead two to find what I'm looking for.  Thanks again to those who have answered and I welcome anyone else's opinion who hasn't chimed in yet and wants to tell me I am doing it wrong big_smile .

Offline

#13 2008-12-20 21:21:11

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,001
Website

Re: Openbox and autostart.sh or .xinitrc?

Interesting read, I had exactly the same question.
I think i will not use autostart.sh/openbox-session at all.  I don't have a session manager running anyway.
Through ~/.xinitrc I start all my needed apps (which are the same for all my WM-setups, so I rather put stuff there), and I'll just start openbox, my panel and I'm pretty much done.


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#14 2011-07-25 11:46:04

NotFromBrooklyn
Member
Registered: 2011-07-24
Posts: 37
Website

Re: Openbox and autostart.sh or .xinitrc?

Well, in the autostart.sh file says:

# This shell script is run before Openbox launches.
# Environment variables set here are passed to the Openbox session.

So I think that it all depends if you want to launch your apps before or after openbox.

Offline

#15 2011-07-25 21:06:20

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Openbox and autostart.sh or .xinitrc?

Do not necrobump threads. Closing...


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB