In /etc/profile.d/ I inserted the file custom.sh which reads:
~/.start/speakers.sh &
~/.start/vpn.sh &
As you can see, both files are run in the background. Why am I still experiencing, sometimes but not always, a black screen after I press login? When that happens, I don't see the desktop.
This morning, I had to turn off the computer the hard way, then boot again. This time no problem, the desktop appeared with the speakers connected and the VPN on.
I suspect that's because of ~/.start/vpn.sh &, sometimes the command inside this file pauses for a (very) long time. What I don't understand is, why is this an issue? The file is run in the background.
My OS is Ubuntu LTS 22.04. More info:
systemd-analyze blame | head returns:
6.126s NetworkManager-wait-online.service
2.485s plymouth-quit-wait.service
1.223s apt-daily-upgrade.service
903ms snapd.seeded.service
617ms snapd.service
534ms modprobe@chromeos_pstore.service
349ms gpu-manager.service
313ms fwupd.service
275ms systemd-resolved.service
254ms systemd-timesyncd.service
ls /usr/bin/*session returns:
/usr/bin/dbus-run-session /usr/bin/gnome-session /usr/bin/gnome-session-custom-session /usr/bin/pipewire-media-session