luakit: Remove config
parent
b59e66226c
commit
9b113b9d59
|
@ -1,98 +0,0 @@
|
|||
-- Global variables for luakit
|
||||
globals = {
|
||||
homepage = "about:blank",
|
||||
scroll_step = 40,
|
||||
zoom_step = 0.1,
|
||||
max_cmd_history = 100,
|
||||
max_srch_history = 100,
|
||||
-- http_proxy = "http://example.com:3128",
|
||||
default_window_size = "800x600",
|
||||
|
||||
-- Disables loading of hostnames from /etc/hosts (for large host files)
|
||||
-- load_etc_hosts = false,
|
||||
-- Disables checking if a filepath exists in search_open function
|
||||
-- check_filepath = false,
|
||||
}
|
||||
|
||||
-- Make useragent
|
||||
local _, arch = luakit.spawn_sync("uname -sm")
|
||||
-- Only use the luakit version if in date format (reduces identifiability)
|
||||
local lkv = string.match(luakit.version, "^(%d+.%d+.%d+)")
|
||||
globals.useragent = string.format("Mozilla/5.0 (%s) AppleWebKit/%s+ (KHTML, like Gecko) WebKitGTK+/%s luakit%s",
|
||||
string.sub(arch, 1, -2), luakit.webkit_user_agent_version,
|
||||
luakit.webkit_version, (lkv and ("/" .. lkv)) or "")
|
||||
|
||||
-- Search common locations for a ca file which is used for ssl connection validation.
|
||||
local ca_files = {
|
||||
-- $XDG_DATA_HOME/luakit/ca-certificates.crt
|
||||
luakit.data_dir .. "/ca-certificates.crt",
|
||||
"/etc/certs/ca-certificates.crt",
|
||||
"/etc/ssl/certs/ca-certificates.crt",
|
||||
}
|
||||
-- Use the first ca-file found
|
||||
for _, ca_file in ipairs(ca_files) do
|
||||
if os.exists(ca_file) then
|
||||
soup.ssl_ca_file = ca_file
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- Change to stop navigation sites with invalid or expired ssl certificates
|
||||
soup.ssl_strict = false
|
||||
|
||||
-- Set cookie acceptance policy
|
||||
cookie_policy = { always = 0, never = 1, no_third_party = 2 }
|
||||
soup.accept_policy = cookie_policy.always
|
||||
|
||||
-- List of search engines. Each item must contain a single %s which is
|
||||
-- replaced by URI encoded search terms. All other occurances of the percent
|
||||
-- character (%) may need to be escaped by placing another % before or after
|
||||
-- it to avoid collisions with lua's string.format characters.
|
||||
-- See: http://www.lua.org/manual/5.1/manual.html#pdf-string.format
|
||||
search_engines = {
|
||||
-- duckduckgo = "http://duckduckgo.com/?q=%s",
|
||||
-- luakit = "http://luakit.org/search/index/luakit?q=%s",
|
||||
-- sourceforge = "http://sf.net/search/?words=%s",
|
||||
arch = "http://wiki.archlinux.org/index.php?title=Special%%3ASearch&search=%s&go=Go",
|
||||
aur = "https://aur.archlinux.org/packages.php?O=0&K=%s&do_Search=Go",
|
||||
ctan = "http://www.ctan.org/search/?search=%s&search_type=description",
|
||||
g = "http://google.com/search?q=%s",
|
||||
gm = "https://maps.google.com/maps?q=%s",
|
||||
gt = "http://translate.google.com/#en/fr/%s",
|
||||
imdb = "http://www.imdb.com/find?s=all&q=%s",
|
||||
torrent = "http://torrentz.eu/search?f=%s",
|
||||
w = "http://en.wikipedia.org/wiki/Special:Search?search=%s",
|
||||
wb = "http://en.wikibooks.org/wiki/Special:Search?search=%s",
|
||||
wbf = "http://fr.wikibooks.org/wiki/Special:Search?search=%s",
|
||||
wf = "http://fr.wikipedia.org/wiki/Special:Search?search=%s",
|
||||
wkf = "http://fr.wiktionary.org/wiki/Special:Search?search=%s",
|
||||
wk = "http://en.wiktionary.org/wiki/Special:Search?search=%s",
|
||||
wr = "http://www.wordreference.com/enfr/%s",
|
||||
youtube = "http://www.youtube.com/results?search_query=%s",
|
||||
}
|
||||
|
||||
-- Set google as fallback search engine
|
||||
search_engines.default = search_engines.g
|
||||
-- Use this instead to disable auto-searching
|
||||
--search_engines.default = "%s"
|
||||
|
||||
-- Per-domain webview properties
|
||||
-- See http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebSettings.html
|
||||
domain_props = { --[[
|
||||
["all"] = {
|
||||
enable_scripts = false,
|
||||
enable_plugins = false,
|
||||
enable_private_browsing = false,
|
||||
user_stylesheet_uri = "",
|
||||
},
|
||||
["youtube.com"] = {
|
||||
enable_scripts = true,
|
||||
enable_plugins = true,
|
||||
},
|
||||
["bbs.archlinux.org"] = {
|
||||
user_stylesheet_uri = "file://" .. luakit.data_dir .. "/styles/dark.css",
|
||||
enable_private_browsing = true,
|
||||
}, ]]
|
||||
}
|
||||
|
||||
-- vim: et:sw=4:ts=8:sts=4:tw=80
|
|
@ -1,223 +0,0 @@
|
|||
-----------------------------------------------------------------------
|
||||
-- luakit configuration file, more information at http://luakit.org/ --
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
require "lfs"
|
||||
|
||||
if unique then
|
||||
unique.new("org.luakit")
|
||||
-- Check for a running luakit instance
|
||||
if unique.is_running() then
|
||||
if uris[1] then
|
||||
for _, uri in ipairs(uris) do
|
||||
if lfs.attributes(uri) then uri = os.abspath(uri) end
|
||||
unique.send_message("tabopen " .. uri)
|
||||
end
|
||||
else
|
||||
unique.send_message("winopen")
|
||||
end
|
||||
luakit.quit()
|
||||
end
|
||||
end
|
||||
|
||||
-- Load library of useful functions for luakit
|
||||
require "lousy"
|
||||
|
||||
-- Small util functions to print output (info prints only when luakit.verbose is true)
|
||||
function warn(...) io.stderr:write(string.format(...) .. "\n") end
|
||||
function info(...)
|
||||
if luakit.verbose then
|
||||
io.stdout:write(string.format(...) .. "\n")
|
||||
end
|
||||
end
|
||||
|
||||
-- Load users global config
|
||||
-- ("$XDG_CONFIG_HOME/luakit/globals.lua" or "/etc/xdg/luakit/globals.lua")
|
||||
require "globals"
|
||||
|
||||
-- Load users theme
|
||||
-- ("$XDG_CONFIG_HOME/luakit/theme.lua" or "/etc/xdg/luakit/theme.lua")
|
||||
lousy.theme.init(lousy.util.find_config("theme.lua"))
|
||||
theme = assert(lousy.theme.get(), "failed to load theme")
|
||||
|
||||
-- Load users window class
|
||||
-- ("$XDG_CONFIG_HOME/luakit/window.lua" or "/etc/xdg/luakit/window.lua")
|
||||
require "window"
|
||||
|
||||
-- Load users webview class
|
||||
-- ("$XDG_CONFIG_HOME/luakit/webview.lua" or "/etc/xdg/luakit/webview.lua")
|
||||
require "webview"
|
||||
|
||||
-- Load users mode configuration
|
||||
-- ("$XDG_CONFIG_HOME/luakit/modes.lua" or "/etc/xdg/luakit/modes.lua")
|
||||
require "modes"
|
||||
|
||||
-- Load users keybindings
|
||||
-- ("$XDG_CONFIG_HOME/luakit/binds.lua" or "/etc/xdg/luakit/binds.lua")
|
||||
require "binds"
|
||||
|
||||
----------------------------------
|
||||
-- Optional user script loading --
|
||||
----------------------------------
|
||||
|
||||
require "webinspector"
|
||||
|
||||
-- Add sqlite3 cookiejar
|
||||
require "cookies"
|
||||
|
||||
-- Cookie blocking by domain (extends cookies module)
|
||||
-- Add domains to the whitelist at "$XDG_CONFIG_HOME/luakit/cookie.whitelist"
|
||||
-- and blacklist at "$XDG_CONFIG_HOME/luakit/cookie.blacklist".
|
||||
-- Each domain must be on it's own line and you may use "*" as a
|
||||
-- wildcard character (I.e. "*google.com")
|
||||
--require "cookie_blocking"
|
||||
|
||||
-- Block all cookies by default (unless whitelisted)
|
||||
--cookies.default_allow = false
|
||||
|
||||
-- Add uzbl-like form filling
|
||||
require "formfiller"
|
||||
|
||||
-- Add proxy support & manager
|
||||
require "proxy"
|
||||
|
||||
-- Add quickmarks support & manager
|
||||
require "quickmarks"
|
||||
|
||||
-- Add session saving/loading support
|
||||
require "session"
|
||||
|
||||
-- Add command to list closed tabs & bind to open closed tabs
|
||||
require "undoclose"
|
||||
|
||||
-- Add command to list tab history items
|
||||
require "tabhistory"
|
||||
|
||||
-- Add greasemonkey-like javascript userscript support
|
||||
require "userscripts"
|
||||
|
||||
-- Add bookmarks support
|
||||
require "bookmarks"
|
||||
require "bookmarks_chrome"
|
||||
|
||||
-- Add download support
|
||||
require "downloads"
|
||||
require "downloads_chrome"
|
||||
|
||||
-- Example using xdg-open for opening downloads / showing download folders
|
||||
--downloads.add_signal("open-file", function (file, mime)
|
||||
-- luakit.spawn(string.format("xdg-open %q", file))
|
||||
-- return true
|
||||
--end)
|
||||
|
||||
-- Add vimperator-like link hinting & following
|
||||
require "follow"
|
||||
|
||||
-- Use a custom charater set for hint labels
|
||||
--local s = follow.label_styles
|
||||
--follow.label_maker = s.sort(s.reverse(s.charset("asdfqwerzxcv")))
|
||||
|
||||
-- Match only hint labels
|
||||
--follow.pattern_maker = follow.pattern_styles.match_label
|
||||
|
||||
-- Add command history
|
||||
require "cmdhist"
|
||||
|
||||
-- Add search mode & binds
|
||||
require "search"
|
||||
|
||||
-- Add ordering of new tabs
|
||||
require "taborder"
|
||||
|
||||
-- Save web history
|
||||
require "history"
|
||||
require "history_chrome"
|
||||
|
||||
require "introspector"
|
||||
|
||||
-- Add command completion
|
||||
require "completion"
|
||||
|
||||
-- NoScript plugin, toggle scripts and or plugins on a per-domain basis.
|
||||
-- `,ts` to toggle scripts, `,tp` to toggle plugins, `,tr` to reset.
|
||||
-- Remove all "enable_scripts" & "enable_plugins" lines from your
|
||||
-- domain_props table (in config/globals.lua) as this module will conflict.
|
||||
require "noscript"
|
||||
|
||||
require "follow_selected"
|
||||
require "go_input"
|
||||
require "go_next_prev"
|
||||
require "go_up"
|
||||
|
||||
-----------------------------
|
||||
-- End user script loading --
|
||||
-----------------------------
|
||||
|
||||
-- Restore last saved session
|
||||
local w = (session and session.restore())
|
||||
if w then
|
||||
for i, uri in ipairs(uris) do
|
||||
w:new_tab(uri, i == 1)
|
||||
end
|
||||
else
|
||||
-- Or open new window
|
||||
window.new(uris)
|
||||
end
|
||||
|
||||
-------------------------------------------
|
||||
-- Open URIs from other luakit instances --
|
||||
-------------------------------------------
|
||||
|
||||
if unique then
|
||||
unique.add_signal("message", function (msg, screen)
|
||||
local cmd, arg = string.match(msg, "^(%S+)%s*(.*)")
|
||||
local w = lousy.util.table.values(window.bywidget)[1]
|
||||
if cmd == "tabopen" then
|
||||
w:new_tab(arg)
|
||||
elseif cmd == "winopen" then
|
||||
w = window.new((arg ~= "") and { arg } or {})
|
||||
end
|
||||
w.win.screen = screen
|
||||
w.win.urgency_hint = true
|
||||
end)
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- CUSTOM
|
||||
--------------------------------------------------------------------------------
|
||||
-- Always save tabs before closing
|
||||
local close_win = window.methods.close_win
|
||||
window.methods.close_win = function (w, ...)
|
||||
session.save{w}
|
||||
close_win(w, ...)
|
||||
end
|
||||
|
||||
-- Always open in a new tab in current instance.
|
||||
webview.init_funcs.window_decision = function (view, w)
|
||||
view:add_signal("new-window-decision", function (v, uri, reason)
|
||||
w:new_tab(uri)
|
||||
return true
|
||||
end)
|
||||
end
|
||||
|
||||
-- Download folder.
|
||||
downloads.default_dir = os.getenv("HOME") .. "/temp"
|
||||
-- if downloads.default_dir == nil then
|
||||
-- downloads.default_dir = os.getenv("HOME")
|
||||
-- end
|
||||
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")
|
||||
end
|
||||
return downloads.default_dir .. "/" .. file
|
||||
end)
|
||||
|
||||
-- Adblock
|
||||
require("adblock")
|
||||
require("adblock_chrome")
|
||||
|
||||
|
||||
-- vim: et:sw=4:ts=8:sts=4:tw=80
|
Loading…
Reference in New Issue