dotfiles

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

commit 36703168874402b38d9122edf0f648c368797701
parent 1daa122c62391382152e3cafa36c69303b85e9d0
Author: hhvn <hayden@haydenvh.com>
Date:   Wed, 11 Nov 2020 17:02:37 +0000

zsh ---> ksh

Diffstat:
D.config/alias | 69---------------------------------------------------------------------
D.config/galias | 13-------------
M.config/nvim/init.vim | 6++++++
M.config/sxhkd/sxhkdrc | 15+++++++++------
M.config/zsh/.zshrc | 85++-----------------------------------------------------------------------------
D.config/zsh/alias.zsh | 82-------------------------------------------------------------------------------
D.config/zsh/functions/0x0.zsh | 3---
D.config/zsh/functions/art.zsh | 3---
D.config/zsh/functions/colotable.zsh | 13-------------
D.config/zsh/functions/cu.zsh | 3---
D.config/zsh/functions/diary.zsh | 13-------------
D.config/zsh/functions/encsign.zsh | 4----
D.config/zsh/functions/fdalias.zsh | 5-----
D.config/zsh/functions/fdconf.zsh | 4----
D.config/zsh/functions/fdfunc.zsh | 4----
D.config/zsh/functions/fdscripts.zsh | 4----
D.config/zsh/functions/geo.zsh | 3---
D.config/zsh/functions/hb.zsh | 4----
D.config/zsh/functions/hbnc.zsh | 3---
D.config/zsh/functions/help.zsh | 7-------
D.config/zsh/functions/ix.zsh | 3---
D.config/zsh/functions/me0w.zsh | 3---
D.config/zsh/functions/newtab.zsh | 4----
D.config/zsh/functions/qmap.zsh | 5-----
D.config/zsh/functions/radio.zsh | 3---
D.config/zsh/functions/sttab.zsh | 3---
D.config/zsh/functions/sudo.zsh | 7-------
D.config/zsh/functions/wfnintrpaste.zsh | 3---
D.config/zsh/functions/yt.zsh | 3---
D.config/zsh/ls.zsh | 47-----------------------------------------------
A.kshrc | 12++++++++++++
A.profile | 2++
A.scripts/bin/0x0 | 3+++
A.scripts/bin/art | 3+++
A.scripts/bin/colotable | 13+++++++++++++
A.scripts/bin/cu | 3+++
A.scripts/bin/diary | 13+++++++++++++
A.scripts/bin/dnsbl | 10++++++++++
M.scripts/bin/dotadd | 2++
M.scripts/bin/dpass | 7++-----
A.scripts/bin/encsign | 4++++
A.scripts/bin/geo | 4++++
A.scripts/bin/hb | 5+++++
A.scripts/bin/hbnc | 4++++
M.scripts/bin/hgpg | 13++++++++++++-
A.scripts/bin/ix | 3+++
A.scripts/bin/me0w | 3+++
D.scripts/bin/mkalias | 4----
M.scripts/bin/mpvrcp | 45++++++++++++++++++---------------------------
A.scripts/bin/newtab | 4++++
A.scripts/bin/notify | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
M.scripts/bin/nwatched | 2+-
A.scripts/bin/qmap | 3+++
A.scripts/bin/radio | 4++++
D.scripts/bin/stig | 8--------
A.scripts/bin/sttab | 4++++
A.scripts/bin/sudo | 3+++
A.scripts/bin/tmuxkillshell | 4++++
A.scripts/bin/wfnintrpaste | 4++++
A.scripts/bin/xdotoolcombo | 34++++++++++++++++++++++++++++++++++
A.scripts/bin/youtubechannelid | 3+++
M.scripts/input/keyboard | 7++++++-
M.xinitrc | 2+-
M.zprofile | 11++++-------
64 files changed, 293 insertions(+), 462 deletions(-)

