dotfiles

shared miscellaneous configuration files between my systems
git clone git://git.eonn.xyz/dotfiles.git
Log | Files | Refs

commit 936cb45f86f269aaa259d24adeaf6396c12260b3
parent ecbc618ef83b80275cda6127d989f14eace7dcde
Author: iressa <ian@eonn.xyz>
Date:   Thu, 20 Jan 2022 00:57:22 -0500

add .bashrc and .bash_profile

Diffstat:
A.bash_profile | 42++++++++++++++++++++++++++++++++++++++++++
A.bashrc | 29+++++++++++++++++++++++++++++
2 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/.bash_profile b/.bash_profile @@ -0,0 +1,42 @@ +xorg_start(){ + SYSTEM_PROFILE="/run/current-system/profile" + exec $SYSTEM_PROFILE/bin/xinit -- $SYSTEM_PROFILE/bin/Xorg :0 vt1 -keeptty \ + -configdir $SYSTEM_PROFILE/share/X11/xorg.conf.d \ + -modulepath $SYSTEM_PROFILE/lib/xorg/modules +} + +SYSTEM_PROFILE="/run/current-system/profile" +GUIX_PROFILE="/home/ian/.guix-profile" +. "$GUIX_PROFILE"/etc/profile +XDG_DATA_DIRS="$SYSTEM_PROFILE"/share:"$GUIX_PROFILE"/share +XDG_CONFIG_DIRS="$SYSTEM_PROFILE"/etc:"$GUIX_PROFILE"/etc + +GUIX_EXTRA_PROFILES="/home/ian/.guix-extra-profiles" + +for i in $GUIX_EXTRA_PROFILES/*; do + profile=$i/$(basename "$i") + if [ -f "$profile"/etc/profile ]; then + GUIX_PROFILE="$profile" + . "$GUIX_PROFILE"/etc/profile + XDG_DATA_DIRS="$XDG_DATA_DIRS":"$GUIX_PROFILE"/share + XDG_CONFIG_DIRS="$XDG_CONFIG_DIRS":"$GUIX_PROFILE"/etc + fi + unset profile +done + +export XDG_DATA_DIRS +export XDG_CONFIG_DIRS + +export HOME=/home/ian +export EDITOR="emacs -nw" + +export GUIX_PACKAGE_PATH="/home/ian/guix-config/guix-package-path" +export GUILE_LOAD_PATH="$GUILE_LOAD_PATH":/home/ian/guix-config/modules + +EMACS_PROFILE="$GUIX_EXTRA_PROFILES"/emacs/emacs +export EMACSLOADPATH="$EMACSLOADPATH":"$EMACS_PROFILE"/share/emacs/site-lisp + +if shopt -q login_shell; then + [[ -f ~/.bashrc ]] && source ~/.bashrc + [[ -t 0 && $(tty) == /dev/tty1 && ! $DISPLAY ]] && xorg_start +fi diff --git a/.bashrc b/.bashrc @@ -0,0 +1,29 @@ +export SHELL + +if [[ $- != *i* ]] +then + [[ -n "$SSH_CLIENT" ]] && source /etc/profile + + return +fi + +source /etc/bashrc + +if command -v tmux >/dev/null 2>&1 && ! shopt -q login_shell ; then + [ -z "${TMUX}" ] && (tmux attach || tmux) >/dev/null 2>&1 +fi + +if [ -n "$GUIX_ENVIRONMENT" ] +then + PS1='\u@\h (\W)[\t] \[env]\$ ' +else + PS1='\u@\h (\W)[\t] \$ ' +fi + +alias emacs="emacs -nw" +alias scrot="scrot -s ~/Pictures/screenshots/%Y-%m%d$s.png" +alias ls="ls -lah --color=always" +alias sleepmode="sudo sh -c 'echo mem > /sys/power/state'" +alias reboot="sudo reboot" + +alias dot="git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"