Set up my Linux Box
Linux is an open-source operating system that is widely used for programming and development. Being open-source, there are several versions available called distributions (distros); this guide will focus on Debian, which is the base for many popular distros such as Ubuntu and Raspberry Pi OS. If you use a different Linux distro, the steps may differ slightly.
In this guide, we will walk through the steps to install the necessary Applications and Tools that you will need to code in C# and C++ with SplashKit. To simplify things, we have an automated script for fresh installs that will install all the required tools and applications for you, or you can follow the manual steps.
1. Automated Setup
This script will install the following applications and tools:
- Visual Studio Code
- C/C++ Extensions
- C# Extensions
- .NET SDK
- SplashKit
- SplashKit Global
- wget
- git
- curl
- clang
Open the Terminal and run the following command:
Once the automated script has finished running, close and reopen the Terminal.
Run the command skm
to check SplashKit is installed correctly.
2. Manual Setup Steps
If you choose not to use the automated setup above or are experiencing issues, you can follow these steps below:
1. Install the SplashKit SDK
SplashKit is a beginner’s all-purpose software toolkit that will allow you to create fun and exciting programs more easily, especially for Graphical User Interface (GUI) programs.
Copy and paste the following command into your Terminal window to download and run the SplashKit installer:
Close and reopen the Terminal, then run the command below to build SplashKit:
2. Install SplashKit Globally
Finally, you will need to install the SplashKit Global Libraries. This will install the SplashKit libraries and library include files into the system’s default global locations so that the compiler can find these files when building (compiling) programs created with SplashKit.
To install SplashKit globally, copy and paste the following command into your Terminal window:
3. Install Visual Studio Code
Visual Studio Code, also commonly known as VS Code or just Code, is a powerful and versatile code editor that enables efficient coding, debugging, and collaboration for your SplashKit projects!
On Debian, running the following commands will download and then install Visual Studio Code:
Recommended Extensions
The final step to complete the setup of VS Code is to install a few Extensions in VS Code:
Go to the page linked above, follow the steps to install both the C# and C/C++ recommended extensions, and then come back here and continue to the next step. You can use the “Back button” in your browser to return to this page.
4. Install Language Specific Tools
Some coding languages require specific tools/frameworks to be installed to be able to build and run your code files.
As you will be coding in C# and C++ in this book, let’s look at the tools needed for these languages:
C# Tools
For coding in C#, you will need to install the .NET
SDK which will allow you to use the dotnet terminal command to create, build, and run your C# project code.
Download the latest version of the .NET SDK using the following command:
You will also need to add the .dotnet folder to your PATH environment variable with the following commands:
Test dotnet is installed correctly by running dotnet --version
in the Terminal.
For more details on the process, refer to this article Deploy .NET apps on ARM single-board computers
C++ Tools
For coding in C++, you will need to have a C++ compiler installed to build your C++ code into a file you can use to run your program. Commonly used compilers are g++
and clang++
.
g++
is installed by default.
To install clang++
run the following command:
3. Optional Steps
Setup zsh shell
When using the terminal, you are actually interacting with a shell, where the default is bash, but other shells are available.
Here, we will install zsh and oh-my-zsh to customise the terminal. These will give you a more user-friendly terminal experience with themes and plugin support.
To install zsh, run the following command in your Terminal:
To install oh-my-zsh, run the following command in your Terminal:
Answer y
to the question Do you want to change your default shell to zsh?
Add SplashKit and dotnet to the PATHs to zsh
Plugins
Several plugins are available for oh-my-zsh that add additional functionality to the terminal.
This article has a list of pre-installed plugins, although there are others available as well.
To install a plugin, add it to the plugin list in the ~/.zshrc
file.
Using autojump
as an example:
First, you will install it with:
Then add it to the plugins list in ~/.zshrc
Navigate to the plugins line and add autojump
to the list. git
will be listed already.
Use a space to separate the plugins as shown below:
Save and close the file. Then run the following command to update the terminal:
Add Shortcut for the Programmers Field Guide
To add the Programmers Field Guide to the menu, run the following commands in the Terminal:
Desktop Background
To customise the desktop background, right-click anywhere on the desktop and select Change Background (Properties on the Raspberry Pi). Then, select the image or theme you want to use as your background.
You can toggle dark mode by clicking on the icon in the top right of the screen and selecting the mode you want to use.