bash, X, profiles, and a better script

master
Rachel Fae Fox 2020-08-08 18:10:04 -04:00
parent 1d93e1c8ac
commit ac0913a9f2
9 changed files with 82 additions and 16 deletions

20
aliases Normal file
View File

@ -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

2
bash_profile Normal file
View File

@ -0,0 +1,2 @@
. ~/dotfiles/profilevars
[[ -f ~/.bashrc ]] && . ~/.bashrc

11
bashrc Normal file
View File

@ -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\] \$ "

23
profilevars Normal file
View File

@ -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

0
profilevars_linux Normal file
View File

View File

@ -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

1
xprofile Normal file
View File

@ -0,0 +1 @@
. ~/dotfiles/profilevars

6
zlogin
View File

@ -1,8 +1,4 @@
EDITOR=emacs
PATH="$HOME/.bin:$PATH"
PAGER=most
export EDITOR PATH PAGER
. ~/dotfiles/profilevars
# Load additions
case $OSTYPE in
darwin*)

3
zshrc
View File

@ -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