summaryrefslogtreecommitdiff
path: root/.kshrc
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.net>2022-05-07 16:54:20 -0500
committertslil clingman <tslil@posteo.net>2022-05-07 16:55:06 -0500
commitf79dd5703a5ad0fa6aee8a77ed5e0bb18d1486e6 (patch)
treeaa4081d8b91ab835a9f75041ff4d723f1afac926 /.kshrc
parentf3d83f50ead34b1ec11e5f3ca27b4e229f867546 (diff)
Fixed setting titles for screen at least
Diffstat (limited to '.kshrc')
-rw-r--r--.kshrc58
1 files changed, 58 insertions, 0 deletions
diff --git a/.kshrc b/.kshrc
new file mode 100644
index 0000000..e3c6ae3
--- /dev/null
+++ b/.kshrc
@@ -0,0 +1,58 @@
+generate_prompt() {
+ local e=$?; local r=""; (( $e )) && r="<$e>";
+ local p=$(echo ${PWD:-?} | sed "s#$HOME#~#;s#.*/\(.*\)/\(.*\)#\1/\2#"); #${PWD##*/}
+ local d=$(date +"%H.%M");
+ local v=$(vcs);
+ echo -n "[$p]($d)$r$v\$ ";
+ # Display PWD
+ case ${TERM} in
+ foot*|tmux*)
+ printf '\033]0;%s:%s\007' "${USER}" "$p";;
+ screen*)
+ printf '\ek%s:%s\e\\\\' "${USER}" "$p";;
+ esac
+ return $e
+}
+
+PS1='$(generate_prompt)'
+
+PS4='[$EPOCHREALTIME]'
+
+alias rm='rm -i'
+alias ls='ls --group-directories-first -vhF --color=always'
+alias hh='cd $HOME'
+alias bk='cd $OLDPWD'
+#alias t="date +%H\ %M\ %S | dc -e '6k???86400/r1440/+r24/+p'"
+
+alias ..='cd ..'
+alias ...='cd ../..'
+alias ....='cd ../../..'
+alias .....='cd ../../../..'
+alias ......='cd ../../../../..'
+
+alias lower="tr '[:upper:]' '[:lower:]'"
+alias upper="tr '[:lower:]' '[:upper:]'"
+alias rot13="tr abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM"
+alias weather="curl -s wttr.in/Baltimore?m | less"
+
+alias vpn_up='doas wg-quick up us-va1'
+alias vpn_down='doas wg-quick down us-va1'
+alias vpn_check='curl -s https://www.ivpn.net | grep "span class=\"label\"" | cut -d\> -f2'
+
+mvf() { mv $*; cd $_ ;}
+c() { echo 'scale=13;' $* | bc -l; }
+j() { ce $*; cd `head -n 1 $HOME/.local/share/dir_lst`; }
+hd() { hexdump -e '"%08.8_ax " 8/1 "%02X " " - " 8/1 "%02X "' -e '" |" "%_p"' -e '"|\n"' "$@"; }
+mkpw() { cat /dev/urandom | tr -dc "[:print:]" | fold -w `[[ "$2" == "" ]] && echo 16 || echo $2` | head -n `[[ "$1" == "" ]] && echo 1 || echo "$1"` ;}
+
+stty -ixon
+
+set -o emacs
+#set -o utf8-mode
+
+. $HOME/.ssh-agent
+export GPG_TTY=$(tty)
+
+#if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" == "1" ] ; then
+# startx -- -keeptty
+#fi;