From e3ca31f1f825c5737c81dd415e51f63cbf6cc451 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Sat, 18 Dec 2021 19:14:26 -0500 Subject: [PATCH] Add bash. --- bash/bash_profile | 82 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 bash/bash_profile diff --git a/bash/bash_profile b/bash/bash_profile new file mode 100644 index 0000000..8f2920a --- /dev/null +++ b/bash/bash_profile @@ -0,0 +1,82 @@ +# Activate Guix extra profiles. +for i in ~/.guix-extra-profiles/*; do + profile=$i/$(basename "$i") + if [ -f "$profile"/etc/profile ]; then + GUIX_PROFILE="$profile" + source "$profile"/etc/profile + fi + if [ -d "$profile"/etc/xdg ]; then + export XDG_CONFIG_DIRS="$profile"/etc/xdg:$XDG_CONFIG_DIRS + fi + if [ -d "$profile"/share ]; then + export XDG_DATA_DIRS="$profile"/share:$XDG_DATA_DIRS + fi + if [ -d "$profile"/share/man ]; then + export MANPATH="$profile"/share/man:$MANPATH + fi + if [ -d "$profile"/share/info ]; then + export INFOPATH="$profile"/share/info:$INFOPATH + fi + unset profile +done + +# Activate Nix profile. +if [ -f /run/current-system/profile/etc/profile.d/nix.sh ]; then + source /run/current-system/profile/etc/profile.d/nix.sh +fi +if [ -d "$HOME"/.nix-profile ]; then + profile=$HOME/.nix-profile + if [ -d "$profile"/etc/xdg ]; then + export XDG_CONFIG_DIRS="$profile"/etc/xdg:$XDG_CONFIG_DIRS + fi + if [ -d "$profile"/share ]; then + export XDG_DATA_DIRS="$profile"/share:$XDG_DATA_DIRS + fi + if [ -d "$profile"/share/man ]; then + export MANPATH="$profile"/share/man:$MANPATH + fi + if [ -d "$profile"/share/info ]; then + export INFOPATH="$profile"/share/info:$INFOPATH + fi + unset profile +fi + +# Activate Flatpak profile. +if [ -d "$HOME"/.local/share/flatpak/exports ]; then + flatpak=$HOME/.local/share/flatpak/exports + if [ -d "$flatpak"/bin ]; then + export PATH="$flatpak"/bin:$PATH + fi + if [ -d "$flatpak"/share ]; then + export XDG_DATA_DIRS="$flatpak"/share:$XDG_DATA_DIRS + fi + unset flatpak +fi + +# Ammend PATH. +if [ -d "$HOME"/.bin ]; then + export PATH="$HOME/.bin:$PATH" +fi + +# Set default text editor. +export VISUAL=nano + +# GnuPG +## Set GPG TTY. +export GPG_TTY=$(tty) +## Set SSH to use gpg-agent. +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" +fi + +# Start Shepherd-User-Services. +if [[ ! -S ${XDG_RUNTIME_DIR-HOME/.cache}/shepherd/socket ]]; then + shepherd +fi + +# Start X display server. +if [ -z $DISPLAY ] && [ "${XDG_VTNR}" -eq 2 ]; then + exec xinit +fi +