A desktop command-line widget

Command Line – KRunner

© Lead Image © fernandocastoldi, 123RF.com

© Lead Image © fernandocastoldi, 123RF.com

Article from Issue 267/2023
Author(s):

KRunner combines the command line with graphical navigation, offering speed and comfort for Plasma users.

For most users, the command line and the desktop environment are distinct. One notable exception is KRunner [1], which is installed by default with KDE's Plasma. Interacting with other default Plasma applications, as well as the system hardware, KRunner is basically a convenient widget for entering a single command, but it is also an application launcher and general navigation tool, as well as a calculator, a measurement and currency converter, music player controller, and even a spell checker – all controllable from the keyboard. In fact, should you choose, you can control the desktop entirely from KRunner, making it one of the most versatile applications in all of Plasma, despite suffering from few limitations.

The KRunner Interface

KRunner uses graphical navigation in the service of the command line (Figure 1). You can run it from the menu, but starting it with one of the KRunner keyboard shortcuts (Alt+F2 or Alt+Space) is more efficient. The KRunner window has an entry field at the top, with a list of possible text completions beneath it. You select these items with the arrow keys or mouse. To the left of the entry field is a button that opens the KRunner System Settings (Figure 1). From the settings, you can choose whether KRunner opens at the top center or top middle of the screen, and whether its text completions are determined partly from previous choices. Below is a list of 26 plugins, some of which can be configured to change the order in which results are displayed, or similar features. If you are short on memory or have no use for a plugin, you can disable it (Figure 2).

Figure 1: KRunner is a versatile command-line widget for interacting with the desktop environment.
Figure 2: KRunner is modular, so you can disable plugins that you don't need for faster performance.

Entering Commands

Most commands that can be entered in a terminal can be entered in KRunner, using the same syntax as in the Bash shell. At the top of the drop-down list, you can select the option to run the command. In the same way, you can install software from KRunner. Type in your best guess at an application's name, and KRunner will offer suggestions. Click a suggestion, and the KDE Plasma Software Center opens.

KRunner also has its own handful of commands to call different functions. Should you want to repeat a command, select it from the drop-down list at the end of the entry field. One of the most useful KRunner commands is kill, which shuts down any application, including a misbehaving one. Note, though, that KRunner's kill command is not the same as Bash's. In fact, it is an arbitrary choice of characters that can be changed in System Settings | KRunner | Terminate Applications. You can also choose whether the list of applications that can be killed displays with the least or most CPU useage first or according to typing completion. Similarly, to view a man page, the syntax is Man:/COMMAND. The man page opens in the KDE man page viewer in Konqueror. Typing #COMMAND no longer works, although it did in past versions of KRunner.

Opening Resources

One of KRunner's main uses is as an alternative to scanning menus and file managers. Files and directories can be opened by entering their paths. For instance, file:/home/HOME opens the home directory in Dolphin; a file path opens the file in the appropriate application. Conveniently, if you don't know the path, you can enter just the file name and choose it from the list of possible results.

Web page addresses and bookmarks in your default browser can be opened by typing them in KRunner's entry field. To save time, you can use the Web Search Keywords in System Settings. For example, typing backports opens Debian Backports, and typing arch opens the ArchWiki for Arch Linux. If a web page is not among the installed defaults, you can add a keyword.

Similarly, you can open a virtual workspace with Desktop NUMBER, but if you customize the name, the best KRunner can do is open the Virtual Workspace window in System Settings. Bookmarks in Dolphin can also be opened, including external drives or a contact in KAddressbook in your email reader. The KDE UserBase Wiki suggests that Activities can be started by typing their names, but in practice that feature does not work in recent Plasma releases.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Tutorial – Plasma

    If you want features, bells and whistles, and configurability in spades, your best choice of desktop is probably KDE's Plasma desktop. Navigating and discovering all that's on offer can be a challenge, though.

  • KDE 4.3

    At the beginning of August, the KDE project released the third major update of KDE 4 – reason enough to put KDE 4.3 through its paces and study the new features.

  • FSearch

    In a crowded field of search applications, FSearch offers many interesting functions for quickly searching files and folders, with more promised in the future.

  • KDE 4.3.0 "Caizen" Released

    KDE has announced version 4.3.0 of its Linux desktop. "Caizen" fixes bugs and provides some new enhancements.

  • The Problem of Menus
comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News