Master the KIO slaves

1847

Author: Federico Kereki

Hard-working KDE Input/Output (KIO) slaves perform much of KDE’s functionality. KIO slaves provide consistent access to different resources, such as filesystems, network protocols, and search functions, making them accessible to all KDE applications in a standard way. For example, you can open a remote FTP session and copy, move, rename, or delete files as if they’re on your own box, or connect via Secure Shell (SSH) and use remote files as if they were local. Even browsing the Web uses a KIO slave.

Using KIO slaves, you can turn your common, run-of-the-mill programs into versatile tools for dealing with local and remote files or with different protocols. For example, Konqueror doubles as both a file manager and a Web browser because it uses different KIO slaves for each function.

For a complete list of all available KIO slaves, run (from a console, or by pressing Alt-F2) kinfocenter and check the Protocols tab. You’ll notice that documentation for several of the KIO slaves is sorely lacking: for example, the entry for camera:/ just reads, “Some info about protocol camera:/ …”

The protocols usually look like theKioslaveName:/, with one or two slashes, eventually followed by some parameters. You might access a diskette drive or USB sticks with the floppy:/ protocol with a single slash, but access Web pages with the http:// protocol with two slashes. The rule of thumb is that network-related protocols use a double slash.

Synchronizing files by using KIO slaves

Let’s say you want to copy some files from your laptop to your PC. Usually that would require using something like Secure Copy (SCP) or rsync, or even a specific application such as Unison or Synbak. In fact, you need nothing but your favorite file browser; let’s do it with Konqueror and KIO slaves.

You cannot use a KIO slave directly, but you can enter one in the address bar of a program or in an Open File or Run dialog. Fire up Konqueror, and go to Windows -> Split View Left/Right, so you can browse two different directories at the same time, each with its own address bar. Click the left-side panel and navigate to the directory with the files you want to copy. Click the right-side panel, and in its address bar, enter fish://theUrlOfTheOtherPC/thePathToTheDirectory. You’ll be asked for your password (I’m assuming here that you have the same username on both machines; should that not be the case, enter fish://yourUserName@theUrlOfTheOtherPC/thePathToTheDirectory). Wait a bit, and the other directory will appear, just as if it were a local one.

You can then access the remote machine with the program and do whatever synchronization you need. In fact, if synchronization is your main interest, you should check out Krusader, as its synchronization tools work well with KIO slaves.

Working along the same lines, if you develop Web sites, you’re probably accustomed to using some FTP client to upload your changes — but you don’t need to! You can simply open ftp://theUrlOfYourSite in a Konqueror or Dolphin window and copy, delete, or rename the files as if they were in your box.

More KIO slaves

You may want to check out the following KIO slaves out of the literally dozens available:

  • about:/ gives you information about the current application — usually the same information you would get in the About help window.
  • applications:/ and programs:/ show the Applications menu in a larger format than what you get in the system menu. You can then click on a program and it starts running.
  • audiocd:/ is great for ripping CDs. It shows the tracks converted to several formats and in specific directories that correspond to each possible format. If you want to get a song in a specific format, just copy it from the appropriate directory to wherever you want; the KIO slave will do the format conversion transparently. Similarly, videodvd:/ provides access to DVDs.
  • file:/directoryName shows you the contents of a specified directory. This KIO slave is probably one of the most commonly used, even though most people don’t know it for what it is. Two similar protocols behave in the same way: home:/, which shows your home directory, and trash:/, which shows deleted files.
  • fish://aRemotePC gives you access via SSH to remote PC directories. You can also try out ftp://someUrl to do the same thing using the FTP protocol.
  • fonts:/ shows both your fonts and the system-wide fonts in two directories. It lets you do some basic font administration, such as removing a font from your box.
  • help:/applicationName, info:/applicationName, and man:/applicationName are three different ways to get information about an application.
  • http://someUrl and https://someSecureUrl provide Web browsing. They’re among the most commonly used KIO slaves.
  • lan:// provides information about your “network neighborhood.”
  • news:// is used whenever you click on a news link on a Web page. It allows you to subscribe to a news feed.
  • print:/ lets you access your printing subsystem, with distinct folders for Classes, Jobs, Manager, Printers, and Specials, the last of which covers operations such as sending faxes and creating PDF files.
  • settings:/ lets you access the KControl modules and change several configuration settings.
  • smb://aWindowsDirectory allows you to access a remote Windows share via Samba.
  • sysinfo:/ provides a screenful of data about your box.
  • tar:/someTarredFile and zip:/someZippedFile allow you to look inside a tarred or zipped file and extract files just by copying them to another directory.

In most cases, you’ll get a list of folders and files that you can browse just as if they were actual files on your disk, giving you a common interface to several different, distinct protocols. KIO slaves allow you to use a single application for multiple objectives.

Using KIO slaves will help you become more proficient in KDE and Linux and will help you get more out of your machine.

Categories:

  • Desktop Software
  • Graphical Environments