dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 28bb5224e4c04cbaa7ee7c359026945765fdb9c5
parent 5f49d72724f518a44ef03564fe411112212d9937
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 30 Jun 2018 15:44:19 -0400

First pass at a generalized w3m config

Diffstat:
M.local/bin/my | 20++++++++++++++++++++
M.local/bin/my-open | 15++++++++++++++-
A.mime.types | 74++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.w3m/config | 16++++++++--------
4 files changed, 116 insertions(+), 9 deletions(-)

diff --git a/.local/bin/my b/.local/bin/my @@ -34,6 +34,26 @@ __getlocker() } case $command in + mailto) + for m in mutt mail + do + if type $m > /dev/null 2>&1 + then + mailer=$m + break + fi + done + if [ -n "$2" ] + then + $mailer -s "$2" $1 + else + $mailer $1 + fi + ;; + search) + query=`echo $1 | tr ' ' '+'` + exec my open -T https://duckduckgo.com/?q=$query + ;; term) SHLVL=0; export SHLVL if type urxvtd > /dev/null 2>&1 diff --git a/.local/bin/my-open b/.local/bin/my-open @@ -1,5 +1,4 @@ #!/bin/sh - # # ~/.local/bin/my-open # @@ -8,6 +7,20 @@ # attempt to resolve the different handlers into a platform-independent # one. # +if [ "$1" = "-T" ] +then + shift + for b in w3m lynx + do + if type $b > /dev/null 2>&1 + then + browser=$b + break + fi + done + $browser $1 + exit +fi # Find handler, if one is available if type cygstart > /dev/null 2>&1 diff --git a/.mime.types b/.mime.types @@ -0,0 +1,74 @@ +# {{{ Application-generated files... +application/msword doc string(0,<D0CF11E0A1B11AE1>) +application/pdf pdf regex(0,^[\n\r]*%PDF) +application/postscript ai eps ps string(0,%!) string(0,<04>%!) \ + contains(0,128,<1B>%-12345X) + \ + (contains(0,4096,"LANGUAGE=POSTSCRIPT") \ + contains(0,4096,"LANGUAGE = Postscript") \ + contains(0,4096,"LANGUAGE = PostScript") \ + contains(0,4096,"LANGUAGE = POSTSCRIPT") \ + (contains(0,4096,<0a>%!) + \ + !contains(0,4096,"ENTER LANGUAGE"))) +application/rss+xml rss +application/vnd.cups-banner string(0,'#CUPS-BANNER') +application/vnd.cups-command string(0,'#CUPS-COMMAND') +application/vnd.cups-pdf +application/vnd.cups-postscript +application/vnd.cups-ppd ppd string(0,"*PPD-Adobe:") +application/vnd.cups-raster string(0,"RaSt") string(0,"tSaR") \ + (string(0,"RaS2") + !string(4,PwgRaster<00>)) string(0,"2SaR") \ + string(0,"RaS3") string(0,"3SaR") +application/vnd.cups-raw (string(0,<1B>E) + !string(2,<1B>%0B)) \ + string(0,<1B>@) \ + (contains(0,128,<1B>%-12345X) + \ + (contains(0,4096,"LANGUAGE=PCL") \ + contains(0,4096,"LANGUAGE = PCL"))) +# }}} + +# {{{ Image files... +image/gif gif string(0,GIF87a) string(0,GIF89a) +image/png png string(0,<89>PNG) +image/jpeg jpeg jpg jpe string(0,<FFD8FF>) +\ + (char(3,0xe0) char(3,0xe1) char(3,0xe2) char(3,0xe3)\ + char(3,0xe4) char(3,0xe5) char(3,0xe6) char(3,0xe7)\ + char(3,0xe8) char(3,0xe9) char(3,0xea) char(3,0xeb)\ + char(3,0xec) char(3,0xed) char(3,0xee) char(3,0xef)) +image/pwg-raster string(0,"RaS2") + string(4,PwgRaster<00>) priority(150) +image/tiff tiff tif string(0,MM<002A>) string(0,II<2A00>) +image/x-photocd pcd string(2048,PCD_IPI) +image/x-portable-anymap pnm +image/x-portable-bitmap pbm string(0,P1) string(0,P4) +image/x-portable-graymap pgm string(0,P2) string(0,P5) +image/x-portable-pixmap ppm string(0,P3) string(0,P6) +image/x-sgi-rgb rgb sgi bw icon short(0,474) +image/x-xbitmap xbm +image/x-xpixmap xpm ascii(0,1024) + string(3,"XPM") +image/x-xwindowdump xwd string(4,<00000007>) +image/x-sun-raster ras string(0,<59a66a95>) +image/fpx fpx +image/urf urf string(0,UNIRAST<00>) +image/x-alias pix short(8,8) short(8,24) +image/x-bitmap bmp string(0,BM) + !printable(2,14) +image/x-icon ico +# }}} + +# {{{ Text files... +application/x-cshell csh printable(0,1024) + string(0,#!) +\ + (contains(2,80,/csh) contains(2,80,/tcsh)) +application/x-perl pl printable(0,1024) + string(0,#!) +\ + contains(2,80,/perl) +application/x-shell sh printable(0,1024) + string(0,#!) +\ + (contains(2,80,/bash) contains(2,80,/ksh)\ + contains(2,80,/sh) contains(2,80,/zsh)) +application/x-csource c cxx cpp cc C h hpp \ + printable(0,1024) + ! css + \ + (string(0,/*) string(0,//) \ + string(0,#include) contains(0,1024,<0a>#include) \ + string(0,#define) contains(0,1024,<0a>#define)) +text/html html htm printable(0,1024) +\ + (istring(0,"<HTML>") istring(0,"<!DOCTYPE")) +text/plain txt printable(0,1024) +text/css css +# }}} + +application/octet-stream diff --git a/.w3m/config b/.w3m/config @@ -16,7 +16,7 @@ use_dictcommand 1 dictcommand file:///$LIB/w3mdict.cgi multicol 0 alt_entity 0 -graphic_char 0 +graphic_char 2 display_borders 0 fold_textarea 0 display_ins_del 1 @@ -42,9 +42,9 @@ image_color green form_color red mark_color cyan bg_color terminal -active_style 0 +active_style 1 active_color cyan -visited_anchor 0 +visited_anchor 1 visited_color magenta pagerline 10000 use_history 1 @@ -54,7 +54,7 @@ confirm_qq 1 close_tab_back 0 mark 0 emacs_like_lineedit 0 -vi_prec_num 0 +vi_prec_num 1 mark_all_pages 0 wrap_search 0 ignorecase_search 1 @@ -72,13 +72,13 @@ document_root personal_document_root cgi_bin index_file -mime_types ~/.mime.types, /usr/etc/mime.types +mime_types ~/.mime.types, /usr/share/cups/mime/mime.types mailcap ~/.mailcap urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap editor $EDITOR mailto_options 1 -mailer mutt -extbrowser /usr/bin/firefox +mailer ~/.local/bin/my mailto +extbrowser ~/.local/bin/my-open extbrowser2 extbrowser3 extbrowser4 @@ -102,7 +102,7 @@ accept_encoding gzip, compress, bzip, bzip2, deflate accept_media text/html, text/*;q=0.5, image/*, application/*, audio/*, video/* argv_is_url 1 retry_http 1 -default_url 1 +default_url 0 follow_redirection 10 meta_refresh 0 dns_order 0