summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xauto.mailcap12
-rwxr-xr-xconfig.toml100
2 files changed, 112 insertions, 0 deletions
diff --git a/auto.mailcap b/auto.mailcap
new file mode 100755
index 0000000..f168e10
--- /dev/null
+++ b/auto.mailcap
@@ -0,0 +1,12 @@
+text/markdown; md2html --fcollapse-whitespace --flatex-math --fpermissive-email-autolinks --fstrikethrough --ftables --ftasklists --funderline --fwiki-links;x-htmloutput
+#text/markdown; pandoc - -f markdown -t html -o -; x-htmloutput
+text/javascript; bat -f -l es6 --file-name "${MAILCAP_URL:-STDIN}" -;x-ansioutput
+audio/*; mpv - 2>/dev/null
+video/*; mpv - 2>/dev/null
+image/*; nsxiv --geometry=1068x600 %s
+application/pdf; qpdfview '%s'
+application/zip; exec cat;x-saveoutput
+application/gzip; exec cat;x-saveoutput
+application/toml; exec cat;copiousoutput
+application/vnd.oasis.opendocument.text;pandoc --from odt --to markdown %s;copiousoutput
+application/*;cp %s /tmp \; xdg-open /tmp/$(basename %s) > /dev/null 2>&1
diff --git a/config.toml b/config.toml
new file mode 100755
index 0000000..f7fea92
--- /dev/null
+++ b/config.toml
@@ -0,0 +1,100 @@
+[siteconf.wittamore]
+host = '(.*\.)?wittamore\.fr'
+cookie = true
+share-cookie-jar = 'wittamore.fr'
+
+[siteconf.gopher]
+url = 'gopher://.*'
+autofocus = true
+
+[siteconf.sr-ht]
+host = '(.*\.)?sr\.ht'
+cookie = true
+share-cookie-jar = 'sr.ht'
+
+[encoding]
+document-charset = "utf-8"
+
+[display]
+highlight-color = "#ffffff"
+image-mode = "auto"
+
+[external]
+editor = "micro %s"
+bookmark = "~/.chawan/bookmarks"
+download-dir = "~/Downloads"
+
+[omnirule.ddg]
+match = '^ddg:'
+substitute-url = '(x) => "https://lite.duckduckgo.com/lite/?kp=-1&kd=-1&q=" + encodeURIComponent(x.split(":").slice(1).join(":"))'
+
+[page]
+# Search using DuckDuckGo Lite.
+'C-k' = '() => pager.load("ddg:")'
+# Lynx style navigation
+'M-[A' = '() => pager.cursorPrevLink()'
+'M-[B' = '() => pager.cursorNextLink()'
+'M-[C' = '() => pager.nextBuffer()'
+'M-[D' = '() => pager.prevBuffer()'
+#
+'M-[7~' = '() => pager.cursorLineBegin()'
+'M-[8~' = '() => pager.cursorLineEnd()'
+'M-[5~' = '() => pager.scrollUp(5)'
+'M-[6~' = '() => pager.scrollDown(5)'
+# External commands
+gr = "pager.externFilterSource(`rdrview -Hu \"$CHA_URL\"`, null, 'text/html')"
+gy = 'pager.extern(`notify-send "opening mpv $u" && mpv "$u" 2>/dev/null &`, {env: {u: pager.hoverLink}})'
+gd = 'pager.extern(`notify-send "Downloading $(basename $u)" && curl -s "$u" > "/tmp/$(basename $u)" &`, {env: {u: pager.hoverLink}})'
+ge = 'pager.extern(`notify-send "opening email $u" && chawan-email-handler "$u" &`, {env: {u: pager.hoverLink}})'
+gt = 'pager.externFilterSource(`trans :en -b`, null, null)'
+
+# FR keyboard replacement
+';' = 'cmd.pager.nextBuffer'
+
+[buffer]
+images = true
+scripting = 'app'
+referer-from = true
+cookie = 'save'
+# filetype display
+user-style = '''
+plaintext {
+ white-space: pre-wrap;
+ text-align: justify;
+ padding:0 10px 0 10px;
+ a {color:#00af5f;}
+ pre::first-line {color:red}
+}
+@media (-cha-content-type: "text/gopher") {
+ html {height:100%;width:100%}
+ html * {cursor:none;}
+ body {min-height:100%;color: #fffff0;}
+ pre {padding-left:7ch; margin:0; white-space: pre-wrap;word-wrap: break-word; }
+ pre::before { content: ' '; width: 0; display: block; }
+ a {color:#00af5f;}
+ a[item-type]::before { min-width: 7ch; text-align: right; display: inline-block;
+ white-space: pre; text-decoration: none; color:#222;}
+ a[item-type]::before { content:""; }
+ a[item-type='1']::before { content:" 📁 "; }
+ a[item-type='3']::before { content:" ⚠ "; color:red; }
+ a[item-type='7']::before { content:" ? "; }
+ a[item-type='h']::before { content:" 🌐 "; }
+}
+@media (-cha-content-type: "text/markdown") {
+ h1 {color:#0087ff;}
+ h2 {color:#00d787;}
+ h3 {color:#d7afaf;}
+ h4 {color:#ffffaf;}
+ h5 {color:#ffaf5f;}
+ h6 {color:#d7afff;}
+ h7 {color:#87875f;}
+ b,code,em {color:#808080;}
+ a {color:#00af5f;}
+ table {color:#ffffff;background-color:#870000;}
+}
+'''
+
+
+
+
+