diff --git a/.config/alias b/.config/alias @@ -1,69 +0,0 @@ -vsplit vim -O -split vim -o -l \ls --color=auto -Fh -ls \ls --color=auto -d \ls --color=auto -FCash -la \ls --color=auto -FAh -ll \ls --color=auto -Flh -lla \ls --color=auto -FlAh -r \rm -rr \rm -rf -v nvim -g \git -c \clear -f \find -xi sudo xbps-install -xiu sudo xbps-install -S; sudo xbps-install -yu xbps; sudo xbps-install -yu; sudo xbps-remove -Ooy; rm -rf ~/.cache ~/.mozilla ~/.local/share/webkitgtk ~/.viminfo ~/.wget-hsts ~/.lesshst ~/.sh_history ~/.python_history ~/.*history ~/.*hst* ~/.dbus ~/.w3m ~/.config/vimb/cookies.db; sudo vkpurge rm all -xq sudo xbps-query -xr sudo xbps-remove -wget \wget --hsts-file="/dev/null" -pipes \pipes -R -r 10000 -c 10 -c 11 -c 12 -c 13 -c 14 -c 15 -s 15 -clock tty-clock -s -c -C 7 -ytdl youtube-dl --add-metadata -ic -ytdla youtube-dl --add-metadata -xic -map telnet mapscii.me -irssi \irssi --home ~/.config/irssi/ -n haydenh -zsleep sudo zzz -hibernate sudo ZZZ -rmst bash ~/.scripts/random/gnulinux.sh -vimb \vimb --no-maximize -mkconfall mkmailpass; mkalias -make \make CC=tcc -nm export ESCDELAY=5 ; neomutt ; rm /tmp/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail -maic sudo make install clean -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 -edconf nvim ~/.config/zsh/.zshrc -gnu.matrix fwknop --rc-file=$HOME/.config/fwknop/config --save-args-file=/dev/full -sn gnu.matrix && ssh gnu.matrix -rss sfeed_update $XDG_CONFIG_HOME/sfeed/config && . $XDG_CONFIG_HOME/sfeed/config && sfeed_curses $XDG_CACHE_HOME/sfeed/* -diff colordiff -irc (sleep 1 && xdotool type 'tmux a' && xdotool key Return) & ssh local -cgo rlwrap cgo -~d cd ~/general/downloads; ls -~do cd ~/general/documents; ls -~iw cd ~/images/wallpapers; ls -~i cd ~/images; ls -~v cd ~/videos; ls -~m cd ~/music; ls -~w cd ~/work; ls -~c cd ~/.config; ls -~s cd ~/.scripts; ls -~sb cd ~/.scripts/bin; ls -~sbdi cd ~/.scripts/bin/display; ls -~sbdm cd ~/.scripts/bin/dmenu; ls -~sbi cd ~/.scripts/bin/i3; ls -~sbm cd ~/.scripts/bin/misc; ls -~ cd -.. cd .. -... cd ../.. -.... cd ../../.. -..... cd ../../../.. -...... cd ../../../../.. -....... cd ../../../../../.. -........ cd ../../../../../../.. -......... cd ../../../../../../../.. -.......... cd ../../../../../../../../.. -........... cd ../../../../../../../../../.. -............ cd ../../../../../../../../../../.. diff --git a/.config/galias b/.config/galias @@ -1,13 +0,0 @@ -... ../.. -.... ../../.. -..... ../../../.. -...... ../../../../.. -....... ../../../../../.. -........ ../../../../../../.. -......... ../../../../../../../.. -.......... ../../../../../../../../.. -........... ../../../../../../../../../.. -............ ../../../../../../../../../../.. -om origin master -gm github master -aic all install clean diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -14,6 +14,12 @@ " vimagit - git in vim " quickscope - find stuff easer +"Persistant undo +set undodir=~/.local/share/nvim/ +set undofile +set undolevels=1000 +set undoreload=10000 + "Leader let mapleader=";" let maplocalleader=',' diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc @@ -29,7 +29,7 @@ super + shift + b dmpvurl /tmp/mpv-socket /tmp/mpv-socket2 super + n - st -e mpvrcp /tmp/mpv-socket + st -c mpvrcp -e mpvrcp /tmp/mpv-socket super + shift + n st -e neomutt @@ -88,9 +88,12 @@ super + shift + w super + shift + g chradio -super + g +super + ctrl + g st -e sh -c 'nvim ~/.local/notes' +super + g + st -e sh -c 'rlwrap cgo' + super + o st -e torrents @@ -136,11 +139,11 @@ super + y super + shift + y st -e sh -c 'wifioff && cu dock' -super + shift + {h,j,k,l} - xdotool mousemove_relative -- {-10 0,0 10,0 -10,10 0} +super + ctrl + {j,k} + for void in $(seq 3); do xdotool click {5,4}; done -super + ctrl + {h,j,k,l} - xdotool mousemove_relative -- {-40 0,0 40,0 -40,40 0} +Menu + xdotool click 2 #thinkpad codes diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc @@ -1,84 +1,3 @@ -# Make alias' -mkalias +#!/bin/zsh -# Prompt -precmd(){ - prev="$?" - branch=$(\git branch 2>/dev/null | grep "\*" | tr -d '\*') - # dir=$(pwd | sed "s#$HOME#~#") - dir=$(pwd) - prompt="%{$(tput setab 3)%0G%} %{$(tput sgr0)%0G%} " - [ "$prev" != "0" ] && prompt+="%F{10}$prev " - [ "$USER" = "root" ] && prompt+="%F{8}$root " - prompt+="%F{6}" - prompt+="$dir" - prompt+="%F{5}" - prompt+="$branch" - prompt+="%F{6}" - prompt+="%{ > %0G%}" - prompt+="%F" - export PROMT="$prompt" -} - -# Completion -autoload -Uz compinit promptinit -compinit -promptinit - -zstyle ':completion:*' menu select -zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} - -# Vi-mode -bindkey -v -zmodload zsh/complist -export KEYTIMEOUT=1 -bindkey -M menuselect 'h' vi-backward-char -bindkey -M menuselect 'j' vi-down-line-or-history -bindkey -M menuselect 'k' vi-up-line-or-history -bindkey -M menuselect 'l' vi-forward-char -bindkey -v '^?' backward-delete-char - -# Load .zsh files -for file in $(find $ZDOTDIR -name "*.zsh") -do - . $file -done - -# Highlighted man pages -export LESS_TERMCAP_mb=$'\e[1;32m' -export LESS_TERMCAP_md=$'\e[1;35m' -export LESS_TERMCAP_me=$'\e[0m' -export LESS_TERMCAP_se=$'\e[0m' -export LESS_TERMCAP_so=$'\e[01;33m' -export LESS_TERMCAP_ue=$'\e[0m' -export LESS_TERMCAP_us=$'\e[1;4;32m' - -# Syntax highlighting -typeset -A ZSH_HIGHLIGHT_STYLES -. /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - -ZSH_HIGHLIGHT_STYLES[unknown-token]='fg=5,bold' -ZSH_HIGHLIGHT_STYLES[command]='fg=13' -ZSH_HIGHLIGHT_STYLES[function]='fg=13,bold' -ZSH_HIGHLIGHT_STYLES[alias]='fg=13,bold' -ZSH_HIGHLIGHT_STYLES[reserved-word]='fg=13,underline,bold' -ZSH_HIGHLIGHT_STYLES[builtin]='fg=13,underline,bold' -ZSH_HIGHLIGHT_STYLES[precommand]='fg=13,underline,bold' -ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=15' -ZSH_HIGHLIGHT_STYLES[hashed-command]='fg=15' -ZSH_HIGHLIGHT_STYLES[globbing]='fg=15' -ZSH_HIGHLIGHT_STYLES[history-expansion]='fg=15' -ZSH_HIGHLIGHT_STYLES[command-substitution]='fg=15' -ZSH_HIGHLIGHT_STYLES[process-substitution]='fg=15' -ZSH_HIGHLIGHT_STYLES[redirection]='fg=10' -ZSH_HIGHLIGHT_STYLES[single-hyphen-option]='fg=7' -ZSH_HIGHLIGHT_STYLES[double-hyphen-option]='fg=7' -ZSH_HIGHLIGHT_STYLES[path]='fg=7' - - -alias hi="printf ' 0/\n /|\n / \\ \n' | tee /dev/stderr | xclip" - -. /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh - -# boot into X -[ "$(tty)" = "/dev/tty1" ] && startx +ksh diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh @@ -1,82 +0,0 @@ -alias -g ...=" ../.." -alias -g ....=" ../../.." -alias -g .....=" ../../../.." -alias -g ......=" ../../../../.." -alias -g .......=" ../../../../../.." -alias -g ........=" ../../../../../../.." -alias -g .........=" ../../../../../../../.." -alias -g ..........=" ../../../../../../../../.." -alias -g ...........=" ../../../../../../../../../.." -alias -g ............=" ../../../../../../../../../../.." -alias -g om=" origin master" -alias -g gm=" github master" -alias -g aic=" all install clean" -alias vsplit=" vim -O" -alias split=" vim -o" -alias l=" \ls --color=auto -Fh" -alias ls=" \ls --color=auto" -alias d=" \ls --color=auto -FCash" -alias la=" \ls --color=auto -FAh" -alias ll=" \ls --color=auto -Flh" -alias lla=" \ls --color=auto -FlAh" -alias r=" \rm" -alias rr=" \rm -rf" -alias v=" nvim" -alias g=" \git" -alias c=" \clear" -alias f=" \find" -alias xi=" sudo xbps-install" -alias xiu=" sudo xbps-install -S; sudo xbps-install -yu xbps; sudo xbps-install -yu; sudo xbps-remove -Ooy; rm -rf ~/.cache ~/.mozilla ~/.local/share/webkitgtk ~/.viminfo ~/.wget-hsts ~/.lesshst ~/.sh_history ~/.python_history ~/.*history ~/.*hst* ~/.dbus ~/.w3m ~/.config/vimb/cookies.db; sudo vkpurge rm all" -alias xq=" sudo xbps-query" -alias xr=" sudo xbps-remove" -alias wget=" \wget --hsts-file="/dev/null"" -alias pipes=" \pipes -R -r 10000 -c 10 -c 11 -c 12 -c 13 -c 14 -c 15 -s 15" -alias clock=" tty-clock -s -c -C 7" -alias ytdl=" youtube-dl --add-metadata -ic" -alias ytdla=" youtube-dl --add-metadata -xic" -alias map=" telnet mapscii.me" -alias irssi=" \irssi --home ~/.config/irssi/ -n haydenh" -alias zsleep=" sudo zzz" -alias hibernate=" sudo ZZZ" -alias rmst=" bash ~/.scripts/random/gnulinux.sh" -alias vimb=" \vimb --no-maximize" -alias mkconfall=" mkmailpass; mkalias" -alias make=" \make CC=tcc" -alias nm=" export ESCDELAY=5 ; neomutt ; rm /tmp/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail ; rm /tmp/blocks/mail ; rm /tmp/dwmblocks/mail" -alias maic=" sudo make install clean" -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" -alias edconf=" nvim ~/.config/zsh/.zshrc" -alias gnu.matrix=" fwknop --rc-file=$HOME/.config/fwknop/config --save-args-file=/dev/full -sn gnu.matrix && ssh gnu.matrix" -alias rss=" sfeed_update $XDG_CONFIG_HOME/sfeed/config && . $XDG_CONFIG_HOME/sfeed/config && sfeed_curses $XDG_CACHE_HOME/sfeed/*" -alias diff=" colordiff" -alias irc=" (sleep 1 && xdotool type 'tmux a' && xdotool key Return) & ssh local" -alias cgo=" rlwrap cgo" -alias ~d=" cd ~/general/downloads; ls" -alias ~do=" cd ~/general/documents; ls" -alias ~iw=" cd ~/images/wallpapers; ls" -alias ~i=" cd ~/images; ls" -alias ~v=" cd ~/videos; ls" -alias ~m=" cd ~/music; ls" -alias ~w=" cd ~/work; ls" -alias ~c=" cd ~/.config; ls" -alias ~s=" cd ~/.scripts; ls" -alias ~sb=" cd ~/.scripts/bin; ls" -alias ~sbdi=" cd ~/.scripts/bin/display; ls" -alias ~sbdm=" cd ~/.scripts/bin/dmenu; ls" -alias ~sbi=" cd ~/.scripts/bin/i3; ls" -alias ~sbm=" cd ~/.scripts/bin/misc; ls" -alias ~=" cd" -alias ..=" cd .." -alias ...=" cd ../.." -alias ....=" cd ../../.." -alias .....=" cd ../../../.." -alias ......=" cd ../../../../.." -alias .......=" cd ../../../../../.." -alias ........=" cd ../../../../../../.." -alias .........=" cd ../../../../../../../.." -alias ..........=" cd ../../../../../../../../.." -alias ...........=" cd ../../../../../../../../../.." -alias ............=" cd ../../../../../../../../../../.." diff --git a/.config/zsh/functions/0x0.zsh b/.config/zsh/functions/0x0.zsh @@ -1,3 +0,0 @@ -0x0(){ - curl -n -F "file=@/dev/stdin" https://0x0.st < /dev/stdin | tee /dev/stderr | tr -d '\n' | xclip -} diff --git a/.config/zsh/functions/art.zsh b/.config/zsh/functions/art.zsh @@ -1,3 +0,0 @@ -art(){ - cp $1 $HOME/general/art.tmp -} diff --git a/.config/zsh/functions/colotable.zsh b/.config/zsh/functions/colotable.zsh @@ -1,13 +0,0 @@ -colotable(){ - o=0 - for ((i=0;i<256;i++)) - do - [ $o -gt 5 ] && printf "\n" && o=0 - o=$(($o+1)) - tput setaf $i - printf " %03d " "$i" - tput setab $i - printf " " - tput sgr0 - done -} diff --git a/.config/zsh/functions/cu.zsh b/.config/zsh/functions/cu.zsh @@ -1,3 +0,0 @@ -cu(){ - sh $HOME/.scripts/custom/$1 -} diff --git a/.config/zsh/functions/diary.zsh b/.config/zsh/functions/diary.zsh @@ -1,13 +0,0 @@ -diary(){ - date=$(date +%d%m%y) - wdate=$(date +%d/%m/%y) - echo "===private===" > ~/.local/privated - echo "#Daily Entry - $wdate" > ~/.local/public.gph - - phlog="$HOME/net/alcl/write" - mkdir -p $phlog/daily.entries ~/.local/diary - vim -O ~/.local/public.gph ~/.local/privated - printf '.txt or .gph?'; read ftype < /dev/tty - mv ~/.local/public.gph $phlog/daily.entries/entry.of.$date.$ftype - mv ~/.local/privated ~/.local/diary/$date -} diff --git a/.config/zsh/functions/encsign.zsh b/.config/zsh/functions/encsign.zsh @@ -1,4 +0,0 @@ -encsign(){ - [ -z $1 ] && echo '$1=recipient $2=file' && exit 1 - gpg --encrypt --sign --armor -r $1 $2 -} diff --git a/.config/zsh/functions/fdalias.zsh b/.config/zsh/functions/fdalias.zsh @@ -1,5 +0,0 @@ -fdalias(){ - alias=$(alias | awk 'BEGIN { FS="=" }; // { print $1 }' | shmenu 'alias') - echo - alias $alias -} diff --git a/.config/zsh/functions/fdconf.zsh b/.config/zsh/functions/fdconf.zsh @@ -1,4 +0,0 @@ -fdconf(){ - conf=$(find $XDG_CONFIG_HOME -type f | sed "s~^.*$XDG_CONFIG_HOME/~~g" | shmenu 'config') - $EDITOR $XDG_CONFIG_HOME/$conf -} diff --git a/.config/zsh/functions/fdfunc.zsh b/.config/zsh/functions/fdfunc.zsh @@ -1,4 +0,0 @@ -fdfunc(){ - func=$(find $XDG_CONFIG_HOME/zsh/functions/ -type f | awk 'BEGIN { FS="/" }; // {print $NF}' | sed 's/\.zsh$//g' | shmenu 'function') - $EDITOR $XDG_CONFIG_HOME/zsh/functions/$func.zsh -} diff --git a/.config/zsh/functions/fdscripts.zsh b/.config/zsh/functions/fdscripts.zsh @@ -1,4 +0,0 @@ -fdscripts(){ - script=$(find ~/.scripts/ -type f | sed "s~^.*\.scripts/~~g" | shmenu scripts) - $EDITOR ~/.scripts/$script -} diff --git a/.config/zsh/functions/geo.zsh b/.config/zsh/functions/geo.zsh @@ -1,3 +0,0 @@ -geo(){ - curl -s https://ipinfo.io/$1/json | jq .ip,.city,.region,.country | tr '\n' '\,' | tr -d '\"' | sed 's/,/, /g' -} diff --git a/.config/zsh/functions/hb.zsh b/.config/zsh/functions/hb.zsh @@ -1,4 +0,0 @@ -hb(){ - cp /dev/stdin ~/net/paste/$1 - echo "gopher://haydenvh.com/p/paste/$1" | tee /dev/stderr | xclip -} diff --git a/.config/zsh/functions/hbnc.zsh b/.config/zsh/functions/hbnc.zsh @@ -1,3 +0,0 @@ -hbnc(){ - nc haydenvh.com 8888 | tee /dev/stderr | xclip -} diff --git a/.config/zsh/functions/help.zsh b/.config/zsh/functions/help.zsh @@ -1,7 +0,0 @@ -help(){ - echo "fdalias - find & view alias' -fdfunc - find & view functions -edconf - edit zsh config -fdconf - find & view config files -fdscripts - find & view scripts" -} diff --git a/.config/zsh/functions/ix.zsh b/.config/zsh/functions/ix.zsh @@ -1,3 +0,0 @@ -ix(){ - curl -n -F "f:1=<-" http://ix.io < /dev/stdin | tee /dev/stderr | xclip -} diff --git a/.config/zsh/functions/me0w.zsh b/.config/zsh/functions/me0w.zsh @@ -1,3 +0,0 @@ -me0w(){ - echo "gopher://me0w.net/0/pit/$(nc me0w.net 31415 < /dev/stdin)" | tee /dev/stderr |xclip -} diff --git a/.config/zsh/functions/newtab.zsh b/.config/zsh/functions/newtab.zsh @@ -1,4 +0,0 @@ -newtab(){ - read txid < /tmp/txid - nohup st -w $txid -e cgo haydenh.null > /dev/null & -} diff --git a/.config/zsh/functions/qmap.zsh b/.config/zsh/functions/qmap.zsh @@ -1,5 +0,0 @@ -#!/bin/sh - -qmap(){ - sudo nmap -A -T4 -Pn -sS $@ | less -} diff --git a/.config/zsh/functions/radio.zsh b/.config/zsh/functions/radio.zsh @@ -1,3 +0,0 @@ -radio(){ - mpv $1 --input-ipc-server=/tmp/mpv-socket3 -} diff --git a/.config/zsh/functions/sttab.zsh b/.config/zsh/functions/sttab.zsh @@ -1,3 +0,0 @@ -sttab(){ - nohup tabbed st -w > /tmp/txid & -} diff --git a/.config/zsh/functions/sudo.zsh b/.config/zsh/functions/sudo.zsh @@ -1,7 +0,0 @@ -sudo(){ - [ -z $1 ] && /bin/doas $SHELL || /bin/doas $@ -} - -doas(){ - [ -z $1 ] && /bin/doas $SHELL || /bin/doas $@ -} diff --git a/.config/zsh/functions/wfnintrpaste.zsh b/.config/zsh/functions/wfnintrpaste.zsh @@ -1,3 +0,0 @@ -wfnintrpaste(){ - curl -F'file=@-' http://wfnintr.ne:1337 -} diff --git a/.config/zsh/functions/yt.zsh b/.config/zsh/functions/yt.zsh @@ -1,3 +0,0 @@ -yt(){ - cgo "haydenh.null/7/exec/idiot/youtube/gopher.dcgi" -} diff --git a/.config/zsh/ls.zsh b/.config/zsh/ls.zsh @@ -1,47 +0,0 @@ -#!/bin/zsh -export LS_COLORS="$(echo 'di=35 -fi=0 -ln=33 -ex=91;01 -*.sh=91 -*.zsh=91 -*.hex=91 -*.html=92 -*.css=97 -*.md=97 -*.yml=93 -*.c=94 -*.h=94 -*.h.orig=94;01 -*.h.rej=94;01 -*.mk=96 -*LICENSE=90 -*FAQ=90 -*MODIFIED=90 -*DESIGN=90 -*Makefile=90 -*make.sh=90 -*configure=90 -*configure.sh=90 -*autogen.sh=90 -*README*=90 -*TODO=97 -*.c.orig=94;01 -*.c.rej=94;01 -*.xcf=95 -*.png=95 -*.jpeg=95 -*.jpg=95 -*.heic=95 -*.heif=95 -*.mp3=95;01 -*.opus=95;01 -*.ogg=95;01 -*.flac=95;01 -*.wav=95;01 -*.m4a=95;04 -*.avi=95;04 -*.mp4=95;04 -*.mkv=95;04 -*.ogv=95;04 -*.webm=95;04' | tr '\n' ':')" diff --git a/.kshrc b/.kshrc @@ -0,0 +1,12 @@ +#!/bin/ksh + +set vi +export PS1="$(tput setaf 5)$(whoami)$(tput setaf 7) \$$(tput sgr0) " +export PS2="$(whoami | tr '[:alnum:]' ' ')$(tput setaf 7) |$(tput sgr0) " +export PS3="$(whoami | tr '[:alnum:]' ' ')$(tput setaf 7) |$(tput sgr0) " +export PS4="$(whoami | tr '[:alnum:]' ' ')$(tput setaf 7) |$(tput sgr0) " + +for f in $HOME/.config/ksh/* +do + . $f +done diff --git a/.profile b/.profile @@ -0,0 +1 @@ +.zprofile +\ No newline at end of file diff --git a/.scripts/bin/0x0 b/.scripts/bin/0x0 @@ -0,0 +1,3 @@ +#!/bin/sh + +curl -n -F "file=@/dev/stdin" https://0x0.st < /dev/stdin | tee /dev/stderr | tr -d '\n' | xclip diff --git a/.scripts/bin/art b/.scripts/bin/art @@ -0,0 +1,3 @@ +#!/bin/sh + +cp $1 $HOME/general/art.tmp diff --git a/.scripts/bin/colotable b/.scripts/bin/colotable @@ -0,0 +1,13 @@ +#!/bin/sh + +o=0 +for i in $(seq 0 256) +do + [ $o -gt 5 ] && printf "\n" && o=0 + o=$(($o+1)) + tput setaf $i + printf " %03d " "$i" + tput setab $i + printf " " + tput sgr0 +done diff --git a/.scripts/bin/cu b/.scripts/bin/cu @@ -0,0 +1,3 @@ +#!/bin/sh + +sh $HOME/.scripts/custom/$1 diff --git a/.scripts/bin/diary b/.scripts/bin/diary @@ -0,0 +1,13 @@ +#!/bin/sh + +date=$(date +%d%m%y) +wdate=$(date +%d/%m/%y) +echo "===private===" > ~/.local/privated +echo "#Daily Entry - $wdate" > ~/.local/public.gph + +phlog="$HOME/net/alcl/write" +mkdir -p $phlog/daily.entries ~/.local/diary +vim -O ~/.local/public.gph ~/.local/privated +printf '.txt or .gph?'; read ftype < /dev/tty +mv ~/.local/public.gph $phlog/daily.entries/entry.of.$date.$ftype +mv ~/.local/privated ~/.local/diary/$date diff --git a/.scripts/bin/dnsbl b/.scripts/bin/dnsbl @@ -0,0 +1,10 @@ +#!/bin/sh + +[ -z $1 ] && echo "usage: dnsbl <ip4 addr> [service]" && exit 1 +[ -z $2 ] && service=torexit.dan.me.uk || service="$2" + +rev=$(echo "$1" | awk 'BEGIN {OFS="."; FS="."}; {print $4, $3, $2, $1}') + +host "$rev.$service" | awk '{print $4}' >/dev/null || exit 1 + +dig +short "$rev.$service" TXT diff --git a/.scripts/bin/dotadd b/.scripts/bin/dotadd @@ -48,3 +48,5 @@ git rm -rf --cache .config/irssi/nicklist* gitadd .config/galias gitadd .config/redshift/ gitadd .ssh/config +gitadd .kshrc +gitadd .profile diff --git a/.scripts/bin/dpass b/.scripts/bin/dpass @@ -1,11 +1,8 @@ #!/bin/sh # -# dmenu/dpass -# Created by Hayden Hamilton -# # hayden@haydenvh.com -# Copyright (c) 2019-2020 Hayden Hamilton. -# +# Copyright (c) 2019-2020 hhvn +# wtfpl [ -z $PASS ] && PASS=$HOME/.local/pass [ ! -f $PASS ] && touch $PASS diff --git a/.scripts/bin/encsign b/.scripts/bin/encsign @@ -0,0 +1,4 @@ +#!/bin/sh + +[ -z $1 ] && echo '$1=recipient $2=file' && exit 1 +gpg --encrypt --sign --armor -r $1 $2 diff --git a/.scripts/bin/geo b/.scripts/bin/geo @@ -0,0 +1,4 @@ +#!/bin/sh + +curl -s https://ipinfo.io/$1/json | jq .ip,.city,.region,.country | tr '\n' '\,' | tr -d '\"' | sed 's/,/, /g' + diff --git a/.scripts/bin/hb b/.scripts/bin/hb @@ -0,0 +1,5 @@ +#!/bin/sh + +cp /dev/stdin ~/net/paste/$1 +echo "gopher://haydenvh.com/p/paste/$1" | tee /dev/stderr | xclip + diff --git a/.scripts/bin/hbnc b/.scripts/bin/hbnc @@ -0,0 +1,4 @@ +#!/bin/sh + +nc haydenvh.com 8888 | tee /dev/stderr | xclip + diff --git a/.scripts/bin/hgpg b/.scripts/bin/hgpg @@ -1,10 +1,21 @@ #!/bin/sh +export LC_ALL=c + a="$1" shift case "$a" in - export-key) gpg --export --armour $1 ;; + genkey) gpg --gen-key ;; + export-key) + for k in $@ + do + gpg --fingerprint $k + printf "Destination? " + read -r dest </dev/tty + gpg --export --armour $k > $dest + done + ;; export-keyring) gpg --export --armour ;; list*) [ ! -z $1 ] && args="--keyid-format $1" diff --git a/.scripts/bin/ix b/.scripts/bin/ix @@ -0,0 +1,3 @@ +#!/bin/sh + +curl -n -F "f:1=<-" http://ix.io < /dev/stdin | tee /dev/stderr | xclip diff --git a/.scripts/bin/me0w b/.scripts/bin/me0w @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "gopher://me0w.net/0/pit/$(nc me0w.net 31415 < /dev/stdin)" | tee /dev/stderr |xclip diff --git a/.scripts/bin/mkalias b/.scripts/bin/mkalias @@ -1,4 +0,0 @@ -#!/bin/sh - -awk '{printf "alias -g "$1"=\"";$1="";printf $0"\"\n"}' < ~/.config/galias > ~/.config/zsh/alias.zsh -awk '{printf "alias "$1"=\"";$1="";printf $0"\"\n"}' < ~/.config/alias >> ~/.config/zsh/alias.zsh diff --git a/.scripts/bin/mpvrcp b/.scripts/bin/mpvrcp @@ -27,7 +27,7 @@ clear trap 'tput cnorm; exit' 2 -trap 'clear; olddis=blah' 28 #SIGWINCH +trap 'clear; oldtitle=blah' 28 #SIGWINCH drw_line(){ tput cup $1 0 @@ -43,7 +43,7 @@ get(){ } getm(){ - echo "$(centre "$(tput bold)$2:$(tput sgr0) $(get "$1" | sed "$3")")" + echo "$(tput bold)$2:$(tput sgr0) $(get "$1" | sed "$3")" } convertsecs() { @@ -77,41 +77,32 @@ draw_main(){ line=0 - dis=$(getm "media-title" "Title" | tr '.' ' ' - getm "metadata/artist" "Artist" - getm "metadata/genre" "Genre" - getm "metadata/album" "Album" - getm "path" "Dir" "s~.*music/~~;s~/[^/]*$~~" - getm "file-format" "FF") + title=$(getm "media-title" " Title " | tr '.' ' ') - [ "$dis" != "$olddis" ] && { - while [ $line -lt $((($(tput lines)/2)-4)) ] - do - drw_line $line "" - line=$(($line+1)) - done - - echo "$dis" | while IFS= read -r s + [ "$title" != "$oldtitle" ] && { + clear + ( + echo "$title" + getm "metadata/artist" "Artist " + getm "metadata/genre" " Genre " + getm "metadata/album" " Album " + getm "metadata/date" " Date " + getm "path" " Dir " "s~.*music/~~;s~/[^/]*$~~" + getm "file-format" " FF " + ) | while IFS= read -r s do drw_line $line "$s" line=$(($line+1)) done - - line=$(($line+6)) - while [ $line -ne $(($(tput lines)-1)) ] - do - drw_line $line "" - line=$(($line+1)) - done + duration=$(convertsecs $(echo '{ "command": ["get_property", "duration"] }' | socat /tmp/mpv-socket - | jq .data | sed 's/\..*$//')) + playlist_pos=$(get "playlist-pos") + playlist_count=$(get "playlist-count") } - olddis="$dis" + oldtitle="$title" state=$(get "pause" | sed 's/false/Playing/;s/true/Paused/') time=$(convertsecs $(echo '{ "command": ["get_property", "playback-time"] }' | socat /tmp/mpv-socket - | jq .data | sed 's/\..*$//')) - duration=$(convertsecs $(echo '{ "command": ["get_property", "duration"] }' | socat /tmp/mpv-socket - | jq .data | sed 's/\..*$//')) - playlist_pos=$(get "playlist-pos") - playlist_count=$(get "playlist-count") drw_line $(tput lines) "$(tput setaf 7; tput rev; tput bold; centre "$(printf "%s | %s/%s | Pos: %s/%s" "$state" "$time" "$duration" "$playlist_pos" "$playlist_count")")" tput sgr0 } diff --git a/.scripts/bin/newtab b/.scripts/bin/newtab @@ -0,0 +1,4 @@ +#!/bin/sh + +read txid < /tmp/txid +nohup st -w $txid -e cgo haydenh.null > /dev/null & diff --git a/.scripts/bin/notify b/.scripts/bin/notify @@ -0,0 +1,85 @@ +#!/bin/sh +# +# notify.sh - use irc to send a notice +# +# hayden@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. + +usage(){ + cat << . +* = required + +stdin* (message(s) to send) + +options: + --server* + --port* + --channel* + --nick* + --password + --tls +. + exit 1 +} + + +while [ $# != 0 ] +do + num=2 + case $1 in + -s|--server) server="$2" ;; + -p|--port) port="$2" ;; + -c|--channel) channel="$2" ;; + -n|--nick) nick="$2" ;; + -P|--passwd|--password) passwd="$2" ;; + -S|--ssl|-t|--tls) tls=y; num=1 ;; + *) usage ;; + esac + shift $num +done + +[ -z $server ] || [ -z $port ] || [ -z $channel ] || [ -z $nick ] && usage + +tmp=$(mktemp) +msg=$(mktemp) +cp /dev/stdin $msg + +[ -z $passwd ] && { + printf "NICK $nick\r\nUSER $nick $nick $nick $nick\r\n" > $tmp +} || { + printf "NICK $nick\r\nUSER $nick $nick $nick $nick\r\nPASS $passwd\r\n" > $tmp +} + +( + [ -z $tls ] && { + tail -f $tmp | nc $server $port + } || { + tail -f $tmp | openssl s_client -connect $server:$port + } +) | \ + tee /dev/stderr | while IFS= read -r line + do + set -- $line + case "$@" in + "PING"*) printf "PONG $2\r\n" ;; + *"MOTD"*|*"Message of The Day"*) + printf "JOIN $channel\r\n" + awk -v "channel=$channel" '{printf("PRIVMSG %s %s\r\n", channel, $0)}' < $msg + printf "QUIT done\r\n" + rm $msg $tmp + exit + ;; + esac + done | tee /dev/stderr >> $tmp diff --git a/.scripts/bin/nwatched b/.scripts/bin/nwatched @@ -19,7 +19,7 @@ # # Useful? :) -[ -z $1 ] 2>/dev/null && echo "usage: nwatched /path/to/dir" && exit +[ -z $1 ] 2>/dev/null && echo "usage: nwatched /path/to/dir" && exit 1 watched=$(find "$1" | grep 'WATCHED$' | sed 's~/WATCHED$~~') all=$(find "$1" -type d) diff --git a/.scripts/bin/qmap b/.scripts/bin/qmap @@ -0,0 +1,3 @@ +#!/bin/sh + +sudo nmap -A -T4 -Pn -sS $@ | less diff --git a/.scripts/bin/radio b/.scripts/bin/radio @@ -0,0 +1,4 @@ +#!/bin/sh + +mpv $1 --input-ipc-server=/tmp/mpv-socket3 + diff --git a/.scripts/bin/stig b/.scripts/bin/stig @@ -1,8 +0,0 @@ -#!/usr/bin/python3 -# -*- coding: utf-8 -*- -import re -import sys -from stig import run -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(run()) diff --git a/.scripts/bin/sttab b/.scripts/bin/sttab @@ -0,0 +1,4 @@ +#!/bin/sh + +nohup tabbed st -w > /tmp/txid & + diff --git a/.scripts/bin/sudo b/.scripts/bin/sudo @@ -0,0 +1,3 @@ +#!/bin/sh + +[ -z $1 ] && /bin/doas $SHELL || /bin/doas $@ diff --git a/.scripts/bin/tmuxkillshell b/.scripts/bin/tmuxkillshell @@ -0,0 +1,4 @@ +#!/bin/sh + +tmux lsp -s -F '#{pane_id} #{==:zsh,#{pane_current_command}}' \ + | awk '$2 == 1 {print $1}' | xargs -r -n1 tmux kill-pane -t diff --git a/.scripts/bin/wfnintrpaste b/.scripts/bin/wfnintrpaste @@ -0,0 +1,4 @@ +#!/bin/sh + +curl -F'file=@-' http://wfnintr.ne:1337 + diff --git a/.scripts/bin/xdotoolcombo b/.scripts/bin/xdotoolcombo @@ -0,0 +1,34 @@ +#!/bin/sh + +down(){ + echo "$1 down..." >&2 + xdotool keydown $1 +} +up(){ + echo "$1 up..." >&2 + xdotool keyup $1 +} +press(){ + down $1 + up $1 +} + +IFS='+' +list=$(echo $@) +unset IFS + +for c in $list +do + echo "$c" | grep -Ei 'ctrl|super|shift|alt' >/dev/null && { + C=$(echo "$c" | sed 's/ctrl/control/' | tr 'csa' 'CSA')_L + down $C + up="$up $C" + } || { + press $c + } +done + +for C in $up +do + up $C +done diff --git a/.scripts/bin/youtubechannelid b/.scripts/bin/youtubechannelid @@ -0,0 +1,3 @@ +#!/bin/sh + +curl -qsL $1 | tr '}{,' '\n' | grep channelId | head -n 1 | sed 's/.*\\":\\"//;s/..$//' | awk '{print "https://www.youtube.com/feeds/videos.xml?channel_id=" $0}' | tee /dev/stderr | xclip diff --git a/.scripts/input/keyboard b/.scripts/input/keyboard @@ -2,4 +2,9 @@ setxkbmap -layout us setxkbmap -option caps:escape -xcape -e 'Shift_L=parenleft;Shift_R=parenright' + +# unicomp endurapro - increase trackpoint sensitivity +xinput set-prop "pointer:Unicomp Inc Unicomp 10x Kbrd R7_2_w_PS_R7_38" "Coordinate Transformation Matrix" 4 0 0 0 4 0 0 0 4 +xinput set-prop "pointer:Unicomp Inc Unicomp 10x Kbrd R7_2_w_PS_R7_38" "libinput Accel Speed" 1 +xinput set-prop "pointer:Unicomp Inc Unicomp 10x Kbrd R7_2_w_PS_R7_38" "libinput Button Scrolling Button" 3 +xinput set-prop 'pointer:Unicomp Inc Unicomp 10x Kbrd R7_2_w_PS_R7_38' 'libinput Scroll Method Enabled' 0 0 1 diff --git a/.xinitrc b/.xinitrc @@ -13,7 +13,7 @@ cu dock & st -e & #/usr/libexec/xscreensaver/galaxy -root -count 5 -/usr/libexec/xscreensaver/cubicgrid -root -zoom 100 -no-bigdots -speed 0.2 & +/usr/libexec/xscreensaver/cubicgrid -root -zoom 100 -speed 0.2 & xsetroot -cursor_name sailboat & exec dwm diff --git a/.zprofile b/.zprofile @@ -1,10 +1,4 @@ -# -# .profile -# Created by Hayden Hamilton -# -# haydenvh.com -# Copyright (c) 2019 Hayden Hamilton. LICENSE:MIT -# +#!/bin/ksh export PATH="$PATH:$HOME/.scripts/bin" export EDITOR="nvim" @@ -54,3 +48,6 @@ export LC_IDENTIFICATION="sv_SE.UTF-8" export LC_ALL="sv_SE.UTF-8" cd $HOME # welcome home (st inherits / from hildon) + +[ "$(basename $SHELL)" != "ksh" ] && ksh +