Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

Embed Size (px)

Citation preview

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    1/473

    A Division of Macmillan Computer Publishing201 West 103rd St., Indianapolis, Indiana, 46290 USA

    Nicholas Wells

    KDE

    in24 Hours

    Teach Yourself

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    2/473

    Sams Teach Yourself KDE in 24 HoursCopyright © 1999 by Sams Publishing

    All rights reserved. No part of this book shall be reproduced, stored in aretrieval system, or transmitted by any means, electronic, mechanical, photo-copying, recording, or otherwise, without written permission from the pub-lisher. No patent liability is assumed with respect to the use of the informationcontained herein. Although every precaution has been taken in the preparationof this book, the publisher and author assume no responsibility for errors oromissions. Neither is any liability assumed for damages resulting from the useof the information contained herein.

    International Standard Book Number: 0-672-31608-0

    Library of Congress Catalog Card Number: 98-83128

    Printed in the United States of America

    First Printing: April 1999

    01 00 99 4 3 2 1

    TrademarksAll terms mentioned in this book that are known to be trademarks or servicemarks have been appropriately capitalized. Sams Publishing cannot attest tothe accuracy of this information. Use of a term in this book should not beregarded as affecting the validity of any trademark or service mark.

    Warning and DisclaimerEvery effort has been made to make this book as complete and as accurate aspossible, but no warranty or fitness is implied. The information provided is onan as is basis. The author and the publisher shall have neither liability orresponsibility to any person or entity with respect to any loss or damagesarising from the information contained in this book or from the use of theCD-ROM or programs accompanying it.

    EXECUTIVE EDITORJeff Koch

    AQUISITIONS EDITORGretchen Ganser

    DEVELOPMENT EDITORSean Dixon

    MANAGING EDITORBrice Gosnell

    PRODUCTION EDITORGretchen Uphoff

    COPY EDITORPamela Woolf

    PROOFREADERBilly Fields

    TECHNICAL EDITORKurt Wall

    SOFTWARE DEVELOPMENTSPECIALIST

    Craig Atkins

    INTERIOR DESIGNGary Adair

    COVER DESIGNAren Howell

    LAYOUT TECHNICIANSBrandon AllenStacey DeRomeTimothy OsbornStaci Somers

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    3/473

    Contents at a GlanceIntroduction 1

    PART I INSTALLING AND RUNNING KDE 51 Understanding the KDE Project 7

    2 Installing KDE from Scratch 21

    3 Starting and Exiting KDE 33

    4 Reviewing the KDE Setup 55

    PART II CUSTOMIZING Y OUR KDE S ETTINGS 69

    5 Exploring the Desktop 716 Managing the KDE Environment 89

    7 Configuring KDE Options 109

    8 Using KDE Themes 133

    9 Managing Files in KDE 153

    10 Learning More KDE File Management 175

    PART III S YSTEM ADMINISTRATION FOR KDE 19311 Using KDE System Management Utilities 195

    12 Using KDE Utilities 221

    13 Managing Network Connections in KDE 237

    14 Managing Printing in KDE 257

    15 Accessing the Internet from KDE 269

    16 Using the Command Line in KDE 289

    PART IV U SING ADDITIONAL KDE A PPLICATIONS 29917 Using Graphics Utilities in KDE 301

    18 Using KDE Text Utilities 31519 Using KDE Business Tools 335

    20 Using KDE for Entertainment 355

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    4/473

    21 Finding and Installing Additional KDE Applications 373

    22 Integrating Non-KDE Applications into KDE 385

    PART V DEVELOPING FOR KDE 40523 Getting Started with KDE Development 407

    24 Developing for KDE 419

    Index 433

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    5/473

    ContentsINTRODUCTION 1

    PART I INSTALLING AND RUNNING KDE 5

    HOUR 1 U NDERSTANDING THE KDE P ROJECT 7

    Understanding the Background of KDE..................................................................7Goals of the KDE Project ............................................ ......................................9Development Model ...................................... ............................................ ......10The Graphical Toolkit of KDE ........................................... .............................11International Scope of KDE ......................................... ...................................13

    Summarizing the KDE Project ......................................... .....................................13Components of KDE Base ........................................... ...................................14

    Participating in the KDE Project ..................................... .....................................15Learning to Work on KDE Projects ........................................... .....................16

    Comparing KDE to the GNOME Desktop............................................................16Summary................................................................................................................18Questions and Answers..........................................................................................18Exercise..................................................................................................................19

    HOUR 2 I NSTALLING KDE FROM SCRATCH 21

    Reviewing Your X Window System ........................................... ...........................22Downloading the KDE Files..................................................................................23

    Deciding Which Files to Download ........................................... .....................24Reviewing the Downloaded Files ......................................... ...........................26

    Installing KDE ...................................... ........................................... .....................27Configuring KDE as Your Graphical Environment ....................................... .......28Reviewing the Installed KDE Files .......................................... ............................29Summary................................................................................................................30Questions and Answers..........................................................................................30Exercises ......................................... ........................................... ............................31

    HOUR 3 S TARTING AND EXITING KDE 33

    Starting KDE in OpenLinux..................................................................................33Starting Another Window Manager in OpenLinux 1.3 ....................................35Starting KDE in Previous Versions of OpenLinux ......................................... .35

    Starting KDE in SuSE Linux ..................................... ...........................................36Starting KDE from a Clean Install ............................................ ............................37

    Starting the X Window System in Red Hat Linux ..........................................37Starting KDE from the startx Script ......................................... .....................38Reviewing the Initial KDE Startup ..................................... .............................39

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    6/473

    Diagnosing Trouble Starting KDE ......................................... ...............................39Logging Out of KDE .......................................... ........................................... .......40

    Using a Standard KDE Logout .......................................... ..............................40

    Using the Emergency Exit................................................................................42Setting Up a Graphical Login with kdm ........................................ ......................43

    Initializing xdm ...................................... ........................................... ...............43Setting KDE as the Graphical System for xdm ..................................... .........45Changing from xdm to kdm ........................................ ....................................45Using the kdm Log in Prompt Dialog Box......... ............................................ .46Changing the Background in xdm or kdm ........................................ ..............47

    Configuring kdm....................................................................................................47Summary................................................................................................................52Questions and Answers..........................................................................................53Exercises ........................................ ........................................... .............................53

    HOUR 4 R EVIEWING THE KDE S ETUP 55

    Defining a User of KDE ........................................... ...........................................55Reviewing the Contents of the .kde Directory ....................................... ...............56

    The config Subdirectory..................................................................................57The apps Subdirectory......................................................................................58The applink Subdirectory....... ........................................... ..............................59The bin and boot Subdirectories......................................................................61The dev , icons , and mimelnk Subdirectories ..................................................61

    Reviewing the Desktop Directory..........................................................................63The Autostart Folder ........................................... ............................................ .64

    The Templates Folder .......................................... ........................................... .65The Trash Bin Folder........................................................................................66Placing Other Items on the KDE Desktop ....................................... ...............67

    Other Notes on KDE Setup ....................................... ...........................................67Summary................................................................................................................67Questions and Answers..........................................................................................68Exercises ........................................ ........................................... .............................68

    PART II CUSTOMIZING Y OUR KDE S ETTINGS 69

    HOUR 5 E XPLORING THE DESKTOP 71

    Reviewing the KDE Environment ..................................... ...................................72The Taskbar ............................................ ........................................... ...............72The Desktop......................................................................................................74The Panel ......................................... ........................................... ......................76The Main K Menu......................................... ........................................... ........78

    Using the KDE Online and Pop-up Help ....................................... .......................78

    vi Sa ms Tea ch Yo urself KDE in 24 Ho urs

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    7/473

    Using KDE Pop-up Help..................................................................................79Using Help Buttons ........................................ ............................................ ......80

    Learning to Manipulate KDE Windows.......................................... ......................80

    Using Standard Window Tools ........................................... .............................81Keyboard Control of Windows ..................................... ...................................82

    Using the Keyboard in KDE..................................................................................83Using Multiple Desktops ............................................ ..........................................85

    Switching Between Desktops ...................................... ....................................85Renaming Desktops..........................................................................................85

    Summary................................................................................................................86Questions and Answers..........................................................................................87Exercises ......................................... ........................................... ............................87

    HOUR 6 M ANAGING THE KDE E NVIRONMENT 89

    Working with Application Windows........................................................ ..............89Switching Between Windows ...................................... ....................................90

    Moving Applications Between Desktops ........................................ ......................92Introducing the KDE Control Center ....................................... .............................92Setting Panel and Taskbar Options....... ........................................... ......................93

    Setting the Location of the Taskbar and Panel ........................................ ........94Setting the Panel Size ..................................... ........................................... ......95Setting Other Panel and Taskbar Options .......................................... ..............96Clearing Your Desktop .......................................... ..........................................98Adding Desktops ..................................... ........................................... ..............98

    Changing How KDE Windows Appear and Operate ...................................... ......99

    Changing Which Buttons Are on the Title Bar .......................................... ....100Defining a New Title Bar ...................................... ........................................101Defining Window Policies..............................................................................103

    Summary..............................................................................................................106Questions and Answers........................................................................................106Exercises ......................................... ........................................... ..........................107

    HOUR 7 C ONFIGURING KDE O PTIONS 109

    Choosing Colors and Wallpaper ........................................ ..................................109Setting the Background Color........................................................................110Choosing Wallpaper........................................................................................113

    Using a Color Scheme....................................................................................115Setting Up the Screensaver..................................................................................117Selecting Screensavers ..................................................................................119Adding Screensaver Options ........................................ ..................................120

    Enabling Desktop Positioning Features ......................................... .....................120Using Active Desktop Borders .......................................... ............................121Using Magic Borders......................................................................................122

    Co nt ent s vi

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    8/473

    Choosing a Language ........................................ ............................................ ......122Selecting Display Fonts ..................................... ........................................... ......125Configuring Desktop Icons..................................................................................127

    Using Style Options ........................................... ............................................ .....128Configuring Sounds ........................................... ............................................ .....129

    Setting the Bell Sound....................................................................................129Defining Sound Events ......................................... .........................................130

    Summary..............................................................................................................132Questions and Answers........................................................................................132Exercises ........................................ ........................................... ...........................132

    HOUR 8 U SING KDE T HEMES 133

    Understanding KDE Themes ........................................... ...................................133Finding a KDE Theme ...................................... ............................................ ......135

    Searching for Themes ........................................ ............................................135Downloading a Theme ........................................ ..........................................137

    Installing a KDE Theme ..................................... ........................................... ......138Preparing the Archive ......................................... ...........................................138Reviewing the READMEFile ............................................................................139Creating KDE Directories ........................................... ...................................140Copying Graphics Files ....................................... ...........................................140Updating the Configuration Files ...................................... ............................141Choosing the Theme in the Control Center ........................................... .......144Restarting KDE ...................................... ........................................... .............147Using Installation Scripts ........................................... ...................................148

    Getting Rid of a Theme ..................................... ........................................... ......149Creating Your Own KDE Theme ...................................... ..................................150Summary..............................................................................................................151Questions and Answers........................................................................................151Exercise................................................................................................................152

    HOUR 9 M ANAGING FILES IN KDE 153

    Understanding the KDE File Manager ........................................... .....................153Integrating kfm and the Disk Navigator into KDE....................................... .154How kfm Is Used............................................................................................154How the Disk Navigator Is Used....................................................................155

    Browsing Your Local File System ......................................... .............................156Running Programs from kfm..........................................................................158Defining an Application in kfm......................................................................159Using Drag and Drop .......................................... ..........................................163

    Using kfm Bookmarks ....................................... ........................................... ......164Configuring kfm .......................................... ........................................... .............165

    viii Sa ms Tea ch Yo urself KDE in 24 Ho urs

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    9/473

    Choosing How to View Objects ............................................ ........................165Selecting Cache Settings ....................................... .........................................168Configuring the Browser Options ........................................ ..........................170

    Reviewing the kfm Configuration Files ...................................... ..................172Summary..............................................................................................................172Questions and Answers........................................................................................172Exercises ......................................... ........................................... ..........................173

    HOUR 10 L EARNING MORE KDE F ILE MANAGEMENT 175

    Creating KDE Links ..................................... ............................................ ...........175Creating a Program Link................................................................................176Creating a Device Link .......................................... ........................................178

    Using the Autostart Folder ......................................... .........................................181Placing Objects on the Desktop ......................................... .................................183

    Modifying the Main Menu ......................................... .........................................186Modifying the Panel Icons .......................................... ........................................189Summary..............................................................................................................191Questions and Answers........................................................................................191Exercises ......................................... ........................................... ..........................192

    PART III S YSTEM ADMINISTRATION FOR KDE 193

    HOUR 11 U SING KDE S YSTEM MANAGEMENT UTILITIES 195

    Setting Keyboard and Mouse Options ...................................... ..........................196Setting Up International Keyboards .......................................... ....................198

    Using kfind to Locate Files ....................................... .........................................200Working With the Files You Find ....................................... ...........................201Performing Advanced Searches................................................. .....................203

    Using kpackage for Software Maintenance ........................................... .............205Managing Initialization Scripts............................................................................207

    Defining Some Terms ........................................... .........................................207Running the SysV Init Editor ....................................... .................................209

    Managing User Accounts ........................................... .........................................211Adding and Modifying Users ...................................... ..................................212Managing Groups .......................................... ............................................ ....214

    Viewing System Information ..................................... .........................................214

    Summary..............................................................................................................219Questions and Answers........................................................................................219Exercises ......................................... ........................................... ..........................220

    HOUR 12 U SING KDE U TILITIES 221

    Using the ark Archival Utility..............................................................................221Extracting Files from an Archive ....................................... ...........................222Creating a New Archive ........................................ ........................................225

    Co nt ent s ix

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    10/473

    Using the Scientific Calculator............................................................................227Using KNotes ....................................... ........................................... ....................230Learning About Other KDE Applications ..................................... .....................233Summary..............................................................................................................234Questions and Answers........................................................................................234Exercises ........................................ ........................................... ...........................235

    HOUR 13 M ANAGING NETWORK CONNECTIONS IN KDE 237

    Understanding Linux Networking ........................................... ...........................237Checking Your Ethernet Connections ...................................... ............................238Establishing a PPP Connection............................................................................242

    Understanding PPP ....................................... ........................................... ......242Starting the Kppp Utility................................................................................242Configuring a Kppp Account ...................................... ..................................243

    Configuring Kppp Options ......................................... ...................................248Reviewing Other KDE Connectivity Tools ........................................ ............251

    Managing Samba Within KDE ......................................... ...................................252Using the KDE Samba Monitor ......................................... ...........................253

    Summary..............................................................................................................254Questions and Answers........................................................................................254Exercises ........................................ ........................................... ...........................255

    HOUR 14 M ANAGING PRINTING IN KDE 257

    Understanding Linux Printing ......................................... ...................................257Reviewing Your Print Configuration........................................... .........................259

    Using Linux Print Utilities ......................................... ...................................259The /etc/printcap File ...................................... ..........................................261

    Using K-LJet to Configure Printing ....................................... .............................262Setting Paper Options ........................................... .........................................263Setting Printer Options ....................................... ...........................................264Configuring Operations....................................... ...........................................265Setting Font Options ..................................... ............................................ .....266

    Summary..............................................................................................................268Questions and Answers........................................................................................268Exercises ........................................ ........................................... ...........................268

    HOUR 15 A CCESSING THE INTERNET FROM KDE 269

    Checking Your Internet Connection ....................................... .............................269Reading Email with KMail..................................................................................270

    Configuring KMail ....................................... ............................................ .....270Reading Messages ......................................... ........................................... ......276Creating a New Message................................................................................279

    Browsing Newsgroups ........................................ ........................................... .....282

    x Sa ms Tea ch Yo urself KDE in 24 Ho urs

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    11/473

    Configuring the KDE News Client ....................................... .........................283Reading Newsgroup Messages .......................................... ............................285

    Summary..............................................................................................................287

    Questions and Answers........................................................................................287Exercises ......................................... ........................................... ..........................288

    HOUR 16 U SING THE COMMAND LINE IN KDE 289

    Understanding the Command Line......................................................................289Opening Terminal Emulator Windows ..................................... ...........................290

    Starting from Another Terminal Window ......................................... .............291Using the Single-Command Entry ............................................ ....................292

    Using the Character-mode Console ......................................... ...........................293Configuring kvt....................................................................................................293

    Setting Color and Font Options......................................................................294

    Setting Input and Display Options ..................................... ...........................296Summary..............................................................................................................297Questions and Answers........................................................................................297Exercise................................................................................................................298

    PART IV U SING ADDITIONAL KDE A PPLICATIONS 299

    HOUR 17 U SING GRAPHICS UTILITIES IN KDE 301

    Using KView to View Graphics Files ......................................... .........................301Manipulating an Image ......................................... .........................................303Using the Image List and Slide Show Features ...................................... ......305

    Using KPaint to Create Bitmapped Images ........................................... .............306Manipulating an Entire Image........................................................................307Drawing a New Image....................................................................................309Choosing Object Colors ....................................... .........................................310Using Cut and Paste ....................................... ........................................... ....311

    Exploring Other KDE Graphics Utilities ....................................... .....................311Summary..............................................................................................................312Questions and Answers........................................................................................313Exercises ......................................... ........................................... ..........................313

    HOUR 18 U SING KDE T EXT UTILITIES 315

    Using the KDE Text Editor..................................................................................315Starting the Text Editor ......................................... .........................................316Using Basic KEdit Features ....................................... ...................................318Setting Up KEdit Options ...................................... ........................................322

    Viewing Text Documents ............................................ ........................................324Viewing Other Document Types.............................................................. ............325

    Using the PostScript Viewer ....................................... ...................................325Using the DVI Viewer ............................................ ........................................330

    Co nt ent s x

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    12/473

    Summary..............................................................................................................332Questions and Answers........................................................................................332Exercises ........................................ ........................................... ...........................333

    HOUR 19 U SING KDE B USINESS TOOLS 335

    Using the Address Book ..................................... ........................................... ......335Adding and Managing Entries........................................................................336Using Address Book Entries ....................................... ...................................338

    Using the KOrganizer ......................................... ............................................ .....340Exploring the KOrganizer ........................................... ...................................340Creating a To-do Task List ......................................... ...................................342Saving Information ....................................... ........................................... ......345Managing Appointments ...................................... ..........................................345Configuring KOrganizer Options ....................................... ...........................348

    Using the Time Tracker ............................................ ..........................................350Defining a Task ...................................... ........................................... .............350Tracking Time for Tasks ..................................... ...........................................351

    Using Fax Features ...................................... ........................................... .............352Summary..............................................................................................................353Questions and Answers........................................................................................353Exercises ........................................ ........................................... ...........................354

    HOUR 20 U SING KDE FOR ENTERTAINMENT 355

    Reviewing Your Sound Card and Related Devices..............................................356Using the CD Player ........................................... ........................................... ......356

    The Display Screen ....................................... ........................................... ......357Adding CDDB Information............................................................................357Configuring the CD Player ......................................... ...................................360Exploring the Rest of the CD Player..............................................................363

    Using Other Multimedia Tools ......................................... ...................................364Playing Arcade Games ...................................... ............................................ ......365Playing Other Games ......................................... ............................................ .....368Summary..............................................................................................................370Questions and Answers........................................................................................370Exercises ........................................ ........................................... ...........................371

    HOUR 21 F INDING AND INSTALLING ADDITIONAL KDE A PPLICATIONS 373

    Locating Additional KDE Applications ......................................... .....................374Downloading KDE Applications ..................................... ...................................375Preparing New KDE Applications ......................................... .............................377

    Checking for Development Libraries ...................................... ......................378Unpack the Application Archive ....................................... .............................379Make the Source Tree ......................................... ...........................................380

    xii Sa ms Tea ch Yo urself KDE in 24 Ho urs

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    13/473

    Installing the New Application ..................................... .................................381Running the Application ....................................... .........................................381

    Summary..............................................................................................................382

    Questions and Answers........................................................................................382Exercises ......................................... ........................................... ..........................383

    HOUR 22 I NTEGRATING NON-KDE A PPLICATIONS INTO KDE 385

    Reviewing a Few Non-KDE Applications ....................................... ...................385Locating Applications to Integrate with KDE ........................................ ............388Creating Application Links..................................................................................390Adding to the Desktop, Panel, and Menus ..........................................................394

    Adding an Application to the Desktop ........................................ ..................394Adding an Application to the Main Menu ........................................ ............395Adding an Application to the Panel ............................................ ..................397

    Adding MIME Types .......................................... ........................................... .....398Defining a New MIME Type..........................................................................399

    Summary..............................................................................................................402Questions and Answers........................................................................................402Exercises ......................................... ........................................... ..........................403

    PART V DEVELOPING FOR KDE 405

    HOUR 23 G ETTING STARTED WITH KDE D EVELOPMENT 407

    Reviewing Software Development Concepts .......................................... ............408Using KAppTemplate ............................................................................................409

    InstallingKAppTemplate

    ................................................................................409Running KAppTemplate ..................................................................................410Exploring the Source Code Tree..........................................................................412

    Reviewing the main and widget Files .......................................... ..................414Reviewing the ksmb.cpp File..........................................................................415

    Changing the Source Code ......................................... .........................................416Summary..............................................................................................................417Questions and Answers........................................................................................418Exercises ......................................... ........................................... ..........................418

    HOUR 24 D EVELOPING FOR KDE 419

    Reviewing the Libraries ...................................... ............................................ ....419Expanding the Sample Application ......................................... ...........................420Learning More About KDE Programming ..................................... .....................427Summary..............................................................................................................431Questions and Answers........................................................................................431Exercises ......................................... ........................................... ..........................432Congratulations....................................................................................................432

    INDEX 433

    Co nt ent s xiii

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    14/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    15/473

    About the AuthorN ICHOLAS W ELLS ([email protected]) is the author of several books on Linux-related subjects, including Sams Teach Yourself StarOffice in 24 Hours . After leavingNovell to join Linux-based start-up Caldera, Inc., he worked as the director of marketingfor several years before realizing that writing about technology was more fun than sellingit. He left Caldera to write and consult full-time. When he’s between projects, he likes toread, garden, and generally avoid his computer for a few days.

    Tell Us What You Think!As the reader of this book, you are our most important critic and commentator. We value

    your opinion and want to know what we’re doing right, what we could do better, whatareas you’d like to see us publish in, and any other words of wisdom you’re willing topass our way.

    As the Associate Publisher for the Operating Systems team at Sams Publishing, I wel-come your comments. You can fax, email, or write me directly to let me know what youdid or didn’t like about this book—as well as what we can do to make our booksstronger.

    Please note that I cannot help you with technical problems related to the topic of thisbook, and that due to the high volume of mail I receive, I might not be able to reply to

    every message.When you write, please be sure to include this book’s title and author as well as yourname and phone or fax number. I will carefully review your comments and share themwith the author and editors who worked on the book.

    Fax: (317) 581-4770

    Email: [email protected]

    Mail: Associate PublisherOperating SystemsSams Publishing201 W. 103rd StreetIndianapolis, IN 46290 US

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    16/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    17/473

    IntroductionWhen people talk about Linux becoming a true desktop operating system—somethingthat can replace a Windows or Macintosh system for daily use—they’re usually saying itbecause they’ve seen KDE.

    Linux already has the stability, speed, and appeal needed by many users. It already hasthousands of native applications, including personal productivity tools such asWordPerfect, the Wingz spreadsheet, and Oracle tools. What Linux lacked was ease of use—a simple, familiar interface to access the features that Linux provides. KDE givesyou that interface.

    What Is KDE?Started just two years ago by Matthias Ettrich and continued now by hundreds of con-tributors, KDE is a complete desktop environment. New tools are regularly added foradditional graphical system administration and networking capability, but KDE alreadyincludes features such as

    Multiple virtual desktops, each individually configurable

    Drag and drop between windows

    An Autostart folder

    Pop-up main menu with a personal section

    Taskbar, with Alt+Tab application selection

    Dozens of applets for common uses (editor, calculator, calendar, and so forth)

    For those more familiar with the technical side of Linux, KDE includes

    Its own window manager, fully configurable from the graphical Control Center

    A graphical login (xdm replacement), also configurable from the Control Center

    An object-oriented programming model that makes new applications easy to create

    A user interface definition and programmatic guidelines to create new KDE-awareapplications

    Clear definitions of KDE components and locations so that it can be run on anyLinux system

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    18/473

    2 Sa ms Tea ch Yo urself KDE in 24 Ho urs

    Why Teach Yourself KDE?This book doesn’t assume that you know anything about KDE, although you’ve prob-

    ably at least seen the user interface and might have played with the menus or a few appli-cations.

    If you’re a new Linux user working with a Linux product such as Caldera OpenLinux orRed Hat Linux, this book will guide you through the KDE interface, teaching you how touse its graphical configuration tools, how to set up menus and Autostart options, and howto configure the look and feel of your desktop to meet your needs.

    If you’re an experienced Linux user, this book can provide insight into how the KDEProject is organized. The directory structure and principles behind KDE are explained asexample applications are demonstrated. You will learn how KDE accesses applications,

    where you can place graphics, and how you can hand-edit or explore configuration filesto get the most out of KDE.

    If you already use KDE every day, you might be surprised by how much more there is toknow about it. It’s easy to get into a regular pattern of use with the desktop and applica-tions you use from day to day, but when you start to learn more about them, you find allsorts of new and useful things that you could have used all along. KDE is a completeenvironment; the more you learn about it, the more you’ll find to like. Regular KDEusers will discover new applications, configuration options, and usage tricks to makeKDE even more productive for them. They will also learn more about the underlying

    structure of the system and how the KDE Project got started and continues to providenew features at an amazing speed.

    If you’re hoping to develop KDE applications, this book ends with a gentle introductionto KDE development. It doesn’t teach you C++ (which you’ll have to know to work much with KDE), but it does describe some tools that are available, and it walks youthrough a sample application to show how easily you can create a new KDE applicationand begin to add functionality to it.

    A lot is happening for KDE; stories in the press, inclusion in most of the world’s Linuxdistributions, and now a book dedicated to it. I hope that after reading this book you’ll

    end up as enthusiastic about the usefulness of KDE and its prospects for the futureas I am.

    How to Use This Book This book is designed to teach you the latest version of KDE in 24 concise one-hour ses-sions. Each hour starts with an overview of the topic to inform you what to expect. This

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    19/473

    overview helps you determine the nature of the lesson and whether the lesson is relevantto your needs.

    Each lesson has a main section that discusses the lesson topic in a clear, concise mannerby breaking the topic down into logical component parts and explaining each componentclearly.

    Interspersed in each lesson are special elements, called Tips, Cautions, and Notes, whichprovide additional information.

    In t ro d uct io n

    A tip informs you of a trick or element tha t is easily missed by mo st new KDE users. Feel free to skip the se hints an d a dd itions; how ever, if you skipread ing the m, you might miss a shorter or more efficient w a y to accomplish

    a ta sk described in the ma in text.

    Each lesson concludes with a summary of what you have just learned, a Question andAnswer section that answers the questions users new to KDE most frequently ask about

    that particular lesson’s subject, and exercises that will advance you in further, hands-onstudy of that lesson’s topic.

    A caution deserves at least a s much a tt ention a s the bod y of t he lesson,because these point o ut problemat ic elements of t he operat ing system or agotchas tha t you w ant to a void w hile using t he operat ing system. Igno ringthe informat ion conta ined in a caution could ha ve adverse effects on thestab ility of your comput er. Be caref ul to rea d every caution yo u run across.

    A not e is designed to clarify the concept b eing d iscussed. Not es also cont ainad ditiona l informa tion t hat might be slight ly off-topic but interestingnonet heless. Notes elabora te on t he subject, and if you’re comforta ble w ithyour understa nding of the subject, you can read these to a dd t o your knowl-edg e or bypass them w ith no dang er.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    20/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    21/473

    Hour1 Understa nd ing the KDE Pro ject

    2 Insta lling KDE from Scra tch

    3 St a rt ing a nd Exit ing KDE

    4 Re vie w ing t he KDE Se t up

    PART IInstalling and RunningKDE

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    22/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    23/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    24/473

    As UNIX technology grows in popularity because of the Internet and the growth of Linux, ease-of-use becomes a larger problem. The technology of UNIX and Linux issound; it has been used for 30 plus years and is well-proven. But as thousands of new

    users begin to work with UNIX and especially Linux systems, they do so without theprofessional experience that made UNIX gurus of the past able to make their UNIX sys-tems perform well.

    KDE resolves the ease-of-use issue by providing a complete graphical environment,where applications can be launched, system configuration tools are graphically accessi-ble, and new applications can be written to integrate into a well-known environment.

    8 Ho ur 1

    KDE can be used o n o th er UNIX systems, such a s Sola ris a nd Irix. This boo kuses Linux as the OS platf orm, b ut ne arly all the informa tion a pplies toot her UNIX variant s as we ll (including mo st o f t he installation an d f ile place-ment det ails). Differences betw een KDE running o n va rious versions of Linuxare noted throughout the t ext .

    By late 1996, Linux was already well known in computing circles, being used by mil-lions around the world and written about widely in computer magazines. Because Linuxincludes the source code to the operating system, allowing anyone to update or alter it,this type of project came to be called Open Source software.

    The success of the Linux phenomenon created an atmosphere in which other very largeprojects using the Open Source model could also succeed.

    KDE is an acronym f or the K Deskto p Environme nt. What do es the K standfor? Nothing—just like X in the X Window System .

    The KDE Project was founded in October 1996 by Matthias Ettrich. It wasn’t longbefore hundreds of developers from around the world began to participate.

    As of late 1998, the KDE Project encompassed over 800,000 lines of source code. KDEhas been developed faster than any comparable software development project in history.

    KDE is now organized as a foundation (for legal and liability reasons), with official rep-resentatives around the world (see Figure 1.1). You can find the Web page containing alist of these representatives at http://ettrich.priv.no/kde_official/representatives.html .

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    25/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    26/473

    Increased network transparency on the application level

    An easy-to-use developer’s kit (SDK) to make it easy to create compatible applica-tions

    From the user’s perspective, the most important goals are these:

    Presenting an attractive, modern-looking desktop

    Avoiding application problems with network connections (making the network transparent to the desktop and its applications)

    Integrated online help providing consistent access points and user interface for allapplications

    Providing a consistent look and feel for all applications, including menus, keyboardshortcuts, color schemes, and so forth

    Creating an international product, with keyboard, menu, online help, and applica-tion support in many languages (see the section “International Scope of KDE” laterin this hour)

    Providing hundreds of integrated applications

    Not all these goals have been met in KDE 1.1, but plans are in place for KDE 2.0 tomeet these goals and many others that are specific to certain components of KDE.

    10 Ho ur 1

    One o f t he larg est developme nt p rojects for KDE is the KOffice suite ofa pplication s. KOffice includes a w ord processor, sprea dsheet , g raphical to ols,and othe r applications, integ rated w ith each ot her and KDE. KOffice hasbee n released in bet a f orm, but it isn’t covered in this bo ok. For mo re info r-ma tion, visit http://koffice.kde.org .

    Development ModelTo develop a project as large as KDE in only two years, the KDE Project has organizedinto groups that lead the development. Each working group includes a committee thatreceives software components from the developers working on that project. The commit-tee reviews all proposed fixes and features, and then votes on which of these to includein the KDE.

    The core tenets of the KDE developers are these:

    Focus on your goal and get the software up and running as soon as possible.

    Start with reasonable functionality and configurability, and then improve it itera-tively over time.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    27/473

    Use available tools rather than reinventing everything. (See the next section on Qt,“The Graphical Toolkit of KDE.”)

    When making a suggestion, change “we should” to “I will”; grandiose plans areuseless unless you are willing to put in the work.

    All developers communicate via email lists. Most of these lists are open to anyone whowants to read the messages as the development progresses, but only those who haveshown some skill and background knowledge can post messages to the lists. This keepsthe lists from being cluttered with messages from uninformed spectators.

    Und erst a nd ing t he KDE Pro ject 11

    The KDE de velopers an d suppo rte rs do mee t in pe rson occa sion a lly. The KDEOne confe rence w a s held in December 1997. Other confe rences a re

    announced on the KDE Web site at http://www.kde.org/events.html .

    Most of the KDE components that are described in this book are part of a core distribu-tion of KDE. This is similar to a Linux distribution, in that it is a complete collection of software, easy to download and install. Anyone can get the latest stable KDE distributionfrom the KDE FTP site: ftp://ftp.kde.org or a local mirror site.

    Many additional KDE applications are available from the KDE FTP site, but are notincluded with the core distribution of KDE.

    This is similar to the Linux model, where the kernel and certain applications are gatheredinto a distribution. Other Linux applications are available for download. The difference isthat the KDE distribution is maintained by the KDE team instead of by commercial ven-dors such as Caldera and Red Hat.

    The Graphical Toolkit of KDEIn order to create a complete desktop environment in record time, the KDE Project choseto use a commercially produced graphical development toolkit called Qt , from Troll Techin Norway.

    The Qt toolkit is a C++ class library that includes all the graphical primitives used byKDE to create windows, dialog boxes, and so forth. A great advantage of the free soft-ware community in general is the ability to accept the work of others and build on it.According to the KDE Project leadership, KDE could not have been developed nearly asquickly if a toolkit had been developed from scratch. Qt is a high-quality, cross-platformdevelopment kit that gave the KDE Project a jumpstart on pursuing its ambitious goals.

    The decision to use Qt has been the subject of fierce debate, however, among OpenSource purists who opine that the inclusion of Qt poisons KDE because of its license

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    28/473

    terms, which are not quite as open as those of KDE itself. In particular, the supporters of the GNOME desktop project (described later in this hour) have been vocal in denouncingKDE for using Qt.

    12 Ho ur 1

    Further d iscussion of the se issues can be fo und on the KDE Web site a thttp://www.kde.org/kdeqtfoundation.html , a thttp://www.troll.no/announce/qpl.html , or a t va rious ot her KDE-and Linux-related mailing list archives and Linux publications.

    While the debate has raged in the free software community, thousands of unsuspectingusers have downloaded or purchased an inexpensive copy of KDE (usually with Linux)

    and used it contentedly without the slightest qualm regarding the license of the Qttoolkit.

    For the record, these are the facts:

    Qt is a commercial product from Troll Tech.

    Qt includes source code to the class libraries in the toolkit.

    Anyone can develop software using Qt and give it away as long as the source codeto the software is included.

    Anyone can make changes to the Qt source code as long as those changes are sub-mitted back to Troll Tech for inclusion in the main product.

    Troll Tech ha s also recen tly a nno unced a true Open Source license fo r the irtoo lkit , removing man y of t he concerns that some developers had rega rd-ing KDE.

    If a company wants to sell a product based on Qt without giving away source code, theymust purchase a commercial license to Qt. Ah, there’s the rub.

    Even so, two additional projects are in place to protect the free nature of KDE (informa-tion on both of these is available on the KDE Web site).

    The Free Qt Foundation is set up to provide a succession plan for the Qt productshould Troll Tech “change its mind” or go bankrupt.

    The Harmony project is creating a clone of the Qt toolkit under a true Open Sourcelicense (using the GNU General Public License). This project is proceeding in par-allel with KDE development, and could, in theory, provide a new toolkit to beswapped for the Troll Tech product when Harmony is finished.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    29/473

    International Scope of KDEKDE has been developed by an international cast of programmers, writers, and others.Started by Matthias Ettrich in Germany, KDE rapidly encompassed participants frommany countries. This diverse group encouraged the development of a completely local-ized (internationalized) KDE.

    From its beginnings, KDE has included the necessary technical components to easilywork in multiple nations. The basis of these is the concept of using message files to holdall the text presented onscreen. Message files can be easily translated by nonprogram-mers. The text from the selected language message file is displayed automaticallyonscreen by KDE.

    As you’ll see in Hour 7, “Configuring KDE Options,” setting the language for KDE is as

    easy as selecting from a drop-down list and restarting the desktop. Documentation forcore applications (and many noncore applications) is already available over 30 lan-guages, including Greek, Russian, Chinese, and Romanian. The translation team cur-rently consists of over 100 people.

    Other international settings—such as time zone, currency, preferred date format, key-board layout, and so forth—are part of all KDE applications, such as the KOffice suite.

    KDE is available worldwide, from about 71 mirrored FTP sites in 30 countries. Althoughmost of the communication on KDE mailing lists and discussions takes place in English,KDE participants recognize the international nature of their work and regularly seek

    advice from others on how to make their work applicable to a worldwide audience.

    Und erst a nd ing t he KDE Pro ject 13

    As you read sections of the KDE Web site o r do cumenta tion, yo u’ll findstra ng e spelling s and sent ences. Many w riters for KDE are n ot na tive Eng lishspeakers, but they produce a great deal of KDE material in their free time. Itry to put a w ay my red pencil and a ppreciate the w ork they’ve done.

    Summarizing the KDE ProjectThe KDE Project uses the concept of a distribution, just as the Linux developers do. TheKDE distribution, however, is smaller (typically about 45MB installed) and is completeas downloaded from a KDE mirror site.

    Hour 2, “Installing KDE from Scratch” describes the components of KDE in more detailas you download and install the pieces that you need. In general, however, the KDE dis-tribution is composed of the major components shown in Table 1.1.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    30/473

    TABLE 1.1 —M AJOR COMPO NENTS INCLUDED IN THE KDE DISTRIBUTION

    N am e o f Co m p o n en t D escr ip t i on

    KDE Base The core of KDE: the window manager, file manager, and so forth(see Table 1.2)

    Libraries Run-time libraries for the graphical objects and other functionsused by many KDE applications

    Graphics Viewers for fax, TeX DVI, PostScript, and bitmapped graphics (asimple paint program and fractal generator)

    Utilities Applets: a calculator, text editor, hex editor, file compression tool,PIM, and so forth

    Multimedia Sound utilities for MIDI and WAV, audio CD Player, Sound Mixer

    Admin User administration and initialization script configuration

    Network Client tools for email, dialed and PPP connections, and news reader

    Toys Additional utilities that are not required to run KDE, but are inter-esting or fun

    Games Many types of great cool games: Minesweeper, Tetris, poker,Asteroids, and so forth

    Components of KDE BaseThe only parts of KDE that you must have installed are the KDE Base packages. These

    form the core of KDE that all the other integrated applications referred to in Table 1.1use to run correctly.

    To help you understand more about how KDE is organized, Table 1.2 lists the compo-nents of the KDE Base group of applications.

    TABLE 1.2 —COMPONENTS OF KDE BASE

    Co m po nen t Descr ip t io n

    kaudio The audioserver, running in the background to process audio files

    kbgndwm A background manager for the main window manager, kwm

    kcontrol The central control panel

    kdehelp The help browser (a basic Web browser), launched by choosing KDE Help,pressing F1, or choosing a Help button in a dialog box

    kdm A graphical login system similar to xdm

    kfind The Find tool, accessible from the default KDE Panel

    14 Ho ur 1

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    31/473

    kfm The file manager, used to browse the file system when you open a directoryfrom the Panel (can also be used as a basic Web browser)

    kfontmanager A manager for the fonts used in KDE applications

    kmenuedit The utility for editing the menu entries of the Panel and the taskbar (both partof kpanel)

    kpanel The Panel and taskbar (the main methods of accessing applications and utili-ties in KDE)

    krootwm A module for managing the root window; used by the kwm window manager

    kscreensaver The screensaver utility; configured via an option on the main menu

    kvt A terminal emulation program (a command-line window in KDE)

    kwm The window manager used by KDE; configured by options in the KDEControl Center

    kwmcom The communications tool for the kwm window manager

    kwmpager The pager for the kwm window manager (provides multiple desktops for thewindow manager)

    Und erst a nd ing t he KDE Pro ject 15

    Co m po nen t Descr ip t io n

    Not a ll the compon ent s of t he KDE ba se collection a re required t o run KDE.Some, such a s the kaudio server and t he kdehelp program are useful but notreq uired. The KDE te a m ha s includ ed a ll th ese compo nen ts in KDE Basebecause they constitute a complete core of functiona lity onto w hich ot herprograms specific to net w orking, ad ministrat ion, and so forth, can build.

    Participating in the KDE ProjectEveryone working on the KDE Project works as a volunteer. If you have skills youwould like to add to the effort, your contribution is welcome. The KDE Web site main-tains a list of projects that need help at any moment, located athttp://www.kde.org/jobs.html (see Figure 1.2).

    Although starting with a small KDE application might be a great way to learn or refineyour C++ programming skills, you don’t have to be a developer to participate in thegrowth of KDE:

    Writers prepare documentation for a variety of new KDE applications, includingthe KOffice suite.

    Translators prepare online help and documentation in many languages.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    32/473

    Speakers give presentations about KDE (introductory, technical, marketing, pro-gramming).

    Webmasters create and maintain Web pages to explain KDE and link to relevantnews and technical information.

    The KDE Web site includes lists of projects you can work on, with contact informationto receive more information.

    16 Ho ur 1

    FIGURE 1.2The KDE Web sitemaintains lists of pro-

    jects that new partici- pants can work on.

    Learning to Work on KDE ProjectsIf you’re interested in programming for KDE, you can start with the information in Hour23, “Getting Started with KDE Development,” and Hour 24, “Developing for KDE.”Several development mailing lists are available on the KDE Web site, and a KDE pro-gramming tutorial can be downloaded as well.

    Some knowledge of C++ or other object-oriented programming languages (such asSmalltalk, Python, or similar languages) is helpful, but you might be able to learn byimitating example code to get started.

    Comparing KDE to the GNOME DesktopBecause you might have questions about GNOME as a product related to or competitivewith KDE, this section provides a little background information.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    33/473

    GNOME , the GNU Network Object Model Environment, is an effort to provide anobject-based desktop environment and related utilities and applications to UNIX andUNIX-like operating systems.

    The GNOME Project was started in August 1997, apparently in reaction to the unfavor-able opinion that some free software supporters held toward the KDE Project’s use of theQt libraries (because of the license of Qt, as described earlier). Ironically, some compo-nents of GNOME were developed by starting with the KDE source code.

    GNOME currently has hundreds of developers worldwide working on it. It also has thefinancial backing of Red Hat Software, a major Linux vendor that has provided employ-ees to work full-time on GNOME.

    Und erst a nd ing t he KDE Pro ject 17

    GNOME is ava ilab le from ftp.gnome.org and many mirror sites. Informationon GNOME is a vailab le at http://www.gnome.org or by searching for GNOMEon Linux information sites such as www.linuxhq.com , www.linuxcentral.com ,www.freshmeat.net , or www.lwn.net .

    How are GNOME and KDE similar? The following list points out some basic things thatKDE and GNOME have in common:

    Both are attempts to create a standard, easy-to-use desktop for UNIX and Linux.

    Both are available in binary and source code form for many Linux and UNIX vari-ants.

    Both use object-oriented technology to quickly build a robust graphical environ-ment.

    Both rely on a graphical toolkit to speed their development efforts (Qt for KDE,GTK+ for GNOME).

    Both depend on an international volunteer development community.

    Both freely distribute the results of their work.

    Both include many applications for networking, games, system administration,

    interface configuration, and so forth; both are working hard at completing an officesuite.

    Both are receiving a lot of attention in the free software community.

    Both are distributed most widely as part of a Linux operating system product (RedHat for GNOME, every other Linux distribution for KDE).

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    34/473

    There are also major differences between GNOME and KDE, as the following list illus-trates:

    As of January 1999, KDE has been released as version 1.1 and is stable enough touse from day to day, with concrete plans for release 2.0; GNOME has not yetreached version 1.0 and might be difficult for nonprogrammers to use.

    KDE uses a commercial graphical class library: Qt from Troll Tech, which now hasan Open Source version as well; GNOME uses an Open Source graphical librarycalled GTK+ (used in GIMP and other popular Open Source software).

    KDE includes a window manager as part of its base distribution and installation;GNOME sits on top of your existing window manager (whichever you choose, solong as it is GNOME-compliant; fvwm2 is one example).

    Notice that the list of common traits is longer than the list of differences. Arguments willcontinue to rage on development mailing lists, but both projects are pushing forward theuse of UNIX and Linux as powerful and complete desktop operating systems.

    In fact, the KDE and GNOME teams are working closely toward cross-compatibility of applications and the ability to share other resources (perhaps using an object systembased on Object Request Broker (ORB) technology).

    SummaryThis hour introduces the KDE Project and describes both what it includes and how youcan be involved in its continuing development, if you’re interested in that. You learnedabout the core packages that comprise KDE and how KDE is prepared as a complete dis-tribution, ready to install. You also learned what the GNOME Project is. The next hourwalks you through a complete installation of KDE.

    Questions and AnswersQ Can I use both KDE and GNOME on my Linux system?

    A Yes, sort of, but not at the same time. You should be fairly familiar with both pro-

    jects so you can reset configurations as needed to work with both. Check the KDEand GNOME Web sites for information about integrating these two systems in themonths to come.

    Q I want to create a new application for KDE. How do I get started?

    A Read this book, especially the last two hours on KDE development. Refer to theKDE Web site often to become familiar with what’s already been done and what

    18 Ho ur 1

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    35/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    36/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    37/473

    HOUR 2Installing KDE fromScratch

    In this hour, you will learn how to install KDE on your system. Althoughseveral Linux systems (such as Caldera OpenLinux and SuSE Linux) nowinclude KDE as part of the default installation, being able to install KDEfrom ground zero will teach you a lot about the KDE system.

    This hour describes how to get the KDE files, where they end up on yourLinux system, and to make it all happen. If you already have KDE installedand want to start using it, you can skip to Hour 3, “Starting and ExitingKDE.”

    The la te st version o f Cald era Open Linux insta lls KDE by d ef a ult.We’ll use a Red Hat 5.1 installation as the basis for installingKDE fro m scra tch. Tips fo r using ot her versions of Red Ha t a ndot her Linux system s are pro vided along the w a y. This insta lla-tion a lso w orks fo r Red Ha t 5.2.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    38/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    39/473

    An .Xclients file in the user’s home directory (a hidden file).

    The default Xclients file located in /etc/X11/xinit/ (not a hidden file); usedonly if no .Xclients file is found in the user’s home directory.

    The process of starting X differs slightly on other Linux systems. The process also dif-fers if you are using the xdm graphical login manager. (A replacement for xdm calledkdm (included as part of KDE), is described in Hour 3.)

    After you have installed and configured KDE as described later in this hour, using thestartx command will start KDE.

    Downloading the KDE FilesIf you’re using Caldera OpenLinux 1.3 or later you can complete a standard OpenLinuxinstallation and begin using KDE immediately by logging in and entering the kde com-mand (see Hour 3).

    For any Linux system, you can try the KDE files from the CD included with this book. If the correct files for your version of Linux are not included on this CD, you’ll need todownload the appropriate files as described here. Although KDE runs on all Linux sys-tems, the configuration of a KDE system varies slightly from one Linux version to thenext. For this reason, it causes minor configuration problems if you use the KDE pack-ages for one Linux system (such as Red Hat) to install KDE on another Linux system(such as SuSE or Deblan). If you use the KDE files from the CD, you can also reviewany README files that are included with them.

    The installation described here is for KDE 1.1, which is a stable version. Beta copies of later versions of KDE might also be available, but you won’t be working with them here.

    All the KDE files are available from ftp://ftp.kde.org or from dozens of mirror sitesaround the world. Table 2.1 lists some major mirror sites if you find ftp.kde.org to bebusy (it often is, although it is hosted by Caldera Systems, Inc. in the U.S. and has a veryfast Internet connection).

    TABLE 2.1 A S ELECTED LIST OF M IRROR SITES FOR ftp.kde.org

    M irro r Sit e Lo cat io n

    ftp://gd.tuwien.ac.at/hci/kde Austria

    ftp://sunsite.cnlab-switch.ch/mirror/kde Switzerland

    ftp://ftp.fu-berlin.de/pub/unix/X11/gui/kde Germany

    ftp://ftp.tsc.uvigo.es/pub/linux/kde Spain

    Inst a lling KDE f ro m Scra t ch 23

    continues

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    40/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    41/473

    In the RedHat-5.1 subdirectory that is used for this installation, you can select the i386directory for the Intel version of Red Hat Linux. Next, select the Binary directory for thebinary files (you can learn about the source files beginning in Hour 23, “Getting Startedwith KDE Development,” but you won’t download or describe them here.)

    The contents of the Binary directory is shown here (I’ve added the full directory path tothe top of the listing for reference as you explore the KDE FTP site):

    ftp://ftp.kde.org/pub/kde/stable/latest/distribution/rpm/RedHat-5.1/i386/binary/

    Up to higher level directorykde-rh5x-i386-1.1.lsm 939 bytes Thu Jan 28 05:40:00 1999kdeadmin-1.1-1rh5x.i386.rpm 376 Kb Thu Jan 28 04:50:00 1999kdebase-1.1-1rh5x.i386.rpm 5530 Kb Thu Jan 28 04:53:00 1999kdegames-1.1-1rh5x.i386.rpm 2151 Kb Thu Jan 28 04:56:00 1999kdegraphics-1.1-1rh5x.i386.rpm 1057 Kb Thu Jan 28 04:57:00 1999kdelibs-1.1-1rh5x.i386.rpm 1896 Kb Thu Jan 28 04:59:00 1999kdemultimedia-1.1-1rh5x.i386.rpm 927 Kb Thu Jan 28 05:01:00 1999kdenetwork-1.1-1rh5x.i386.rpm 2782 Kb Thu Jan 28 05:04:00 1999kdesupport-1.1-1rh5x.i386.rpm 760 Kb Thu Jan 28 05:07:00 1999

    kdesupport-1.1-2rh5x.i386.rpm 760 Kb Fri Jan 29 13:59:00 1999kdetoys-1.1-1rh5x.i386.rpm 159 Kb Thu Jan 28 05:07:00 1999kdeutils-1.1-1rh5x.i386.rpm 1117 Kb Thu Jan 28 05:08:00 1999korganizer-1.1-1rh5x.i386.rpm 435 Kb Thu Jan 28 05:10:00 1999qt-1.42-3rh51.i386.rpm 817 Kb Thu Jan 28 05:10:00 1999qt-devel-1.42-3rh51.i386.rpm 2630 Kb Thu Jan 28 05:14:00 1999qt-rh51-i386-1.42-3.lsm 623 bytes Thu Jan 28 05:41:00 1999readme-redhat-rpms.html 11 Kb Thu Jan 28 05:14:00 1999readme-redhat-rpms.txt 12 Kb Thu Jan 28 05:14:00 1999

    Now for the good news: You don’t have to download all the files in this list! First, noticeall the files with .lsm extensions. These are descriptive files that you don’t need to

    download.The files that you need to download to completely install KDE are listed in Table 2.2.

    Inst a lling KDE f ro m Scra t ch 25

    Although the versions of KDE for Linux are very similar, several library andcompiler issues are resolved by cho osing the subdirecto ry w ith f iles prebuilt

    for your version of Linux.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    42/473

    TABLE 2.2 FILES TO DOWNLOAD FOR A COMPLETE KDE INSTALLATIONFile t o Do w n lo ad (Fir st Descr ip t io n Part of Fi lename O nly)

    kdebase The core packages of KDE (window manager, Panel, taskbar, andso forth)

    kdesupport A collection of non-KDE libraries for graphics, MIME- typing,and similar common operations

    qt-1.42 Graphical toolkit libraries used by all KDE applications

    qt-devel-1.42 Graphical libraries for developing new KDE applications(optional; download if you’re interested in developing KDE appli-cations)

    kdelibs Other libraries used by all KDE applications

    kdeadmin Administrative utilities (optional but highly recommended)kdenetwork Networking utilities (optional but highly recommended)

    kdeutils Additional system and user utilities (optional but highly recom-mended)

    kdegraphics Graphics programs and viewers for various formats (optional butrecommended)

    ktoys Additional utilities; not games, but not necessary for a fully-functional KDE system

    korganizer A personal organizer for tasks, events, and so forth. (Similar to

    Microsoft Outlook)kdemultimedia Multimedia programs such as a CD Player and Sound Mixer

    (optional)

    kdegames Games (optional)

    26 Ho ur 2

    Reviewing the Downloaded FilesAlthough the list of packages in Table 2.2 provides a complete KDE installation, somepackages listed on the KDE FTP site require comment:

    The eight application packages—kdeutils, kdeadmin, kdenetwork, kdegraphics,kdemultimedia, kdetoys, korganizer, and kdegames—are sets of applications thatare part of the default KDE menu and are generally very useful. If you’re short onhard disk space, however, you can omit any of them.

    If you have a 28.8KB or higher mod em, do w nloading all the KDE packagesin Ta ble 2.2 should t ake less tha n t w o h ours. The t ot al size o f t he item s inTa ble 2.2 is ab ou t 20MB.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    43/473

    The Qt-develop package is used for developing KDE applications or recompilingthe KDE source code. See Hour 23 for more information.

    The gcc to egcs HOWTO document (not an rpm package) is a tutorial on changingpackaging compiled with the standard gcc compiler (in C++ mode) to the egcscompiler (the C++ compiler used in Red Hat 5.1). This information is not applica-ble unless you’re compiling or developing KDE components on Red Hat.

    Installing KDELog in as root to perform the KDE installation. All users on your Linux system will haveaccess to KDE when you have finished.

    Inst a lling KDE f ro m Scra t ch 27

    If you w an t t o install KDE on a Red Ha t 5.0 system (rat her tha n 5.1 or 5.2),you must f irst insta ll an upda ted packag e of C+ + libraries. Get t he file froma Red Ha t FTP site ( ftp.redhat.com or a mirror) and insta ll it w ith th is com-mand before using t he commands that f o l low :

    # rpm -Uvh libstdc++-2.8.0-8.i386.rpm

    Change to the directory where the KDE packages are stored and execute these commandsin a terminal window. The exact version numbers (thus filenames) might differ dependingon the latest stable release available when you download these files:

    rpm -Uvh qt-1.42-1rh51.i386.rpmrpm -Uvh kdesupport-1.1-7rh5x.i386.rpmrpm -Uvh kdelibs-1.1-7rh5x.i386.rpmrpm -Uvh kdebase-1.1-7rh5x.i386.rpm

    The preceding com ma nds must be executed in this orde r or the installationw ill fa il.

    The - Uvh options on the rpm command indicate to install as an upgrade (being mindful of existing KDE packages on the system), print a nice progress bar during the file installa-tion, and display any relevant informational messages (the v option is for Verbose mode).

    Next, install the KDE applications using these commands. These can be executed in anyorder, and you can skip any that you decide not to download:

    rpm -Uvh kdeadmin-1.1-5rh5x.i386.rpmrpm -Uvh kdegraphics-1.1-5rh5x.i386.rpmrpm -Uvh kdenetwork-1.1-5rh5x.i386.rpm

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    44/473

    rpm -Uvh kdeutils-1.1-5rh5x.i386.rpmrpm -Uvh kdemultimedia-1.1-5rh5x.i386.rpmrpm -Uvh kdetoys-1.1-5rh5x.i386.rpmrpm -Uvh korganizer-1.1-5rh5x.i386.rpmrpm -Uvh kdegames-1.1-5rh5x.i386.rpm

    KDE is now installed on your Linux system!

    Configuring KDE as Your GraphicalEnvironment

    As described earlier in this hour, the startx command uses several files to determinewhat programs to start as your graphical environment.

    KDE provides a simple script to review these files and set them up to use KDE as thedefault graphics system when you start the X Window System with the startx com-mand. You should review all the instructions in this section to be certain that KDE is cor-rectly configured to run on your Linux system.

    While logged in as root, use this command to set up KDE as the default graphical systemfor any user on your Linux system:

    # /opt/kde/bin/usekde username

    This script creates a file named .Xclients in the user’s home directory. This file isreferred to when the X Window System is started.

    The usekde script will detect any existing .Xclients , .xinitrc , or .xsession files inthe user’s home directory and rename them .Xclients.orig and so forth as it createsnew files.

    28 Ho ur 2

    Users ca n execute t he usekde script at this point t o set up KDE a s theirgra phical system .

    An alternative method can be used to define KDE as the graphical setting for all users onyour Linux system.

    KDE provides a new version of the default Xclients file located at/etc/X11/xinit/Xclients.kde . Executing these commands replaces the default copy of Xclients with the KDE-specific copy:

    $ cp /etc/X11/xinit/Xclients /etc/X11/xinit/Xclients.redhat$ cp /etc/X11/xinit/Xclients.kde /etc/X11/xinit/Xclients$ chmod a+x /etc/X11/xinit/Xclients

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    45/473

    The final step to prepare to run KDE is to include the KDE Binary directory in yourPATH environment variable so the KDE programs can be located. Use this command froma command line before executing the startx command (this command applies to the

    default bash shell):$ export PATH=$PATH:/opt/kde/bin

    Inst a lling KDE f ro m Scra t ch 29

    Add the previous PATH command to your ~/.bashrc or ot her sta rtup file so itis alw ays part of your PATH .

    Now you can start KDE with this command:

    $ startx

    Additional details about starting and exiting KDE are provided in Hour 3.

    Reviewing the Installed KDE FilesAlmost all the files installed by the KDE packages described in this hour are placed inthe /opt/kde directory. Exceptions are small configuration files such as/etc/X11/xinit/Xclients.kde , which are not used until you rename them, as describedpreviously.

    The subdirectories of /opt/kde/ are described in Table 2.3.

    TABLE 2.3 SUBD IRECTORIES OF /opt/kde

    Su b d irect o ry Co n t en t s

    bin Program files used throughout KDE, including core features and add-onapplications

    cgi-bin Scripts used by the KDE help system to process help requests

    include Header files used to access functions throughout KDE

    lib System libraries used by KDE applications, installed by the kdesupport and

    kdelibs packagesshare Shared resources (icons, other graphics, application links, and so forth) used

    by all KDE users

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    46/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    47/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    48/473

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    49/473

    HOUR 3Starting and Exiting KDE

    In this hour, you learn how to start and exit KDE. In particular, you see howKDE functions on the major Linux distributions. Startup options are

    described and the logout process is also outlined.Starting KDE is generally a simple process, but reviewing it in this hour willhelp you troubleshoot if any problems occur. This will also enable you toadd a graphical login to KDE. (This graphical login is called kdm; it’s simi-lar to xdm on other UNIX computers using the X Window System.)

    Starting KDE in OpenLinuxIf you are running Caldera Systems OpenLinux, starting KDE is very easy.

    Each time you log in to your user account on OpenLinux, a messageinforms you that you can start the graphical system by using the startxcommand or the kde command. The next section, “Starting Another windowmanager in OpenLinux,” describes using the startx command when youdon’t want to use KDE.

  • 8/15/2019 Linux - Teach Yourself KDE in 24 Hours - SAMS - Nich.pdf

    50/473

    The default installation of OpenLinux includes the complete KDE 1.1 distribution. TheKDE Binary directory is also added to each user’s PATH variable so that KDE programscan be located.

    To start KDE, enter the following command after logging in:

    $ kde

    When you use the kde command, the file /etc/X11R6/xinit/kdeinitrc is used as aparameter to start the xinit program. The kdeinitrc script takes care of many house-keeping tasks relative to starting KDE