Quix Syntax

Quix comes with a vast array of built in commands, but you can extend it using your own custom commands file. Once you’ve made your own custom commands file available on the web, go to the extend page to create a bookmarklet that’ll work with that file.

The built-in commands are always loaded before your custom commands file, (they’re actually in a file you can see too: quix.txt) with your commands replacing the built-in commands. Should you want to kill the default commands, you can add a single line on top of your own custom commands file:

#kill-defaults

This will eliminate all the commands that have been loaded up until that point.

Syntax for the Command File

The syntax for the command file is based on the syntax for Shortwave, but has since been heavily extended.

Comments
Comments start with >, and both comment lines and empty lines are ignored.

Groups
There’s one other “special” sort of line: those that start with an @. The first @ creates a new group of commands, if the line after that starts with @ as well, that line is used as a description of the group. Those groups are mainly used on the help page to group commands together.

Commands
Each other line is treated as a command, and a command has to consist of three building blocks:

  1. The command
  2. The executable
  3. A short description

Each of the building blocks has to be followed by at least one white space or tab.

1. The command

An alpha-numeric command, preferably easy to remember.

2. The executable

One of the following options, in all of which you can use the replacement tokens, and have to replace whitespace by %20. New lines are not allowed, so longer scripts should be embedded using an external script file.

The order is as follows: Quix takes the executable, turns any %20 back into spaces, replaces the replacement tokens and then executes what’s left, either taking you to a new URL or embedding the script or stylesheet into the curent page:

  1. a URL (this doesn’t have to be a http:// URL, it can be any URL, like mailto:, or even tweetie:)
  2. a single line of javascript code, prefixed with javascript:
  3. a link to a javascript file, prefixed with script:
  4. a link to a stylesheet, prefixed with style:

Replacement tokens

In your executables you can use replacement tokens, currently, Quix supports the following tokens:

%s
Replaced by any search terms that were entered after the command and / or any text that was selected when the command was issued. There’s a special case of this: %s_, this does the same except that it replaces spaces with underscores ( _ ) instead of plus signs, this is used in the Wikipedia command in the example file.
%r
Replaced by the URL you were on when the command was issued.
%rs
Replaced by a bit.ly shortened version of the URL you were on when the command was issued.
%d
Replaced by the domain you were on when the command was issued.
%t
Replaced by the title of the page you were on when the command was issued.


3. The description

A short description of the command, some HTML, like links, is allowed.

Special cases

Just like in Shortwave, a special * trigger can be used to define an untriggered command. For instance, adding the following:

* http://www.google.com/search?q=%s Untriggered search

to your custom command file would allow you to do a Google Search by entering just a search term (without the `g` trigger) in the Quix prompt.

Instant feedback

While writing your own Quix file, type 'debug' to check whether Quix recognizes your commands!

Like Quix? Share it!

Instant Quix Updates