summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-08-13 22:39:35 +0200
committerGravatar Tom Willemse2013-08-13 22:39:35 +0200
commitf9f898e5586c58fc7cd4fbef88e3bdebf778a91c (patch)
tree748e401a9972b7fafb2a871b1e021b2d0ffeab7c
downloadconkeror-f9f898e5586c58fc7cd4fbef88e3bdebf778a91c.tar.gz
conkeror-f9f898e5586c58fc7cd4fbef88e3bdebf778a91c.zip
Initial commit of my conkeror configuration in vcsh
-rw-r--r--.conkerorrc/ext_restore.js33
-rw-r--r--.conkerorrc/gtk2rc11
-rw-r--r--.conkerorrc/init.js269
-rw-r--r--.conkerorrc/themes/yoshi/conkeror--scrollbars.css36
-rw-r--r--.conkerorrc/themes/yoshi/hints--url-panel.css17
-rw-r--r--.conkerorrc/themes/yoshi/minibuffer.css49
-rw-r--r--.conkerorrc/themes/yoshi/mode-line.css16
-rw-r--r--.conkerorrc/themes/yoshi/new-tabs.css54
-rw-r--r--.conkerorrc/themes/yoshi/tab-bar.css41
-rw-r--r--.conkerorrc/themes/yoshi/theme.json9
10 files changed, 535 insertions, 0 deletions
diff --git a/.conkerorrc/ext_restore.js b/.conkerorrc/ext_restore.js
new file mode 100644
index 0000000..39b125e
--- /dev/null
+++ b/.conkerorrc/ext_restore.js
@@ -0,0 +1,33 @@
+/// From http://conkeror.org/Tips#Restore_Killed_Buffer_Url
+// I think by the time kill_buffer_hook runs the buffer is gone so I
+// patch kill_buffer
+
+var kill_buffer_original = kill_buffer_original || kill_buffer;
+
+var killed_buffer_urls = [];
+
+kill_buffer = function (buffer, force) {
+ if (buffer.display_uri_string) {
+ killed_buffer_urls.push(buffer.display_uri_string);
+ }
+
+ kill_buffer_original(buffer,force);
+};
+
+interactive("restore-killed-buffer-url", "Loads url from a previously killed buffer",
+ function restore_killed_buffer_url (I) {
+ if (killed_buffer_urls.length !== 0) {
+ var url = yield I.minibuffer.read(
+ $prompt = "Restore killed url:",
+ $completer = all_word_completer($completions = killed_buffer_urls),
+ $default_completion = killed_buffer_urls[killed_buffer_urls.length - 1],
+ $auto_complete = "url",
+ $auto_complete_initial = true,
+ $auto_complete_delay = 0,
+ $match_required);
+
+ load_url_in_new_buffer(url);
+ } else {
+ I.window.minibuffer.message("No killed buffer urls");
+ }
+ });
diff --git a/.conkerorrc/gtk2rc b/.conkerorrc/gtk2rc
new file mode 100644
index 0000000..fd511e5
--- /dev/null
+++ b/.conkerorrc/gtk2rc
@@ -0,0 +1,11 @@
+include "/home/slash/.gtkrc-2.0"
+
+style "noscrollbars" {
+ GtkScrollbar::slider-width=0
+ GtkScrollbar::trough-border=0
+ GtkScrollbar::has-backward-stepper=0
+ GtkScrollbar::has-forward-stepper=0
+ GtkScrollbar::has-secondary-backward-stepper=0
+ GtkScrollbar::has-secondary-forward-stepper=0
+}
+widget "MozillaGtkWidget.*" style "noscrollbars"
diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js
new file mode 100644
index 0000000..96460be
--- /dev/null
+++ b/.conkerorrc/init.js
@@ -0,0 +1,269 @@
+require("content-policy.js");
+require("favicon");
+require("session");
+
+load_paths.push("file:///usr/local/clark/share/conkeror/modules/");
+load_paths.push("file:///home/slash/projects/cdispass/");
+load_paths.push("file:///home/slash/.conkerorrc/site-js/");
+theme_load_paths.push("/home/slash/.conkerorrc/themes/");
+
+require("clark");
+require("cdispass");
+require("quickdispatch");
+
+define_browser_object_class(
+ "history-url", null,
+ function (I, prompt) {
+ check_buffer(I.buffer, content_buffer);
+ var result = yield I.buffer.window.minibuffer.read_url(
+ $prompt = prompt, $use_webjumps = false, $use_history = true,
+ $use_bookmarks = false, $sort_order = 'date_descending'
+ );
+ yield co_return(result);
+ }
+);
+
+function ext_title_format(window) {
+ return '(' + get_current_profile() +') '
+ + window.buffers.current.description;
+}
+
+function oni_add_sheet(css) {
+ let (sheet = get_home_directory()) {
+ sheet.append(".conkerorrc");
+ sheet.append("styles");
+ sheet.append(css);
+ register_user_stylesheet(make_uri(sheet));
+ };
+}
+
+function oni_before_quit_func() {
+ var w = get_recent_conkeror_window();
+ var result = (w == null) ||
+ "y" == (yield w.minibuffer.read_single_character_option(
+ $prompt="Quit Conkeror? (y/n)",
+ $options=["y", "n"]));
+ yield co_return(result);
+}
+
+function oni_block_flash(content_type, content_location) {
+ var Y = content_policy_accept, N = content_policy_reject;
+ var action = ({ "youtube.com": Y }
+ [content_location.host] || N);
+
+ if (action == N)
+ dumpln("blocked flash: " + content_location.spec);
+
+ return action;
+}
+
+function oni_escape(str) {
+ return str.replace(/(["$`])/g, '\\$1');
+}
+
+function oni_org_store_link(I) {
+ var cmd_str = 'emacsclient \"org-protocol://store-link://'
+ + encodeURIComponent(I.buffer.display_uri_string) + '/'
+ + encodeURIComponent(I.buffer.document.title) + '\"';
+
+ if (I.window != null) {
+ window.minibuffer.message('Issuing ' + cmd_str);
+ }
+
+ shell_command_blind(cmd_str);
+}
+interactive("org-store-link",
+ "Stores [[url][title]] as org link and copies url to emacs "
+ + "kill ring",
+ oni_org_store_link);
+
+interactive("find-url-from-history",
+ "Find a page from history in the current buffer",
+ "find-url",
+ $browser_object = browser_object_history_url);
+interactive("find-url-from-history-new-buffer",
+ "Find a page from history in a new buffer",
+ "find-url-new-buffer",
+ $browser_object = browser_object_history_url);
+
+define_webjump("emacswiki",
+ "https://duckduckgo.com/?q=%s+site%3Aemacswiki.org",
+ $alternative="http://www.emacswiki.org");
+define_webjump("php",
+ "http://www.php.net/manual-lookup.php?pattern=%s&scope=quickref",
+ $alternative="http://www.php.net");
+define_webjump("python",
+ "http://docs.python.org/search.html?q=%s&check_keywords=yes&area=default",
+ $alternative="http://www.python.org");
+define_webjump("ddg",
+ "https://duckduckgo.com/?q=%s",
+ $alternative="https://duckduckgo.com");
+define_webjump("metal-archives",
+ "http://www.metal-archives.com/search?searchString=%s&type=band_name",
+ $alternative="http://www.metal-archives.com");
+define_webjump("djangodocs",
+ "https://docs.djangoproject.com/search/?q=%s&release=5",
+ $alternative="https://docs.djangoproject.com/");
+define_webjump("google",
+ "https://duckduckgo.com?q=!google%%20%s");
+define_webjump("github",
+ "https://github.com/search?q=%s&type=Everything&repo=&langOverride=&start_value=1",
+ $alternative="https://github.com");
+define_webjump("mdn",
+ "https://developer.mozilla.org/en-US/search?q=%s",
+ $alternative="https://developer.mozilla.org/");
+define_webjump("monsterhunter",
+ "http://monsterhunter.wikia.com/wiki/index.php?search=%s&fulltext=Search",
+ $alternative="http://monsterhunter.wikia.com/");
+define_webjump("quickdocs", "http://quickdocs.org/search?q=%s",
+ $alternative="http://quickdocs.org/");
+// Archlinux
+define_webjump("arch/wiki",
+ "https://wiki.archlinux.org/index.php?search=%s",
+ $alternative="https://wiki.archlinux.org");
+define_webjump("arch/aur",
+ "https://aur.archlinux.org/packages.php?O=0&K=%s&do_Search=Go",
+ $alternative="https://aur.archlinux.org");
+define_webjump("arch/packages",
+ "https://www.archlinux.org/packages/?sort=&q=%s&limit=50",
+ $alternative="https://packages.archlinux.org");
+
+/// Chickadee
+// From http://conkeror.org/Webjumps
+function chickadee_completer (input, cursor_position, conservative) {
+ var completions = [];
+ var content = yield send_http_request(
+ load_spec({uri: "http://api.call-cc.org/cdoc/ajax/prefix?q="+
+ encodeURIComponent(input)}));
+ if (content.responseText) {
+ var parser = Cc["@mozilla.org/xmlextras/domparser;1"]
+ .createInstance(Ci.nsIDOMParser);
+ var doc = parser.parseFromString(content.responseText, "text/xml");
+ var res = doc.getElementsByTagName("li");
+ for (let i = 0, n = res.length; i < n; ++i) {
+ completions.push(res[i].textContent);
+ }
+ }
+ yield co_return(prefix_completer($completions = completions)
+ (input, cursor_position, conservative));
+}
+define_webjump("chickadee",
+ "http://api.call-cc.org/cdoc?q=%s&query-name=Lookup",
+ $alternative = "http://api.call-cc.org/doc/",
+ $completer = chickadee_completer);
+/// /Chickadee
+
+// content_policy_bytype_table.object = oni_block_flash;
+cwd = make_file("/home/slash/downloads/");
+hint_digits = "arstdhneio";
+read_buffer_show_icons = true;
+title_format_fn = ext_title_format;
+url_remoting_fn = load_url_in_new_buffer;
+session_auto_save_auto_load = true;
+
+define_key(content_buffer_normal_keymap, "C-x C-b", "switch-to-buffer");
+define_key(content_buffer_normal_keymap, "C-y", "paste-url-new-buffer");
+define_key(content_buffer_normal_keymap, "H", "find-url-from-history");
+define_key(content_buffer_normal_keymap, "h", "find-url-from-history-new-buffer");
+define_key(default_base_keymap, "C-x f", "follow-new-buffer");
+define_key(content_buffer_normal_keymap, "b", clark_keymap);
+define_key(content_buffer_text_keymap, "C-c d", "dispass-and-submit");
+
+add_hook("before_quit_hook", oni_before_quit_func);
+add_hook("content_policy_hook", content_policy_bytype);
+add_hook("mode_line_hook", mode_line_adder(buffer_count_widget));
+add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true);
+add_hook("mode_line_hook", mode_line_adder(clark_bookmarked_widget), true);
+add_hook("mode_line_hook", mode_line_adder(downloads_status_widget));
+
+remove_hook("download_added_hook", open_download_buffer_automatically);
+
+hints_minibuffer_annotation_mode(true);
+theme_load("yoshi");
+
+external_content_handlers.set("application/pdf", "zathura");
+external_content_handlers.set("application/vnd.ms-excel", "libreoffice");
+
+var gh_url = "http://github.com/";
+function read_url_github_repo_command_handler(input)
+{
+ var m = /^gh\s+(\S+\/\S+)(?:\s+(\#\d+|\@\S+|issues|pulls|wiki|graphs|network|admin)(?:\s+(\#\d+|new))?)?$/.exec(input);
+
+ if (m) {
+ repo_url = gh_url + m[1] + "/";
+
+ switch (m[2]) {
+ case "issues":
+ issues_url = repo_url + m[2] + "/";
+
+ if (m[3]) {
+ if (m[3][0] == '#')
+ return issues_url + m[3].substring(1);
+ else if (m[3] == "new")
+ return issues_url + m[3];
+ else
+ break;
+ }
+
+ return issues_url;
+ case "pulls":
+ case "wiki":
+ case "graphs":
+ case "network":
+ case "admin":
+ return repo_url + m[2];
+ default:
+ // Still need watch and unwatch
+ if (m[2]) {
+ if (m[2][0] == '#')
+ return repo_url + "issues/" + m[2].substring(1);
+ else if (m[2][0] == '@')
+ return repo_url + "tree/" + m[2].substring(1);
+ else
+ break;
+ }
+
+ return repo_url;
+ }
+ }
+
+ return null;
+}
+
+function read_url_github_command_handler(input)
+{
+ return read_url_github_repo_command_handler(input);
+}
+
+read_url_handler_list = [read_url_github_command_handler,
+ read_url_qd_handler];
+
+// Mozrepl
+let (mozrepl_init = get_home_directory()) {
+ mozrepl_init.appendRelativePath(".mozrepl-conkeror.js");
+ session_pref('extensions.mozrepl.initUrl', make_uri(mozrepl_init).spec);
+};
+
+// if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) {
+// let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1']
+// .getService(Ci.nsIMozRepl);
+// if (!mozrepl.isActive())
+// mozrepl.start(4242);
+// }
+
+register_user_stylesheet(
+ "data:text/css," +
+ escape(
+ "@namespace url(\"http://www.w3.org/1999/xhtml\");\n" +
+ "span.__conkeror_hint {\n" +
+ " font-family: \"Envy Code R\" !important;\n" +
+ " font-size: 12px !important;\n" +
+ " line-height: 12px !important;\n" +
+ " padding: 0 2px !important;\n" +
+ "}"
+ )
+);
+
+oni_add_sheet("github.css");
+oni_add_sheet("help.css");
+oni_add_sheet("git-scm.css");
diff --git a/.conkerorrc/themes/yoshi/conkeror--scrollbars.css b/.conkerorrc/themes/yoshi/conkeror--scrollbars.css
new file mode 100644
index 0000000..0f70e96
--- /dev/null
+++ b/.conkerorrc/themes/yoshi/conkeror--scrollbars.css
@@ -0,0 +1,36 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+/* The "background" behind the scrolling part of the scrollbar. */
+scrollbar {
+ background-color: #222;
+}
+
+/* corner between horizontal and vertical scrollbars */
+scrollcorner {
+ background-color: black;
+}
+
+/* The scroll up/down buttons. */
+scrollbarbutton {
+ background-color: #666;
+}
+
+/* The actual scrolling part of the scrollbar. */
+thumb {
+ background-color: #666;
+}
+
+thumb, scrollbarbutton {
+ -moz-border-bottom-colors: #000 #333;
+ -moz-border-left-colors: #aaa #888;
+ -moz-border-right-colors: #000 #333;
+ -moz-border-top-colors: #aaa #888;
+}
+
+scrollbarbutton:hover:active, scrollbarbutton[active="true"] {
+ -moz-border-bottom-colors: #aaa #888;
+ -moz-border-left-colors: #000 #333;
+ -moz-border-right-colors: #aaa #888;
+ -moz-border-top-colors: #000 #333;
+}
diff --git a/.conkerorrc/themes/yoshi/hints--url-panel.css b/.conkerorrc/themes/yoshi/hints--url-panel.css
new file mode 100644
index 0000000..143f3c1
--- /dev/null
+++ b/.conkerorrc/themes/yoshi/hints--url-panel.css
@@ -0,0 +1,17 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+.panel {
+ border-top: 4px double #333333;
+ color: white;
+ background-color: black;
+}
+
+.panel .panel-row-label {
+ font-weight: bold;
+}
+
+.panel .url-panel-label {
+ font-weight: bold;
+}
+
diff --git a/.conkerorrc/themes/yoshi/minibuffer.css b/.conkerorrc/themes/yoshi/minibuffer.css
new file mode 100644
index 0000000..d474165
--- /dev/null
+++ b/.conkerorrc/themes/yoshi/minibuffer.css
@@ -0,0 +1,49 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+#minibuffer {
+ background-color: #111113;
+ border: none;
+ color: #EEEEEC;
+ font: 16px "Liberation Mono";
+}
+
+#minibuffer-input, #minibuffer-input * {
+ color: #EEEEEC;
+}
+
+#minibuffer-prompt {
+ color: #EEEEEC;
+}
+
+/* Completions display */
+
+tree.completions treechildren { border: none !important; }
+
+tree.completions treecol { -moz-binding: none !important; }
+tree.completions {
+ -moz-appearance: none !important;
+ border: 0px none !important;
+ background-color: #111113 !important;
+ -moz-border-top-colors: -moz-initial !important;
+ color: #EEEEEC !important;
+ font: 18px "Liberation Mono";
+}
+
+tree.completions treechildren::-moz-tree-row {
+ background-color: #111113 !important;
+ border: none;
+}
+
+tree.completions treechildren::-moz-tree-row(current) {
+ background-color: #536580 !important;
+ color: #EEEEEC;
+}
+
+tree.completions treechildren::-moz-tree-cell-text(completion-description) {
+ color: #b8ffa6 !important;
+}
+
+tree.completions treechildren::-moz-tree-cell-text(current) {
+ color: #EEEEEC !important;
+}
diff --git a/.conkerorrc/themes/yoshi/mode-line.css b/.conkerorrc/themes/yoshi/mode-line.css
new file mode 100644
index 0000000..74c27b6
--- /dev/null
+++ b/.conkerorrc/themes/yoshi/mode-line.css
@@ -0,0 +1,16 @@
+.mode-line {
+ font: 16px "Liberation Mono";
+ padding: 0px;
+ border: none;
+ color: #EEEEEC;
+ background-color: #222224;
+}
+
+.mode-line label {
+ color: #EEEEEC;
+}
+
+.mode-line .buffer-icon-widget {
+ max-height: 16px;
+ max-width: 16px;
+}
diff --git a/.conkerorrc/themes/yoshi/new-tabs.css b/.conkerorrc/themes/yoshi/new-tabs.css
new file mode 100644
index 0000000..f5d30c0
--- /dev/null
+++ b/.conkerorrc/themes/yoshi/new-tabs.css
@@ -0,0 +1,54 @@
+#tab2-bar {
+ background: #222;
+}
+
+.tab2 {
+ margin: 2px 0px 0px 2px;
+ padding: 0px;
+ height: 22px;
+ border-width: 2px;
+ border-bottom-width: 0;
+ border-style: solid;
+ -moz-border-radius: 3px 3px 0 0;
+ -moz-border-left-colors: #888 #555;
+ -moz-border-right-colors: #000 #171717;
+ -moz-border-top-colors: #888 #555;
+ background: #333;
+ min-width: 200px;
+ max-width: 200px;
+ overflow: hidden; /* Chops end of label */
+}
+
+.tab2[selected=true] {
+ -moz-border-left-colors: #aaa #888;
+ -moz-border-right-colors: #000 #333;
+ -moz-border-top-colors: #aaa #888;
+ background: #666;
+}
+
+.tab2:hover {
+ -moz-border-left-colors: #eee #bbb;
+ -moz-border-right-colors: #333 #666;
+ -moz-border-top-colors: #eee #bbb;
+ background: #999;
+}
+
+.tab2-label {
+ margin-left: 4px;
+ padding-top: 1px;
+ color: #fff;
+ font: 11px Tahoma;
+}
+
+.tab2-icon {
+ margin: 1px !important;
+ padding: 1px;
+ width: 20px;
+ height: 15px;
+ max-height: 15px;
+ -moz-border-radius: 1px;
+ background: black;
+ color: white;
+ font: 900 11px Tahoma;
+ text-align: center;
+}
diff --git a/.conkerorrc/themes/yoshi/tab-bar.css b/.conkerorrc/themes/yoshi/tab-bar.css
new file mode 100644
index 0000000..c451778
--- /dev/null
+++ b/.conkerorrc/themes/yoshi/tab-bar.css
@@ -0,0 +1,41 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+/* TABS */
+#tab2-bar {
+ background: #000;
+}
+
+#tab2-bar .tab2 {
+ margin: 0;
+ padding: 0;
+ border: none;
+ /*height: 19px;
+ border: 1px solid #666;
+ min-width: 200px;
+ max-width: 200px;*/
+ background: #333;
+ overflow: hidden;
+}
+
+#tab2-bar .tab2-label {
+ margin: 0;
+ color: white;
+ font: 11px Tahoma;
+}
+
+#tab2-bar .tab2-icon {
+ height: 16px;
+ width: 16px;
+ background: #222;
+ color: white;
+ border: 1px solid #999;
+ font: 900 11px Tahoma;
+ text-align: center;
+}
+
+#tab2-bar .tab2[selected=true] {
+ border: 1px solid white;
+ background: #666;
+ border: 1px solid #999;
+}
diff --git a/.conkerorrc/themes/yoshi/theme.json b/.conkerorrc/themes/yoshi/theme.json
new file mode 100644
index 0000000..bb74ee1
--- /dev/null
+++ b/.conkerorrc/themes/yoshi/theme.json
@@ -0,0 +1,9 @@
+{ "sheets" : [
+ "conkeror--scrollbars.css",
+ "new-tabs.css",
+ "minibuffer.css",
+ "mode-line.css",
+ "hints--url-panel.css",
+ "tab-bar.css"
+ ]
+}