Chapter 4

Working with Applications

The Raspberry Pi comes with a basic set of preinstalled desktop applications. You can use them to finish setting up your Pi before you begin learning more about the Linux operating system.

Introducing the Raspberry Pi Apps

Set Up Wi-Fi

View Web Pages

Work with Files in File Manager

Edit Text with Leafpad58

Configure the Desktop

Configure the Launch Panel

Introducing Raspberry Pi Apps

The Raspberry Pi uses an operating system called Linux, which is popular with software developers. Linux comes in many different distros, or distributions. The official distro for the Pi is called called Raspbian Wheezy, a customized version of Debian, a distro known for its reliability. (The Pi includes a reference guide to Debian on the desktop, but the content is very technical.) In spite of the unusual name, Wheezy includes many familiar features. You can work with it by typing commands from the keyboard, or by launching applications from a desktop and using a mouse, keyboard, menus, and icons.

Understanding the Linux Desktop

9781118768198-fg0401.tif

In Linux, the desktop is a just another application. You can launch it manually after the Pi boots with the startx command. You can also select a Boot to Desktop option using raspi-config. Larger variants of Linux give you a choice of desktops. Because the Pi is a small computer with limited memory, Wheezy includes a single lightweight desktop application called LXDE.

Browse the Web

9781118768198-cf0401.tif

The default desktop on the Pi includes a web browser called Midori. Midori is designed for slow computers with limited memory but still provides advanced features such as tabs, page code inspection, and support for Mozilla plug-ins. On the Pi, Midori runs more slowly than the desktop browsers you may be used to.

Work with Commands

9781118768198-cf0402.tif

Because text commands are so widely used in Linux, LXDE includes a terminal application called LXTerminal. Terminal is an old computing word for a device that accepts text commands and displays text output.

Edit Text Files

9781118768198-fg0402.tif

Wheezy's text editor is called Leafpad. It is similar to Notepad on Windows and TextEdit on the Mac. However, Leafpad does not allow you to edit many important files. To fix this you must understand Linux security. For details, see the information about becoming a superuser in Chapter 5.

Work with Games and Software

9781118768198-cf0403.tif

Because the Pi is designed for education, it includes a “toy” programming language for kids called Scratch. It also includes two versions of the popular Python programming language and a set of extensions for Python called Pygame, which makes it easy to create simple animated games. Scratch, Python, and Pygame are described in later chapters.

Check Your Speed

9781118768198-cf0404.tif

Because the Pi is slow, apps often take longer to respond than you may be used to. LXDE lacks an hourglass or a spinning beach ball to show when the operating system is busy. However, the bottom of the taskbar shows a miniature graph that tells you how hard the Pi is working. When the graph is solid green, the Pi is busy and may respond slowly.

Set Up Wi-Fi

You can connect your Pi to a network with Wi-Fi. To use Wi-Fi, plug an optional Wi-Fi dongle — a small aerial — into one of your Pi's USB ports. You can then configure a connection with the wpa_gui application on the desktop.

Always plug in a dongle with the power off. In theory, your Pi should be able to cope with live connection/disconnection. In practice, the power drained by a dongle may crash it, forcing it to reboot.

Set Up Wi-Fi

001.eps Plug a Wi-Fi dongle into one of the Pi's USB ports or into a connected USB hub.

002.eps Launch the desktop with startx if it is not already open.

9781118768198-fg0403.tif

003.eps Double-click wpa_gui.

The wpa_gui application dialog box opens.

004.eps Click Scan.

A dialog box opens and the Pi scans the available networks.

9781118768198-fg0404.tif

005.eps Double-click a network to set up a password.

Note: The signal column shows how strong the Wi-Fi signal is for each network. The smaller the number, the stronger the signal.

9781118768198-fg0405.tif

006.eps If the network uses WPA security, type the network password into the PSK box.

Note: If the network uses older and less secure WEP security, select Static WEP (Shared Authentication) from the Encryption menu and type the WEP key (or keys) into the WEP Keys box.

007.eps Click Add.

The Pi connects to the Wi-Fi network you selected.

9781118768198-fg0406.tif

A You can click Connect if the wap_gui does not connect automatically.

View Web Pages

You can view web pages with the Midori browser. To open Midori, double-click its desktop icon. Midori includes support for tabs and for Mozilla-format plug-ins.

Midori on the Pi is not a speedy browser. Pages take a few seconds to load — noticeably longer than they take on a recent PC or Mac.

View Web Pages

001.eps Launch the desktop if it is not already open.

9781118768198-fg0407.tif

002.eps Double-click Midori.

9781118768198-fg0408.tif

A Midori loads with a default page showing an introductory help file.

003.eps To view a different page, type its URL into the browser bar, just as you would when using a mainstream browser.

Midori goes to the new web page.

9781118768198-fg0409.tif

004.eps To perform a web search, type a phrase into the search bar.

005.eps To select a different search engine, click and hold the icon at the left of the search bar.

Note: By default, Midori uses the Duck Duck Go search engine.

006.eps To open another tab, click the New Tab icon (9781118768198-ma006.tif).

9781118768198-fg0410.tif

007.eps Click the gear icon (9781118768198-ma007.tif) to view more options.

008.eps Click Preferences.

The Preferences opens.

009.eps Click any tab to select a set of preferences, such as Startup or Fonts.

Work with Files in File Manager

You can navigate the file system using the File Manager tool on the desktop. To launch File Manager, click the icon to the right of the LXDE icon in the Application Launch bar. The Pi user can also double-click the File Manager icon.

Use the Forward, Back, and Home buttons to navigate through folders. A “level up” takes you to the containing folder one level up the directory tree. File Manager launches with a view of the /home/pi folder. To view the list of system folders, type / in the address bar. To open any folder, double-click it.

