Once upon a time, I remembered that,
If launch openbox, trayfreq, nm-applet, lxpanel, everything goes fine.
If launch openbox-session, I got two trayfreqs and two nm-applets. One instance is run by ./config/openbox/autostart, which is expected. And the second instance is invoked by the "session", definitely. I googled, went to /etc/X11/foo and ~/bar (sorry I cannot remember the right directory), deleted the file, and the second instance disappeared.
But I did not try to find which script does that. And that's what "did not dig deep" means.
edit:
The directory is "/etc/xdg/autostart"
the archlinux openbox wiki updated then:
Autostart directory
Openbox also starts any *.desktop files in /etc/xdg/autostart - this happens regardless of whether a user startup script is present. nm-applet, for example, installs a file at this location, and may cause it to run twice for users with the usual (sleep 3 && /usr/bin/nm-applet --sm-disable) & in their startup script. There is a discussion on managing the effects of this at [2].
Why do you think openbox-session will execute some *.desktop automatically? You have complete control over the apps that will be autostarted, using ~/.config/openbox/autostart.
I did not dig that deep. But I am sure openbox-session does something I do not want.
Anyway I am happy with the solution now.
I will mark the title as resolved.
Thanks all for your advices.
I knew what openbox-session & openbox-autostart script does.
I just do not want to see some .desktop been executed automatically. And even I remove those .desktop items, a package update would bring everything back.
That's why I'd prefer openbox. I like the idea that everything's under control.
Thanks for your advice.
]]>If you insist, you can put the other stuff in .xinitrc and just start openbox at the end:
lxpanel &
nm-applet &
trayfreq &
exec ck-launch-session dbus-launch openbox
Or you can put the other stuff where it belongs (in $HOME/.config/openbox/autostart) and run that script from .xinitrc before you start openbox, but that's exactly what openbox-session does, so it really makes more sense to use openbox-session if you want autostart.
]]>This works fine here
exec dbus-launch --exit-with-session openbox
I don't know why that wouldn't work for you. There is no "session", openbox-session is just a script.
Hi Trilby
It did work. But I cannot start some other apps with openbox, such as nm-applet, lxpanel, trayfreq...
If I want to start apps with openbox, but do not use openbox-session, I can do this:
openbox & wmpid=$!
#ck-launch-session dbus-launch openbox
lxpanel &
nm-applet &
trayfreq &
wait $wmpid
But I do not know how to launch it with ck-launch-session dbus-launch...
Sorry that I did not describe my purpose good enough.
]]>exec dbus-launch --exit-with-session openbox
I don't know why that wouldn't work for you. There is no "session", openbox-session is just a script.
]]>in /usr/bin/openbox-session, there's "/usr/lib/openbox/openbox-autostart" ->
"/usr/lib/openbox/openbox-xdg-autostart" ->
run "*.desktop"
this is what I do not want.
And that's why I'd prefer openbox, rather than openbox-session
I'd like my desktop environment be neat and completely customizable.
in .xinitrc I can use something like
exec ck-launch-session dbus-launch openbox-session or
exec ck-launch-session dbus-launch gnome-session
but I do not want to start unwanted stuff. If I use
exec ck-launch-session dbus-launch openbox
This will not work because openbox is not a "session" and will exit after exec.
And I do not want to use extra file "startOpenbox" to contain something like
openbox &
pid=$!
...something else...
wait $pid
and "exec ck-launch-session dbus-launch startOpenbox"
any idea?
thanks