From 82df70eff06e7b44ee84283070d7f801f7fc1d92 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sat, 6 Nov 2021 20:25:45 -0400 Subject: initial commit --- .config/shell/.bashrc | 27 +++++++++++++++++++++++++++ .config/shell/aliasrc | 39 +++++++++++++++++++++++++++++++++++++++ .config/shell/profile | 22 ++++++++++++++++++++++ .config/shell/shortcutsrc | 27 +++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 .config/shell/.bashrc create mode 100644 .config/shell/aliasrc create mode 100644 .config/shell/profile create mode 100644 .config/shell/shortcutsrc (limited to '.config/shell') diff --git a/.config/shell/.bashrc b/.config/shell/.bashrc new file mode 100644 index 0000000..1a66eb0 --- /dev/null +++ b/.config/shell/.bashrc @@ -0,0 +1,27 @@ +# Source aliases and shortcuts +source ~/.config/shell/aliasrc +source ~/.config/shell/shortcutsrc + +# History file settings +HISTSIZE= +HISTFILE="~/.cache/bash_history" +HISTFILESIZE= +HISTTIMEFORMAT="%a, %d %b %Y %T %z " + +# Shell Options +set -o vi +shopt -s autocd +shopt -s histappend +shopt -s checkwinsize + +# Prompt +color_prompt=yes +PS1='\[\033[1;30m\][\u@\h:]\[\033[1;31m\]\W\[\033[1;30m\]\[\033[0m\]\$ ' + +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc new file mode 100644 index 0000000..c1a2de9 --- /dev/null +++ b/.config/shell/aliasrc @@ -0,0 +1,39 @@ +#!/bin/sh + +# Add color to commands +alias \ + diff="diff --color=auto" \ + dir="dir --color=auto" \ + vdir="vdir --color=auto" \ + egrep="egrep --color=auto" \ + fgrep="fgrep --color=auto" \ + grep="grep --color=auto" \ + ls="ls --group-directories-first --color=auto" + +# Git +alias \ + g='git' \ + gd='git --git-dir=$HOME/dotfiles/ --work-tree=$HOME' + +# Shorten other commands +alias \ + ports="ss -tuanp" \ + py="python3" \ + rb="/usr/sbin/reboot" \ + sd="/usr/sbin/shutdown now" \ + sx="startx" \ + svm="sudo systemctl start libvirtd" \ + v="vim" \ + yta="youtube-dl -f bestaudio --download-archive ~/media/youtube/archive" \ + ytv="youtube-dl -f bestvideo[height\<=1080]+bestaudio/best[height\<=1080] --download-archive ~/media/youtube/archive" \ + z="zathura" + +# Start commands with specific options always +alias \ + calcurse="calcurse -D ~/.config/calcurse" \ + cp="cp -iv" \ + ffmpeg="ffmpeg -hide_banner" \ + mv="mv -iv" \ + rm="rm -Iv" + +source $XDG_CONFIG_HOME/shell/private-aliasrc diff --git a/.config/shell/profile b/.config/shell/profile new file mode 100644 index 0000000..e806ba1 --- /dev/null +++ b/.config/shell/profile @@ -0,0 +1,22 @@ +#!/bin/bash +# Profile file - executed by login shells + +# Add ~/.local/bin and all subdirectories to path +script_dirs="$(find ~/.local/bin/ -type d | grep -v "git")" +script_dirs="$(echo $script_dirs | tr ' ' ':')" +export PATH=$PATH:$script_dirs + +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' +export LESSHISTFILE='-' +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc" +export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" +export ZDOTDIR="$XDG_CONFIG_HOME/zsh" +export BROWSER="firefox" +export EDITOR="vim" +export TERMINAL="urxvtc" + +eval `ssh-agent -s` +[ "$(tty)" = "/dev/tty1" ] && startx "$XINITRC" diff --git a/.config/shell/shortcutsrc b/.config/shell/shortcutsrc new file mode 100644 index 0000000..b8486be --- /dev/null +++ b/.config/shell/shortcutsrc @@ -0,0 +1,27 @@ +#!/bin/sh +alias \ + bin='cd $HOME/.local/bin' \ + brc='vim $HOME/.bashrc' \ + cac='cd $HOME/.cache' \ + cfa='vim $HOME/.config/shell/aliasrc' \ + cff='vim $XDG_CONFIG_HOME/fontconfig/fonts.conf' \ + cfg='cd $HOME/.config/' \ + cfs='vim $HOME/.config/shell/shortcutsrc' \ + dat='cd $HOME/.local/share' \ + dbc='cd $HOME/.local/src/dwmblocks; vim ~/.local/src/dwmblocks/blocks.h' \ + dwc='cd $HOME/.local/src/dwm; vim ~/.local/src/dwm/config.h' \ + dws='cd $HOME/.local/src/dwm' \ + gms='cd $HOME/.steam/debian-installation/steamapps/common' \ + h='cd $HOME' \ + hkc='vim $HOME/.config/sxhkd/sxhkdrc' \ + i3b='cd $HOME/.config/i3blocks/' \ + i3c='vim $HOME/.config/i3/config' \ + mus='cd ~/media/music' \ + pro='cd $HOME/programs/' \ + pic='cd $HOME/pictures/' \ + sbs='cd $HOME/.local/bin/statusbar' \ + src='cd $HOME/.local/src' \ + vrc='vim $HOME/.vim/vimrc' \ + xrc='vim $HOME/.config/x11/xinitrc' \ + xrs='vim $HOME/.config/x11/xresources' \ + zrc='vim $HOME/.config/zsh/.zshrc' -- cgit v1.2.3