globals.lua

Wed, 01 Sep 2010 04:03:42 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Wed, 01 Sep 2010 04:03:42 +0100
changeset 2
1e9553b2f9a2
parent 1
4d7540af8518
child 3
547eaf259e9d
permissions
-rw-r--r--

Add note about required patch

0
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 -- Global variables for luakit
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 globals = {
1
4d7540af8518 Initial set of changes to make 'insert' mode 'normal', eradicate 'command' mode and adjust key bindings appropriately (following common binding patterns from other browsers, and in places the nano text editor)
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
3 homepage = "http://google.co.uk/",
0
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 scroll_step = 20,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 zoom_step = 0.1,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 max_cmd_history = 100,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 max_srch_history = 100,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 -- http_proxy = "http://example.com:3128",
1
4d7540af8518 Initial set of changes to make 'insert' mode 'normal', eradicate 'command' mode and adjust key bindings appropriately (following common binding patterns from other browsers, and in places the nano text editor)
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
9 download_dir = luakit.get_special_dir("DOWNLOAD") or (os.getenv("HOME") .. "/Downloads"),
0
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 }
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 -- Make useragent
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 local rv, out, err = luakit.spawn_sync("uname -sm")
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 local webkit_version = string.format("WebKitGTK+/%d.%d.%d", luakit.webkit_major_version,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 luakit.webkit_minor_version, luakit.webkit_micro_version)
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 local luakit_version = string.format("luakit/%s", luakit.version)
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 globals.useragent = string.format("Mozilla/5.0 (%s) %s %s", string.match(out, "([^\n]*)"), webkit_version, luakit_version)
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 -- Search common locations for a ca file which is used for ssl connection validation.
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20 local ca_files = {luakit.data_dir .. "/ca-certificates.crt",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 "/etc/certs/ca-certificates.crt", "/etc/ssl/certs/ca-certificates.crt",}
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22 for _, ca_file in ipairs(ca_files) do
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 if os.exists(ca_file) then
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24 globals.ca_file = ca_file
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
25 break
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
26 end
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
27 end
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
28
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 -- Change to stop navigation sites with invalid or expired ssl certificates
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30 globals.ssl_strict = false
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 -- Search engines
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 search_engines = {
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 luakit = "http://luakit.org/search/index/luakit?q={0}",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 google = "http://google.com/search?q={0}",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36 wikipedia = "http://en.wikipedia.org/wiki/Special:Search?search={0}",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 debbugs = "http://bugs.debian.org/{0}",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 imdb = "http://imdb.com/find?s=all&q={0}",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39 sourceforge = "http://sf.net/search/?words={0}",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 }
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 -- Fake the cookie policy enum here
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 cookie_policy = { always = 0, never = 1, no_third_party = 2 }
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
45 -- Per-domain webview properties
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 domain_props = { --[[
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47 ["all"] = {
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 ["enable-scripts"] = false,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 ["enable-plugins"] = false,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
50 ["enable-private-browsing"] = false,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51 ["user-stylesheet-uri"] = "",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52 ["accept-policy"] = cookie_policy.never,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53 },
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 ["youtube.com"] = {
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55 ["enable-scripts"] = true,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56 ["enable-plugins"] = true,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57 },
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 ["lwn.net"] = {
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59 ["accept-policy"] = cookie_policy.no_third_party,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60 },
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61 ["forums.archlinux.org"] = {
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62 ["user-stylesheet-uri"] = luakit.data_dir .. "/styles/dark.css",
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63 ["enable-private-browsing"] = true,
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
64 }, ]]
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
65 }
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
66
98e4b0c9fcac Initial commit of default luakit config from 2010.08.30
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67 -- vim: et:sw=4:ts=8:sts=4:tw=80

mercurial