I have been trying to set up an autostart script to start on the Desktop login (Kubuntu)
I tried adding my script through the startup applications GUI, and it did add it, but the script wasnt working. and by that, nothing have been hapening
so I manually created a .desktop file, and moved it to ~/.config/autostart/
which can be seen here:
[Desktop Entry]
Comment[en_GB]=A startup scipt to start a minecraft server on Desktop log in
Comment=A startup scipt to start a minecraft server on Desktop log in
Exec=/home/awakenmagic/Desktop/StartMCServer.sh
GenericName[en_GB]=
GenericName=
Icon= MimeType= Name[en_GB]=Maciej Name=Maciej Path=
StartupNotify=true
Terminal=false
TerminalOptions= Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-GNOME-Autostart-enabled=true
X-KDE-SubstituteUID=false
X-KDE-Username=
and then I tried to see manually what is the output when its beeing ran.
So I ran this command to start that script:
~/.config/autostart/ServerStartup.desktop start
and this popped up:
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 1: [Desktop: command not found
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 2: `Comment[en_GB]': not a valid identifier
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 2: startup: command not found
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 3: startup: command not found
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 16: X-DBUS-ServiceName=: command not found
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 17: X-DBUS-StartupType=: command not found
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 18: X-GNOME-Autostart-enabled=true: command not found
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 19: X-KDE-SubstituteUID=false: command not found
/home/awakenmagic/.config/autostart/ServerStartup.desktop: line 20: X-KDE-Username=: command not found
I have been getting the same errors when using the autostart default .desktop file that it created, and the same thing has happened
can somebody help?
thanks
EDIT1:
I wanted to create that autostart, which will start my script file on start, so that .desktop file, with the executable path to my actual script has been created in the ~/.config/autostart/ folder, when I added that script through the GUI to be started on log in, and it gave me those errors
EDIT2:
I did test my script without the startup, and it worked fine, with no problem, it started my server in a tmux session,I dont understart why I got those errors like [Desktop: Command not found, or Comment[en_GB]`: not a valid indendifier
thats the scipt from my .sh:
#!/bin/bash
tmux new -s MCServer 'cd MinecraftServer/; bash --init-file ./run.sh'
Could that be maybe because I have it move directory to "MinecraftServer", and startup scripts start from a different directory or something simmilar and not "Desktop"?
I am still learnign a lot of things about linux, its a little painful haha
EDIT3:
Is there a way to see what is the output of that script that is trying to be ran? I can try to read the output and figure out what is causing the issue, I might have coded something wrong?