Raspberry Pi Desktop

Experience the Raspberry Pi Through the Desktop.

What is the Raspberry Pi Desktop?

The Raspberry Pi desktop is software that manages a Raspberry Pi in a user-friendly setting.

This is an image of the Raspberry Pi operating system desktop.

Booting Up

This article assumes you have one of the Raspberry Raspberry OS with Desktop versions installed. With the OS onto the micro SD card and inserted into the Raspberry Pi, we are ready to power up!

When initially booting up the Raspberry Pi, the desktop will take us through a quick setup.

The window that first pops up when you boot up in the desktop reads, "Welcome to the Raspberry Pi Desktop! Before you start using it, there are a few things to set up. Press 'Next' to get started."

This quick setup will allow us to set the country, language, time zone, a new password, the Wi-Fi network, and we will have the option to update the software. We highly recommend changing the password since all Raspberry Pi’s come pre-configured with the same login credentials (username: pi, password: raspberry). Additionally, we recommend updating the Raspberry Pi upon boot up to ensure all of the packages are updated.

Reboot

When changing the settings on a Raspberry Pi, it is sometimes necessary to reboot the Raspberry Pi before the new settings can take effect. One way to reboot the system is by entering the command sudo reboot in the command-line terminal. Another way to reboot the system is by selecting the Logout option in the application menu. This will bring you to a window where the Reboot option can be chosen.

System Settings

We can change many of the Raspberry Pi settings from the desktop of the operating system. First, we will click on the Raspberry Pi icon in the top left corner of the screen and it will open the application menu. Next, we will click on Preferences and then Raspberry Pi Configuration.

This is a screenshot of the Raspberry Pi icon when it is selected, then the Preference window is selected, and then the Raspberry Pi Configuration is selected.

This is a screenshot of the system tab in the Raspberry Pi Configuration window.

The tabs on the Configuration window are System, Display, Interfaces, Performance, and Localisation. When the System tab is selected we can change the following settings:

  • Password: Used to login to the Raspberry Pi.
  • Hostname: The visible name of the Raspberry Pi.
  • Boot: Select whether the Raspberry Pi will boot up in the CLI (command line/console) or the desktop.
  • Auto login: No login is required upon boot up if this is enabled.
  • Network at Boot: The Raspberry Pi will wait for a network connection before completely booting up if this is enabled.
  • Splash Screen: No splash screen will be present upon boot up if this is enabled.

Localisation Settings

Another tab on the Raspberry Pi Configuration window is the Localisation tab.

This is an image of the Localisation tab in the Raspberry Pi Configuration window.

This tab allows us to change the Locale (Language, Country, and Character Set), Timezone, Keyboard, and Wi-Fi Country. It is important to set the correct Wi-Fi Country as different countries use different networking channels.

Display Settings

The Display tab (found in the Raspberry Pi Configuration window) can be useful if you want to change the Overscan, Pixel Doubling, Screen Blanking, or Headless Resolution settings.

This is an image of the Display tab in the Raspberry Pi Configuration window.

The Overscan setting places a black border around the screen when enabled. This is needed if any text or image gets cut off when reaching the end of the screen.

Connecting to the Wi-Fi

Now that we are finished with the Configuration window, we will connect our Raspberry Pi to the wireless internet. First, click the Wi-Fi icon in the top right corner of the desktop screen.

This is an image of the Wi-Fi symbol.

Then select the desired network and enter the “Pre Shared Key” or passphrase.

Note: An ethernet cable can also be used to connect a Raspberry Pi to the internet.

Audio Output

The audio on a Raspberry Pi can either output to an HDMI connection or a 3.5mm AV Jack. The HDMI output is mainly used for TV speakers or a monitor, and the AV Jack output can be used for headphones or desktop speakers.

To switch between the AV Jack output and the HDMI output, right click the sound icon in the top right corner of the screen.

This is a screenshot of the audio icon in the top right corner of the desktop screen. The audio icon has been selected and a drop-down menu appears with the options to select either "AV Jack" or "HDMI" as the audio output.

Note: You must reboot the system for the new audio output to take effect.

Connect a Bluetooth Device

