Lua config: Reformat with tabs and more consistent style
parent
d13548540a
commit
a5e40117a5
File diff suppressed because it is too large
Load Diff
|
@ -25,7 +25,8 @@ theme.border_marked = "#91231c"
|
||||||
-- There are other variable sets
|
-- There are other variable sets
|
||||||
-- overriding the default one when
|
-- overriding the default one when
|
||||||
-- defined, the sets are:
|
-- defined, the sets are:
|
||||||
-- [taglist|tasklist]_[bg|fg]_[focus|urgent]
|
-- taglist_[bg|fg]_[focus|urgent|occupied|empty]
|
||||||
|
-- tasklist_[bg|fg]_[focus|urgent]
|
||||||
-- titlebar_[bg|fg]_[normal|focus]
|
-- titlebar_[bg|fg]_[normal|focus]
|
||||||
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
|
-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
|
||||||
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
|
-- mouse_finder_[color|timeout|animate_timeout|radius|factor]
|
||||||
|
@ -90,7 +91,7 @@ theme.layout_dwindle = "/usr/share/awesome/themes/default/layouts/dwindlew.png"
|
||||||
|
|
||||||
theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png"
|
theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png"
|
||||||
|
|
||||||
-- Define the icon theme for application icons. If not set then the icons
|
-- Define the icon theme for application icons. If not set then the icons
|
||||||
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
||||||
theme.icon_theme = nil
|
theme.icon_theme = nil
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
-- Global variables for luakit
|
-- Global variables for luakit
|
||||||
globals = {
|
globals = {
|
||||||
homepage = "about:blank",
|
homepage = "about:blank",
|
||||||
scroll_step = 40,
|
scroll_step = 40,
|
||||||
zoom_step = 0.1,
|
zoom_step = 0.1,
|
||||||
max_cmd_history = 100,
|
max_cmd_history = 100,
|
||||||
max_srch_history = 100,
|
max_srch_history = 100,
|
||||||
-- http_proxy = "http://example.com:3128",
|
-- http_proxy = "http://example.com:3128",
|
||||||
default_window_size = "800x600",
|
default_window_size = "800x600",
|
||||||
|
|
||||||
-- Disables loading of hostnames from /etc/hosts (for large host files)
|
-- Disables loading of hostnames from /etc/hosts (for large host files)
|
||||||
-- load_etc_hosts = false,
|
-- load_etc_hosts = false,
|
||||||
-- Disables checking if a filepath exists in search_open function
|
-- Disables checking if a filepath exists in search_open function
|
||||||
-- check_filepath = false,
|
-- check_filepath = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Make useragent
|
-- Make useragent
|
||||||
|
@ -19,22 +19,22 @@ local _, arch = luakit.spawn_sync("uname -sm")
|
||||||
-- Only use the luakit version if in date format (reduces identifiability)
|
-- Only use the luakit version if in date format (reduces identifiability)
|
||||||
local lkv = string.match(luakit.version, "^(%d+.%d+.%d+)")
|
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",
|
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,
|
string.sub(arch, 1, -2), luakit.webkit_user_agent_version,
|
||||||
luakit.webkit_version, (lkv and ("/" .. lkv)) or "")
|
luakit.webkit_version, (lkv and ("/" .. lkv)) or "")
|
||||||
|
|
||||||
-- Search common locations for a ca file which is used for ssl connection validation.
|
-- Search common locations for a ca file which is used for ssl connection validation.
|
||||||
local ca_files = {
|
local ca_files = {
|
||||||
-- $XDG_DATA_HOME/luakit/ca-certificates.crt
|
-- $XDG_DATA_HOME/luakit/ca-certificates.crt
|
||||||
luakit.data_dir .. "/ca-certificates.crt",
|
luakit.data_dir .. "/ca-certificates.crt",
|
||||||
"/etc/certs/ca-certificates.crt",
|
"/etc/certs/ca-certificates.crt",
|
||||||
"/etc/ssl/certs/ca-certificates.crt",
|
"/etc/ssl/certs/ca-certificates.crt",
|
||||||
}
|
}
|
||||||
-- Use the first ca-file found
|
-- Use the first ca-file found
|
||||||
for _, ca_file in ipairs(ca_files) do
|
for _, ca_file in ipairs(ca_files) do
|
||||||
if os.exists(ca_file) then
|
if os.exists(ca_file) then
|
||||||
soup.ssl_ca_file = ca_file
|
soup.ssl_ca_file = ca_file
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Change to stop navigation sites with invalid or expired ssl certificates
|
-- Change to stop navigation sites with invalid or expired ssl certificates
|
||||||
|
@ -50,25 +50,25 @@ soup.accept_policy = cookie_policy.always
|
||||||
-- it to avoid collisions with lua's string.format characters.
|
-- it to avoid collisions with lua's string.format characters.
|
||||||
-- See: http://www.lua.org/manual/5.1/manual.html#pdf-string.format
|
-- See: http://www.lua.org/manual/5.1/manual.html#pdf-string.format
|
||||||
search_engines = {
|
search_engines = {
|
||||||
-- duckduckgo = "http://duckduckgo.com/?q=%s",
|
-- duckduckgo = "http://duckduckgo.com/?q=%s",
|
||||||
-- luakit = "http://luakit.org/search/index/luakit?q=%s",
|
-- luakit = "http://luakit.org/search/index/luakit?q=%s",
|
||||||
-- sourceforge = "http://sf.net/search/?words=%s",
|
-- sourceforge = "http://sf.net/search/?words=%s",
|
||||||
arch = "http://wiki.archlinux.org/index.php?title=Special%%3ASearch&search=%s&go=Go",
|
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",
|
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",
|
ctan = "http://www.ctan.org/search/?search=%s&search_type=description",
|
||||||
g = "http://google.com/search?q=%s",
|
g = "http://google.com/search?q=%s",
|
||||||
gm = "https://maps.google.com/maps?q=%s",
|
gm = "https://maps.google.com/maps?q=%s",
|
||||||
gt = "http://translate.google.com/#en/fr/%s",
|
gt = "http://translate.google.com/#en/fr/%s",
|
||||||
imdb = "http://www.imdb.com/find?s=all&q=%s",
|
imdb = "http://www.imdb.com/find?s=all&q=%s",
|
||||||
torrent = "http://torrentz.eu/search?f=%s",
|
torrent = "http://torrentz.eu/search?f=%s",
|
||||||
w = "http://en.wikipedia.org/wiki/Special:Search?search=%s",
|
w = "http://en.wikipedia.org/wiki/Special:Search?search=%s",
|
||||||
wb = "http://en.wikibooks.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",
|
wbf = "http://fr.wikibooks.org/wiki/Special:Search?search=%s",
|
||||||
wf = "http://fr.wikipedia.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",
|
wkf = "http://fr.wiktionary.org/wiki/Special:Search?search=%s",
|
||||||
wk = "http://en.wiktionary.org/wiki/Special:Search?search=%s",
|
wk = "http://en.wiktionary.org/wiki/Special:Search?search=%s",
|
||||||
wr = "http://www.wordreference.com/enfr/%s",
|
wr = "http://www.wordreference.com/enfr/%s",
|
||||||
youtube = "http://www.youtube.com/results?search_query=%s",
|
youtube = "http://www.youtube.com/results?search_query=%s",
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Set google as fallback search engine
|
-- Set google as fallback search engine
|
||||||
|
@ -79,20 +79,20 @@ search_engines.default = search_engines.g
|
||||||
-- Per-domain webview properties
|
-- Per-domain webview properties
|
||||||
-- See http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebSettings.html
|
-- See http://webkitgtk.org/reference/webkitgtk/stable/WebKitWebSettings.html
|
||||||
domain_props = { --[[
|
domain_props = { --[[
|
||||||
["all"] = {
|
["all"] = {
|
||||||
enable_scripts = false,
|
enable_scripts = false,
|
||||||
enable_plugins = false,
|
enable_plugins = false,
|
||||||
enable_private_browsing = false,
|
enable_private_browsing = false,
|
||||||
user_stylesheet_uri = "",
|
user_stylesheet_uri = "",
|
||||||
},
|
},
|
||||||
["youtube.com"] = {
|
["youtube.com"] = {
|
||||||
enable_scripts = true,
|
enable_scripts = true,
|
||||||
enable_plugins = true,
|
enable_plugins = true,
|
||||||
},
|
},
|
||||||
["bbs.archlinux.org"] = {
|
["bbs.archlinux.org"] = {
|
||||||
user_stylesheet_uri = "file://" .. luakit.data_dir .. "/styles/dark.css",
|
user_stylesheet_uri = "file://" .. luakit.data_dir .. "/styles/dark.css",
|
||||||
enable_private_browsing = true,
|
enable_private_browsing = true,
|
||||||
}, ]]
|
}, ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
-- vim: et:sw=4:ts=8:sts=4:tw=80
|
-- vim: et:sw=4:ts=8:sts=4:tw=80
|
||||||
|
|
|
@ -5,19 +5,19 @@
|
||||||
require "lfs"
|
require "lfs"
|
||||||
|
|
||||||
if unique then
|
if unique then
|
||||||
unique.new("org.luakit")
|
unique.new("org.luakit")
|
||||||
-- Check for a running luakit instance
|
-- Check for a running luakit instance
|
||||||
if unique.is_running() then
|
if unique.is_running() then
|
||||||
if uris[1] then
|
if uris[1] then
|
||||||
for _, uri in ipairs(uris) do
|
for _, uri in ipairs(uris) do
|
||||||
if lfs.attributes(uri) then uri = os.abspath(uri) end
|
if lfs.attributes(uri) then uri = os.abspath(uri) end
|
||||||
unique.send_message("tabopen " .. uri)
|
unique.send_message("tabopen " .. uri)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
unique.send_message("winopen")
|
unique.send_message("winopen")
|
||||||
end
|
end
|
||||||
luakit.quit()
|
luakit.quit()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Load library of useful functions for luakit
|
-- Load library of useful functions for luakit
|
||||||
|
@ -25,7 +25,11 @@ require "lousy"
|
||||||
|
|
||||||
-- Small util functions to print output (info prints only when luakit.verbose is true)
|
-- Small util functions to print output (info prints only when luakit.verbose is true)
|
||||||
function warn(...) io.stderr:write(string.format(...) .. "\n") end
|
function warn(...) io.stderr:write(string.format(...) .. "\n") end
|
||||||
function info(...) if luakit.verbose then io.stdout:write(string.format(...) .. "\n") end end
|
function info(...)
|
||||||
|
if luakit.verbose then
|
||||||
|
io.stdout:write(string.format(...) .. "\n")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Load users global config
|
-- Load users global config
|
||||||
-- ("$XDG_CONFIG_HOME/luakit/globals.lua" or "/etc/xdg/luakit/globals.lua")
|
-- ("$XDG_CONFIG_HOME/luakit/globals.lua" or "/etc/xdg/luakit/globals.lua")
|
||||||
|
@ -152,12 +156,12 @@ require "go_up"
|
||||||
-- Restore last saved session
|
-- Restore last saved session
|
||||||
local w = (session and session.restore())
|
local w = (session and session.restore())
|
||||||
if w then
|
if w then
|
||||||
for i, uri in ipairs(uris) do
|
for i, uri in ipairs(uris) do
|
||||||
w:new_tab(uri, i == 1)
|
w:new_tab(uri, i == 1)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Or open new window
|
-- Or open new window
|
||||||
window.new(uris)
|
window.new(uris)
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
@ -165,17 +169,17 @@ end
|
||||||
-------------------------------------------
|
-------------------------------------------
|
||||||
|
|
||||||
if unique then
|
if unique then
|
||||||
unique.add_signal("message", function (msg, screen)
|
unique.add_signal("message", function (msg, screen)
|
||||||
local cmd, arg = string.match(msg, "^(%S+)%s*(.*)")
|
local cmd, arg = string.match(msg, "^(%S+)%s*(.*)")
|
||||||
local w = lousy.util.table.values(window.bywidget)[1]
|
local w = lousy.util.table.values(window.bywidget)[1]
|
||||||
if cmd == "tabopen" then
|
if cmd == "tabopen" then
|
||||||
w:new_tab(arg)
|
w:new_tab(arg)
|
||||||
elseif cmd == "winopen" then
|
elseif cmd == "winopen" then
|
||||||
w = window.new((arg ~= "") and { arg } or {})
|
w = window.new((arg ~= "") and { arg } or {})
|
||||||
end
|
end
|
||||||
w.win.screen = screen
|
w.win.screen = screen
|
||||||
w.win.urgency_hint = true
|
w.win.urgency_hint = true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
@ -184,16 +188,16 @@ end
|
||||||
-- Always save tabs before closing
|
-- Always save tabs before closing
|
||||||
local close_win = window.methods.close_win
|
local close_win = window.methods.close_win
|
||||||
window.methods.close_win = function (w, ...)
|
window.methods.close_win = function (w, ...)
|
||||||
session.save{w}
|
session.save{w}
|
||||||
close_win(w, ...)
|
close_win(w, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Always open in a new tab in current instance.
|
-- Always open in a new tab in current instance.
|
||||||
webview.init_funcs.window_decision = function (view, w)
|
webview.init_funcs.window_decision = function (view, w)
|
||||||
view:add_signal("new-window-decision", function (v, uri, reason)
|
view:add_signal("new-window-decision", function (v, uri, reason)
|
||||||
w:new_tab(uri)
|
w:new_tab(uri)
|
||||||
return true
|
return true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Download folder.
|
-- Download folder.
|
||||||
|
@ -202,14 +206,14 @@ downloads.default_dir = os.getenv("HOME") .. "/temp"
|
||||||
-- downloads.default_dir = os.getenv("HOME")
|
-- downloads.default_dir = os.getenv("HOME")
|
||||||
-- end
|
-- end
|
||||||
downloads.add_signal("download-location", function (uri, file)
|
downloads.add_signal("download-location", function (uri, file)
|
||||||
if not file or file == "" then
|
if not file or file == "" then
|
||||||
file = (string.match(uri, "/([^/]+)$")
|
file = (string.match(uri, "/([^/]+)$")
|
||||||
or string.match(uri, "^%w+://(.+)")
|
or string.match(uri, "^%w+://(.+)")
|
||||||
or string.gsub(uri, "/", "_")
|
or string.gsub(uri, "/", "_")
|
||||||
or "untitled")
|
or "untitled")
|
||||||
end
|
end
|
||||||
return downloads.default_dir .. "/" .. file
|
return downloads.default_dir .. "/" .. file
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Adblock
|
-- Adblock
|
||||||
require("adblock")
|
require("adblock")
|
||||||
|
|
Loading…
Reference in New Issue