summaryrefslogtreecommitdiff
path: root/.config/shell
diff options
context:
space:
mode:
authorSam Chudnick <sam@chudnick.com>2021-11-06 20:25:45 -0400
committerSam Chudnick <sam@chudnick.com>2021-11-06 20:25:45 -0400
commit82df70eff06e7b44ee84283070d7f801f7fc1d92 (patch)
treed17ea9cc6e012b16ff0cdeffcf4a97b5e5cd2d11 /.config/shell
initial commit
Diffstat (limited to '.config/shell')
-rw-r--r--.config/shell/.bashrc27
-rw-r--r--.config/shell/aliasrc39
-rw-r--r--.config/shell/profile22
-rw-r--r--.config/shell/shortcutsrc27
4 files changed, 115 insertions, 0 deletions
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 @@
1# Source aliases and shortcuts
2source ~/.config/shell/aliasrc
3source ~/.config/shell/shortcutsrc
4
5# History file settings
6HISTSIZE=
7HISTFILE="~/.cache/bash_history"
8HISTFILESIZE=
9HISTTIMEFORMAT="%a, %d %b %Y %T %z "
10
11# Shell Options
12set -o vi
13shopt -s autocd
14shopt -s histappend
15shopt -s checkwinsize
16
17# Prompt
18color_prompt=yes
19PS1='\[\033[1;30m\][\u@\h:]\[\033[1;31m\]\W\[\033[1;30m\]\[\033[0m\]\$ '
20
21if ! shopt -oq posix; then
22 if [ -f /usr/share/bash-completion/bash_completion ]; then
23 . /usr/share/bash-completion/bash_completion
24 elif [ -f /etc/bash_completion ]; then
25 . /etc/bash_completion
26 fi
27fi
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 @@
1#!/bin/sh
2
3# Add color to commands
4alias \
5 diff="diff --color=auto" \
6 dir="dir --color=auto" \
7 vdir="vdir --color=auto" \
8 egrep="egrep --color=auto" \
9 fgrep="fgrep --color=auto" \
10 grep="grep --color=auto" \
11 ls="ls --group-directories-first --color=auto"
12
13# Git
14alias \
15 g='git' \
16 gd='git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
17
18# Shorten other commands
19alias \
20 ports="ss -tuanp" \
21 py="python3" \
22 rb="/usr/sbin/reboot" \
23 sd="/usr/sbin/shutdown now" \
24 sx="startx" \
25 svm="sudo systemctl start libvirtd" \
26 v="vim" \
27 yta="youtube-dl -f bestaudio --download-archive ~/media/youtube/archive" \
28 ytv="youtube-dl -f bestvideo[height\<=1080]+bestaudio/best[height\<=1080] --download-archive ~/media/youtube/archive" \
29 z="zathura"
30
31# Start commands with specific options always
32alias \
33 calcurse="calcurse -D ~/.config/calcurse" \
34 cp="cp -iv" \
35 ffmpeg="ffmpeg -hide_banner" \
36 mv="mv -iv" \
37 rm="rm -Iv"
38
39source $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 @@
1#!/bin/bash
2# Profile file - executed by login shells
3
4# Add ~/.local/bin and all subdirectories to path
5script_dirs="$(find ~/.local/bin/ -type d | grep -v "git")"
6script_dirs="$(echo $script_dirs | tr ' ' ':')"
7export PATH=$PATH:$script_dirs
8
9export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
10export LESSHISTFILE='-'
11export XDG_CACHE_HOME="$HOME/.cache"
12export XDG_CONFIG_HOME="$HOME/.config"
13export XDG_DATA_HOME="$HOME/.local/share"
14export XINITRC="$XDG_CONFIG_HOME/x11/xinitrc"
15export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
16export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
17export BROWSER="firefox"
18export EDITOR="vim"
19export TERMINAL="urxvtc"
20
21eval `ssh-agent -s`
22[ "$(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 @@
1#!/bin/sh
2alias \
3 bin='cd $HOME/.local/bin' \
4 brc='vim $HOME/.bashrc' \
5 cac='cd $HOME/.cache' \
6 cfa='vim $HOME/.config/shell/aliasrc' \
7 cff='vim $XDG_CONFIG_HOME/fontconfig/fonts.conf' \
8 cfg='cd $HOME/.config/' \
9 cfs='vim $HOME/.config/shell/shortcutsrc' \
10 dat='cd $HOME/.local/share' \
11 dbc='cd $HOME/.local/src/dwmblocks; vim ~/.local/src/dwmblocks/blocks.h' \
12 dwc='cd $HOME/.local/src/dwm; vim ~/.local/src/dwm/config.h' \
13 dws='cd $HOME/.local/src/dwm' \
14 gms='cd $HOME/.steam/debian-installation/steamapps/common' \
15 h='cd $HOME' \
16 hkc='vim $HOME/.config/sxhkd/sxhkdrc' \
17 i3b='cd $HOME/.config/i3blocks/' \
18 i3c='vim $HOME/.config/i3/config' \
19 mus='cd ~/media/music' \
20 pro='cd $HOME/programs/' \
21 pic='cd $HOME/pictures/' \
22 sbs='cd $HOME/.local/bin/statusbar' \
23 src='cd $HOME/.local/src' \
24 vrc='vim $HOME/.vim/vimrc' \
25 xrc='vim $HOME/.config/x11/xinitrc' \
26 xrs='vim $HOME/.config/x11/xresources' \
27 zrc='vim $HOME/.config/zsh/.zshrc'