Work with Files in File Manager

001.eps Launch the desktop if it is not open.

9781118768198-fg0411.tif

002.eps Click the File Manager icon (9781118768198-ma008.tif) in the Application Launch bar.

A You can also click the LXDE icon (9781118768198-ma009.tif), Accessories, and then File Manager.

B LXDE launches File Manager in a window.

Note: Even if you are running as root, File Manager always displays the /home/pi folder.

9781118768198-fg0412.tif

003.eps To view the main system folder, drag the mouse over home/pi to highlight it, press 9781118768198-delete.tif or 9781118768198-bksp.tif, and press 9781118768198-ent.tif.

C File Manager displays the contents of /, the main system directory.

004.eps To open a folder, double-click it.

9781118768198-fg0413.tif

005.eps Repeat the double-click to drill down into a series of folders inside the / folder.

Note: This example shows the results of double-clicking home, Pi, and then Desktop to view/home/pi/Desktop.

006.eps Double-click IDLE to launch the Python editor application.

9781118768198-fg0414.tif

D The application launches in a new window.

Note: You can double-click any application to launch it.

Note: If a file is a text file or image, right-click it to view more options. For example, you can edit a text file with Leafpad.

Edit Text with Leafpad

You can use Leafpad to edit text files. Leafpad is a simple WYSIWYG (What You See Is What You Get) text editor with basic features. It is not a word processor, but you can use it to edit your Pi's configuration files.

Note that Leafpad does not allow you to edit critical files unless you have root superpowers. Use File Manager to promote yourself to root before you try to edit important files. For more about promoting yourself to root, see the previous section, “Work with Files in File Manager,” and also Chapter 5.

Edit Text with Leafpad

9781118768198-fg0415.tif

001.eps Click the LXDE icon (9781118768198-ma009.tif).

002.eps Click Accessories.

003.eps Click Leafpad.

9781118768198-fg0416.tif

A Leafpad launches with an empty window.

004.eps Type some text.

9781118768198-fg0417.tif

005.eps Click File.

006.eps Click Save As.

007.eps Click the pi icon to save the file to the /home/pi folder.

008.eps Type a name for the file.

009.eps Click Save.

Leafpad saves the file to your home folder.

9781118768198-fg0418.tif

010.eps Click the File Manager icon (9781118768198-ma008.tif).

File Manager launches if it is not already open.

011.eps Double-click the file you saved.

B Leafpad opens in a new window and loads the file into it.

Configure the Desktop

If you experiment with the desktop's many menus, you can find plenty of configuration options. With the most useful options you can customize the wallpaper, and add or remove icons on the desktop. Ignore the other options, which are not essential. Changing them may break the desktop.

Note there are two desktops. They show the same icons, but you can have different windows open on them. To switch desktops, click the blue/white rectangles in the bottom bar.

Configure the Desktop

9781118768198-fg0419.tif

001.eps Right-click the desktop.

002.eps Click Desktop Preferences.

003.eps In the Desktop Preferences, click the Wallpaper box.

004.eps Select a new file from the file selector.

005.eps Click Open.

The new wallpaper loads.

Note: The Pi does not include preinstalled wallpaper files. Use Midori to search for and save alternative wallpapers. Or you can leave the default Raspberry Pi wallpaper unchanged.

9781118768198-fg0420.tif

006.eps To change the font used for the desktop icons, click the Label text font box in the Desktop Preferences.

007.eps Select one of the alternative fonts.

Note: You can see a preview of the font in the Preview box.

008.eps Click OK.

Note: Do not access the Advanced tab in Desktop Preferences. You may accidentally remove the right-click menu.

9781118768198-fg0421.tif

009.eps Click the File Manager icon (9781118768198-ma006.tif).

File manager launches.

010.eps Type /usr/share/application into the address bar and press 9781118768198-ent.tif.

Note: You can also type / to navigate to the root folder and then drill down by double-clicking the usr, share, and applications folders.

A File Manager displays a list of installed applications.

9781118768198-fg0422.tif

011.eps Press and hold 9781118768198-ctrl.tif and drag an application icon to the desktop to add it.

Note: You can keep adding applications until your desktop is full.

012.eps To remove an application from the desktop, right-click it.

013.eps Click Delete.

Note: Deleting an icon removes it from the desktop. It does not remove the application from your Pi.

Configure the Launch Panel

The Launch Panel is unique to LXDE. It is based on the Quick Launch apps that appear in the Windows XP taskbar. It looks like a single bar, but in fact it includes multiple items, including the main Start menu, quick links to File Manager and Web Browser, a CPU performance graph, and so on.

You can add and remove items and customize each item to control what it includes. You can also insert spacers between items to push them toward the left or right of the panel.

Configure the Launch Panel

9781118768198-fg0423.tif

001.eps Right-click the second or third icons from the left of the launch panel.

002.eps Click “Application Launch Bar” Settings.

The Application Launch Bar Preferences open.

003.eps Click Web Browser.

004.eps Click Remove.

Note: This removes the Dillo web browser that is preinstalled on the launch panel.

9781118768198-fg0424.tif

005.eps Click the triangle next to Internet.

006.eps Click Midori.

007.eps Click Add.

008.eps Click Close.

A A Midori icon appears in the launch panel.

9781118768198-fg0425.tif

009.eps Right-click the launch panel.

010.eps Click Panel Settings.

The Panel Preferences open.

011.eps Click the Panel Applets tab.

012.eps Click Add.

The Add Plugin to Panel pane appears.

9781118768198-fg0426.tif

013.eps Click Temperature Monitor.

014.eps Click Add.

B A temperature monitor appears on the panel.

015.eps Click Up or Down to move the monitor left or right on the panel.

Note: You can click Remove to remove an item from the launch panel.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.247.77