From ArchWiki
Revision as of 20:29, 15 May 2012 by Ambrevar (talk | contribs) (Removed useless title.)
Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Luakit is an extremely fast, lightweight and flexible web browser using the webkit engine. It is customizable through lua scripts and fully usable with keyboard shortcuts.


The luakit package can be found in the official repositories and can be installed with pacman.

You can also use the git version available from the [AUR].

With the Unix philosophy in mind, Luakit is entirely customizable through its configuration files. Those files are written in the Lua scripting language, thus allowing virtually unlimited features. First, copy the configuration files to your $XDG_CONFIG_HOME folder:


Now you can edit any of these files to make your browser fits your needs. Even if you do not know much about Lua, the configuration is simple and well commented enough to make it straightforward.

Basic usage

Note: Most of the shortcuts are viewable and customizable from binds.lua.

Press Template:Keypress to access the command prompt. You can do nearly everything from there. Use Template:Keypress to autocomplete commands.

To quit, use the quit command, or the Template:KeypressTemplate:Keypress shortcut. You can also close the browser while remembering the session (i.e. restoring the tabs) by using the writequit command instead, or the Template:KeypressTemplate:Keypress shortcut.


Input fields

Many webpages have editable elements like dropdown lists, checkboxes, text fields and so one. While they work perfectly with the mouse, you may encounter some troubles using the follow commands. In such a case, pressing the arrow keys may help.


If enabled (default configuration), bookmarks can be used from within Luakit.

  • The :bookmarks command opens the bookmarks page. (Shortcut: Template:Keypress).
  • The :bookmark uri group command adds the specified URI to the specified group in the bookmarks.



Set your homepage as follows:

globals = {
    homepage = "about:blank",
-- ...

Custom search engines

You can virtually add any search engine you want. Make a search on the website you want and copy paste the URI to the Luakit configuration by replacing the searched terms with an %s. Example:

search_engines = {
    aur = "",
-- ...

The variable is used as a keyword for the :open command in Luakit.

Set the defaut search engine by using this same keyword:

search_engines.default = search_engines.aur

Download location

This can be specified in rc.lua :

-- Add download support                                                                                                                                                                                                                        
require "downloads"
require "downloads_chrome"

-- Set download location                                                                                                                                                                                                                                      
downloads.default_dir = os.getenv("HOME") .. "/downloads"
downloads.add_signal("download-location", function (uri, file)
    if not file or file == "" then
        file = (string.match(uri, "/([^/]+)$")
            or string.match(uri, "^%w+://(.+)")
            or string.gsub(uri, "/", "_")
            or "untitled")
    return downloads.default_dir .. "/" .. file

Bookmarks management


Bookmarks are stored in a simple plain text file: $XDG_DATA_HOME/luakit/bookmarks. Each line is a bookmark. It is composed of 2 fields:

link    group   
Warning: Each field is followed by a tabulation. If you insert spaces instead, the link will not be properly bookmarked.

Groups and links are alphabetically sorted, so there is no need to do it manually.

You can put a symbolic link in place of the default file to store your bookmarks anywhere on your machine. This way if your are using a cloud sync application like Dropbox, you can keep your bookmarks synchronized between your different computers.

Import from Firefox

To import your bookmarks from Firefox, first you must export them to an HTML file using its bookmarks manager. Now we must convert the XML file to a Luakit format. You can use the following one-line awk command:

$ cat bookmarks.html | awk '
{gsub(/\"/," ")}
/<\/H3>/{FS=">";gsub(/</,">");og=g;g=$(NF-2);FS=" "}
/<DL>/{x++;if(x>= 3)gl[x-3]=g}
/HREF/{gsub(/</," ");gsub(/>/," ");if(g!=""){if(og!=g){printf "\n";og=g};printf "%s\t",$4;if(x>=3){for(i=0;i<=x-4;i++){printf "%s-",gl[i]}printf "%s\n",gl[x-3]}else{printf "\n"}}}'

Or if you prefer the more readable script version:


# Notes: 'folders' for Firefox bookmarks mean 'groups' for Luakit.

# Put spaces where it is needed to delimit words properly.
{gsub(/\"/," ")}

# Since the folder name may have spaces, delimiter must be ">" here.
/<\/H3>/ {
    FS=" "

# Each time a <DL> is encountered, it means we step into a subfolder.
# 'count' is the depth level.
# Base level starts at 2 (Firefox fault).
# 'groupline' is an array of all parent folders.
/<DL>/ {
    if ( count >= 3 )

# On </DL>, we step out.
# If if return to the base level (i.e. not in a folder), then we give 'group' a fake name different
# from 'oldgroup' to make sure a line will be skipped (see below).
/<\/DL>/ {
    if( count == 2 )

# The bookmark name.
# If oldgroup is different than group, (i.e. folder changed) then we skip a line.
# If we are in a folder, then we print the group name, i.e. all parents plus the current folder
# separated by an hyphen.
/HREF/ {
    gsub(/</," ")
    gsub(/>/," ")
    if (group != "")
        if(oldgroup != group)
            printf "\n"
        printf "%s\t",$4
        if ( count >= 3 )
            for ( i=0 ; i <= count-4 ; i++ )
            {printf "%s-" , groupline[i]}
            printf "%s" , groupline[count-3]
        printf "\n"

Run it with

$ awk -f ff2lk.awk bookmarks.html >> bookmarks