dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 24b24229ee2b13f553668bc1716372c8f8732b2e
parent 5d59990a5f451c076c6c9c7c0d88c76a8fe6fa98
Author: Hayden Hamilton <haydenh@sdf.org>
Date:   Sat, 13 Jun 2020 21:50:08 +0100

nvim, mainly

Diffstat:
M.config/alias | 2+-
M.config/git/config | 2+-
M.config/irssi/config | 2+-
M.config/neomutt/neomuttrc | 5++---
A.config/nvim/ftdetect/zettel.vim | 4++++
M.config/nvim/init.vim | 3+++
M.config/nvim/modules/filetype.vim | 23++++++++++++++++++++---
M.config/nvim/modules/term.vim | 2++
M.config/nvim/syntax/gph.vim | 4+++-
A.config/nvim/syntax/markdown.vim | 142+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/nvim/syntax/zettel.vim | 19+++++++++++++++++++
M.config/picom/config | 2+-
M.config/vimb/config | 26++++++++++++++++++++++++--
M.config/vimb/scripts.js | 2+-
M.config/zsh/.zshrc | 2++
M.config/zsh/alias.zsh | 2+-
M.scripts/bin/display/wbcachemake | 24+++++++-----------------
A.scripts/bin/dns/hl-dns | 25+++++++++++++++++++++++++
M.scripts/bin/misc/alcl | 109++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
A.scripts/bin/misc/dupfind | 16++++++++++++++++
D.scripts/bin/misc/mkmailbox | 16----------------
D.scripts/bin/misc/mkmailpass | 40----------------------------------------
R.scripts/bin/misc/webimg -> .scripts/bin/misc/netimg | 0
R.scripts/bin/misc/webmkv -> .scripts/bin/misc/netvid | 0
A.scripts/bin/misc/pman | 9+++++++++
A.scripts/bin/misc/toxclip | 4++++
M.scripts/bin/misc/urlhand | 8++++----
M.scripts/custom/dock | 4++--
M.scripts/dwmblocks/dwmbar | 2+-
29 files changed, 395 insertions(+), 104 deletions(-)

