# Installing Eyesim on Ubuntu 22.04!

Eyesim is a robot simulator that lets you program some robots, used in the lab assignments for some units in The University Of Western Australia, in a simulated environment. Here is a quick guide on how to setup Eyesim on your Ubuntu 22.04 device!

I used PopOS 22.04, which is an ubuntu-based distro so the steps should be the same.

Oh, and we will also cover how to add Eyesim to your search menu!

![A screenshot of eyesim appearing in the application launcher on a popos operating system. Note pop os is an ubuntu based distro.](https://cdn.hashnode.com/res/hashnode/image/upload/v1713686804501/e60f167b-4661-41e2-a7db-6db8c76e2844.png align="center")

Note: I have heavily referred to roblab's [official eyesim](https://roblab.org/eyesim/) website and extends upon the instructions provided from there.

## Steps:

1. Install X1[1](https://file+.vscode-resource.vscode-cdn.net/home/thedoctor/Downloads/EyeSim%20installation%20guide%20for%20Ubuntu%2022.04%20%28By%20TheDoctor%29.md#ref1) library using following command:
    
    ```bash
    sudo apt-get install libx11-dev
    ```
    
2. Download the latest Eyesim for Linux from [here](https://roblab.org/eyesim/ftp/)
    
    * Yes, the `.tag.gz` file.
        
3. Unarchive the `.tar.gz` file in your `home/<your username>` directory!
    
    * This is the directory that is accessed when you do `cd ~`.
        
    * So after unarchiving the zip into your home directory, you should have a `home/<your username>/EyeSim/` directory!
        
4. Open a terminal inside of that EyeSim/ folder.
    
5. Modify the `install.sh` file with a text editor of your choice, and comment out lines 15.
    
    * *But why Ash?* Well, it is desireable for us to keep and copy the `eyesimX` folder to a location of our choice as it has example eyesim programs in C, C++ and python.
        
    * **Also** check line 11 to make sure that the location, where [`eye.py`](http://eye.py) will be placed, is the correct location to put your own python modules.
        
        * If you're not using python3 or if you're using a python version manager such as pyenv, then that directory will be different. (ChatGPT can help you figure out that directory :P)
            
6. Execute the installation script by running `sh install.sh`
    
    * If it says something like
        
    * ```bash
          install.sh: 18: cannot create /etc/ld.so.conf.d/local.conf: Permission denied
        ```
        
        then just run `sudo sh install.sh`
        
    * **Note:** Don't do this with any random scripts! We have looked at the contents of this script so we can trust it. **But still**, just be sure to double check it to make sure there's no *fishy* commands!
        
7. Try running `eyesim` in your terminal. This should open up eyesim, along with a terminal!
    
8. Now to add eyesim to our applications menu (i.e. the place you can search for applications from):
    
    * Open your terminal in the EyeSim/ folder you made, and run `pwd`. Copy that path and paste it somewhere because you'll need it in a sec.
        
    * Create a new file called `eyesim.desktop` somewhere.
        
    * Add these contents to it (replacing `<your copied path!>` with the path you copied when you ran the `pwd` two steps ago):
        
        ```bash
        [Desktop Entry]
        Type=Application
        Name=EyeSim
        Exec=<your copied path!>/EyeSim
        Icon=<your copied path!>/EyeSim_Data/Resources/UnityPlayer.png
        Terminal=false
        Categories=Game;Simulation;
        ```
        
    * Run `chmod +x /path/to/eyesim.desktop` (e.g. if it's on your desktop then `chmod +x ~/Desktop/eyesim.desktop`)
        
    * Now copy that file to `~/.local/share/applications/`
        
        * You can do that by
            
            ```bash
            cp path/to/eyesim.desktop ~/.local/share/applications/
            ```
            
    * Now log out of your machine and log back in.
        
9. You should be able to find Eyesim in your application launcher now! Give yourself a pat on the back :)
    

Let me know absolutely any of your thoughts and ideas down in the comments!
