1 caf6781a 2021-01-06 xhr # sh/ksh initialization
3 caf6781a 2021-01-06 xhr [ -f $HOME/.kshrc.private ] && . $HOME/.kshrc.private
5 caf6781a 2021-01-06 xhr #############################################################################
7 caf6781a 2021-01-06 xhr #############################################################################
9 caf6781a 2021-01-06 xhr if command -v colorls > /dev/null ; then
11 8098ffa8 2022-05-29 xhr export CLICOLOR=1
16 caf6781a 2021-01-06 xhr if [[ $(uname -s) == "Linux" ]]; then
17 caf6781a 2021-01-06 xhr alias ls='ls --color=auto -h --file-type -s'
18 caf6781a 2021-01-06 xhr alias ll='ls -l'
19 caf6781a 2021-01-06 xhr alias rm='rm --preserve-root --one-file-system -I'
20 caf6781a 2021-01-06 xhr alias cps='sync ; cvs up ; sync'
21 caf6781a 2021-01-06 xhr if [ -x /usr/bin/dircolors ]; then
22 caf6781a 2021-01-06 xhr test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
24 caf6781a 2021-01-06 xhr bind -m '^L'=clear'^J'
25 caf6781a 2021-01-06 xhr elif [[ $(uname -s) == "OpenBSD" ]]; then
26 caf6781a 2021-01-06 xhr alias ls='$LS'
27 caf6781a 2021-01-06 xhr alias ll='$LS -Flho'
28 caf6781a 2021-01-06 xhr alias cps='sync ; opencvs up ; sync'
30 caf6781a 2021-01-06 xhr bind '^L'=clear-screen
32 caf6781a 2021-01-06 xhr # Enable SIGINFO with ^T
33 caf6781a 2021-01-06 xhr stty status ^T
34 33ae4ce3 2022-09-08 xhr elif [[ $(uname -s) == "Darwin" ]]; then
35 33ae4ce3 2022-09-08 xhr alias ls='$LS -G'
36 33ae4ce3 2022-09-08 xhr alias ll='$LS -GFlho'
38 33ae4ce3 2022-09-08 xhr bind '^L'=clear-screen
39 33ae4ce3 2022-09-08 xhr export MACPATH=/opt/homebrew/bin/:/opt/homebrew/sbin
40 caf6781a 2021-01-06 xhr elif [[ $(uname -s) == "FreeBSD" ]]; then
41 caf6781a 2021-01-06 xhr alias ls='$LS -G'
42 caf6781a 2021-01-06 xhr alias ll='$LS -GFlho'
44 caf6781a 2021-01-06 xhr bind '^L'=clear-screen
46 caf6781a 2021-01-06 xhr # Enable SIGINFO with ^T
47 caf6781a 2021-01-06 xhr stty status ^T
49 caf6781a 2021-01-06 xhr export TERM=xterm-256color
52 f77246f9 2022-06-01 xhr if [[ $HIGHDPI -eq 1 ]]; then
53 f77246f9 2022-06-01 xhr alias mpv='mpv --no-audio-display --audio-channels=stereo --geometry=50%+1430+300 --sub-scale=0.5'
55 f77246f9 2022-06-01 xhr alias mpv='mpv --no-audio-display --audio-channels=stereo --geometry=50%+950+200 --sub-scale=0.7'
58 6e553973 2022-04-26 xhr alias .2='cds ../..'
59 6e553973 2022-04-26 xhr alias .3='cds ../../..'
60 6e553973 2022-04-26 xhr alias .4='cds ../../../..'
61 caf6781a 2021-01-06 xhr alias j='jump'
62 caf6781a 2021-01-06 xhr alias c='cvs'
63 caf6781a 2021-01-06 xhr alias h='history -60 | sort -k2 | uniq -f2 | sort -bn'
64 caf6781a 2021-01-06 xhr alias sudo='sudo -H'
65 caf6781a 2021-01-06 xhr alias mc='mc --color'
66 caf6781a 2021-01-06 xhr alias pwgen='pwgen -s'
67 07664861 2021-01-19 xhr alias pkg_add='pkg_add -V'
68 caf6781a 2021-01-06 xhr alias dt='dtoggle'
69 caf6781a 2021-01-06 xhr alias tty-clock='tty-clock -s -c'
70 caf6781a 2021-01-06 xhr alias chromium='chromium --disk-cache-dir=/tmp'
71 caf6781a 2021-01-06 xhr alias open="xdg-open"
72 caf6781a 2021-01-06 xhr alias ffplay='ffplay -hide_banner'
73 caf6781a 2021-01-06 xhr alias gps='sync ; git pull ; sync'
74 caf6781a 2021-01-06 xhr alias cal='cal -m -w'
75 caf6781a 2021-01-06 xhr alias ed='ed -p*'
76 caf6781a 2021-01-06 xhr alias qw='pkill -9 xidle'
77 caf6781a 2021-01-06 xhr alias cc='cc -fdiagnostics-color'
78 caf6781a 2021-01-06 xhr alias weather='curl http://wttr.in/Karlsruhe'
79 dd3af197 2022-02-06 xhr alias dig='dig +noall +answer +comment'
80 6223de89 2021-12-10 xhr alias gdb='gdb -q'
81 444bd907 2021-12-28 xhr alias egdb='egdb -q'
83 caf6781a 2021-01-06 xhr #############################################################################
85 caf6781a 2021-01-06 xhr #############################################################################
87 caf6781a 2021-01-06 xhr # Following three functions from "shell FU by Isaac Levy" presentation
88 caf6781a 2021-01-06 xhr yell() { echo "$0: $*" >&2; }
89 caf6781a 2021-01-06 xhr die() { yell "$*"; exit 111; }
90 caf6781a 2021-01-06 xhr try() { "$@" || die "cannot $*"; }
92 60ed39b5 2022-01-14 xhr # Quick n dirty hack to generate a RSA key and a X509 cert
93 60ed39b5 2022-01-14 xhr gennewcert() {
94 60ed39b5 2022-01-14 xhr [[ -z "$1" ]] && echo "No alias provided" && return
96 60ed39b5 2022-01-14 xhr openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes \
97 60ed39b5 2022-01-14 xhr -keyout $1.key.pem -new -subj /CN=$1 -out $1.cert.pem \
98 60ed39b5 2022-01-14 xhr -addext subjectAltName=DNS:$1
101 caf6781a 2021-01-06 xhr # Neat trick from https://github.com/lf94/peek-for-tmux/blob/master/README.md
103 caf6781a 2021-01-06 xhr tmux split-window -p 33 more $@ || exit;
107 2a9e5229 2021-06-28 xhr if [ -d ".got" ]; then
114 67c208cf 2021-12-28 xhr enablevideoconf() {
115 67c208cf 2021-12-28 xhr echo "[+] Enable video recording"
116 67c208cf 2021-12-28 xhr doas sysctl kern.video.record=1
117 67c208cf 2021-12-28 xhr echo "[+] Enable audio recording"
118 67c208cf 2021-12-28 xhr doas sysctl kern.audio.record=1
119 67c208cf 2021-12-28 xhr echo "[+] Set mic to mic2"
120 67c208cf 2021-12-28 xhr doas mixerctl record.adc-0:1_source=mic2
121 67c208cf 2021-12-28 xhr echo "[+] Adjust input level"
122 67c208cf 2021-12-28 xhr sndioctl input.level=0.25
125 67c208cf 2021-12-28 xhr disablevideoconf() {
126 67c208cf 2021-12-28 xhr echo "[+] Disable video recording"
127 67c208cf 2021-12-28 xhr doas sysctl kern.video.record=0
128 67c208cf 2021-12-28 xhr echo "[+] Disable audio recording"
129 67c208cf 2021-12-28 xhr doas sysctl kern.audio.record=0
132 51896f71 2021-12-28 xhr # Connect to a vmm(4) VM which uses the "local interface" networking scheme
134 51896f71 2021-12-28 xhr if [ -z "$1" ]; then
135 51896f71 2021-12-28 xhr echo "Usage: vmmssh <name of the vmm VM> [user]"
137 51896f71 2021-12-28 xhr echo "If no user name is provided, root is used"
141 51896f71 2021-12-28 xhr local _user="${2:-root}"
142 51896f71 2021-12-28 xhr local _id=$(vmctl show $1| tail -1 | awk '{ print $1}')
144 51896f71 2021-12-28 xhr if [ "${_id}" = "ID" ]; then
145 51896f71 2021-12-28 xhr echo "No VM named $1 found"
149 cce4ab6c 2021-12-29 xhr ssh -o StrictHostKeyChecking=no -l ${_user} 100.64.${_id}.3
152 caf6781a 2021-01-06 xhr checklatestsnap() {
153 25aece9a 2022-05-29 xhr ftp -MVo- http://172.23.5.36/pub/OpenBSD/snapshots/$(uname -m)/BUILDINFO
154 86642edf 2021-09-22 xhr ftp -MVo- "$(egrep -m 1 "^(ftp|http|https)" /etc/installurl)/snapshots/$(uname -m)/BUILDINFO"
155 86642edf 2021-09-22 xhr ftp -MVo- http://ftp.openbsd.org/pub/OpenBSD/snapshots/$(uname -m)/BUILDINFO
158 caf6781a 2021-01-06 xhr lostandfoundcheck() {
159 fdc3c907 2022-02-22 xhr for mp in $(mount -t ffs | cut -d ' ' -f 3); do
160 caf6781a 2021-01-06 xhr [[ -d ${mp}/lost+found ]] && echo "${mp}/lost+found exists"
165 94be960e 2022-03-30 xhr . $HOME/.kshrc
168 caf6781a 2021-01-06 xhr updatesrc() {
169 540ef4dd 2021-06-26 xhr if [ ! -d "/var/git" ]; then
170 540ef4dd 2021-06-26 xhr local _oldpwd="$PWD"
171 540ef4dd 2021-06-26 xhr cd /usr/src && {
172 540ef4dd 2021-06-26 xhr sync && git pull ; sync
174 540ef4dd 2021-06-26 xhr cd /usr/ports && {
175 540ef4dd 2021-06-26 xhr sync && git pull ; sync
177 540ef4dd 2021-06-26 xhr cd "$_oldpwd"
179 540ef4dd 2021-06-26 xhr local _oldpwd="$PWD"
180 540ef4dd 2021-06-26 xhr cd /var/git/src.git && {
181 540ef4dd 2021-06-26 xhr sync && got fetch; sync
183 003d21e6 2021-07-16 xhr cd /usr/src && {
184 003d21e6 2021-07-16 xhr sync && got up && sync
186 540ef4dd 2021-06-26 xhr cd /var/git/ports.git && {
187 540ef4dd 2021-06-26 xhr sync && got fetch; sync
189 540ef4dd 2021-06-26 xhr cd /usr/ports && {
190 003d21e6 2021-07-16 xhr sync && got up && sync
192 540ef4dd 2021-06-26 xhr cd "$_oldpwd"
196 caf6781a 2021-01-06 xhr updatepkgs() {
197 caf6781a 2021-01-06 xhr local _option="" _args=$1
198 caf6781a 2021-01-06 xhr if [[ -n $(sysctl -n kern.version | cut -d ' ' -f2 | grep beta) ]]; then
199 caf6781a 2021-01-06 xhr _option="-D snap"
202 9ea26640 2021-08-13 xhr sync && doas pkg_add -ui $_option $_args
207 003d21e6 2021-07-16 xhr if [ ! -d /var/pkg_mirror ]; then
208 003d21e6 2021-07-16 xhr doas mkdir /var/pkg_mirror
210 003d21e6 2021-07-16 xhr doas mount_nfs -s -a 4 -T -r 32768 -w 32768 -o noatime,ro,intr mx.xosc.net:/pkg /var/pkg_mirror
211 003d21e6 2021-07-16 xhr doas umount /var/pkg_mirror/
214 caf6781a 2021-01-06 xhr getbsdrd() {
215 caf6781a 2021-01-06 xhr local _mirror="$(egrep -m 1 "^(ftp|http|https)" /etc/installurl)/snapshots/$(uname -m)"
217 caf6781a 2021-01-06 xhr ftp -V -o /tmp/bsd.rd "$_mirror/bsd.rd" || return 1
218 caf6781a 2021-01-06 xhr ftp -V -o /tmp/SHA256.sig "$_mirror/SHA256.sig" || return 1
220 caf6781a 2021-01-06 xhr cd /tmp && signify -C -p "/etc/signify/openbsd-$(uname -r | tr -d '.')-base.pub" -x /tmp/SHA256.sig bsd.rd
223 caf6781a 2021-01-06 xhr getbsdvm() {
224 caf6781a 2021-01-06 xhr local _mirror="$(egrep -m 1 "^(ftp|http|https)" /etc/installurl)/snapshots/$(uname -m)"
226 caf6781a 2021-01-06 xhr ftp -V -o /tmp/bsd "$_mirror/bsd" || return 1
227 caf6781a 2021-01-06 xhr ftp -V -o /tmp/SHA256.sig "$_mirror/SHA256.sig" || return 1
229 caf6781a 2021-01-06 xhr cd /tmp && signify -C -p "/etc/signify/openbsd-$(uname -r | tr -d '.')-base.pub" -x /tmp/SHA256.sig bsd && doas mv /tmp/bsd /bsd.vm
232 caf6781a 2021-01-06 xhr openports() {
233 003d21e6 2021-07-16 xhr local _filter1='internet'
234 003d21e6 2021-07-16 xhr local _filter2='icmp|raw|<-|->'
236 003d21e6 2021-07-16 xhr if [ "$1" = "-4" ]; then
237 003d21e6 2021-07-16 xhr _filter2="internet6|${_filter2}"
238 003d21e6 2021-07-16 xhr elif [ "$1" = "-6" ]; then
239 003d21e6 2021-07-16 xhr _filter1="internet6"
242 003d21e6 2021-07-16 xhr printf "%-10s %-13s %-5s %-5s %-9s %s\n" "USER" "COMMAND" "PID" "PROTO" "FAMILY" "LOCAL ADDRESS"
243 003d21e6 2021-07-16 xhr fstat | grep "${_filter1}" | grep -vE "${_filter2}" | awk '{ printf("%-10s %-13s %5s %-5s %-9s %s\n", $1,$2,$3,$7,$5,$9); }' | sort -u
247 caf6781a 2021-01-06 xhr local pt="/usr/ports"
249 caf6781a 2021-01-06 xhr [[ -z ${1} ]] && echo "Need a keyword to search for" && return
250 caf6781a 2021-01-06 xhr [[ ! -d ${pt} ]] && echo "Cannot find ports tree" && return
252 caf6781a 2021-01-06 xhr cd ${pt} && make search name=${1}
256 caf6781a 2021-01-06 xhr # The following is only needed on WSL not on other OSes
257 caf6781a 2021-01-06 xhr [ -f "/proc/version" ] && grep -qE "(Microsoft|WSL)" /proc/version 2> /dev/null
258 caf6781a 2021-01-06 xhr if [ $? -eq 0 ]; then
259 5ff5ff72 2022-06-02 xhr /usr/bin/keychain -q --nogui $HOME/.ssh/id_ed25519
263 caf6781a 2021-01-06 xhr # Find all public keys...
264 caf6781a 2021-01-06 xhr for i in $(find $HOME/.ssh/ -maxdepth 1 -name "*.pub"); do
265 caf6781a 2021-01-06 xhr # ... and strip the .pub suffix
266 caf6781a 2021-01-06 xhr _key=`echo $i | sed -e 's/\.pub//'`
267 caf6781a 2021-01-06 xhr command ssh-add $_key
271 caf6781a 2021-01-06 xhr cvspsdiff() {
272 caf6781a 2021-01-06 xhr [ -z "$1" ] && return
273 caf6781a 2021-01-06 xhr cvsps -q -s "$1" -g | cdiff
277 f0843204 2021-04-21 xhr ps aux | grep "$@" | grep -v "grep $@"
280 83809fd3 2021-05-05 xhr qrcodegen() {
281 83809fd3 2021-05-05 xhr # Idea from https://dataswamp.org/~solene/2021-03-25-computer-to-phone-text.html
282 83809fd3 2021-05-05 xhr xclip -o | qrencode -o - > ~/qrclip.png && sxiv -g 600x600 ~/qrclip.png && rm ~/qrclip.png
286 caf6781a 2021-01-06 xhr test -z "$1" && cd $HOME && ls -lh && return
287 caf6781a 2021-01-06 xhr cd "$1" && ls -lah
290 caf6781a 2021-01-06 xhr pkg_search() {
291 1125314c 2022-01-03 xhr pkglocate "$1" | cut -d ':' -f 1 | sort -u | fzf
295 caf6781a 2021-01-06 xhr [[ -n $1 ]] || return 0
296 caf6781a 2021-01-06 xhr [[ -d $1 ]] || mkdir -p "$1"
297 caf6781a 2021-01-06 xhr [[ -d $1 ]] && builtin cd "$1"
301 caf6781a 2021-01-06 xhr curl -OL --compressed "$@"
304 caf6781a 2021-01-06 xhr showwifi() {
305 caf6781a 2021-01-06 xhr ifconfig | grep ieee | awk {'print $3'}
308 caf6781a 2021-01-06 xhr # Show infos about my external IP address
309 caf6781a 2021-01-06 xhr showmyipaddress() {
310 caf6781a 2021-01-06 xhr echo "My external IPv4 : $(ftp -4 -M -o - http://icanhazip.com 2> /dev/null)"
311 caf6781a 2021-01-06 xhr echo "My external IPv6 : $(ftp -6 -M -o - http://icanhazip.com 2> /dev/null)"
312 caf6781a 2021-01-06 xhr echo "My external PTR : $(ftp -M -o - http://icanhazptr.com 2> /dev/null)"
316 caf6781a 2021-01-06 xhr echo "scale=3;$@" | bc -l
319 377cb53e 2021-10-28 matthias. # Copied from https://github.com/agkozak/polyglot/ MIT license
320 377cb53e 2021-10-28 matthias. _polyglot_branch_status() {
321 377cb53e 2021-10-28 matthias. POLYGLOT_REF="$(env git symbolic-ref --quiet HEAD 2> /dev/null)"
322 377cb53e 2021-10-28 matthias. case $? in # See what the exit code is.
323 377cb53e 2021-10-28 matthias. 0) ;; # $POLYGLOT_REF contains the name of a checked-out branch.
324 377cb53e 2021-10-28 matthias. 128) return ;; # No Git repository here.
325 377cb53e 2021-10-28 matthias. # Otherwise, see if HEAD is in a detached state.
326 377cb53e 2021-10-28 matthias. *) POLYGLOT_REF="$(env git rev-parse --short HEAD 2> /dev/null)" || return ;;
329 377cb53e 2021-10-28 matthias. if [ -n "$POLYGLOT_REF" ]; then
330 377cb53e 2021-10-28 matthias. if [ "${POLYGLOT_SHOW_UNTRACKED:-1}" -eq 0 ]; then
331 377cb53e 2021-10-28 matthias. POLYGLOT_GIT_STATUS=$(LC_ALL=C GIT_OPTIONAL_LOCKS=0 env git status -uno 2>&1)
333 377cb53e 2021-10-28 matthias. POLYGLOT_GIT_STATUS=$(LC_ALL=C GIT_OPTIONAL_LOCKS=0 env git status 2>&1)
336 377cb53e 2021-10-28 matthias. POLYGLOT_SYMBOLS=''
338 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
339 377cb53e 2021-10-28 matthias. *' have diverged,'*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}&*" ;;
341 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
342 377cb53e 2021-10-28 matthias. *'Your branch is behind '*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}&" ;;
344 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
345 377cb53e 2021-10-28 matthias. *'Your branch is ahead of '*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}*" ;;
347 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
348 377cb53e 2021-10-28 matthias. *'new file: '*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}+" ;;
350 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
351 377cb53e 2021-10-28 matthias. *'deleted: '*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}x" ;;
353 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
354 377cb53e 2021-10-28 matthias. *'modified: '*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}!!" ;;
356 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
357 377cb53e 2021-10-28 matthias. *'renamed: '*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}->" ;;
359 377cb53e 2021-10-28 matthias. case $POLYGLOT_GIT_STATUS in
360 377cb53e 2021-10-28 matthias. *'Untracked files:'*) POLYGLOT_SYMBOLS="${POLYGLOT_SYMBOLS}?" ;;
363 377cb53e 2021-10-28 matthias. [ -n "$POLYGLOT_SYMBOLS" ] && POLYGLOT_SYMBOLS=" $POLYGLOT_SYMBOLS"
365 377cb53e 2021-10-28 matthias. printf ' (%s%s)' "${POLYGLOT_REF#refs/heads/}" "$POLYGLOT_SYMBOLS"
368 377cb53e 2021-10-28 matthias. unset POLYGLOT_REF POLYGLOT_GIT_STATUS POLYGLOT_SYMBOLS
372 caf6781a 2021-01-06 xhr local _pf=${1:-/etc/pf.conf}
373 caf6781a 2021-01-06 xhr doas pfctl -n -f ${_pf} && doas pfctl -F rules && doas pfctl -f ${_pf}
376 caf6781a 2021-01-06 xhr # Disable history logging for this shell
377 caf6781a 2021-01-06 xhr nohistory() {
378 caf6781a 2021-01-06 xhr HISTFILE=/dev/null
382 caf6781a 2021-01-06 xhr TOG_COLORS=1 TERM=xterm /usr/local/bin/tog "$@"
385 caf6781a 2021-01-06 xhr # http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-filesystem-from-the-command-line.html
387 caf6781a 2021-01-06 xhr export MARKPATH=$HOME/.marks
389 caf6781a 2021-01-06 xhr cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1"
392 caf6781a 2021-01-06 xhr mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$1"
395 caf6781a 2021-01-06 xhr rm -i "$MARKPATH/$1"
398 caf6781a 2021-01-06 xhr ls -l "$MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
401 caf6781a 2021-01-06 xhr #############################################################################
402 caf6781a 2021-01-06 xhr # COMPLETIONS
403 caf6781a 2021-01-06 xhr #############################################################################
405 caf6781a 2021-01-06 xhr # Mostly copied from
406 caf6781a 2021-01-06 xhr # https://github.com/qbit/dotfiles/blob/master/common/dot_ksh_completions
408 caf6781a 2021-01-06 xhr if [ -d ~/.password-store ]; then
409 caf6781a 2021-01-06 xhr PASS_LIST=$(
410 caf6781a 2021-01-06 xhr cd ~/.password-store
411 caf6781a 2021-01-06 xhr find . -type f -name \*.gpg | sed 's/^\.\///' | sed 's/\.gpg$//g'
414 caf6781a 2021-01-06 xhr set -A complete_tpm_1 -- $PASS_LIST usage
415 caf6781a 2021-01-06 xhr set -A complete_tpm_2 -- $PASS_LIST edit insert show rm
418 caf6781a 2021-01-06 xhr set -A complete_kill_1 -- -9 -HUP -INFO -KILL -TERM
420 caf6781a 2021-01-06 xhr set -A complete_ifconfig_1 -- $(ifconfig | grep ^[a-z] | cut -d: -f1)
422 caf6781a 2021-01-06 xhr if [ -d /var/db/pkg ]; then
423 caf6781a 2021-01-06 xhr PKG_LIST=$(/bin/ls -1 /var/db/pkg)
424 caf6781a 2021-01-06 xhr set -A complete_pkg_info -- $PKG_LIST
426 c5a18514 2021-04-21 xhr alias dpkgdel="doas pkg_delete"
427 c5a18514 2021-04-21 xhr set -A complete_dpkgdel_1 -- $PKG_LIST
430 ff408f72 2021-06-17 matthias. # relayctl completion. Second level only for 'show'
431 ff408f72 2021-06-17 matthias. set -A complete_relayctl_1 -- monitor show load poll reload stop redirect table host log
432 ff408f72 2021-06-17 matthias. set -A complete_relayctl_2 -- summary hosts redirects relays routers sessions
434 ff408f72 2021-06-17 matthias. set -A complete_unwindctl_1 -- reload log status
436 caf6781a 2021-01-06 xhr if [ -d /etc/rc.d ]; then
437 55fd2977 2021-04-21 xhr RCD_LIST=$(/bin/ls /etc/rc.d)
438 55fd2977 2021-04-21 xhr set -A complete_rcctl_1 -- get getdef set check reload restart stop start disable enable order ls
439 55fd2977 2021-04-21 xhr set -A complete_rcctl_2 -- $RCD_LIST
441 caf6781a 2021-01-06 xhr alias drcctl="doas rcctl"
442 caf6781a 2021-01-06 xhr set -A complete_drcctl_1 -- get getdef set check reload restart stop start disable enable order ls
443 55fd2977 2021-04-21 xhr set -A complete_drcctl_2 -- $RCD_LIST
446 caf6781a 2021-01-06 xhr set -A complete_tarsnap_1 -- --list-archives --print-stats --fsck --fsck-prune --nuke --verify-config --version --checkpoint-bytes --configfile --dry-run --exclude --humanize-numbers --keyfile --totals
448 3922435f 2021-12-05 xhr set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
450 caf6781a 2021-01-06 xhr # /tmp/.man-list is generated upon boot by /etc/rc.local with
451 caf6781a 2021-01-06 xhr # find /usr/share/man/ -type f | sed -e 's/.*\///' -e 's/\.[0-9]//' | sort -u
452 caf6781a 2021-01-06 xhr [[ -f /tmp/.man-list ]] && set -A complete_man -- $(cat /tmp/.man-list)
454 caf6781a 2021-01-06 xhr [[ -d $HOME/.marks ]] && set -A complete_j -- $(/bin/ls $HOME/.marks)
456 caf6781a 2021-01-06 xhr #############################################################################
458 caf6781a 2021-01-06 xhr #############################################################################
460 3329c032 2022-05-29 xhr _error_code() {
461 3329c032 2022-05-29 xhr local _temp=$?
462 3329c032 2022-05-29 xhr if [ $_temp -ne 0 ]; then
463 3329c032 2022-05-29 xhr echo -n "\033[38;5;1m [$_temp]\033[m"
467 caf6781a 2021-01-06 xhr if [ -z "$SSH_CLIENT" ]; then
468 caf6781a 2021-01-06 xhr PS1_TRENNER="!!"
470 caf6781a 2021-01-06 xhr PS1_TRENNER="@"
473 caf6781a 2021-01-06 xhr if [[ $(id -u) -eq 0 ]]; then
474 caf6781a 2021-01-06 xhr PS1='\h$PS1_TRENNER\\033[0;101m\u\\033[0m \w [$?]\n\$ '
475 957edac5 2022-06-02 xhr elif [[ $(whoami) = "xhr" ]] || [[ $(whoami) = "matthiaschmidt" ]]; then
476 3329c032 2022-05-29 xhr PS1='\h \w$(_polyglot_branch_status)$(_error_code) \033[38;5;11m\$\033[m '
478 377cb53e 2021-10-28 matthias. PS1='\h$PS1_TRENNER\u \w$(_polyglot_branch_status) [$?]\n\$ '
481 caf6781a 2021-01-06 xhr #############################################################################
482 5f9e8be1 2021-07-16 xhr # MISC SETTINGS
483 5f9e8be1 2021-07-16 xhr #############################################################################
485 5f9e8be1 2021-07-16 xhr set bell-style none
487 5f9e8be1 2021-07-16 xhr #############################################################################
489 caf6781a 2021-01-06 xhr #############################################################################
491 5ff5ff72 2022-06-02 xhr [ -d $HOME/.keychain ] && . $HOME/.keychain/LWKA-6Q7VRN2-sh
493 caf6781a 2021-01-06 xhr LSCOLORS=Dxfxcxdxbxegedabagacad
494 3012dead 2022-01-30 xhr HISTSIZE=30000
495 caf6781a 2021-01-06 xhr HISTFILE=$HOME/.sh_history
496 6e9de349 2021-07-16 xhr HISTCONTROL=ignoredups:ignorespace
498 33ae4ce3 2022-09-08 xhr PATH=$HOME/Documents/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:$MACPATH
499 caf6781a 2021-01-06 xhr LESSSECURE=1
500 caf6781a 2021-01-06 xhr PAGER='less -JWAceX'
502 25aece9a 2022-05-29 xhr PKG_PATH=http://172.23.5.36/pub/OpenBSD/%c/packages/%a:http://ftp.hostserver.de/pub/OpenBSD/%c/packages/%a
504 291deb6d 2022-01-16 xhr # better two-finger touchpad scrolling
505 291deb6d 2022-01-16 xhr export MOZ_USE_XINPUT2=1
506 291deb6d 2022-01-16 xhr # opengl acceleration
507 291deb6d 2022-01-16 xhr export MOZ_ACCELERATED=1
508 291deb6d 2022-01-16 xhr # force webrender to enable
509 291deb6d 2022-01-16 xhr export MOZ_WEBRENDER=1
511 003d21e6 2021-07-16 xhr export PATH HOME TERM LSCOLORS HISTSIZE BLOCKSIZE PAGER LESSSECURE PKG_PATH FETCH_CMD