dots

Personal dotfiles
git clone git://git.gormless.xyz/dots.git
Log | Files | Refs

profile (3158B)


      1 #!/bin/ksh
      2 # shellcheck disable=SC2164
      3 
      4 set -o vi
      5 
      6 # pkg_purge
      7 # shellcheck disable=SC2015
      8 function pkp {
      9     test -z "$1" && echo "pkg_delete: No packages to delete" || doas pkg_delete "$@"; doas pkg_delete -a
     10 }
     11 
     12 # shellcheck disable=SC2046
     13 export PASSWORD_STORE_DIR="$HOME/var/spm"
     14 
     15 # Tmux management. Credit to roman zolotarev, OpenBSD wizard.
     16 t() { tmux new -DAs 0; }
     17 
     18 m() { stmux 'mus' 'usr/mus' 'cmus'; }
     19 n() { stmux 'new' 'var/newsboat' 'newsboat'; }
     20 w() { stmux 'web' 'var/www'; }
     21 i() { stmux 'irc' 'var/irc' 'weechat'; }
     22 e() { stmux 'ema' 'var/mail' 'mutt'; }
     23 s() { stmux 'ssh' 'var/www' 'ssh anon@8.9.30.198'; }
     24 p() { stmux 'pro' '.' 'profanity'; }
     25 
     26 ##############
     27 # Completion #
     28 ##############
     29 
     30 set -A complete_spm_1 -- add del list search show help
     31 set -A complete_spm_2 -- $(find "$PASSWORD_STORE_DIR" -type f | cut -c "21-$*")
     32 
     33 set -A complete_rcctl_1 -- disable enable get ls order set restart start stop
     34 # shellcheck disable=SC2046
     35 set -A complete_rcctl_2 -- $(rcctl ls all)
     36 
     37 set -A complete_git_1 -- add am archive \
     38 bisect branch bundle \
     39 checkout cherry-pick citool clean clone commit config \
     40 describe diff \
     41 fetch format-patch \
     42 gc grep gui \
     43 init \
     44 log \
     45 merge mv \
     46 notes \
     47 pull push \
     48 range-diff rebase reset restore revert rm \
     49 shortlog show sparse-checkout stash status submodule switch \
     50 tag \
     51 worktree
     52 
     53 # shellcheck disable=SC2046
     54 test "$(id -u)" = 1000 && set -A complete_ssh -- $(cut -f 1 -d " " ~/.ssh/known_hosts)
     55 
     56 # Acme setup
     57 test "$winid" && _cd() { cd "$1" && awd "$1"; } && alias cd=_cd
     58 
     59 ###########
     60 # Aliases #
     61 ###########
     62 
     63 # Package management
     64 alias \
     65 	pka='doas pkg_add' \
     66 	pkd='doas pkg_delete' \
     67 	pki='pkg_info' \
     68 	pkl='pkg_locate' \
     69 
     70 # Configuration
     71 alias \
     72 	a='E ~/etc/shell/profile && . ~/etc/shell/profile' \
     73 	abook='abook -C $HOME/etc/abook/abookrc --datafile $HOME/var/abook/addressbook' \
     74 	newsboat='newsboat -C $HOME/etc/newsboat/config -u $HOME/etc/newsboat/urls' \
     75 	vdwm='v ~/usr/src/dwm/config.h' \
     76 	vst='v ~/usr/src/st/config.h'
     77 
     78 # Mounting
     79 alias \
     80 	mtp='doas simple-mtpfs --device 1 /mnt/mtp -o uid=1000 -o gid=1000 -o allow_other' \
     81 	ddrive='doas mount /dev/sd1c /mnt/ddrive'
     82 
     83 # Devour
     84 alias \
     85 	firefox='devour firefox' \
     86 	iridium='devour iridium'
     87 
     88 # Misc
     89 alias \
     90 	chok='chocolate-doom' \
     91 	cp='cp -v' \
     92 	blood='cd $HOME/usr/games/blood; nblood' \
     93 	duke='cd $HOME/usr/games/duke; eduke32' \
     94 	deemix='deemix -b flac' \
     95 	drawterm='cpu=192.168.2.88 auth=192.168.2.88 USER=glenda drawterm' \
     96 	gpg='gpg2' \
     97 	ls='ls -F' \
     98 	ll='ls -hFl' \
     99 	mv='mv -v' \
    100 	newtor='doas rcctl restart tor' \
    101 	office='spm show office/school' \
    102 	pipdate="pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U" \
    103 	rm='rm -v' \
    104 	s='devour' \
    105 	sxh='sxhkd >/dev/null &' \
    106 	trem='doas -u _transmission transmission-remote' \
    107 	wait='sleep' \
    108 	wireless='doas wireless'
    109 
    110 # Environment variables
    111 export DOOMWADDIR="/usr/local/share/doom"
    112 export NOTMUCH_CONFIG="$HOME/etc/notmuch/notmuch-config"
    113 export GAP="8"
    114 export MASTER="960"
    115 export ACTIVE="0xd79921"
    116 export INACTIVE="0xa89984"
    117 export DOOMDIR="$HOME/etc/doom"
    118 export PASSWORD_STORE_KEY=mitch@mitchtaylor.xyz
    119 export GOPATH=/home/mitch/usr/src/go