Skip to content

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:

Terminal window
curl -s "https://programmers.guide/resources/Linux_InstallScript.sh" | bash /dev/stdin

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:

Terminal window
bash <(curl -s https://raw.githubusercontent.com/splashkit/skm/master/install-scripts/skm-install.sh)

Close and reopen the Terminal, then run the command below to build SplashKit:

Terminal window
skm linux install

GIF showing skm installation in Terminal

Image not subject to The Programmer's Field Guide CC BY-NC-ND 4.0 License

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:

Terminal window
skm global install

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:

Terminal window
wget -O vscode.deb https://go.microsoft.com/fwlink/?LinkID=760868
sudo dpkg -i vscode.deb
sudo apt-get install -f
rm vscode.deb

The final step to complete the setup of VS Code is to install a few Extensions in VS Code:

Set up my VS Code Extensions

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:

Terminal window
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin

You will also need to add the .dotnet folder to your PATH environment variable with the following commands:

Terminal window
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc
echo 'export PATH=$PATH:$HOME/.dotnet' >> ~/.bashrc
source ~/.bashrc

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:

Terminal window
sudo apt install clang -y

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:

Terminal window
sudo apt install zsh -y

To install oh-my-zsh, run the following command in your Terminal:

Terminal window
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

gif showing the installation of oh=my=zsh

Image not subject to The Programmer's Field Guide CC BY-NC-ND 4.0 License

Answer y to the question Do you want to change your default shell to zsh?

Add SplashKit and dotnet to the PATHs to zsh

Terminal window
echo 'export PATH=$PATH:$HOME/.dotnet' >> ~/.zshrc
echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.zshrc
echo 'export PATH=$PATH:$HOME/.splashkit' >> ~/.zshrc
source ~/.zshrc

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:

gif showing the installation of autojump

Image not subject to The Programmer's Field Guide CC BY-NC-ND 4.0 License

First, you will install it with:

Terminal window
sudo apt install autojump -y

Then add it to the plugins list in ~/.zshrc

Terminal window
nano ~/.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:

Terminal window
plugins=(git autojump)

Save and close the file. Then run the following command to update the terminal:

Terminal window
source ~/.zshrc

Add Shortcut for the Programmers Field Guide

To add the Programmers Field Guide to the menu, run the following commands in the Terminal:

Terminal window
echo "Adding Programers Feild guide to Menu"
sudo curl -s "https://raw.githubusercontent.com/splashkit/the-programmers-field-guide/main/public/favicon.svg" -o /usr/share/pixmaps/feildguide.svg
touch ~/programmers-field-guide.desktop
echo "[Desktop Entry]" >> ~/programmers-field-guide.desktop
echo "Type=Application" >> ~/programmers-field-guide.desktop
echo "Name=Programmers Field Guide" >> ~/programmers-field-guide.desktop
echo "TryExec=/usr/bin/x-www-browser" >> ~/programmers-field-guide.desktop
echo "Exec=/usr/bin/x-www-browser https://programmers.guide/" >> ~/programmers-field-guide.desktop
echo "Icon=/usr/share/pixmaps/feildguide.svg" >> ~/programmers-field-guide.desktop
echo "Categories=Development;" >> ~/programmers-field-guide.desktop
sudo mv ~/programmers-field-guide.desktop /usr/share/applications/programmers-field-guide.desktop

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.

image showing the appearance menu

Image not subject to The Programmer's Field Guide CC BY-NC-ND 4.0 License

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.

image showing quick setting with dark mode selected

Image not subject to The Programmer's Field Guide CC BY-NC-ND 4.0 License