diff options
| author | Simen A. W. Olsen <so@bjerk.io> | 2020-11-21 14:01:35 +0100 |
|---|---|---|
| committer | Simen A. W. Olsen <so@bjerk.io> | 2020-11-21 14:01:35 +0100 |
| commit | decd709def67526c270e37d888693d5ef6dca990 (patch) | |
| tree | 70cdfbd138ce96c96d12ccd0cbbfebc4ba6efea0 /.bashrc | |
| parent | 41e96227e712ce1094c78c7c57d64f5df61b3327 (diff) | |
| download | dotfiles-decd709def67526c270e37d888693d5ef6dca990.tar.gz dotfiles-decd709def67526c270e37d888693d5ef6dca990.zip | |
a bunch of additions
Diffstat (limited to '.bashrc')
| -rwxr-xr-x | .bashrc | 54 |
1 files changed, 54 insertions, 0 deletions
@@ -0,0 +1,54 @@ +#!/bin/bash +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples + +# If not running interactively, don't do anything +case $- in + *i*) ;; + *) return;; +esac + +# Start the gpg-agent if not already running +if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then + gpg-connect-agent /bye >/dev/null 2>&1 +fi +gpg-connect-agent updatestartuptty /bye >/dev/null + +# use a tty for gpg +# solves error: "gpg: signing failed: Inappropriate ioctl for device" +GPG_TTY=$(tty) +export GPG_TTY + +# Set SSH to use gpg-agent +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + if [[ -z "$SSH_AUTH_SOCK" ]] || [[ "$SSH_AUTH_SOCK" == *"apple.launchd"* ]]; then + SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + export SSH_AUTH_SOCK + fi +fi + +# Shell +if [ -z "$SSH_AUTH_SOCK" ] ; then + eval `ssh-agent -s` + /usr/bin/ssh-add -K +fi + +# TODO: Fix /dev/fd/13:type:12979: bad option: -t issue +# source kubectl bash completion +# if hash kubectl 2>/dev/null; then +# # shellcheck source=/dev/null +# source <(kubectl completion bash) +# fi + +# Set Emacs as VISUAL +export VISUAL="emacs" + +for file in ~/.{aliases,path,extras}; do + if [[ -r "$file" ]] && [[ -f "$file" ]]; then + # shellcheck source=/dev/null + source "$file" + fi +done +unset file
\ No newline at end of file |
