# Debian 11 Autostart

To make a program or script run automatically when the Debian 11 operating system starts up, you can use the autostart feature. This can be accomplished by creating a .desktop file in the `/etc/xdg/autostart` directory.

## Steps

1.  Open a terminal window.
    
2.  Navigate to the `/etc/xdg/autostart` directory by running the following command:
    

```sh
cd /etc/xdg/autostart
```

3.  Create a new .desktop file named `test.desktop` by running the following command:

`sudo nano test.desktop`

4.  Copy and paste the following code into the file:

```
[Desktop Entry]
Type=Application
Exec=/home/linaro/autostart.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=MyScript
Comment=Runs MyScript script at system startup.
```

5.  Save and exit the file by pressing `Ctrl+X`, then `Y`, and then `Enter`.
    
6.  Ensure that the `autostart.sh` file located at `/home/linaro/autostart.sh` has permissions to run by executing the following command:
    

`chmod +x /home/linaro/autostart.sh`

7.  Reboot the system to verify that the script runs automatically at startup.

Congratulations! Your script will now automatically run at system startup on Debian 11.