Autostart script at boot on xfce

Hello, i tried some guides here and there but i cant get a script to run at boot. This script needs to execute a program in terminal. I tried both through the xfce settings manager and by pasting the script in config/autostart but nothing happens.
How to do?

Welcome to the forum! :slight_smile:

I’m afraid we can’t really give you any advice without seeing the script. Type three backticks (```) on a new line, and paste the script underneath. Then put another line with three backticks below the script. This makes it more readable for everyone.

1 Like

Hi!

You want to run your script in a Terminal at startup?
The script is executable?
It works as expected when you start it from a terminal?

What you’d need to do at startup/login is the same thing:
first start a terminal - and give it the script you wan to run in it
something like:
xfce4-terminal -e ’/path/to/script’ &
If that does what you want you can then put that command in the autostart.
HTH

2 Likes

It worked. In the xfce session&startup manager i originally input as new command

sh scriptname.sh

instead of plain

scriptname.sh

However thanks

yepp - if the script location is in your $PATH the script runs, without a terminal to run it in to provide feedback/output
I would have put:
sh -x script_name
so it would run without being marked executable
and perhaps even if the script didn’t contain:
#!/bin/sh
or
#!/bin/bash
as the first line

I don’t know what
sh
is calling in Manjaro - probably bash, but could be zsh