small pixel drawing of a pufferfish dotfiles

Add .rc
Jes Olson jolson@digitalocean.com
Mon, 25 Oct 2021 10:40:48 -0500
commit

101d320e9bb069cb4b8086863eac4db895efb291

parent

dfe596bb194b1d393516f1706d3f67b2645b96a2

1 files changed, 62 insertions(+), 0 deletions(-)

jump to
A .rc

@@ -0,0 +1,62 @@

+#!/bin/sh + +PS1='$(prompt) \$ ' + +# make history infinite, dedup'd, and sync'd between terms +HISTFILESIZE=infinite +HISTCONTROL=ignoredups:erasedups +shopt -s histappend +PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" + +# extend pa for git stuffs +# meh i don't like this at all tbh +pa() { + case $1 in + g) + cd "${PA_DIR:=${XDG_DATA_HOME:=$HOME/.local/share}/pa}" + git pull + git add --all + git commit -m '*' + git push + cd - + ;; + + *) + command pa "$@" + ;; + esac +} + +# yep still needed +if ls --version 2>&1 | grep -i gnu > /dev/null +then + alias ls='ls --color=auto ' +elif ls --version 2>&1 | grep -i busybox > /dev/null +then + alias ls='ls --color=auto ' +fi + +if [ -z "${SSH_AGENT_PID}" ] +then + if ! [ -e /tmp/ssh-agent-$USER ] + then + ssh-agent 2>/dev/null >/tmp/ssh-agent-$USER + fi + . /tmp/ssh-agent-$USER >/dev/null +fi + +# launch alacritty with no GPU support if on old thinkpad +# TODO: maybe irrelevant when using foot +if [ "$(hostname)" == 'nyx' ]; then + export LIBGL_ALWAYS_SOFTWARE=1 +fi + +if [ "$(hostname)" == 'nostromo' ]; then + if ! pgrep syncthing &> /dev/null; then + syncthing --no-browser > /dev/null & + fi +fi + +if [ "$TERM" = "alacritty" ]; then + alias ssh='TERM=xterm-256color ssh' +fi