Autostart script does not work

I tried to create an auto start script but it doesn’t work. Here’s what I have and I’ve added the script to the login scripts section under autostart in System Settings and checked the box for an executable & also gave it permissions to read, write, and execute (thru chmod). I put the script in my home directory (not sure if that matters or not) and here’s what I have in it (file name: autostart.sh)

#!/bin/bash

bash ~/.config/polybar/launch.sh --forest
mount /dev/nvme0n1p4 /mnt/windows11

# optimus-manager --switch integrated

Hmm, can you try this variation?

sh ~/.config/polybar/launch.sh --forest && mount /dev/nvme0n1p4 /mnt/windows11

Unfortunately doesn’t work. I read something about the autostart.sh.desktop file being the issue but everything in there seems correct so I don’t know either.

[Desktop Entry]
Comment[en_US]=
Comment=
Exec=/home/ethan/autostart.sh
GenericName[en_US]=
GenericName=
Icon=dialog-scripts
MimeType=
Name[en_US]=autostart.sh
Name=autostart.sh
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-AutostartScript=true
X-KDE-SubstituteUID=false
X-KDE-Username=

Something simple could be like this:

[Desktop Entry]
Type=Link
Icon=dialog-scripts
Name=autostart.sh
URL=/home/ethan/autostart.sh
Terminal=false
Hidden=false

Check (and perhaps then configure and extend) your $PATH variable

echo $PATH

include ~/.local/bin in it
and put your script there - instead of into ~/.config

and make the script executable
and modify it by just calling it by it’s (unique) name - not via:
bash ~/.config/polybar/launch.sh --forest

more like:
launch.sh --forest
(if that name is unique - if no other program in the $PATH has got that same name)

#!/bin/bash
is already enough
there should be no need to then use:
bash ~/.config/polybar/launch.sh --forest
inside the script
that is already called as a bash script

The name of the script (no path to it) should be enough.

Sorry I’m new to Linux/Manjaro, to add a directory to $PATH would I go into my .bashrc file and then add the following line of code to the end of the file?

export PATH="~/.local/bin" 

And then I would move my autostart.sh file there and re-add it under System Settings? Would I also need to edit the autostart.sh.desktop file to the new directory or will it do it automatically?

Do I also need to add:

X-KDE-AutostartScript=true 

Because I read (in the Manjaro help section) that this specific key needs to be set to true in order for it to work.

didnt read far enough, question moot.