To connect a Bluetooth device to our Raspberry Pi, we will click on the Bluetooth icon in the top right corner of the screen and select `Add Device..’.

This is a screenshot of the Bluetooth icon in the top right corner of the screen. The Bluetooth icon has been selected and the drop-down menu options read, "Turn Off Bluetooth", "Make Discoverable", and "Add Device..".

Thonny - Code Editor

There are two code editing programs preinstalled onto your Raspberry Pi operating system: Geany and Thonny. Although Geany can be used to create files in over 50 programming languages, we recommend using Thonny to write files for the Raspberry Pi. Thonny is very user-friendly and was designed specifically for Python files.

To find these programs, click the Raspberry Pi icon in the top left corner of the screen and then select Programming.

Thonny Setup

After opening a Thonny window, click on the blue words found in the top right corner of the window that says, “Switch to regular mode”.

This is an image of the Thonny window with the words, "Switch to regular mode" circled.

We must then exit out of Thonny and open it up again so the regular mode will take effect. Now that we are in regular mode, notice the fields at the top of the Thonny window. These were not offered in the simple mode.

This is a small clip of the fields at the top of the Thonny window in regular mode. They read, "File", "Edit", "View", "Run", "Tools", and "Help".

Python Files

When a Thonny window is opened, there will be a blank Python file titled <untitled>. To edit this file, enter your Python code in the white space just below the title.

To save a Python file, click the third icon from the left (floppy disk with a white down arrow).

This is an image of the "save" symbol. This symbol is a picture of a floppy disk with an arrow pointing downward.

Then select where the Python file should be saved, type the name of the file, and click OK.

To create a new Python file, click the “New” icon at the top of the screen (green plus sign).

This is the icon that opens a new Python file. It is a green plus sign.

To run the Python file within the code editor, click the “Run” icon at the top (green circle with a white triangle). If the file is not saved yet, it will first have you save the file.

This is an image of the "run" symbol. This symbol is a green circle with a white triangle inside.

The output from our Python code will appear in the Shell (white space below the Python file). We can also test our Python code by typing it directly into the Shell. If we exit out of the Shell we can pull a new shell up by selecting View (at the top) and then Shell.

This is an image of the Shell in Thonny.

Variable List

Thonny has very helpful features including a variables list that can be viewed at all times.

This is a screenshot of the Thonny window with the variables list highlighted to help you find it.

To place the variables list on the Thonny window, click View (top of the window) and then Variables.

Syntax Highlighting

Thonny also has syntax error highlighting so that unclosed parenthesis and quotes are highlighted.

This is a screenshot of the word "Smith" without the closing parenthesis, therefore it is highlighted green to notify you of the mistake.

Code Completion

Code completion is another helpful tool in Thonny. After typing a letter or two in the code editor, hit tab and a list of valid elements will appear. If nothing appears then there is no valid code for what was typed.

Debugging

On the top of the Thonny window is a button for debugging:

This is an image of the debugging symbol. It is a black square with white lines and has small green arrows pointing to each white line.

This button will then highlight the first line of code. To run each line of code continue to press the “Step Over” button (boxed in red below).

This is an image of the Thonny window after you click the debugging symbol. The first line of the Python file is highlighted yellow, and the "Step Over" button (to the right of the debugging button) is circled in red to show you which symbol will run each line of the Python file.

This will help us find which lines of code run properly and which ones do not.

Web Browser

To open a web browser in Raspberry Pi OS, click on the Raspberry Pi icon, select Internet and then choose which browser to open.

Note: You must be connected to the internet for the web browser to work.

File Manager

To view and edit the files on a Raspberry Pi, we can use the File Manager by clicking on the Raspberry Pi icon, selecting Accessories, and then File Manager.

Command-Line Terminal

The command line is a text interface that uses text commands to manage the computer. To open a command line in Raspberry Pi OS, click on the Raspberry Pi icon in the top left corner of the screen, select Accessories, and then Terminal. If there is a Terminal shortcut on the taskbar, then we could click this instead of using the application menu.

To practice in the command line, we will enter the command pwd to view the system path of the current working directory (the folders we are currently in). Notice in the example below, the current working directory is /home/pi.

This is a screenshot of the command line after you enter the `pwd` command and the `ls` command. The output from the `pwd` command is `/home/pi` and the output from the `ls` command is the list of files in `/home/pi`.

We also entered the command ls to view the list of folders and files within this directory. If you open the File Manager again and select the pi folder, you will see the same folders and files.

Update Raspberry Pi

It is important to update the Raspberry Pi to ensure the newest versions of every package are being used.

First, we will open a command-line terminal and enter the following command:

sudo apt update

This will update the list of packages on our Raspberry Pi. This is important so that new packages are available to install.

Next, we will upgrade the already installed packages to their latest versions with:

sudo apt upgrade

After we enter this command in the command line, the following text will appear:

Do you want to continue? [Y/n]

Make sure to type Y and hit Enter so the Raspberry Pi can finish upgrading.

This is an image of the command line after the `sudo apt update` and `sudo apt upgrade` commands have been entered.

Shutdown, Reboot, or Logout

To either shutdown, reboot, or log out of the Raspberry Pi, click on the Raspberry Pi icon (top left corner of the screen) and select Logout. This window will then appear:

This is a small screenshot of the "Logout" menu. The options are "Shutdown", "Reboot", and "Logout".

Now that you have the power to utilize the Raspberry Pi operating system, get busy building your tech!

Author

Codecademy Team

'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'

Meet the full team