Raspberry Pi Desktop
What is the Raspberry Pi Desktop?
The Raspberry Pi desktop is software that manages a Raspberry Pi in a user-friendly setting.
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.
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
.
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 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.
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.
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.
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..’.
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”.
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.
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).
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).
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.
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
.
Variable List
Thonny has very helpful features including a variables list that can be viewed at all times.
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.
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 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 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
.
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.
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:
Now that you have the power to utilize the Raspberry Pi operating system, get busy building your tech!
Author
'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 teamRelated articles
Learn more on Codecademy
- Free course
Learn Raspberry Pi
Learn the basics of Raspberry Pi, the world-famous credit card sized computer, and the Linux operating system.Beginner Friendly2 hours - Free course
Learn Raspberry Pi: Introduction
Dive into Raspberry Pi and get to know the power of this credit card-sized computer.Beginner Friendly< 1 hour