2022-12-04 22:59:34 +01:00
|
|
|
# ksh environment file
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# ENVIRONMENT VARIABLES
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
### SEARCH PATHS
|
2023-02-16 10:12:03 +01:00
|
|
|
PATH=~/.bin\
|
2022-12-04 22:59:34 +01:00
|
|
|
:/bin\
|
|
|
|
:/sbin\
|
|
|
|
:/usr/bin\
|
|
|
|
:/usr/sbin\
|
|
|
|
:/usr/local/bin\
|
|
|
|
:/usr/local/sbin\
|
|
|
|
:/usr/X11R6/bin\
|
2024-02-14 11:08:37 +01:00
|
|
|
:/usr/ports/infrastructure/bin\
|
|
|
|
:/opt/homebrew/bin
|
2022-12-04 22:59:34 +01:00
|
|
|
export PATH
|
|
|
|
|
|
|
|
### LANGUAGE
|
|
|
|
LANG=en_US.UTF-8
|
|
|
|
LC_MESSAGES=C
|
|
|
|
LC_NUMERIC=C
|
2023-11-19 08:40:50 +01:00
|
|
|
LC_TIME=de_DE.UTF-8
|
2024-02-14 07:54:31 +01:00
|
|
|
export LANG LC_MESSAGES LC_NUMERIC LC_TIME
|
2022-12-04 22:59:34 +01:00
|
|
|
|
2023-10-24 16:14:42 +02:00
|
|
|
### SOFTWARE PREFERENCES
|
|
|
|
EDITOR="vim"
|
|
|
|
VISUAL="vim"
|
2024-01-24 08:07:09 +01:00
|
|
|
BROWSER="chrome"
|
2023-10-24 16:14:42 +02:00
|
|
|
PAGER="less"
|
|
|
|
export EDITOR VISUAL BROWSER PAGER
|
|
|
|
|
2023-11-01 16:08:10 +01:00
|
|
|
PRINTER="rp"
|
|
|
|
export PRINTER
|
|
|
|
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
# STOP HERE IF NON INTERACTIVE
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
[[ $- != *i* ]] && return
|
|
|
|
|
|
|
|
########################################################################
|
2024-02-14 07:54:31 +01:00
|
|
|
# INTERACTIVE ENVIRONMENT
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
|
|
|
|
### HISTORY
|
|
|
|
HISTCONTROL=ignoredups:ignorespace:erasedups
|
|
|
|
HISTFILE=$HOME/.ksh-history
|
|
|
|
HISTSIZE=2000
|
|
|
|
export HISTCONTROL HISTFILE HISTSIZE
|
|
|
|
|
|
|
|
# LESS
|
2023-01-10 22:18:46 +01:00
|
|
|
LESS="-giJmR--tilde"
|
2022-12-04 22:59:34 +01:00
|
|
|
LESSHISTFILE="$HOME/.less-history"
|
|
|
|
export LESS LESSHISTFILE
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# SHELL SETTINGS
|
|
|
|
########################################################################
|
|
|
|
|
|
|
|
ulimit -c 0
|
|
|
|
stty -ixon -ixoff
|
|
|
|
set -o emacs
|
|
|
|
set bell-style none
|
|
|
|
|
|
|
|
########################################################################
|
2024-02-14 07:54:31 +01:00
|
|
|
# LOAD LOCAL ADDITIONS
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
[ -f ~/.ksh.local ] && . ~/.ksh.local
|
|
|
|
[ -f ~/.ksh.complete ] && . ~/.ksh.complete
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# PROMPT
|
|
|
|
########################################################################
|
2023-01-13 13:46:11 +01:00
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
C1="\[$(tput setaf 241)\]" # gray
|
|
|
|
C2="\[$(tput setaf 37)\]" # green
|
|
|
|
C0="\[$(tput op)\]" # reset
|
|
|
|
x=$(echo -e \\001) # hack from ksh(1)
|
2024-01-24 08:10:00 +01:00
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
[ $(id -u) -eq 0 ] \
|
|
|
|
&& C2="\[$(tput setaf 196)\]" # gray
|
2024-01-24 08:10:00 +01:00
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
PS1="${C1}[${C2}\h${C1}](${C2}\${?}${C1})(${C2}\w${C1})\$ ${C0}"
|
2024-01-19 22:17:16 +01:00
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
# PS1="\\$ "
|
2024-01-01 13:48:13 +01:00
|
|
|
|
|
|
|
########################################################################
|
2024-02-14 07:54:31 +01:00
|
|
|
# ALIASES
|
2024-01-01 13:48:13 +01:00
|
|
|
########################################################################
|
2022-12-04 22:59:34 +01:00
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
# config files
|
|
|
|
alias kshrc="vim ~/.kshrc"
|
|
|
|
alias muttrc="vim ~/.mutt/rc-common"
|
|
|
|
alias vimrc="vim ~/.vim/vimrc"
|
|
|
|
alias luakitrc="vim ~/.config/luakit/rc.lua"
|
|
|
|
alias spectrwmrc="vim ~/.config/spectrwm/spectrwm.conf"
|
|
|
|
alias vifmrc="vim ~/.config/vifm/vifmrc"
|
|
|
|
|
|
|
|
# task warrior
|
|
|
|
alias t=task
|
|
|
|
alias ta="task add"
|
|
|
|
alias tm="task mod"
|
|
|
|
|
|
|
|
# social media
|
|
|
|
alias tuta="tut -u 'sh@bsd.network uugrn@chaos.social'"
|
|
|
|
|
|
|
|
# servers
|
|
|
|
alias x="ssh -t sdk@home.codevoid.de tmux -u at \|\| tmux"
|
|
|
|
|
|
|
|
alias myps="ps -fU sdk"
|
|
|
|
|
|
|
|
alias portroach="portroach-cli -m codevoid"
|
|
|
|
|
|
|
|
alias ugrep="\ugrep -nI --exclude=tags --exclude=.tags --exclude='cscope.*'"
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# AMUSED
|
|
|
|
########################################################################
|
|
|
|
alias amused-next="_amused_cmd next"
|
|
|
|
alias amused-prev="_amused_cmd prev"
|
|
|
|
alias amused-play="_amused_cmd play"
|
|
|
|
alias amused-stop="_amused_cmd stop"
|
|
|
|
alias amused+="_amused_cmd seek +15"
|
|
|
|
alias amused-="_amused_cmd seek -15"
|
|
|
|
alias amused-jump="_amused_jump"
|
|
|
|
alias amused-shuffle="amused show | sort -R | amused load"
|
|
|
|
alias amused-sort="amused show | sort -h | amused load"
|
|
|
|
|
|
|
|
_amused_cmd() {
|
|
|
|
. ~/.bin/_config
|
|
|
|
amused "${@}" 2>&1 > /dev/null
|
|
|
|
STATUS="$(amused status | head -1 | cut -d'/' -f5-)"
|
|
|
|
NOTIFY_CMD "$STATUS"
|
|
|
|
echo "$@: $STATUS"
|
|
|
|
}
|
2022-12-04 22:59:34 +01:00
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
_amused_jump() {
|
|
|
|
S="$(echo "$(amused show | cut -d'/' -f5-)" | sort -h | fzf -i -e)"
|
|
|
|
[ ! -z "$S" ] \
|
|
|
|
&& _amused_cmd jump "$S"
|
|
|
|
}
|
2022-12-04 22:59:34 +01:00
|
|
|
|
|
|
|
########################################################################
|
2024-02-14 07:54:31 +01:00
|
|
|
# EMAIL HANDLING
|
2022-12-04 22:59:34 +01:00
|
|
|
########################################################################
|
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
# mailboxes
|
|
|
|
MUTT_HOST="imaps://mail.codevoid.de"
|
|
|
|
|
|
|
|
# account aliases
|
|
|
|
alias mutt-acc-gmx="\mutt -F $HOME/.mutt/rc-account-gmx"
|
|
|
|
alias mutt-acc-priv="\mutt -F $HOME/.mutt/rc-account-private"
|
|
|
|
alias mutt-acc-work="\mutt -F $HOME/.mutt/rc-account-work"
|
|
|
|
alias mutt-acc-offl="\mutt -F $HOME/.mutt/rc-account-offline"
|
|
|
|
alias mutt-acc-mborg="\mutt -F $HOME/.mutt/rc-account-mborg"
|
|
|
|
alias mutt-acc-uugrn="\mutt -F $HOME/.mutt/rc-account-uugrn"
|
|
|
|
|
|
|
|
# default
|
|
|
|
alias mutt="mutt-acc-priv"
|
|
|
|
alias muttopen="\mutt -F ~/.mutt/rc-common -f"
|
|
|
|
|
|
|
|
# select mailbox
|
|
|
|
mutt-textmail() { mutt-acc-priv -f $MUTT_HOST/Mailboxes/textmail.me/$1; }
|
|
|
|
mutt-codevoid() { mutt-acc-priv -f $MUTT_HOST/Mailboxes/codevoid.de/sh+$1; }
|
|
|
|
|
|
|
|
# shortcuts
|
|
|
|
alias mutt-all="mutt -f $MUTT_HOST/Virtual/ALL"
|
|
|
|
alias mutt-last-day="mutt -f $MUTT_HOST/Virtual/LAST_DAY"
|
|
|
|
alias mutt-last-week="mutt -f $MUTT_HOST/Virtual/LAST_WEEK"
|
|
|
|
alias mutt-last-month="mutt -f $MUTT_HOST/Virtual/LAST_MONTH"
|
|
|
|
alias mutt-last-year="mutt -f $MUTT_HOST/Virtual/LAST_YEAR"
|
|
|
|
alias mutt-openbsd-all="mutt -f $MUTT_HOST/Virtual/OpenBSD"
|
|
|
|
alias mutt-amazon="mutt-textmail amazon"
|
|
|
|
alias mutt-ccc-intern="mutt-textmail ccc-intern"
|
|
|
|
alias mutt-lieferando="mutt-textmail lieferando"
|
|
|
|
alias mutt-mutt-users="mutt-codevoid mutt-users"
|
|
|
|
alias mutt-openbsd-bugs="mutt-codevoid openbsd-bugs"
|
|
|
|
alias mutt-openbsd-hackers="mutt-codevoid openbsd-hackers"
|
|
|
|
alias mutt-openbsd-misc="mutt-codevoid openbsd-misc"
|
|
|
|
alias mutt-openbsd-ports-bugs="mutt-codevoid openbsd-ports-bugs"
|
|
|
|
alias mutt-openbsd-ports-cvs="mutt-codevoid openbsd-ports-cvs"
|
|
|
|
alias mutt-openbsd-ports="mutt-codevoid openbsd-ports"
|
|
|
|
alias mutt-openbsd-sparc="mutt-codevoid openbsd-sparc"
|
|
|
|
alias mutt-openbsd-src-cvs="mutt-codevoid openbsd-src-cvs"
|
|
|
|
alias mutt-openbsd-tech="mutt-codevoid openbsd-tech"
|
|
|
|
alias mutt-openbsd-x11="mutt-codevoid openbsd-x11"
|
|
|
|
alias mutt-paypal="mutt-textmail paypal"
|
|
|
|
alias mutt-uugrn="mutt-codevoid uugrn"
|
|
|
|
alias mutt-vorstand="mutt-codevoid vorstand"
|
|
|
|
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# PORT TOOLS
|
|
|
|
########################################################################
|
|
|
|
CVSROOT="sdk@cvs.openbsd.org:/cvs"
|
|
|
|
export CVSROOT
|
|
|
|
|
|
|
|
cvs_update_all() {(
|
|
|
|
set -ex
|
|
|
|
cd /usr/src && doas -u sdk cvs -d $CVSROOT -z1 -q up -Pd -A
|
|
|
|
cd /usr/xenocara && doas -u sdk cvs -d $CVSROOT -z1 -q up -Pd -A
|
|
|
|
cd /usr/ports && doas -u sdk cvs -d $CVSROOT -z1 -q up -Pd -A
|
|
|
|
cd /usr/www && doas -u sdk cvs -d $CVSROOT -z1 -q up -Pd -A
|
|
|
|
)}
|
|
|
|
|
|
|
|
po() { cd $(make show=WRKSRC); }
|
|
|
|
pj() {
|
|
|
|
[ -z $1 ] && return 1
|
|
|
|
cd /usr/ports
|
|
|
|
PATTERN="pobj|plist|CVS|locks|packages|distfiles|infrastructure"
|
|
|
|
LIST=$( ls -d1 \
|
|
|
|
*$1* \
|
|
|
|
*/*$1* \
|
|
|
|
mystuff/*$1* \
|
|
|
|
mystuff/*/*$1* \
|
|
|
|
openbsd-wip/*$1* \
|
|
|
|
openbsd-wip/*/*$1* \
|
|
|
|
2>/dev/null \
|
|
|
|
| grep -Ev "$PATTERN" \
|
|
|
|
| sort -u
|
|
|
|
)
|
|
|
|
|
|
|
|
[ $(echo "$LIST" | wc -l) -gt 1 ] \
|
|
|
|
&& cd $(echo "$LIST" | fzf -e -i) \
|
|
|
|
|| cd $LIST
|
2022-12-04 22:59:34 +01:00
|
|
|
}
|
2024-02-14 07:54:31 +01:00
|
|
|
########################################################################
|
|
|
|
# REMIND
|
|
|
|
########################################################################
|
2022-12-04 22:59:34 +01:00
|
|
|
|
2024-02-14 07:54:31 +01:00
|
|
|
alias rem="remind -@1,1,1 -c+cu4 -wt ~sdk/.reminders.rem"
|
|
|
|
alias remy="remind -@1,1,1 -c+cu52 -wt ~sdk/.reminders.rem | less"
|
|
|
|
#alias rem="remind -@1,1,1 -c+3 -g ~sdk/.reminders.rem"
|
|
|
|
#alias remy="remind -cu12 -wt ~sdk/.reminders | less -r"
|
|
|
|
alias rems="remind -n ~sdk/.reminders | sort -n | head -10"
|
|
|
|
alias remc="remindcal ~sdk/.reminders"
|
|
|
|
alias rem-personal="rem-edit personal"
|
|
|
|
alias rem-birthdays="rem-edit birthdays"
|
|
|
|
alias rem-uugrn="rem-edit uugrn"
|
|
|
|
|
|
|
|
rem-edit() {
|
|
|
|
vim sftp://sdk@home.codevoid.de/.reminders/$1.rem
|
|
|
|
scp -q sdk@home.codevoid.de:.reminders/$1.rem ~sdk/.reminders/$1.rem
|
|
|
|
[ "$1" == "uugrn" ] \
|
|
|
|
&& echo "Running ~sdk/.bin/make_calendar.sh" \
|
|
|
|
&& ssh -q sdk@vorstand.uugrn.org sh \
|
|
|
|
~sdk/.bin/make_calendar.sh \
|
|
|
|
|| true
|
|
|
|
}
|