-1

I use Xubuntu with gnome-terminal.

I need to launch a sh script (restart.sh) on the pc startup. The .sh file is in this directory: "/home/stark/Desktop/Tracking/Release/5600/"

I created a launcher like this:

[Desktop Entry]
Name=My GUI App
Exec=gnome-terminal -x sh -c "/home/stark/Desktop/Tracking/Release/5600/restart.sh"
Icon=/path/to/you/icon.svg
Terminal=true
Type=Application
StartupNotify=true
Name[en_US]=Intel5600
Comment=
Path=

What's wrong? Thank you!

EDIT:

This is the bash file:

#!/bin/bash
gnome-terminal -x sh -c 'python3 main00.py'

If I start it from its folder it works (if in a terminal I type: ./restart.sh), but from the launcher it doesn't work.

I tried to set terminal=false, but nothing changes.

G. Threepwood
  • 454
  • 8
  • 23

2 Answers2

0

add an @reboot cron task:

  1. Running crontab -e will allow you to edit your cron.

  2. Adding a line like this to it:

    @reboot /path/to/script

will execute that script once your computer boots up.

tso
  • 4,732
  • 2
  • 22
  • 32
0
vi /etc/rc.local

with content like the following:

# This script is executed at the end of each multiuser runlevel
/path/to/my/script.sh || exit 1   # Added by me
exit 0