From ac0913a9f20a3baadcecf6c40df0eb0c62f08602 Mon Sep 17 00:00:00 2001 From: Rachel Fae Fox Date: Sat, 8 Aug 2020 18:10:04 -0400 Subject: [PATCH] bash, X, profiles, and a better script --- aliases | 20 ++++++++++++++++++++ bash_profile | 2 ++ bashrc | 11 +++++++++++ profilevars | 23 +++++++++++++++++++++++ profilevars_linux | 0 setup.sh | 32 ++++++++++++++++++++++---------- xprofile | 1 + zlogin | 6 +----- zshrc | 3 ++- 9 files changed, 82 insertions(+), 16 deletions(-) create mode 100644 aliases create mode 100644 bash_profile create mode 100644 bashrc create mode 100644 profilevars create mode 100644 profilevars_linux create mode 100644 xprofile diff --git a/aliases b/aliases new file mode 100644 index 0000000..9483673 --- /dev/null +++ b/aliases @@ -0,0 +1,20 @@ +# portable aliases written here +alias emacs="emacsclient -n" +# aliases +alias mkdir='mkdir -p' +alias psgrep='ps aux | grep -v grep | grep -i -e VSZ -e' +case $OSTYPE in + darwin*) + ;; + freebsd*) + alias ps='ps auxd' + ;; + linux-gnu) + alias ls='ls -CF --color=auto' + alias ll='s -lisa --color=auto' + alias free='free -mt' + alias ps='ps auxf' + alias wget='wget -c' + alias fetch='wget -c' + ;; +esac \ No newline at end of file diff --git a/bash_profile b/bash_profile new file mode 100644 index 0000000..8597c78 --- /dev/null +++ b/bash_profile @@ -0,0 +1,2 @@ +. ~/dotfiles/profilevars +[[ -f ~/.bashrc ]] && . ~/.bashrc diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..2a766ce --- /dev/null +++ b/bashrc @@ -0,0 +1,11 @@ +# +# ~/.bashrc +# + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +. ~/dotfiles/aliases + +# Set prompt +PS1="\[\e[0;33m\]\u@\h\[\e[m\]: \[\e[0;34m\]\w\[\e[m\] \$ " \ No newline at end of file diff --git a/profilevars b/profilevars new file mode 100644 index 0000000..2155254 --- /dev/null +++ b/profilevars @@ -0,0 +1,23 @@ +# this and included scripts should be written in portable shell. +PATH=$HOME/.bin:$PATH +EDITOR="emacsclient -n" +GIT_EDITOR="emacsclient" +BROWSER="firefox" +PAGER=most +LC_ALL=en_US.UTF-8 +if [ -z "SSH_AGENT_PID" ] ; then + eval `ssh-agent` +fi +# Platorm Specific Vars +case $OSTYPE in + darwin*) + . ~/dotfiles/profilevars_mac + ;; + freebsd*) + . ~/dotfiles/profilevars_bsd + ;; + linux-gnu) + . ~/dotfiles/profilevars_linux + ;; +esac +export PATH EDITOR GIT_EDITOR PAGER BROSWER LC_ALL \ No newline at end of file diff --git a/profilevars_linux b/profilevars_linux new file mode 100644 index 0000000..e69de29 diff --git a/setup.sh b/setup.sh index 6088c50..4df9f8e 100644 --- a/setup.sh +++ b/setup.sh @@ -1,29 +1,41 @@ #!/usr/bin/env sh +echo "This script will clobber existing links and files." +echo "Press Control C in the next 5 seconds to abort" +for x in 5 4 3 2 1 ; do + printf "%s." "$x" + sleep 1 +done +echo clobbering linked files! + IAM="$(realpath $(dirname $0))" mkdir -p ~/.config mkdir -p ~/.bin # shell dotfiles -ln -s $IAM/zlogin ~/.zlogin -ln -s $IAM/zshrc ~/.zshrc +ln -fns $IAM/profilevars ~/.profile +ln -fns $IAM/zlogin ~/.zlogin +ln -fns $IAM/zshrc ~/.zshrc +ln -fns $IAM/bashrc ~/.bashrc +ln -fns $IAM/bash_profile ~/.bash_profile # editor dotfiles -ln -s $IAM/emacs.d ~/.emacs.d -ln -s $IAM/vimrc ~/.vimrc +ln -fns $IAM/emacs.d ~/.emacs.d +ln -fns $IAM/vimrc ~/.vimrc # X dotfiles -ln -s $IAM/xinitrc ~/.xinitrc -ln -s $IAM/xmodmap ~/.xmodmap +ln -fns $IAM/xinitrc ~/.xinitrc +ln -fns $IAM/xmodmap ~/.xmodmap +ln -fns $IAM/xprofile ~/.xprofile # WM/DE dotfiles -ln -s $IAM/i3 ~/.config/i3 -ln -s $IAM/i3status ~/.config/i3status -ln -s $IAM/qt5ct ~/.config/qt5ct +ln -fns $IAM/i3 ~/.config/i3 +ln -fns $IAM/i3status ~/.config/i3status +ln -fns $IAM/qt5ct ~/.config/qt5ct # misc dotfiles -ln -s $IAM/gitconfig ~/.gitconfig +ln -fns $IAM/gitconfig ~/.gitconfig # tasks emacs --script install-packages.el diff --git a/xprofile b/xprofile new file mode 100644 index 0000000..3208365 --- /dev/null +++ b/xprofile @@ -0,0 +1 @@ +. ~/dotfiles/profilevars \ No newline at end of file diff --git a/zlogin b/zlogin index 1d8608d..68625c6 100644 --- a/zlogin +++ b/zlogin @@ -1,8 +1,4 @@ -EDITOR=emacs -PATH="$HOME/.bin:$PATH" -PAGER=most -export EDITOR PATH PAGER - +. ~/dotfiles/profilevars # Load additions case $OSTYPE in darwin*) diff --git a/zshrc b/zshrc index 3b7d96b..76e7187 100644 --- a/zshrc +++ b/zshrc @@ -1,3 +1,4 @@ +. ~/dotfiles/profilevars HISTFILE=~/.histfile HISTSIZE=1000 SAVEHIST=1000 @@ -9,7 +10,7 @@ autoload -Uz promptinit promptinit prompt clint -export PATH=$HOME/.bin:$PATH EDITOR=emacs PAGER=most +. ~/dotfiles/aliases # Load additions case $OSTYPE in