View previous topic :: View next topic |
Author |
Message |
Shidouuu n00b
Joined: 28 Mar 2021 Posts: 16
|
Posted: Sun Apr 11, 2021 9:32 pm Post subject: Should you create ~/.xinitrc for Openbox? |
|
|
On the Openbox wiki page, it says,
Quote: | ...note that a common misconception is to create a ~/.xinitrc file - please do not do that, as it will prevent X from executing all the automatically provided scripts in /etc/X11/xinit/xinitrc.d/ - if you wish to add anything in particular, you can create an executable file in that directory. |
and instead put export XSESSION=openbox in ~/.bashrc or to use a display manager. I did this and it did not work. Using exec openbox-session in ~/.xinitrc did however, though I'm not sure how that affected any scripts in xinitrc.d.
Contrary to Gentoo's Openbox page, the Arch wiki mentions none of this, and just says to use xinit. Why is it that only this page says not to use a ~/.xinitrc file? |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1530 Location: South America
|
Posted: Sun Apr 11, 2021 9:48 pm Post subject: |
|
|
Yes, I run Openbox by setting XSESSION to "openbox", and don't have an ~/.xinitrc file. It works.
Shidouuu wrote: | Contrary to Gentoo's Openbox page, the Arch wiki mentions none of this, and just says to use xinit. Why is it that only this page says not to use a ~/.xinitrc file? |
Because it is a Gentoo-specific setup. There's an /etc/X11/chooser.sh script on Gentoo that handles XSESSION. |
|
Back to top |
|
|
Shidouuu n00b
Joined: 28 Mar 2021 Posts: 16
|
Posted: Sun Apr 11, 2021 10:05 pm Post subject: |
|
|
Huh, is this specific to Openbox aswell? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54234 Location: 56N 3W
|
Posted: Sun Apr 11, 2021 10:24 pm Post subject: |
|
|
Shidouuu,
~/.xinitrc is only used when you run startx.
If you use a display manager, its not consulted. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1530 Location: South America
|
Posted: Sun Apr 11, 2021 10:24 pm Post subject: |
|
|
I don't understand the question. On Gentoo, the value of XSESSION tells startx what it should start. If you set it to "openbox", then startx will start Openbox.
The complete mechanism that makes this work is:
- startx is a shell script that runs the xinit program. If you do not have an ~/.xinitrc file, startx will supply /etc/X11/xinit/xinitrc as the client.
- /etc/X11/xinit/xinitrc is also a shell script that will source all files in /etc/X11/xinit/xinitrc.d. That's what the Wiki article mentions.
- /etc/X11/xinit/xinitrc will also call /etc/X11/chooser.sh to determine what to run, using the value of XSESSION.
- If the value of XSESSION is "openbox", /etc/X11/chooser.sh will run /etc/X11/Sessions/openbox, which is provided by Gentoo's x11-wm/openbox package.
- /etc/X11/Sessions/openbox calls /usr/bin/openbox-session, and that's what ultimately launches Openbox.
If you use a display manager, then nothing of this applies. Display managers have their own way to determine which desktop environment or window manager to start. |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 2964 Location: Edge of marsh USA
|
Posted: Mon Apr 12, 2021 3:25 am Post subject: |
|
|
"... please do not do that, ..." is a little bit too strong, in my opinion.
My ~/.xinitrc takes care of the necessary duties, plus then some.
Code: | setxkbmap -option terminate:ctrl_alt_bksp
#exec startkde
#exec xfce4-session
#exec startxfce4
#exec startlxde
xhost +local:root > /dev/null
/usr/bin/numlockx on
#DEPRECATED ck-launch-session
# ck-launch-session dbus-launch --sh-syntax --exit-with-session startlxde
export XDG_MENU_PREFIX=lxde-
#dbus-launch --sh-syntax --exit-with-session startlxde
#dbus-launch --sh-syntax --exit-with-session openbox-session
/usr/bin/dbus-launch --sh-syntax --exit-with-session /usr/bin/openbox-session |
The commented-out lines (#) are for my historical reference.
More that one way to skin a cat. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
|