Slow GTK programs start on OpenBox

Forum rules
Before you post please read how to get help
Post Reply
Blue
Level 1
Level 1
Posts: 49
Joined: Fri Mar 08, 2019 9:40 am

Slow GTK programs start on OpenBox

Post by Blue » Fri Mar 08, 2019 10:06 am

Hi there,

I'm currently making a custom OpenBox setup that I'd like to use as my main DE, but I'm experiencing a really annoying bug.
The first time I start any GTK-based application like Firefox or Nemo on OpenBox (ie. first run after computer start), it takes 20~30 seconds to load, which is really long compared to the rest of my system.

Other applications doesn't have this problem, and next runs of the GTK-based programs also works well. Everything works normally on Cinnamon.

As far as I can tell, I'd say there are some libraries I'm missing to launch, but I didn't manage to find them on this distro.

Thanks in advance,
Blue :)
Last edited by Blue on Sun Mar 10, 2019 6:26 am, edited 2 times in total.

User avatar
thx-1138
Level 7
Level 7
Posts: 1803
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Slow GTK programs start on OpenBox

Post by thx-1138 » Fri Mar 08, 2019 11:23 am

I haven't ever set up Openbox from scratch myself, however if i am to make somewhat a quick guess in the wild,
i'd say it's quite likely that you might have not set up openbox to also launch a dbus session:
https://wiki.gentoo.org/wiki/Openbox#Starting
https://wiki.parabola.nu/Openbox#Openbo ... d-alone_WM

If you indeed have set it more or less as per above, I'd still be inclined to believe it's somehow dbus services' related:
try to first check the .xsession-errors file and / or furthermore maybe run strace,
in order to see what the GTK apps in question try open, but somehow fail / time out etc...
Chances are that when the app starts up, a specific dbus service either isn't found to be already enabled,
or, as you said, it's package possibly not installed at all (eg. accessibility-related / at-spi ones come quickly to mind).

Blue
Level 1
Level 1
Posts: 49
Joined: Fri Mar 08, 2019 9:40 am

Re: Slow GTK programs start on OpenBox

Post by Blue » Fri Mar 08, 2019 12:57 pm

Hi, here's the content of my autostart script, located at ~/.config/openbox/autostart.sh.
I just added the first line, but it doesn't seem to solve the problem:

Code: Select all

dbus-launch --sh-syntax --exit-with-session &
hsetroot -solid "#000000" &
nitrogen --restore &
tint2 -c /home/thibaut/.config/tint2/storm-side.tint2rc &
(sleep 1 && tint2 -c /home/thibaut/.config/tint2/clock.tint2rc) &
(sleep 1 && xcompmgr) &
volti &
Could you give any instructions on using strace ?
Last edited by Blue on Sun Mar 10, 2019 6:26 am, edited 1 time in total.

Blue
Level 1
Level 1
Posts: 49
Joined: Fri Mar 08, 2019 9:40 am

Re: Slow GTK programs start on OpenBox

Post by Blue » Fri Mar 08, 2019 1:51 pm

I did some search based on what you said about DBus, and added the following lines into my autostart, which slightly improved the things:

Code: Select all

if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi
However, Firefox still takes 15 seconds to load. Uh, I guess I'll have to blame it for being too heavy... Still, why does it only do this on first run ?
Last edited by Blue on Sun Mar 10, 2019 6:27 am, edited 1 time in total.

User avatar
thx-1138
Level 7
Level 7
Posts: 1803
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Slow GTK programs start on OpenBox

Post by thx-1138 » Fri Mar 08, 2019 3:46 pm

Blue: applications get cached in memory, so that execution is faster the next time they're run.
If you run sudo sysctl vm.drop_caches=3 (under whatever desktop configuration),
you'll find that the next time you'll start an application, it will take way much longer to do so.

What came to mind in the first place above was more or less something among those lines.
Similar issues with running window managers instead of full-blown desktops: 1, 2, 3...

Other than that - i'm the least qualified person to advise / guide you through this
(the 'haven't ever set up Openbox from scratch myself' part...) :-)
Hopefully someone familiar with such will help you figuring it out...

Blue
Level 1
Level 1
Posts: 49
Joined: Fri Mar 08, 2019 9:40 am

Re: Slow GTK programs start on OpenBox

Post by Blue » Sun Mar 10, 2019 6:30 am

Ok, I'll take a look at this.
However, if someone accustomed to Openbox could guide me trough the process, it would be really great :wink:

Post Reply

Return to “Others”