I have found many things on how to do that.
I tried with upstart, but it didn't do anything. I think I found some post that tells it doesn't come out of the box with upstart anymore. This is why this question is not a duplicate of this post.
I tried using the "Autostart" application, but whenever I add my script there, close the window and reopen it, it's gone.
I would like to execute a bash script when my user is logged in and the GUI is ready (because the script is going to open and set-up some applications). What is the best way (preferably through command line) to achieve that?
~/.config/autostartand~/.config/autostart-scripts. To make sure the GUI is ready, you may need to add asleepvalue at the start of your script. – DK Bose Apr 24 '18 at 15:11sleep, just copy the script over to~/.config/autostart-scripts, log out and log back in. Maybe that'll work.whileloop, e.g. withwhile [[ ! $(pgrep plasmashell) ]]; do sleep 1; donewhich tests every second (at least in Kubuntu 16.04 the process is calledplasmashell, adapt it if necessary). – dessert Apr 24 '18 at 19:21