]> git.sev.monster Git - dotfiles.git/blame_incremental - xdg/luakit/rc.lua
small gtk fixes, update dunstrc, modules, user.js
[dotfiles.git] / xdg / luakit / rc.lua
... / ...
CommitLineData
1------------------------------------------------------------------------------
2-- luakit configuration file, more information at https://luakit.github.io/ --
3------------------------------------------------------------------------------
4
5require "lfs"
6
7require "unique_instance"
8
9-- Set the number of web processes to use. A value of 0 means 'no limit'.
10luakit.process_limit = 4
11-- Set the cookie storage location
12soup.cookies_storage = luakit.data_dir .. "/cookies.db"
13
14-- Load library of useful functions for luakit
15local lousy = require "lousy"
16
17-- Load users theme
18-- ("$XDG_CONFIG_HOME/luakit/theme.lua" or "/etc/xdg/luakit/theme.lua")
19lousy.theme.init(lousy.util.find_config("theme.lua"))
20assert(lousy.theme.get(), "failed to load theme")
21
22-- Load users window class
23-- ("$XDG_CONFIG_HOME/luakit/window.lua" or "/etc/xdg/luakit/window.lua")
24local window = require "window"
25
26-- Load users webview class
27-- ("$XDG_CONFIG_HOME/luakit/webview.lua" or "/etc/xdg/luakit/webview.lua")
28local webview = require "webview"
29
30-- Add luakit;//log/ chrome page
31local log_chrome = require "log_chrome"
32
33window.add_signal("build", function (w)
34 local widgets, l, r = require "lousy.widget", w.sbar.l, w.sbar.r
35
36 -- Left-aligned status bar widgets
37 l.layout:pack(widgets.uri())
38 l.layout:pack(widgets.hist())
39 l.layout:pack(widgets.progress())
40
41 -- Right-aligned status bar widgets
42 r.layout:pack(widgets.buf())
43 r.layout:pack(log_chrome.widget())
44 r.layout:pack(widgets.ssl())
45 r.layout:pack(widgets.tabi())
46 r.layout:pack(widgets.scroll())
47end)
48
49-- Load luakit binds and modes
50local modes = require "modes"
51local binds = require "binds"
52
53local settings = require "settings"
54require "settings_chrome"
55
56----------------------------------
57-- Optional user script loading --
58----------------------------------
59
60-- Add adblock
61local adblock = require "adblock"
62local adblock_chrome = require "adblock_chrome"
63
64local webinspector = require "webinspector"
65
66-- Add uzbl-like form filling
67local formfiller = require "formfiller"
68
69-- Add proxy support & manager
70local proxy = require "proxy"
71
72-- Add quickmarks support & manager
73local quickmarks = require "quickmarks"
74
75-- Add session saving/loading support
76local session = require "session"
77
78-- Add command to list closed tabs & bind to open closed tabs
79local undoclose = require "undoclose"
80
81-- Add command to list tab history items
82local tabhistory = require "tabhistory"
83
84-- Add greasemonkey-like javascript userscript support
85local userscripts = require "userscripts"
86
87-- Add bookmarks support
88local bookmarks = require "bookmarks"
89local bookmarks_chrome = require "bookmarks_chrome"
90
91-- Add download support
92local downloads = require "downloads"
93local downloads_chrome = require "downloads_chrome"
94
95-- Add automatic PDF downloading and opening
96local viewpdf = require "viewpdf"
97
98-- Example using xdg-open for opening downloads / showing download folders
99downloads.add_signal("open-file", function (file)
100 luakit.spawn(string.format("xdg-open %q", file))
101 return true
102end)
103
104-- Add vimperator-like link hinting & following
105local follow = require "follow"
106
107-- Add command history
108local cmdhist = require "cmdhist"
109
110-- Add search mode & binds
111local search = require "search"
112
113-- Add ordering of new tabs
114local taborder = require "taborder"
115
116-- Save web history
117local history = require "history"
118local history_chrome = require "history_chrome"
119
120local help_chrome = require "help_chrome"
121local binds_chrome = require "binds_chrome"
122
123-- Add command completion
124local completion = require "completion"
125
126-- Press Control-E while in insert mode to edit the contents of the currently
127-- focused <textarea> or <input> element, using `xdg-open`
128local open_editor = require "open_editor"
129
130-- NoScript plugin, toggle scripts and or plugins on a per-domain basis.
131-- `,ts` to toggle scripts, `,tp` to toggle plugins, `,tr` to reset.
132-- If you use this module, don't use any site-specific `enable_scripts` or
133-- `enable_plugins` settings, as these will conflict.
134require "noscript"
135
136local follow_selected = require "follow_selected"
137local go_input = require "go_input"
138local go_next_prev = require "go_next_prev"
139local go_up = require "go_up"
140
141-- Filter Referer HTTP header if page domain does not match Referer domain
142require_web_module("referer_control_wm")
143
144local error_page = require "error_page"
145
146-- Add userstyles loader
147local styles = require "styles"
148
149-- Hide scrollbars on all pages
150local hide_scrollbars = require "hide_scrollbars"
151
152-- Add a stylesheet when showing images
153local image_css = require "image_css"
154
155-- Add a new tab page
156local newtab_chrome = require "newtab_chrome"
157
158-- Add tab favicons mod
159local tab_favicons = require "tab_favicons"
160
161-- Add :view-source command
162local view_source = require "view_source"
163
164-----------------------------
165-- End user script loading --
166-----------------------------
167
168settings.window.search_engines = {
169 ddg = "https://duckduckgo.com/?q=%s",
170 gh = "https://github.com/search?q=%s",
171 w = "https://en.wikipedia.org/wiki/Special:Search?search=%s"
172}
173settings.window.search_engines.default = settings.window.search_engines.ddg
174
175-- change tab text
176require("lousy.widget.tab").label_format = '<span foreground="{index_fg}" font-weight="bold">{index}</span> {title}'
177
178-- Restore last saved session
179local w = (not luakit.nounique) and (session and session.restore())
180if w then
181 for i, uri in ipairs(uris) do
182 w:new_tab(uri, { switch = i == 1 })
183 end
184else
185 -- Or open new window
186 window.new(uris)
187end
188
189-- vim: et:sw=4:ts=8:sts=4:tw=80
This page took 0.028498 seconds and 4 git commands to generate.