commit bd9c6a66ea688959061a9038918d119f6db888f3 Author: Marrub Date: Sat Apr 27 09:33:34 2019 -0400 initial set of scripts and configs diff --git a/bookmark_get.ps1 b/bookmark_get.ps1 new file mode 100755 index 0000000..ebfdf45 --- /dev/null +++ b/bookmark_get.ps1 @@ -0,0 +1,74 @@ +param([Parameter(Mandatory=$true)][string] $fname) + +function make-ouf($ofn, $ofe) +{ + new-object IO.FileInfo("output/$ofn.$ofe") +} + +function log($text) +{ + out-file -append log.txt -inputobject "$text`n" -encoding ascii -nonewline + echo "*** $text" +} + +if(!(test-path output)) { + mkdir output +} + +$uagent = "Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0" +$progressPreference = "silentlyContinue" +$sums = @() +$numerrors = 0 +$duplicates = 0 +$newfiles = 0 + +if(test-path "hashes.txt") { + $sums = (get-content "hashes.txt") -split '\n' +} else { + log "WARNING: No hashes file. Duplicates will not be removed." +} + +log "Started download at $(date)" + +foreach($line in [IO.File]::ReadLines((resolve-path $fname))) { + $inf = $line.split('/')[-1].split(':')[0].split('.') + $ofn = $inf[0 .. ($inf.length - 2)] -join '.' + $ofe = $inf[-1] + $ouf = (make-ouf $ofn $ofe) + + while($ouf.exists) { + $ofn += '_' + $ouf = (make-ouf $ofn $ofe) + } + + echo ">>\ $line" + echo " | $ouf" + + try { + $uri = [Uri]$line + $r = invoke-webrequest -useragent $uagent -header @{"Referer" = ('http://' + $uri.host) } -uri $line -sessionvariable ofp -erroraction stop -timeout 60 -outfile $ouf + $sum = ((xxhsum $ouf) -split " ")[0] + if($sums.contains($sum)) { + rm $ouf + $duplicates += 1 + echo " / duplicate $sum" + } else { + $sums += $sum + $newfiles += 1 + echo "< "Revision.h" + cmake -D MUPENPLUSAPI=On CMakeLists.txt + make + + cd "$srcdir/mupen64plus-video-arachnoid/projects/unix" + make all PIC=1 + + cd "$srcdir/angrylion-rdp-plus" + cmake CMakeLists.txt + make + + cd "$srcdir/mupen64plus-rsp-cxd4/projects/unix" + make all PIC=1 + + cd "$srcdir/mupen64plus-rsp-z64/projects/unix" + make all SSE=SSE3 PIC=1 +} + +package() { + cd "$srcdir/GLideN64-Public_Release_4_0/src/plugin/Release" + install -Dm644 "mupen64plus-video-GLideN64.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-video-GLideN64.so" + + cd "$srcdir/mupen64plus-video-arachnoid/projects/unix" + install -Dm644 "mupen64plus-video-arachnoid.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-video-arachnoid.so" + + cd "$srcdir/angrylion-rdp-plus" + install -Dm644 "mupen64plus-video-angrylion-plus.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-video-angrylion-plus.so" + + cd "$srcdir/mupen64plus-rsp-cxd4/projects/unix" + install -Dm644 "mupen64plus-rsp-cxd4-sse2.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-rsp-cxd4-sse2.so" + + cd "$srcdir/mupen64plus-rsp-z64/projects/unix" + install -Dm644 "mupen64plus-rsp-z64.so" "$pkgdir/usr/lib/mupen64plus/mupen64plus-rsp-z64.so" +} diff --git a/megadl.sh b/megadl.sh new file mode 100755 index 0000000..6c6eeea --- /dev/null +++ b/megadl.sh @@ -0,0 +1 @@ +megadl $(cat ~/dl) diff --git a/path.sh b/path.sh new file mode 100644 index 0000000..aa0731b --- /dev/null +++ b/path.sh @@ -0,0 +1,2 @@ +export PATH=$HOME/.local/bin:$PATH +export DOOMWADDIR=/mnt/d/Stuff/GamesPC/IWads diff --git a/porple.sss b/porple.sss new file mode 100644 index 0000000..63c57cc --- /dev/null +++ b/porple.sss @@ -0,0 +1,101 @@ +styleset { + name = "porple"; + + default { + font = "Px437 IBM VGA8"; + size = 12; + foreground = 216, 216, 216; + background = 41, 44, 54; + bold = 0; + italic = 0; + underlined = 0; + } + + selection { + background = 71, 65, 96; + } + + preprocessor { + foreground = 239, 161, 107; + } + + comment { + foreground = 101, 86, 138; + } + + comment_doc { + foreground = 100, 135, 143; + } + + string { + foreground = 149, 199, 111; + } + + character { + foreground = 248, 69, 71; + } + + keyword { + foreground = 183, 73, 137; + } + + constant { + foreground = 210, 142, 93; + } + + type { + foreground = 239, 161, 107; + } + + property { + foreground = 248, 69, 71; + } + + function { + foreground = 132, 133, 206; + } + + number { + foreground = 210, 142, 93; + } + + operator { + } + + bracematch { + bold = 1; + } + + bracebad { + foreground = 41, 44, 54; + background = 248, 69, 71; + bold = 1; + } + + linenum { + foreground = 101, 86, 138; + background = 51, 51, 68; + } + + calltip { + } + + calltip_hl { + } + + foldmargin { + foreground = 101, 86, 138; + background = 51, 51, 68; + } + + guides { + } + + wordmatch { + } + + current_line { + background = 51, 51, 68; + } + +} diff --git a/progm.xkb b/progm.xkb new file mode 100644 index 0000000..6842944 --- /dev/null +++ b/progm.xkb @@ -0,0 +1,55 @@ +partial +xkb_symbols "us-intl" { + name[Group1] = "English (US, Programmer, intl., with dead keys)"; + include "us(intl)" + key { [ comma, less ] }; // , < + key { [ period, greater ] }; // . > + key { [ slash, question ] }; // / ? + key { [ semicolon, plus ] }; // ; + + key { [ at, quoteleft ] }; // @ ` + key { [ bracketleft, braceleft ] }; // [ { + key { [bracketright, braceright ] }; // ] } + key { [ 1, exclam ] }; // 1 ! + key { [ 2, quotedbl ] }; // 2 " + key { [ 3, numbersign ] }; // 3 # + key { [ 4, dollar ] }; // 4 $ + key { [ 5, percent ] }; // 5 % + key { [ 6, ampersand ] }; // 6 & + key { [ 7, quoteright ] }; // 7 ' + key { [ 8, parenleft ] }; // 8 ( + key { [ 9, parenright ] }; // 9 ) + key { [ 0, minus ] }; // 0 - + key { [ colon, asterisk ] }; // : * + key { [ underbar, equal ] }; // _ = + key { [ backslash, bar ] }; // \ | + key { [ asciicircum, asciitilde ] }; // ^ ~ +}; + +partial +xkb_symbols "us-workman-intl" { + name[Group1] = "English (Workman, Programmer, intl., with dead keys)"; + include "us(workman-intl)" + key { [ comma, less ] }; // , < + key { [ period, greater ] }; // . > + key { [ slash, question ] }; // / ? + key { [ semicolon, plus ] }; // ; + + key { [ at, quoteleft ] }; // @ ` + key { [ bracketleft, braceleft ] }; // [ { + key { [bracketright, braceright ] }; // ] } + key { [ 1, exclam ] }; // 1 ! + key { [ 2, quotedbl ] }; // 2 " + key { [ 3, numbersign ] }; // 3 # + key { [ 4, dollar ] }; // 4 $ + key { [ 5, percent ] }; // 5 % + key { [ 6, ampersand ] }; // 6 & + key { [ 7, quoteright ] }; // 7 ' + key { [ 8, parenleft ] }; // 8 ( + key { [ 9, parenright ] }; // 9 ) + key { [ 0, minus ] }; // 0 - + key { [ colon, asterisk ] }; // : * + key { [ underbar, equal ] }; // _ = + key { [ backslash, bar ] }; // \ | + key { [ asciicircum, asciitilde ] }; // ^ ~ + key { [ Caps_Lock ] }; +}; + diff --git a/sharenix.cw.sh b/sharenix.cw.sh new file mode 100755 index 0000000..3a3c925 --- /dev/null +++ b/sharenix.cw.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env zsh + +export spectacleargs=-a + +. $HOME/bin/_scripts/sharenix.sh diff --git a/sharenix.fs.sh b/sharenix.fs.sh new file mode 100755 index 0000000..96d1999 --- /dev/null +++ b/sharenix.fs.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env zsh + +export spectacleargs=-f + +. $HOME/bin/_scripts/sharenix.sh diff --git a/sharenix.sel.sh b/sharenix.sel.sh new file mode 100755 index 0000000..ada0e9c --- /dev/null +++ b/sharenix.sel.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env zsh + +export spectacleargs=-r + +. $HOME/bin/_scripts/sharenix.sh diff --git a/sharenix.sh b/sharenix.sh new file mode 100755 index 0000000..e36249c --- /dev/null +++ b/sharenix.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env zsh + +f=$HOME/Pictures/$(date "+%y%m%d-%H%M%S").png + +spectacle -b $spectacleargs -n -o $f + +if [ -f $f ] +then + sharenix -n -s Greyserv $f +fi + +rm $f diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..f8447e2 --- /dev/null +++ b/vimrc @@ -0,0 +1,404 @@ +" Settings -------------------------------------------------------------------| + +se lbr +se sbr= +se sm +se ve=onemore +se ttm=0 +se hls +se scs +se ic +se is +se ai +se et +se sta +se sw=3 +se sts=-1 +se cf +se ru +se wmnu +se acd +se lz +se cole=1 +se ul=1000 +se ls=2 +se tpm=1000 +se enc=utf-8 +se fencs=ucs_bom,utf_8,sjis +se bs=indent,eol,start +se vi='100,/50,<50,s10,h,% +se stl=[%{&syn}]\ %f +se stl+=%r +se stl+=%m +"se stl+=\ %{tagbar#currenttag('←\ %s\ ','','f')} +se stl+=\ %= +se stl+=\ %{MabFileSize()} +se stl+=\ %4l:%-3c +se stl+=\ %4L +se stl+=\ %3p%% +se bo=all +se cc=81 +se nuw=4 +se hid +se ffs=unix,dos,mac +se nojs +se ut=500 +se fo=tcrqnolj +se com=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// +se rnu +se nu + +if has('gui_running') + se gcr+=i:hor10-Cursor + se gcr+=a:blinkon0 + se go=agit + se lines=50 + se co=90 + se cul +el + se t_Co=256 + let base16colorspace=256 + se tgc +en + +colo base16-porple + +sy on + +" 2019-02-25. I finally concede to turning all of these on... +" although my autocommands still turn off most of them. ;P +filet on +filet plugin on +filet indent on + + " good fonts: + " =Lucida_Console:h10:cANSI:qDRAFT + " =Noto_Mono:h10:cANSI:qDRAFT + " =ばぐまるゴシック:h12:cSHIFTJIS:qDRAFT + " =Courier:h10:cANSI:qDRAFT + " =Px437_IBM_PS/2thin4:h12:cDEFAULT:qDRAFT + " =PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT + " =PxPlus_IBM_VGA8:h12:cDEFAULT:qDRAFT + + " good colors: + " base16-atelier-cave + " base16-atelier-sulphurpool + " base16-atelier-plateu-light + " base16-circus + " base16-material-palenight + " base16-porple + " base16-rebecca + " base16-unikitty-dark + " base16-xcode-dusk + " morning + " JSCZmgNell + +" Global Config --------------------------------------------------------------| + +" bufexplorer +let g:bufExplorerDisableDefaultKeyMapping=1 + +" Gutentags +let g:gutentags_project_root=['.git', 'Makefile'] + +" TwitVim +let twitvim_browser_cmd='palemoon' + +" vim-markdown +let g:vim_markdown_folding_disabled=1 + +" rainbow +let g:rainbow_active=0 + +" netrw +let g:netrw_banner=0 +let g:netrw_liststyle=3 +let g:netrw_browse_split=4 +let g:netrw_altv=1 +let g:netrw_winsize=20 + +" buftabline +let g:buftabline_indicators=1 +let g:buftabline_numbers=2 + +" vim +let mapleader="\" + +" TagBar +let g:tagbar_vertical=7 +let g:tagbar_compact=1 +let g:tagbar_show_linenumbers=1 +let g:tagbar_iconchars=['»', '▼'] +let g:tagbar_autoshowtag=1 + +" abolish +let g:abolish_no_mappings=1 " we set out own later + +" OS-specific settings -------------------------------------------------------| + +if has('gui_running') + if has('win32') + se gfn=PxPlus_IBM_EGA8:h12:cDEFAULT:qDRAFT + el + se gfn=PxPlus\ IBM\ EGA8\ 12 + se lsp=-2 + en +en + +if has('win32') + let $PATH='G:\msys64\usr\bin;'.$PATH + se ssl + let key='G:/msys64/home/marrub/.ssh/id_rsa' + let g:netrw_cygwin=0 + let g:netrw_ignorenetrc=1 + let g:netrw_list_cmd="ssh -i " . key . " USEPORT HOSTNAME ls -Fa " + let g:netrw_ssh_cmd="ssh -i " . key + let g:netrw_scp_cmd="scp -q -i " . key + let g:netrw_sftp_cmd="sftp -i " . key + let g:netrw_silent=1 + let g:gutentags_cache_dir=$VIM .'/vimtags/' + se dir=$VIM/vimtemp// +el + let g:gutentags_cache_dir=$HOME.'/.vim/tags/' + se gp=rg\ --vimgrep\ -n + se dir=$HOME/.vim/temp// +en + +" Functions ------------------------------------------------------------------| + +" Strip whitespace on buffer write +fu! StripWhite() + let l=line(".") + let c=col(".") + %s/\s\+$//e + cal cursor(l, c) +endf + +" Automatic headers +fu! FillLine(str) + let tw=&textwidth + if tw == 0 | let tw=80 | en + .s/\s*$// + let rep = ((tw - col("$")) / len(a:str)) - 2 + if rep > 0 | .s/$/\=(' '.repeat(a:str, rep))/ | en +endf + +" File size +fu! MabFileSize() + let fs=line2byte(line('$')+1)-1 + if fs < 0 | retu "" | else | retu fs | en +endf + +" Close empty buffers +fu! CloseEmptyBuffers() + let bufs = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && !getbufvar(v:val, "&mod")') + if !empty(bufs) + exe 'bd' join(bufs, ' ') + en +endf + +" Autocommands ---------------------------------------------------------------| + +" Strip whitespace +au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,markdown au BufWritePre cal StripWhite() + +" Enable rainbow braces +au FileType c,cpp,cs,java,php,ruby,rust,python,go,zscript,html,scheme,racket,lisp au BufEnter RainbowToggleOn + +" ASM options +au BufNewFile,BufRead *.s,*.inc setl sw=8 ft=asm_ca65 + +" close empty buffers automatically +au BufEnter * cal CloseEmptyBuffers() + +" EDF → conf +au FileType edif se syn=conf + +" disable most ftplugins +au BufReadPre * let b:did_ftplugin=1 + +" au VimEnter * nested :TagbarOpen + +" rust.vim sets Cargo.toml to use filetype `cfg` even though it shouldn't, to +" fix this we simply do the same thing before it has a chance to +au BufRead,BufNewFile Cargo.toml if &filetype == "" | set filetype=toml | endif + +"au VimEnter * vs + +" Mapping --------------------------------------------------------------------| + +" Alignment mode +nm ga (EasyAlign) +xm ga (EasyAlign) + +nn e :cal FillLine("-")A\| + +" TagBar +nm :TagbarToggle + +" Copyright header +nn C :0pu=strftime('// Copyright © %Y ')A + +" Align text +nn c :ce +nn R :ri + +" Faux asterism +nn A oA** *2:ce + +" Substitute word across file +nn s :%s/\<\>//g + +" Fuck off, highlighting +nn :noh:ec + +" Block comments +nn r O////// A + +" Preview tag +nn t :pta + +" Fold mark +nn f zfa{ + +" Spellcheck toggle +nn q :setl spell! + +" Use ag +nn a :Ack! + +" Map emoji +nn E :%s/:\([^:]\+\):/\=emoji#for(submatch(1), submatch(0))/g + +" Sort +nn S vip:sort +vn S :sort + +" Tmux-like bindings +nn bw :let g:netrw_chgwin = winnr() +nn b" :new:winc x:winc j +nn b% :vne:winc x:winc l + +" Buffer movement +nn bn :bn +nn bv :bp +nn be :BufExplorer +nn bd :bp\|bd # +nn bq :bufdo bd +nn bs :new\|BufExplorer +nn br :bro ol +nn bb b +nm 1 BufTabLine.Go(1) +nm 2 BufTabLine.Go(2) +nm 3 BufTabLine.Go(3) +nm 4 BufTabLine.Go(4) +nm 5 BufTabLine.Go(5) +nm 6 BufTabLine.Go(6) +nm 7 BufTabLine.Go(7) +nm 8 BufTabLine.Go(8) +nm 9 BufTabLine.Go(9) + +" Copy whole file +nn x gg"+yG`` + +" Mirror +vn v c:se ri":se nori + +" Fix syntax +nn :sy sync fromstart +nn :sy off\|sy on\|RainbowToggleOn + +" Ctrl-Arrow movement +nn + +nn - +nn b +nn w +nn + +nn - +nn b +nn w + +" Better movement +nn j gj +vn j gj +nn k gk +vn k gk + +nn j +vn j +nn k +vn k + +nn x +vn x + +nn +vn +nn +vn +nn +vn +nn +vn + +nn +vn +nn +vn +nn +vn +nn +vn + +" abolish +nm cr (abolish-coerce-word) + +" find +com! -nargs=+ -complete=file -bar Gr sil! gr! ""|cw +nn KK :Gr \b\b +nn Kk :Gr + +" Rainbow Config -------------------------------------------------------------| + +let g:rainbow_conf = { +\ 'guifgs': ['#ff533d', '#ff973d', '#ffe13d', '#91ff3d', '#3dffd8', '#3daeff', '#6a3dff', '#ee3dff'], +\ 'ctermfgs': ['lightblue', 'lightyellow', 'lightcyan', 'lightmagenta'], +\ 'operators': '_,_', +\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'], +\ 'separately': { +\ '*': {}, +\ 'haskell': { +\ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/\v\{\ze[^-]/ end=/}/ fold'], +\ }, +\ 'tex': { +\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/'], +\ }, +\ 'vim': { +\ 'parentheses': ['start=/(/ end=/)/', 'start=/\[/ end=/\]/', 'start=/{/ end=/}/ fold', 'start=/(/ end=/)/ containedin=vimFuncBody', 'start=/\[/ end=/\]/ containedin=vimFuncBody', 'start=/{/ end=/}/ fold containedin=vimFuncBody'], +\ }, +\ 'xml': { +\ 'syn_name_prefix': 'xmlRainbow', +\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=## fold'], +\ }, +\ 'xhtml': { +\ 'parentheses': ['start=/\v\<\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'))?)*\>/ end=## fold'], +\ }, +\ 'html': { +\ 'parentheses': ['start=/\v\<((script|style|area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=## fold'], +\ }, +\ 'perl': { +\ 'syn_name_prefix': 'perlBlockFoldRainbow', +\ }, +\ 'php': { +\ 'syn_name_prefix': 'phpBlockRainbow', +\ 'parentheses': ['start=/\v\<((area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)[ >])@!\z([-_:a-zA-Z0-9]+)(\s+[-_:a-zA-Z0-9]+(\=("[^"]*"|'."'".'[^'."'".']*'."'".'|[^ '."'".'"><=`]*))?)*\>/ end=## fold', 'start=/(/ end=/)/ containedin=@htmlPreproc contains=@phpClTop', 'start=/\[/ end=/\]/ containedin=@htmlPreproc contains=@phpClTop', 'start=/{/ end=/}/ containedin=@htmlPreproc contains=@phpClTop'], +\ }, +\ 'stylus': { +\ 'parentheses': ['start=/{/ end=/}/ fold contains=@colorableGroup'], +\ }, +\ 'css': 0, +\ 'sh': 0, +\ } +\} + +" EOF diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..7c03e2c --- /dev/null +++ b/zshrc @@ -0,0 +1,14 @@ +HISTFILE=~/.zsh/hist +HISTSIZE=100000 +SAVEHIST=10000 + +setopt appendhistory extendedglob nomatch +unsetopt autocd beep + +bindkey -e +bindkey "^[[H" beginning-of-line +bindkey "^[[F" end-of-line + +zstyle :compinstall filename '/home/marrub/.zshrc' +autoload -Uz compinit +compinit