Development
Xiki: blurring the distinction between an editor and a shell
The Xiki project explores territory where other free-software applications have gone before: it offers a "modern" interactive environment for command-line use that adds flexibility and power on top of a traditional Unix-like shell. Users interact with Xiki primarily through their text editor of choice; they can execute commands anywhere within a document, and the entire session can be saved as a text file for recall later. But Xiki does more than simply replace the shell prompt; it also provides hooks for working with databases, programming languages, the filesystem, and almost any user-defined command.
Xiki basics
Xiki is a Ruby application that is intended to run on Unix-like desktops, including Linux and Mac OS X. The code is hosted at GitHub and available under the permissive MIT license. Installation is straightforward: Ruby 1.9.3 is the prerequisite, and the package itself can be installed either by pulling the GitHub source or by installing the corresponding Ruby gem.
Once installed, users can launch a web-based interface that runs on the local machine. From there the interface walks users through the process of enabling their preferred text editor (such as Emacs or Vim) to run a Xiki session. The text editor is the primary method of interacting with Xiki, although the web front-end can be used as well (though in a limited fashion, since the text in the browser window is not editable).
The name Xiki is an abbreviation for "eXecutable wiki," which is a key concept to remember when learning one's way around the program. That is, the Xiki session is a structured document, but any of its text contents can be treated like a command. The user types arbitrary text into the editor, but certain tokens are automatically recognized and linked to shell-like interaction. For example, the user can put a prompt anywhere in the document by typing a $, then follow the prompt with a normal shell command that will be executed when the user double-clicks on it. Similarly, the user can type URLs or filesystem paths; Xiki will recognize the syntax and take the appropriate action (opening the URL in the system browser, or listing the contents of the filesystem directory) when they are clicked.
When Xiki commands produce output, that output is generated as text directly beneath the command. The session can be saved like a generic text file and edited later, which makes for an interesting record: the commands and all of their output are saved in the same text file. In many cases, the output can also be acted upon within the Xiki editing session itself—for example, double-clicking on folders in a directory lists their contents, just like opening a folder in a GUI file manager.
Menus
These common use cases combine to make Xiki a shell replacement that would be an interesting tool in its own right, but there is more. Xiki supports a wide array of other commands that, in Xiki terminology, are called "menus." There are more than 100 by default, some of which hook into outside programming languages (Ruby, Clojure, Python, JavaScript, CSS, and quite a few others), while others implement utility functions like performing Google web searches or exploring a text-mode calendar.
Unlike the built-in shell functionality, menus can be both created and modified by the user. As mentioned already, Xiki recognizes certain tokens that are bound to common commands. But the user can type anything in a Xiki-ified editor window. All text starts out as plain text; double-clicking on an arbitrary word makes Xiki attempt to parse it as a menu item. If the menu exists, the interface highlights it (in bold gray, at least in the current Emacs theme) to indicate that fact, then it displays the menu's sub-commands. If the menu does not exist, Xiki fills in some explanatory text prompting the user with how to add the menu.
Like the term "menu" might imply, these items are presented as a hierarchical text outline. A + next to a node indicates that it has children and will expand when clicked on; a - indicates that it is expanded. Each node can be a command, another sub-menu, or both. For example, in this menu:
time/
+ time zones/
+ see/
the "time" menu can be double-clicked to display the current system time, but each of the sub-menus contains functions of its own:
time/
1:45:13pm
- time zones/
- Hawaii/
8:45:29am
+ Alaska/
+ Pacific Time/
+ Arizona/
+ Mountain Time/
+ Central Time/
+ Eastern Time/
+ Indiana (East)/
- see/
@date/
@calendar/
@timer/
The "times zones" submenu displays the current time in each of the various US time zones—a fairly natural extension of the top-level menu's functionality. The "see" submenu, however, holds several distinctly different functions: the "date" function displays the date, but the "calendar" function displays a text-mode calendar of the current month:
- jul/
| 1 2 3 4 5
| 6 7 8 9 10 11 12
| 13 14 15 16 17 18 19
| 20 21 (22) 23 24 25 26
| 27 28 29 30 31
<= year/
while the "timer" function implements a stopwatch. Also worth noting are the special characters that surround the menus. The trailing slash indicates that Xiki has read and processed the line of text as a menu. The at-sign that replaces the + underneath the "see" submenu indicates that the functions listed are actually links to other menu files. The <= next to "year" in the calendar example is a special case; by default clicking on the "calendar" submenu generates the calendar for the current month: the "year" submenu resets "calendar" and presents a new submenu where the user can click on any month.
The syntax in some of Xiki's more flexible functionality can be a bit difficult to parse, and this is indeed one of the project's current weaknesses. There is no written documentation, only a collection of screencasts that discuss various features. As interesting as the built-in menus are, it is clear from the screencasts that far more of Xiki's functionality is tied up in it is ability to be customized.
For starters, users can create new menus of their own design. The quickest way to do so is to simply type the name of the new menu anywhere in the Xiki-enabled editor and add a trailing slash. Double clicking the new menu generates a prompt advising the user on how to create a skeleton menu and flesh it out bit by bit:
lwn/
> Menu doesn't exist yet
| Create it? Make your menu by creating one of these...
+ text file/
+ items/
+ notes/
+ code/
+ more/
The simplest option (denoted by the "items" submenu) is to type in submenu items as text in the editor. Xiki creates a new menu definition in a file inside the user's home directory (in this example, it would be ~/menu/lwn.menu) containing whatever hierarchy the user creates. Without any further customization, this menu is, essentially, a text document like one might use in Emacs org-mode.
To turn such user-defined menu items into executable functions, though, those items must be bound to actual code. The default is to use Ruby; clicking on the "code" submenu will walk the user through the necessary steps. Essentially, each menu or submenu the user adds is bound to a Ruby object with a self.menu method; whatever the user puts into self.menu gets executed when the menu is double-clicked.
Fortunately for those who do not use Ruby, there are multiple other options; as the "code" and "more" submenus explain, a menu's functionality can also be written in Python, JavaScript, CoffeeScript, or it can be a block of HTML, Bootstrap markup, or any of several other options.
This level of customizability is a plus, as it potentially allows users to write their own commands in whatever language seems to be the best fit for the problem at hand. One of the screencasts refers to Xiki's "pretend like it works" philosophy, which is on display in the user-defined menu feature. The built-in guides do their best to advise you when you have written something that does not make sense, when you need to save your work to continue, and what your options are at each stage of the process.
Nevertheless, in its current state, customizing Xiki can still be a rather difficult process to discover. The "it's text until you double-click, and then it's a command" mode is nice enough when exploring the large set of built-in functions, but it can get disorienting when trying to write code within the text editor. What the project really needs is a full reference manual, covering the syntax and the various options available. Revisiting the project's site to hunt for something relevant in the screencasts is a process that loses its charm in a hurry.
On the plus side, the Xiki project did recently complete a Kickstarter campaign to fund more development work. While some of the items on the roadmap
are on the nebulous side (e.g., "Initial user experience
improvement: 1 month
"), hopefully the roadmap will
include concrete usability improvements in the end.
One final word of caution is that the process of configuring a text editor for use with Xiki involves accepting some heavy changes to how the editor works. If you are dependent on specific Emacs or Vim settings for how you work, be advised that Xiki-ifying the editor will steamroll over your settings with its own. It will make a backup of your old configuration file first, but it still means that Xiki may not be a convenient choice for occasional usage.
On the whole, however, there are a lot of interesting ideas encapsulated in Xiki. Some of them make Xiki a weird and wild environment for command-line work; other ideas may be interesting enough that other open-source shell projects would be wise to take a close look at them. Xiki certainly has competition, from (among others) existing Emacs projects like org-mode and shell mode. But such competition could be beneficial for all involved.
Brief items
Quotes of the week
At some point during this process I get a Skype call from some friends, which I answer. Up comes a video call with them, their newborn, perfect audio, and no hassle. I have a conversation with them that doesn't involve me cursing technology at all. And then I go back to fighting with SIP.
X.Org server 1.16.0 released
Keith Packard has announced the release of the 1.16.0 X.Org server with many new features, including Glamor (GL-based 2D X acceleration) integration, XWayland, systemd integration, Glamor for the Xephyr nested X server, and support for non-PCI devices. In addition, "thousands of compiler warnings were eliminated from the code base. "For the first time in several releases, we've added substantial amounts of code to the server, only 2/3 of which was the glamor code base: 604 files changed, 34449 insertions(+), 7024 deletions(-)"Firefox 31 released
Firefox 31 has been released. This version adds a search field to the new tab page, adds support of Prefer:Safe http header for parental control, and it will block malware from downloaded files. See the release notes for more information.Exim 4.83 released
Version 4.83 of the Exim mail transfer agent (MTA) is available. New features include mainline (non-experimental) support for Per-Recipient Data Response (PRDR) and Online Certificate Status Protocol (OCSP) as well as numerous enhancements to LDAP, DNSSEC, DMARC, and related services.
s390 glibc jmp_buf change to be reverted
LWN recently looked at the problems that resulted from an ABI-breaking change merged into the GNU C Library for the s390 architecture. It seems that this change will now be reverted, putting the ABI back to what it was before the 2.19 release. The tricky part now is to figure out how to do that without creating more problems, given that 2.19 has been released for some time. There will probably be a point release to 2.19 with the fix, which will also, of course, be in the next major glibc release.ownCloud 7 released
The ownCloud 7 release has been announced. The headline feature this time around appears to be server-to-server sharing, but it also has mobile web browser support, file activity notifications, and an improved management interface.Astropy v0.4 available
Version 0.4 of the astropy Python package for astronomy has been released. Major new functionality in this version includes a redesigned sub-package for handling celestial coordinates, a redesigned configuration system, a new HTML table processor, and a new command line tool for working with the Flexible Image Transport System (FITS) image file format. An update to the PyFITS library was also released in conjunction with astropy 0.4.
GStreamer 1.4.0 available
The GStreamer team has announced the 1.4.0 release of GStreamer Core, GStreamer Plugins, and the GStreamer RTSP server. API changes since GStreamer 1.2 include the new GstDeviceMonitor API for probing audio and video devices, a GstFlowAggregator object that "
simplifies handling of flow returns in elements with multiple source pads", and a segment API for accessing media content with an offset value. Other changes include support for accessing Video4Linux2 hardware decoders and support for h265/HEVC and VP8 in the codec utilities.GNU Datamash 1.0.5 released
The first stable release of the new GNU Datamash utility is now available. Datamash is a command-line program for performing numeric and statistical operations on text input.
Apache 2.4.10 is available
Apache 2.4.10 has been released. Although a minor update to the stable series, this release addresses several security vulnerabilities and incorporates some new features, such as Unix Domain Socket (UDS) support for mod_proxy backends and improvements to mod_lua, mod_ssl, and mod_socache_shmcb.
Newsletters and articles
Development newsletters from the past week
- What's cooking in git.git (July 22)
- Haskell Weekly News (July 17)
- LLVM Weekly (July 21)
- OCaml Weekly News (July 22)
- OpenStack Community Weekly Newsletter (July 18)
- Perl Weekly (July 21)
- PostgreSQL Weekly News (July 20)
- Python Weekly (July 17)
- Ruby Weekly (July 17)
- Tor Weekly News (July 23)
- Wikimedia Tech News (July 21)
The state of accessibility in Linux and open source software (Opensource.com)
Over at Opensource.com, Rikki Endsley interviews Spencer Hunley, who will be giving a talk on accessibility at LinuxCon NA in August. Hunley also spoke at last year's LinuxCon NA and, shortly after that, helped form the Universal Tux Google+ community to work on accessibility in Linux. "Built-in, easy to use and understand accessibility support is hard to find in many distributions. Can you tell me the key combination to activate that support in Ubuntu? How about any other distro? The fact is that although it's there, it may not be easy to locate and/or use. When addressing this, focusing on independence is vital. No one wants to have to call upon someone else to help them install a new OS, or to utilize an application. This is especially true for people with disabilities; the learning curve can be nearly impossible, which leaves little in the way of choice in the FOSS world, depending on your abilities."
Page editor: Nathan Willis
Next page:
Announcements>>