diff --git a/.config/alias b/.config/alias @@ -34,7 +34,7 @@ tmux tmux -f ~/.config/tmux/config nw pkill newsboat; newsboat nm neomutt ; rm /tmp/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail maic sudo make all install clean -homesync rsync --port 222 --delete -azPe 'ssh -p 222' --exclude=general --exclude=.cache --exclude=.local/cache $HOME/ void@192.168.1.20:/home/void/homedir/ +homesync rsync --port 22 --delete -azPe 'ssh -p 222' --exclude=general --exclude=.cache --exclude=.local/cache $HOME/ void@192.168.1.20:/home/void/homedir/ tmux \tmux -f $HOME/.config/tmux/config notes vim ~/.local/notes fwknop fwknop --rc-file=$HOME/.config/fwknop/config --save-args-file=/dev/full diff --git a/.config/git/config b/.config/git/config @@ -1,7 +1,7 @@ # This is Git's per-user configuration file. [user] name = Hayden Hamilton - email = hayden@haydenvh.com + email = haydenh@sdf.org [blame] date = human diff --git a/.config/irssi/config b/.config/irssi/config @@ -242,7 +242,7 @@ settings = { core = { real_name = "haydenvh.com"; user_name = "haydenh"; - nick = "haydenh"; + nick = "allicce"; recode_transliterate = "no"; timestamp_format = "%H:%M:%S"; }; diff --git a/.config/neomutt/neomuttrc b/.config/neomutt/neomuttrc @@ -6,12 +6,11 @@ set mailcap_path = "~/.config/neomutt/mailcap" set smtp_authenticators = "plain" set folder = "~/general/mail/" -set spoolfile = "~/general/mail/inbox" +set spoolfile = "~/general/mail/inbox-airmail" set record = "~/general/mail/sent" set postponed = "~/general/mail/drafts" set trash = "~/general/mail/rubbish" -# mailboxes =inbox =sent =drafts =rubbish # These are probably what you want -mailboxes =inbox =sent =drafts =rubbish =spam ="===============" =exmouth =exmouthsent =exmouthrubbish# Configured by my mkmailbox script +mailboxes =inbox-airmail =sent =drafts =rubbish =spam-airmail ="===============" =exmouth =exmouthsent =exmouthrubbish set mbox_type = Maildir diff --git a/.config/nvim/ftdetect/zettel.vim b/.config/nvim/ftdetect/zettel.vim @@ -0,0 +1,4 @@ +au BufNewFile,BufRead *.zettel set filetype=zettel +au BufNewFile,BufRead *.zettel set syntax=zettel +au BufNewFile,BufRead *.zettel nnoremap <buffer> <localleader>z 0i!<esc>wcw[]<left> +au BufNewFile,BufRead *.zettel nnoremap <buffer> <localleader>Z :w<CR>:bd<CR>:call GphZettelFin()<CR> diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -95,6 +95,7 @@ noremap <leader>Ee :edit noremap <leader>yv :reg<CR> noremap <leader>8 :set colorcolumn=80<CR>:set tw=80<CR>:set fo+=t<CR> noremap <leader>Gi :!git +noremap <leader>P :w !nc haydenh.null 9999<CR> noremap <leader>nn :set number! relativenumber!<CR> noremap <leader><leader>nn :setlocal number! relativenumber!<CR> @@ -118,6 +119,8 @@ inoremap <leader><leader>' ''<Esc><Left>i inoremap <leader><leader>{ {}<Esc><Left>i inoremap <leader><leader>< <><Esc><Left>i +inoremap <c-;> <esc>: + "General stuff noremap dw diw noremap dew dw diff --git a/.config/nvim/modules/filetype.vim b/.config/nvim/modules/filetype.vim @@ -14,12 +14,29 @@ endfunction function Gphconfig() nnoremap <buffer> <localleader>c :call GphCitation()<CR> + nnoremap <buffer> <localleader>t :%s/\t/ /g<CR> + nnoremap <buffer> <localleader>l :call GphZettel("")<left><left> + inoremap <buffer> <localleader>l <esc>:call GphZettel("")<left><left> + nnoremap <buffer> <localleader>s :%s/\/home\/hayden\/net\//gopher:\/\/haydenh.null/g<CR> +endfunction + +function GphZettel(srch) + redir! >/tmp/vim.zettel | silent! echo 'When positioned over a line, use <localleader>z to select and name it' | silent! echo 'Use <localleader>Z to finish' | silent! silent! execute ':!alcl find "' . a:srch . '"' | redir END + vsplit /tmp/vim.zettel +endfunction + +function GphZettelFin() + mark ` + read !sed -n 's/[[:space:]]*\[/\t[/;s/][[:space:]]*/]\t/;/^\!/p' < /tmp/vim.zettel | awk -F'\t' '{print $2}' + normal G + read !sed -n 's/[[:space:]]*\[/\t[/;s/][[:space:]]*/]\t/;/^\!/p' < /tmp/vim.zettel | awk -F'\t' '{print "[<++|$2|$3|server|port]}' + normal ``kJA endfunction function GphCitation() redir! >/tmp/vim-cite | silent! %s/\[[0-9]*\]//gn | redir END let count=system("tail -n 1 < /tmp/vim-cite | awk '{print $1}'") - let void=system("echo '' > /tmp/vim-cite") + let void=system("printf '' > /tmp/vim-cite") let done=1 normal G while done <= count @@ -29,12 +46,12 @@ function GphCitation() read /tmp/vim-cite endfunction -augroup autocmd +augroup filetypes autocmd FileType,WinEnter,BufEnter netrw call Configurenetrw() autocmd FileType html :normal gg=G autocmd FileType html :setlocal nowrap autocmd FileType c :noremap <buffer> <localleader>e $a;<esc> autocmd FileType c :inoremap <buffer> <localleader><localleader>e <esc>$a;<esc> autocmd FileType sh :call Shconfig() - autocmd FileType *.gph :call Gphconfig() + autocmd FileType gph :call Gphconfig() augroup END diff --git a/.config/nvim/modules/term.vim b/.config/nvim/modules/term.vim @@ -39,6 +39,8 @@ function! Shwin() call nvim_open_win(nvim_create_buf(v:false, v:true), v:true, opts) endfunction +command! -nargs=0 Quickterm call Quickterm() + augroup terminal autocmd WinNew,BufNew,BufNewFile,BufEnter,WinEnter * call Termstart() autocmd WinLeave,BufLeave,BufWinLeave * call Termend() diff --git a/.config/nvim/syntax/gph.vim b/.config/nvim/syntax/gph.vim @@ -12,11 +12,13 @@ syn keyword gphSelf server port contained syn region gphSelector start=/^\[/ end=/\]$/ oneline contains=gphBrackl,gphBrackr,gphPipe,gphSelf +syn match gphTab ' ' + hi gphPunc guifg=#a1a1d9 hi link gphBrackl gphPunc hi link gphBrackr gphPunc hi link gphPipe gphPunc - hi gphSelf guifg=#005f5f +hi link gphTab errormsg let b:current_syntax='gph' diff --git a/.config/nvim/syntax/markdown.vim b/.config/nvim/syntax/markdown.vim @@ -0,0 +1,142 @@ +" Vim syntax file +" Language: Markdown +" Maintainer: Tim Pope <vimNOSPAM@tpope.org> +" Filenames: *.markdown +" Last Change: 2016 Aug 29 + +if exists("b:current_syntax") + finish +endif + +if !exists('main_syntax') + let main_syntax = 'markdown' +endif + +runtime! syntax/html.vim +unlet! b:current_syntax + +if !exists('g:markdown_fenced_languages') + let g:markdown_fenced_languages = [] +endif +for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")') + if s:type =~ '\.' + let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*') + endif + exe 'syn include @markdownHighlight'.substitute(s:type,'\.','','g').' syntax/'.matchstr(s:type,'[^.]*').'.vim' + unlet! b:current_syntax +endfor +unlet! s:type + +syn sync minlines=10 +syn case ignore + +syn match markdownValid '[<>]\c[a-z/$!]\@!' +syn match markdownValid '&\%(#\=\w*;\)\@!' + +syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar + +syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule +syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError + +syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink +syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink + +syn match markdownHeadingRule "^[=-]\+$" contained + +syn region markdownH1 matchgroup=markdownHeadingDelimiter start="##\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH2 matchgroup=markdownHeadingDelimiter start="###\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH3 matchgroup=markdownHeadingDelimiter start="####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH4 matchgroup=markdownHeadingDelimiter start="#####\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH5 matchgroup=markdownHeadingDelimiter start="######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained +syn region markdownH6 matchgroup=markdownHeadingDelimiter start="#######\@!" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained + +syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock + +syn region markdownCodeBlock start=" \|\t" end="$" contained + +" TODO: real nesting +syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained +syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained + +syn match markdownRule "\* *\* *\*[ *]*$" contained +syn match markdownRule "- *- *-[ -]*$" contained + +syn match markdownLineBreak " \{2,\}$" + +syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite +syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained +syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained +syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained +syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained +syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained + +syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart +syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained +syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained +syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline + +let s:concealends = has('conceal') ? ' concealends' : '' +exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\S\@<=\*\|\*\S\@=" end="\S\@<=\*\|\*\S\@=" keepend contains=markdownLineStart' . s:concealends +exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\S\@<=\*\*\|\*\*\S\@=" end="\S\@<=\*\*\|\*\*\S\@=" keepend contains=markdownLineStart,markdownItalic' . s:concealends +exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\S\@<=\*\*\*\|\*\*\*\S\@=" end="\S\@<=\*\*\*\|\*\*\*\S\@=" keepend contains=markdownLineStart' . s:concealends + +syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart +syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart +syn region markdownCode matchgroup=markdownCodeDelimiter start="^\s*```.*$" end="^\s*```\ze\s*$" keepend + +syn match markdownFootnote "\[^[^\]]\+\]" +syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:" + +if main_syntax ==# 'markdown' + for s:type in g:markdown_fenced_languages + exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*```\s*'.matchstr(s:type,'[^=]*').'\>.*$" end="^\s*```\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') + endfor + unlet! s:type +endif + +syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]" +syn match markdownError "\w\@<=\w\@=" + +hi def link markdownH1 htmlH1 +hi def link markdownH2 htmlH2 +hi def link markdownH3 htmlH3 +hi def link markdownH4 htmlH4 +hi def link markdownH5 htmlH5 +hi def link markdownH6 htmlH6 +hi def link markdownHeadingRule markdownRule +hi def link markdownHeadingDelimiter Delimiter +hi def link markdownOrderedListMarker markdownListMarker +hi def link markdownListMarker htmlTagName +hi def link markdownBlockquote Comment +hi def link markdownRule PreProc + +hi def link markdownFootnote Typedef +hi def link markdownFootnoteDefinition Typedef + +hi def link markdownLinkText htmlLink +hi def link markdownIdDeclaration Typedef +hi def link markdownId Type +hi def link markdownAutomaticLink markdownUrl +hi def link markdownUrl Float +hi def link markdownUrlTitle String +hi def link markdownIdDelimiter markdownLinkDelimiter +hi def link markdownUrlDelimiter htmlTag +hi def link markdownUrlTitleDelimiter Delimiter + +hi def link markdownItalic htmlItalic +hi def link markdownItalicDelimiter markdownItalic +hi def link markdownBold htmlBold +hi def link markdownBoldDelimiter markdownBold +hi def link markdownBoldItalic htmlBoldItalic +hi def link markdownBoldItalicDelimiter markdownBoldItalic +hi def link markdownCodeDelimiter Delimiter + +hi def link markdownEscape Special +hi def link markdownError Error + +let b:current_syntax = "markdown" +if main_syntax ==# 'markdown' + unlet main_syntax +endif + +" vim:set sw=2: diff --git a/.config/nvim/syntax/zettel.vim b/.config/nvim/syntax/zettel.vim @@ -0,0 +1,19 @@ +if exists("b:current_syntax") + finish +endif + +syn match zettelExc '^!' contained +syn match zettelBrackl '\[' contained +syn match zettelBrackr '\]' contained +syn match zettelBrackText '[^\[\]]' contained + +syn region zettelSelected start=/^!/ end=/$/ oneline contains=zettelExc,zettelBracks +syn region zettelBracks start=/\[/ end=/\]/ contained contains=zettelBrackl,zettelBrackr,zettelBrackText + +hi zettelPunc guifg=#a1a1d9 +hi link zettelExc zettelPunc +hi link zettelBrackl zettelPunc +hi link zettelBrackr zettelPunc +hi zettelBrackText guifg=#005f5f + +let b:current_syntax='gph' diff --git a/.config/picom/config b/.config/picom/config @@ -22,7 +22,7 @@ opacity-rule = [ "100:_NET_WM_STATE@[3]:32a *= '_NET_WM_STATE_FULLSCREEN'", "100:_NET_WM_STATE@[4]:32a *= '_NET_WM_STATE_FULLSCREEN'", "100:_NET_WM_STATE@[5]:32a *= '_NET_WM_STATE_FULLSCREEN'", - "100:class_g ?= 'slop'", + "0:class_g ?= 'slop'", "87:class_g ?= 'urxvt' && !focused", "84:class_g ?= 'urxvt' && focused", "87:class_g ?= 'st-256color' && !focused", diff --git a/.config/vimb/config b/.config/vimb/config @@ -1,5 +1,5 @@ set download-path=~/general/downloads/ -set editor-command="urxvt -e vim %s" +set editor-command="st -e nvim %s" set history-max-items=99999 set input-autohide=false @@ -22,8 +22,29 @@ nmap B :sh! mpv "$(xclip -o)"<CR> nnoremap h <C-o> nnoremap l <C-i> +nnoremap gt :sh! xdotool key --window $VIMB_XID alt+shift+l<CR><Esc> +nnoremap gT :sh! xdotool key --window $VIMB_XID alt+shift+h<CR><Esc> +nnoremap 1gt :sh! xdotool key --window $VIMB_XID alt+1<CR><Esc> +nnoremap 2gt :sh! xdotool key --window $VIMB_XID alt+2<CR><Esc> +nnoremap 3gt :sh! xdotool key --window $VIMB_XID alt+3<CR><Esc> +nnoremap 4gt :sh! xdotool key --window $VIMB_XID alt+4<CR><Esc> +nnoremap 5gt :sh! xdotool key --window $VIMB_XID alt+5<CR><Esc> +nnoremap 6gt :sh! xdotool key --window $VIMB_XID alt+6<CR><Esc> +nnoremap 7gt :sh! xdotool key --window $VIMB_XID alt+7<CR><Esc> +nnoremap 8gt :sh! xdotool key --window $VIMB_XID alt+8<CR><Esc> +nnoremap 9gt :sh! xdotool key --window $VIMB_XID alt+9<CR><Esc> +nnoremap 0gt :sh! xdotool key --window $VIMB_XID alt+0<CR><Esc> + +set default-font=DejaVu Sans Mono +set monospace-font=DejaVu Sans Mono +set sans-serif-font=DejaVu Sans Mono +set serif-font=DejaVu Sans Mono +set default-zoom=75 + +shortcut-default sch + shortcut-add sx=https://searx.me/ -shortcut-add sch=https://searx.ninja/?q=$0 +shortcut-add sch=https://searx.lukesmith.xyz/?q=$0 shortcut-add bit=https://bitchute.com/search?q=$0 shortcut-add yt=https://youtube.com/results?search_query=$0 shortcut-add hh=http://www.haydenvh.com/h/ @@ -40,3 +61,4 @@ shortcut-add map=https://map.openaerialmap.org/#/ shortcut-add ebay=https://www.ebay.co.uk/sch/$0 shortcut-add am=https://www.amazon.co.uk/s?k=$0 shortcut-add 8=https://8kun.top/$0/catalog.html +shortcut-add dict=https://dict.css/?s=$0 diff --git a/.config/vimb/scripts.js b/.config/vimb/scripts.js @@ -17,7 +17,7 @@ var element = document.getElementsByTagName("tr"); element.outerHTML = element.outerHTML; addGlobalStyle("*{color:#1e5eb3 !important;}#js-tab-pipeline *{background-color:#0a0a10 !important}form *{background-color:#0a0a10 !important;}h1,h2,h3,h4,h5,h6{color:inherit !important;}.avatar-container *{ background-color:#141726 !important;}.top-bar{ background:#111111 !important;}aside{ background-color:#111111 !important;}.js-jobs-container{ background-color:#111111 !important;}.build-job *{ background-color:#222222 !important; border:0 !important;}body.ui-indigo .navbar-gitlab .navbar-sub-nav > li.active > button{ background-color:rgba(10,10,10,0.5) !important;}.content-block, .content-block *, .content-block * *{ background-color:#141726 !important;}.dropdown{ background-color:rgba(0,0,0,0) !important;}.file-holder *{ background-color:#141726 !important;}.banner-callout{ display:none !important;}.bg-light{ background-color:#141726 !important; border:none !important;}*{ color:#1e5eb3 !important; border-radius:0 !important;}.avatar-tile{ background-color:#141726 !important;}.avatar-container{ background-color:rgba(0,0,0,0) !important;}textarea{ border:0 !important; background-color:rgba(50,50,50,0.5) !important;}.input-group-prepend,.input-group-prepend div{ border:0 !important; background-color:rgba(25,25,25,0.5) !important;}gspan{color:#aaaaaa !important}.commit-sha-group div{ background-color:#141726 !important; border:0 !important; color:#ffffff !important;}.ci-status-link{ display:none !important;}.card, .card div{ background-color:#141726 !important;}.card{ border:0 !important;}.row-content-block{ background-color:#141726; border:0 !important;}.commit-header{ background-color:#141726 !important; border:0 !important;}body{font-family:monospace !important}.toggle-sidebar-button{ background-color:#141726; border:0 !important;}.dropdown-menu{ background-color:#141726;}input{ background:rgba(50,50,50,0.5) !important;}.cover-block{ background-color:#141726; color:#ffffff !important; padding-bottom:5vh !important;}.cover-block p,.cover-block .cover-title{ color:#ffffff !important;}.profile-link-holder{ color:#ffffff !important;}.cover-block .scrolling-tabs-container .nav-links{ border-bottom:0; position:relative; top:5vh;}.cover-block .scrolling-tabs-container .nav-links li{ border-top:#ffffff 1px solid !important;}.user-caller{display:none !important;}.avatar-container{border:0 !important;border-radius:0 !important;}article{border:0 !important;}article div{background-color:#141726 !important; border:0 !important; color:#ffffff !important;}article p{ color:#ffffff !important;}code{ background-color:rgba(15,15,15,0.5)}body{ background-color:#0a0a10; color:#1e5eb3 !important;}#content-body input,#content-body button,#content-body.dropdown,#content-body a{ border:none; background-color:rgba(0,0,0,0) !important; color:#1e5eb3 !important;font-weight:bold !important;}header{ background-color:#141726 !important;}.nav-sidebar{ background-color:#141726 !important;}.fly-out-list{ background-color:#141726 !important; border:0; border:#393982 1px solid !important; color:#ffffff !important;}a{ color:#ffffff !important;}.info-well{ background-color:rgba(0,0,0,0); border:0;}.bs-callout{ display:none !important;}.count-badge-count{ display:none !important;}table{ border:0 !important; background-color:rgba(0,0,0,0) !important; color:#ffffff !important;}.table-holder{ border:0 !important;}thead th{ background-color:#141726 !important; border:0 !important;}tr{ border-bottom-color:#141726 !important;}tr:hover{ border-bottom-color:#141726 !important; display:}"); } -if (hostname == "occusearch.de.win" || hostname == "searx.me") {addGlobalStyle("*{color:#1e5eb3 !important;border-color:#1e5e3 !important;}#categories label{ background-color:#141726; border:none !important; padding:1vw; cursor:pointer; border-bottom:#5555 5px solid !important;}.result{ background-color:rgba(0,0,0,0) !important;}.highlight{ background-color:#aaa !important;}.alert{ background-color:rgba(10,10,10,0.5) !important;}.panel div{ background-color:#0a0a10 !important; color:#1e5eb3 !important;}.panel img{ border:7.5px solid #141726}.searx-navbar{ background-color:#141726;}body{ background-color:#0a0a10; font-family:monospace !important;}input,button{ background-color:rgba(0,0,0,0) !important;}.footer{ display:none;}");} +if (hostname == "searx.lukesmith.xyz" || hostname == "searx.me") {addGlobalStyle("*{color:#1e5eb3 !important;border-color:#1e5e3 !important;}#categories label{ background-color:#141726; border:none !important; padding:1vw; cursor:pointer; border-bottom:#5555 5px solid !important;}.result{ background-color:rgba(0,0,0,0) !important;}.highlight{ background-color:#aaa !important;}.alert{ background-color:rgba(10,10,10,0.5) !important;}.panel div{ background-color:#0a0a10 !important; color:#1e5eb3 !important;}.panel img{ border:7.5px solid #141726}.searx-navbar{ background-color:#141726;}body{ background-color:#0a0a10; font-family:monospace !important;}input,button{ background-color:rgba(0,0,0,0) !important;}.footer{ display:none;}");} if (hostname == "neinchan.com") { addGlobalStyle(".greenText{color:#3ab475 !important;}a{color:#3ab475 !important;font-weight:bold !important;font-decoration:underline !important;}*{color:#1e5eb3 !important;}fieldset{ border:0 !important;}fieldset legend{ display:none !important;}.small{ display:none !important;g}*{border-radius:0 !important; background-color:#070911 !important;font-family:monospace !important;}nav{ padding-top:2vh !important; border-bottom:#aaaaaa 1px solid !important;}nav *,nav{ background-color:#141726 !important; color:#1e5eb3 !important;}hr{ border:0 !important; border-bottom:#aaaaaa 1px solid !important;}.postCell .innerPost{ border:#aaaaaa 1px solid !important;}.deletionCheckBox{ display:none !important;}th{ border:#aaaaaa 0.5px solid !important; padding-left:1vw !important; padding-right:1vw !important;}table input,table textarea,table .dropzone,button{ border:#aaaaaa 0.5px solid !important; padding:0.5vw !important; max-width:285px !important;}") document.getElementsByTagName("table")[0].setAttribute("cellspacing","0") diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc @@ -93,5 +93,7 @@ ZSH_HIGHLIGHT_STYLES[path]='fg=7' . /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +alias hi="printf ' 0/\n /|\n / \\ \n' | tee /dev/stderr | xclip" + # boot into X [ "$(tty)" = "/dev/tty1" ] && startx diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh @@ -47,7 +47,7 @@ alias tmux=" tmux -f ~/.config/tmux/config" alias nw=" pkill newsboat; newsboat" alias nm=" neomutt ; rm /tmp/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail" alias maic=" sudo make all install clean" -alias homesync=" rsync --port 222 --delete -azPe 'ssh -p 222' --exclude=general --exclude=.cache --exclude=.local/cache $HOME/ void@192.168.1.20:/home/void/homedir/" +alias homesync=" rsync --port 22 --delete -azPe 'ssh -p 222' --exclude=general --exclude=.cache --exclude=.local/cache $HOME/ void@192.168.1.20:/home/void/homedir/" alias tmux=" \tmux -f $HOME/.config/tmux/config" alias notes=" vim ~/.local/notes" alias fwknop=" fwknop --rc-file=$HOME/.config/fwknop/config --save-args-file=/dev/full" diff --git a/.scripts/bin/display/wbcachemake b/.scripts/bin/display/wbcachemake @@ -19,24 +19,14 @@ donorm(){ } mkdir -p $cache/wallblur -rm $cache/wallblur/* files=$(find images/wallpapers/ -type f -name "*.png") -half=$(echo "$files" | wc -l) -half=$(($half/2)) -top=$(echo "$files" | head -n $half) -bot=$(echo "$files" | tail -n $half) -for file in $top +for file in $files do - echo $file start - donorm "$cache/wallblur/$(basename $file)" - echo $file done -done & - -for file in $bot -do - echo $file start - donorm "$cache/wallblur/$(basename $file)" - echo $file done -done & + [ ! -f $cache/wallblur/$(basename "$file") ] && { + echo $file start + donorm "$cache/wallblur/$(basename $file)" + echo $file done + } +done diff --git a/.scripts/bin/dns/hl-dns b/.scripts/bin/dns/hl-dns @@ -0,0 +1,25 @@ +#!/bin/sh + +path="/tmp" # change this depending on the base of your gopher server +cd $path + +mkdir -p sources +touch dns.custom +sources="gnu.matrix 45.32.178.12" # each host is seperated by a space char, priority from left to right + +for s in $sources +do + curl gopher://$s/1/dns > sources/$s + touch sources/$s +done + +for s in $sources +do + sf="$sf sources/$s" +done + +cat $(echo "$sf" | sed 's/^ //g') dns.custom | sort | uniq > dns +[ ! -f /etc/hosts.old ] && cp /etc/hosts /etc/hosts.old +cat /etc/hosts.old dns > /etc/hosts + +rm -rf sources diff --git a/.scripts/bin/misc/alcl b/.scripts/bin/misc/alcl @@ -1,10 +1,39 @@ #!/bin/sh +# +# alcl +# Created by Hayden Hamilton +# +# haydenvh.com +# Copyright (c) 2020 Hayden Hamilton +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# This work is free. You can redistribute it and/or modify it under the +# terms of the Do What The Fuck You Want To Public License, Version 2, +# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. GOPHERDIR="/alcl/write" PHLOG="$HOME/net/$GOPHERDIR" RSSBNB="$HOME/net/phlog.rssbnb" HOSTNAME="haydenh.null" +HEAD=" ________ __ ________ __ + _____/ | / / / ____ / / / + ____/ / | / / / / '-' / / + ___/ _ | / / / / / / + __/ / | | / /_____ / /___.-. / /_____ + _/_/ |_| /_______/ /_______/ /_______/ + +================================================================================" + +FOOT="================================================================================" + sanitise(){ sed 's/\\:/\&#58;/g;s/\\,/\&#44;/g;s/:/\&#58;/g;s/,/\&#44;/g' < /dev/stdin } @@ -21,22 +50,30 @@ _list(){ } _new(){ - [ -d "$PHLOG/$1" ] && { + [ ! -z "$1" ] && { dir="$PHLOG/$1" gopherdir="$GOPHERDIR/$1" } || { - dir="$PHLOG" - gopherdir="$GOPHERDIR" + echo "$(find $PHLOG/ -type d | sed "s~$PHLOG/~~" | tr '\n' ' ')" + printf 'Dir? ' + read _dir < /dev/tty + [ ! -z $_dir ] && { + dir="$PHLOG/$_dir" + gopherdir="$GOPHERDIR/$_dir" + } || { + dir="$PHLOG" + gopherdir="$GOPHERDIR" + } } printf "Entry title? " && read name < /dev/tty - filename=$(echo "$name" | tr '[[:space:]]' '.' | tr '[:upper:]' '[:lower:]' | tr -dc '[A-Za-z0-9-.+=%#!]') + filename=$(echo "$name" | tr '[[:space:]]' '.' | tr '[:upper:]' '[:lower:]' | tr -dc '[A-Za-z0-9-.+=%#!]' | sed 's/\.\./\./g') printf "gph or txt? " && read filetype < /dev/tty [ -f $dir/$filename$filetype ] && echo "Entry already exists... quitting" && exit 1 case "$filetype" in gph) gophertype="1";; *) gophetype="0";; esac - echo "#$name" > $dir/$filename$filetype + printf "$HEAD\n\n#$name\n\n<++>\n\n$FOOT\n\n" > $dir/$filename$filetype $EDITOR $dir/$filename$filetype [ ! -f $RSSBNB ] && { printf "No RSSBNB file... creating.\nPhlog title? " @@ -48,18 +85,72 @@ _new(){ echo ":main,$(echo "$title" | sanitise),$(echo "$link" | sanitise),$(sed '/^\!/d' < /tmp/desc.alcl | sanitise):" } - printf "! Entry description?\n! All lines starting with '!' are ignored\n" > /tmp/desc.alcl + printf "! Entry description?\n! All lines starting with '!' are ignored\n! Add a single line containing a single char, 'X' to cancel your entry.\n" > /tmp/desc.alcl + $EDITOR /tmp/desc.alcl + sed '/^!/d;/^$/d' < /tmp/desc.alcl | head -n 1 | grep '^X$' >/dev/null && { + printf "Cancelling...\nDraft entry moved to $HOME/$filename$filetype, use \`alcl import\` later.\n" + printf "!! FILE: $dir/$filename$filetype\n!! DRAFT PHLOG ENTRY\n" | cat /dev/stdin $dir/$filename$filetype > $HOME/$filename$filetype + exit 2 + } + echo ":sub,$(echo "$name" | sanitise),gopher\://$(echo "$HOSTNAME" | sanitise)/$gophertype$(echo "$gopherdir" | sanitise)/$filename$filetype,$(sanitise < /tmp/desc.alcl | sed '/^\!/d'):" >> $RSSBNB +} + +_import(){ + # check validity + [ $(head -n 2 < "$1" | grep '^!!' | wc -l) -ne 2 ] && echo "Invalid draft file... exiting" && exit 1 + + file=$(head -n 1 < "$1") + file=${file##*FILE: } + + tail -n +3 < "$1" > $file + + $EDITOR $file + [ ! -f $RSSBNB ] && { + printf "No RSSBNB file... creating.\nPhlog title? " + read title < /dev/tty + printf "Phlog link? " + read link < /dev/tty + printf "! Phlog description?\n! All lines starting with '!' are ignored\n" > /tmp/desc.alcl + $EDITOR /tmp/desc.alcl + echo ":main,$(echo "$title" | sanitise),$(echo "$link" | sanitise),$(sed '/^\!/d' < /tmp/desc.alcl | sanitise):" + } + + printf "! Entry description?\n! All lines starting with '!' are ignored\n! Add a single line containing a single char, 'X' to cancel your entry.\n" > /tmp/desc.alcl $EDITOR /tmp/desc.alcl - echo ":sub,$(echo "$name" | sanitise),gopher\://$(echo "$HOSTNAME" | sanitise)/$gophertype$(echo "$gopherdir" | sanitise)/$filename$filetype,$(sanitise < /tmp/desc.alcl | sed '/^\!/d'):" >> $PHLOG + sed '/^!/d;/^$/d' | head -n 1 | grep '^X$' >/dev/null && { + printf "Cancelling...\nDraft entry moved to $HOME/${file##*/}, use \`alcl import\` later.\n" + printf "!! FILE: $file\n!! DRAFT PHLOG ENTRY\n" | cat /dev/stdin $file > $HOME/${file##*/} + exit 2 + } + [ "${file##*.}" = "gph" ] && gophertype=1 || gophertype=0 + echo ":sub,$(grep '^#' < $file | head -n 1 | sanitise),gopher\://$(echo "$HOSTNAME" | sanitise)/$gophertype$(echo "$GOPHERDIR" | sanitise)/${file##$PHLOG}$,$(sanitise < /tmp/desc.alcl | sed '/^\!/d'):" >> $RSSBNB +} + +_find(){ + [ "$1" = "" ] && echo "No query" && exit + + files=$(find $PHLOG/ -type f -name "*.gph" -o -name "*.txt" -not -name "links.gph") + + # titles take priority + titles=$(grep "^#[^#].*$1.*" $files | awk -F: '{print $1;print $1;print $1;print $1;print $1}') + + # rest is secondary + contents=$(grep "$1" $files | awk -F: '{print $1}') + + printf "$title\n$contents\n" | uniq -c | tail -n +2 | sort -r } + case "$1" in ls) _list "$2" ;; new) _new "$2" ;; + import) _import "$2" ;; + find) _find "$2" ;; *) echo 'usage: alcl <subcommand> SUBCOMMANDS: ls [dir] - new [dir]' ;; + new [dir] + import /path/to/draft + search "query"' ;; esac - diff --git a/.scripts/bin/misc/dupfind b/.scripts/bin/misc/dupfind @@ -0,0 +1,16 @@ +#!/bin/sh + +IFS=' +' +for f in $(find $@ -type f) +do + sha512sum "$f" +done | sort | awk ' + // { + if (lastsum == $1) { + print last + print $0 + } + lastsum=$1 + last=$0 + }' | awk '!visited[$0]++' diff --git a/.scripts/bin/misc/mkmailbox b/.scripts/bin/misc/mkmailbox @@ -1,16 +0,0 @@ -#!/bin/sh - -mailboxes="$(printf "=inbox =sent =drafts =rubbish =\"===============\" -$(find ~/general/mail -type d | sed "s~$HOME/~~g;/\/.*\/.*\//d;/mail\/main/d;s~general/mail/~~g;s~^~=~g;s/===============$//g;s/=inbox$//g;s/=sent$//g;s/=drafts$//g;s/=rubbish//g" | tail -n +2)" | tr '\n' ' ' | tr -s ' ' | sed 's/ =$//g')" - -for var in "inbox" "sent" "drafts" "rubbish" "===============" -do - [ ! -d ~/general/mail/$var ] && { - mkdir -p ~/general/mail/$var/cur \ - ~/general/mail/$var/tmp \ - ~/general/mail/$var/new - } -done - -out=$(sed 's~^mailboxes.*$~mailboxes '"$mailboxes"'# Configured by my mkmailbox script~g' < $HOME/.config/neomutt/neomuttrc) -echo "$out" > $HOME/.config/neomutt/neomuttrc diff --git a/.scripts/bin/misc/mkmailpass b/.scripts/bin/misc/mkmailpass @@ -1,40 +0,0 @@ -#!/bin/sh - -file="$HOME/general/security/mailinfo" -[ "$1" != "" ] && file="$1" - -. $file - -printf "set folder = \"~/mail/\" -set smtp_url = \"$SMTP_ADDRESS\" -set from = \"$MAIL_ADDRESS\" -set realname = \"$REAL_NAME\" -" > ~/.config/neomutt/user - -printf "set imap_pass = \"$IMAP_PASS\" -set smtp_pass = \"$SMTP_PASS\" -" > ~/.config/neomutt/pass - -printf "IMAPAccount main -Host $IMAP_HOST -User $IMAP_USER -Pass $IMAP_PASS -SSLType IMAPS -CertificateFile /etc/ssl/certs/ca-certificates.crt - -IMAPStore main-remote -Account main - -MaildirStore main-local -Subfolders Verbatim -Path ~/mail/main/ -Inbox ~/mail/inbox - -Channel main -Master :main-remote: -Slave :main-local: -Expunge Both -Patterns * -Create Both -SyncState * -" > ~/.config/neomutt/mbsync diff --git a/.scripts/bin/misc/webimg b/.scripts/bin/misc/netimg diff --git a/.scripts/bin/misc/webmkv b/.scripts/bin/misc/netvid diff --git a/.scripts/bin/misc/pman b/.scripts/bin/misc/pman @@ -0,0 +1,9 @@ +#!/bin/sh + +mandir="/usr/share/man" + +section=$(man -k "$1" 2>/dev/null | tr '()' '+' | grep "^$1[,+]" | awk -F, '{print $NF}' | grep -o '+[0-9]*p*+' | tr -d '+') + +[ "$section" = "" ] && echo "No such man page" && exit + +[ -f $mandir/man${section}p/$1.${section}p ] && man ${section}p $1 || man ${section} $1 diff --git a/.scripts/bin/misc/toxclip b/.scripts/bin/misc/toxclip @@ -0,0 +1,4 @@ +#!/bin/sh +# put arg into xclip + +echo "$1" | xclip diff --git a/.scripts/bin/misc/urlhand b/.scripts/bin/misc/urlhand @@ -1,6 +1,6 @@ #!/bin/bash -link=$(grep -Eo 'https://.*|http://.*|gopher://.*' < /dev/stdin 2>/dev/null | awk '{print $1}' | dmenu -i -p 'Select url') +link=$(grep -Eo '[A-Za-z][A-Za-z]*://\S*' < /dev/stdin 2>/dev/null | awk '{print $1}' | dmenu -i -p 'Select url') IFS=$'\n' @@ -9,9 +9,9 @@ popupmpv youtube-dl --add-metadata -ic youtube-dl --add-metadata -xic vimb --no-maximize -xclip -webimg -webkmv +toxclip +netimg +netvid popupcurl popupcgo" | dmenu -i -p "Select a handler:") diff --git a/.scripts/custom/dock b/.scripts/custom/dock @@ -5,5 +5,5 @@ do ds="$ds --output $d --off" done -xrandr $ds --output LVDS1 --mode 1920x1080 --primary --pos 0x0 -xrandr --output HDMI2 --mode 1920x1080 --pos 1920x0 --rotate left +xrandr $ds --output LVDS1 --mode 1280x800 --primary --pos 0x0 +xrandr --output HDMI2 --mode 1920x1080 --pos 1920x0 diff --git a/.scripts/dwmblocks/dwmbar b/.scripts/dwmblocks/dwmbar @@ -44,5 +44,5 @@ do do grep '[[:alnum:]]' < $f >/dev/null && cp $f /tmp/dwmblocks done - xsetroot -name "$(for void in $(seq 150); do printf " "; done) $(cat * | sed '/^#/d;/^$/d' | sed '1~2s/^/\^c#ffaaaa\^/;2~2s/^/\^c#aaaaff\^/;s~\[~ ^b#1a3136^ ~g;s~\]~ ^d^~g' | tr '\n' ' ') " + xsetroot -name "$(for void in $(seq 150); do printf " "; done) $(cat mpv bat cpu mem disk disk2 news mail rem time vol time2 host | sed '/^#/d;/^$/d' | sed '1~2s/^/\^c#ffaaaa\^/;2~2s/^/\^c#aaaaff\^/;s~\[~ ^b#1a3136^ ~g;s~\]~ ^d^~g' | tr '\n' ' ') " done &