----------------------------------------------------------------------- -- luakit configuration file, more information at http://luakit.org/ -- ----------------------------------------------------------------------- require "lfs" local unique_instance = require "unique_instance" unique_instance.open_links_in_new_window = true -- Set the number of web processes to use. A value of 0 means 'no limit'. luakit.process_limit = 8 -- Load library of useful functions for luakit local lousy = require "lousy" -- Cookie acceptance policy soup.accept_policy = "always" -- always, never, no_third_party -- Cookie storage location soup.cookies_storage = luakit.data_dir .. "/cookies.db" -- Load users theme lousy.theme.init(lousy.util.find_config("theme.lua")) assert(lousy.theme.get(), "failed to load theme") -- Load users window class local window = require "window" -- Load users webview class local webview = require "webview" -- Add luakit://log/ chrome page local log_chrome = require "log_chrome" window.add_signal("build", function (w) local widgets, l, r = require "lousy.widget", w.sbar.l, w.sbar.r -- Left-aligned status bar widgets l.layout:pack(widgets.zoom()) l.layout:pack(widgets.uri()) l.layout:pack(widgets.hist()) l.layout:pack(widgets.progress()) -- Right-aligned status bar widgets r.layout:pack(widgets.buf()) r.layout:pack(log_chrome.widget()) r.layout:pack(widgets.ssl()) r.layout:pack(widgets.tabi()) r.layout:pack(widgets.scroll()) end) -- Load luakit binds and modes local modes = require "modes" local binds = require "binds" -- Settings (the commented ones do not [yet] work) local settings = require "settings" local settings_chrome = require "settings_chrome" settings.window.home_page = "luakit://newtab" settings.window.scroll_step = 20 settings.window.zoom_step = 0.2 settings.webview.zoom_level = 100 settings.window.close_with_last_tab = true -- search engines settings.window.search_engines.duckduckgo = "https://duckduckgo.com/?q=%s" settings.window.search_engines.default = settings.window.search_engines.duckduckgo ---------------------------------- -- Optional user script loading -- ---------------------------------- -- Add adblock -- local adblock = require "adblock" -- local adblock_chrome = require "adblock_chrome" -- Enable Developer Tools local webinspector = require "webinspector" -- Add uzbl-like form filling -- local formfiller = require "formfiller" -- formfiller.extend({ -- pass = function(s) return io.popen("pass " .. s):read() end -- }) -- Add proxy support & manager local proxy = require "proxy" -- Add quickmarks support & manager -- local quickmarks = require "quickmarks" -- Add session saving/loading support -- local session = require "session" -- Enable Gopher protocol support local gopher = require "gopher" -- Delete website data local clear_data = require "clear_data" -- Add command to list closed tabs & bind to open closed tabs local undoclose = require "undoclose" -- Add command to list tab history items -- local tabhistory = require "tabhistory" -- Add greasemonkey-like javascript userscript support -- local userscripts = require "userscripts" -- Add bookmarks support -- local bookmarks = require "bookmarks" -- local bookmarks_chrome = require "bookmarks_chrome" -- Add download support local downloads = require "downloads" local downloads_chrome = require "downloads_chrome" downloads.default_dir = os.getenv("HOME") .. "/Downloads" -- Add automatic PDF downloading and opening local viewpdf = require "viewpdf" -- Add vimperator-like link hinting & following local follow = require "follow" -- Add command history local cmdhist = require "cmdhist" -- Add search mode & binds local search = require "search" -- Add ordering of new tabs local taborder = require "taborder" -- Save web history local history = require "history" local history_chrome = require "history_chrome" -- :help pages local help_chrome = require "help_chrome" local binds_chrome = require "binds_chrome" -- Add command completion local completion = require "completion" -- Press Control-E while in insert mode to edit the contents of the currently -- focused