However, if I put that script in ~/.config/autostart, then the whole OS sort of freezes after login into Gnome. I say “sort of”, because Gnome seems to start correctly, seems to “live” correctly (the clock in the panel works, I can see other extensions like CPU load in the panel varying, and so on). However, I have no control, neither the mouse nor the keyboard respond.
Worse, I can not even access another console (<Ctrl><Alt><F3> for example). I have to physically shut down the laptop (long press on power button), boot Linux into recovery mode, and delete (or modify) the script in ~/.config/autostart.
Now, if I add a sleep 3 right before gnome-extensions disable $EXTENSION, it works (sleep 1 doesn’t work either, I haven’t tested sleep 2).
So, it seems I try to run gnome-extensions disable $EXTENSION too early in the startup process of Gnome Shell, thus the freezing. Is there something more elegant than sleep 3 to detect if Gnome Shell has finished loading ?
_centerBox is enforced, but not the index (0) : after login, the icon can be anywhere in the top panel’s center area.
I’m using another extension (Top Bar Organizer - GNOME Shell Extensions) to reorder the items of the top panel, but that specified Harddisk LED icon isn’t detected by this extension.
I eventually found out that disabling and enabling the extension right after login makes it go to its designed place.
So, this really is an XY Problem, with the actual issue being “On login, the top bar organizer does not move the indicator of another extension to the right place”.
Now, the actual solution would be to find out what causes the issue in the first place[1] and fix it in the extension. So, ideally you would report an issue to the extension.
Until the issue can be properly resolved, the script is well enough as a stop-gap.
My guess would be that the Harddisk LED extension uses an unusual widget combination (I think icon + button), which the top bar organizer extension doesn’t know how to sort right. ↩︎