dotfiles

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

commit a33f040378ff193a39cb7f7b52ff2ee38cefe998
parent 12f144d9121d63dca57e15871326040e43d51ba4
Author: hhvn <hayden@haydenvh.com>
Date:   Tue, 19 Jan 2021 18:48:48 +0000

.config/ksh/*: heh, I forgot to add these

Diffstat:
A.config/ksh/alias | 89+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ksh/kshrc | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/ksh/less | 9+++++++++
A.config/ksh/ls | 48++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 197 insertions(+), 0 deletions(-)

diff --git a/.config/ksh/alias b/.config/ksh/alias @@ -0,0 +1,89 @@ +#!/bin/ksh + +alias less="\less -R" +mkcd(){ + mkdir -p $1 + cd $1 +} +uncd(){ + cd $OLDPWD +} +irclog(){ + [ -z $1 ] && ls $HOME/.cache/irclogs && return + [ -f $HOME/.irssi/log2ansi.pl ] && log2ansi=$HOME/.irssi/log2ansi.pl\ --clear + [ -f $HOME/.config/irssi/log2ansi.pl ] && log2ansi=$HOME/.config/irssi/log2ansi.pl\ --clear + echo "$1" | grep '/' >/dev/null && dir=$1 || dir=$HOME/.cache/irclogs/$1 + cat $(find $dir | sed -E 's/(..)-(..)-(..)/\3-\2-\1/g' | sort | sed -E 's/(..)-(..)-(..)/\3-\2-\1/g') | ${log2ansi:-cat}| less +} +alias q="exit" +alias g="git" +alias vsplit="vim -O" +alias split="vim -o" +alias b="git branch" +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 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/" +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 dmake="doas make CC=tcc" +alias nm="export ESCDELAY=5; neomutt" +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/ksh/kshrc b/.config/ksh/kshrc @@ -0,0 +1,51 @@ +#!/bin/ksh + +[ -z $ENV ] && export ENV=$HOME/.profile + +seteditor(){ + command -v $1 >/dev/null && export EDITOR=$1 + set vi +} + + +seteditor vi +seteditor vis +seteditor vim +seteditor nvim + +settitle(){ + # set terminal's title + printf "\033]0;%s\007" "$1" +} + +_ksh_prompt(){ + errorcode=$1 + tput setaf 10 + [ $errorcode -eq 0 ] && tput setaf 15 || tput setaf 10 + printf "%s " $errorcode + tput setaf 5 + printf "%s " $(whoami) + tput setaf 3 + printf "%s" $(git branch 2>/dev/null | grep '^*' | awk '{print $2 "|"}') + git diff 1>/dev/null 2>/dev/null && { + git diff | grep '.' >/dev/null && tput setaf 8 || tput setaf 15 + printf "%s " $(git diff 2>/dev/null | grep -E '^(\+\+\+|---)' | sed -E 's~^[^a]*a/|^[^b]*b/~~' \ + | grep -v /dev/null | uniq | wc -l | tr -d '\n' | grep '.' || printf 0) + } + tput setaf 7 + printf "%s " $(pwd | sed "s-$HOME-~-") + tput setaf 7 + printf "$ " + tput sgr0 +} +PS1="\$(_ksh_prompt \$?)" +PS2="$(tput setaf 7):; $(tput sgr0)" +PS3="$(tput setaf 7):; $(tput sgr0)$(tput el) " +PS4="$(tput setaf 7):; $(tput sgr0)" + +export PS1 PS2 PS3 PS4 + +for f in $HOME/.config/ksh/* +do + [ "$(basename "$f")" != "kshrc" ] && . $f +done diff --git a/.config/ksh/less b/.config/ksh/less @@ -0,0 +1,9 @@ +#!/bin/ksh + +export LESS_TERMCAP_mb=$(printf '\033[1;31m') +export LESS_TERMCAP_md=$(printf '\033[1;35m') +export LESS_TERMCAP_me=$(printf '\033[0m') +export LESS_TERMCAP_so=$(printf '\033[92m') +export LESS_TERMCAP_se=$(printf '\033[0m') +export LESS_TERMCAP_us=$(printf '\033[1;32m') +export LESS_TERMCAP_ue=$(printf '\033[0m') diff --git a/.config/ksh/ls b/.config/ksh/ls @@ -0,0 +1,48 @@ +#!/bin/ksh + +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' ':')"