organize shell configs so i can use them elsewhere
This commit is contained in:
parent
409cb8adea
commit
c786dace2d
6 changed files with 52 additions and 40 deletions
|
@ -1,21 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Common
|
|
||||||
alias \
|
|
||||||
ls="exa -al --group-directories-first" \
|
|
||||||
fzf="fzf --cycle --reverse" \
|
|
||||||
diff="diff --color=auto" \
|
|
||||||
grep="grep --color=auto" \
|
|
||||||
calc="bc -l" \
|
|
||||||
cp="cp -iv" \
|
|
||||||
mv="mv -iv" \
|
|
||||||
rm="rm -iv" \
|
|
||||||
vim="nvim" \
|
|
||||||
|
|
||||||
# Command shortcuts
|
|
||||||
alias \
|
|
||||||
apt-upgrade="sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y" \
|
|
||||||
|
|
||||||
# Directories
|
# Directories
|
||||||
alias \
|
alias \
|
||||||
src="cd $HOME/.local/src/ && ls" \
|
src="cd $HOME/.local/src/ && ls" \
|
||||||
|
@ -31,6 +15,18 @@ alias \
|
||||||
img="cd $HOME/Pictures/ && ls" \
|
img="cd $HOME/Pictures/ && ls" \
|
||||||
vid="cd $HOME/Videos/ && ls" \
|
vid="cd $HOME/Videos/ && ls" \
|
||||||
|
|
||||||
|
# Common
|
||||||
|
alias \
|
||||||
|
ls="exa -al --group-directories-first" \
|
||||||
|
fzf="fzf --cycle --reverse" \
|
||||||
|
diff="diff --color=auto" \
|
||||||
|
grep="grep --color=auto" \
|
||||||
|
calc="bc -l" \
|
||||||
|
cp="cp -iv" \
|
||||||
|
mv="mv -iv" \
|
||||||
|
rm="rm -iv" \
|
||||||
|
vim="nvim" \
|
||||||
|
|
||||||
# Launch args
|
# Launch args
|
||||||
alias \
|
alias \
|
||||||
fzf-edit-script="fzf_nav /home/$(whoami)/.config/scripts" \
|
fzf-edit-script="fzf_nav /home/$(whoami)/.config/scripts" \
|
||||||
|
@ -38,3 +34,7 @@ alias \
|
||||||
notes="note list" \
|
notes="note list" \
|
||||||
def="dict" \
|
def="dict" \
|
||||||
|
|
||||||
|
# Command shortcuts
|
||||||
|
alias \
|
||||||
|
apt-upgrade="sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y" \
|
||||||
|
|
||||||
|
|
26
shell/bashrc
26
shell/bashrc
|
@ -12,34 +12,22 @@ PS1='\[\033[2m\]($?) \[\033[1m\]\[\033[46m\] \u@\h \[\033[44m\] \w \[\033[45m\]$
|
||||||
PROMPT_COMMAND="echo" # Line jump after every command
|
PROMPT_COMMAND="echo" # Line jump after every command
|
||||||
|
|
||||||
# General configs
|
# General configs
|
||||||
PATH="$HOME/.config/scripts/status${PATH:+:${PATH}}"
|
|
||||||
PATH="$HOME/.config/scripts/menu${PATH:+:${PATH}}"
|
|
||||||
PATH="$HOME/.config/wrappers${PATH:+:${PATH}}"
|
|
||||||
PATH="$HOME/.config/scripts${PATH:+:${PATH}}"
|
|
||||||
PATH="$HOME/.local/bin${PATH:+:${PATH}}" # Custom PATHs for executables
|
|
||||||
bind "set completion-ignore-case on" # Case insensitive TAB complete
|
bind "set completion-ignore-case on" # Case insensitive TAB complete
|
||||||
shopt -s cdspell # Autocorrect directory name
|
shopt -s cdspell # Autocorrect directory name
|
||||||
shopt -s autocd # cd into dir by typing the name
|
shopt -s autocd # cd into dir by typing the name
|
||||||
set -o vi # vi mode
|
set -o vi # vi mode
|
||||||
|
|
||||||
# External configs
|
# External configs
|
||||||
source ~/.config/shell/xdgspec
|
[ -e "$HOME/.config/shell/functions" ] && source ~/.config/shell/functions
|
||||||
source ~/.config/shell/envvar
|
[ -e "$HOME/.config/shell/xdgspec" ] && source ~/.config/shell/xdgspec
|
||||||
source ~/.config/shell/aliasrc
|
[ -e "$HOME/.config/shell/aliasrc" ] && source ~/.config/shell/aliasrc
|
||||||
source ~/.config/shell/functions
|
[ -e "$HOME/.config/shell/envvar" ] && source ~/.config/shell/envvar
|
||||||
|
|
||||||
# Binds
|
# Binds
|
||||||
bind '"\C-f":"fzf_nav\C-m"'
|
[ -e "$HOME/.config/shell/keybinds" ] && source ~/.config/shell/keybinds
|
||||||
bind '"\C-y":"copy_output\C-m"'
|
|
||||||
bind '"\C-e":"dragon -x \* 2>/dev/null\C-m"'
|
|
||||||
|
|
||||||
# Autostart dwm after tty login
|
# Autostart dwm after tty login
|
||||||
type systemctl 2>/dev/null 1>&2 && if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
|
[ -e "$HOME/.config/shell/dwm" ] && source ~/.config/shell/dwm
|
||||||
cat ~/.config/snippets/welcome
|
|
||||||
sleep 0.5
|
|
||||||
amixer
|
|
||||||
exec startx
|
|
||||||
fi
|
|
||||||
|
|
||||||
# nice login prompt
|
# nice login prompt
|
||||||
[ -e "/usr/bin/afetch" ] && afetch || fetch min
|
[ -e "/usr/bin/afetch" ] && afetch || fetch min 2>/dev/null
|
||||||
|
|
9
shell/dwm
Normal file
9
shell/dwm
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Autostart dwm after tty login
|
||||||
|
type systemctl 2>/dev/null 1>&2 && if systemctl -q is-active graphical.target && [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then
|
||||||
|
cat ~/.config/snippets/welcome
|
||||||
|
sleep 0.5
|
||||||
|
amixer
|
||||||
|
exec startx
|
||||||
|
fi
|
|
@ -1,6 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Useful variables
|
# Useful variables
|
||||||
|
|
||||||
|
# Custom PATHs for executables
|
||||||
|
PATH="$HOME/.config/scripts/status${PATH:+:${PATH}}"
|
||||||
|
PATH="$HOME/.config/scripts/menu${PATH:+:${PATH}}"
|
||||||
|
PATH="$HOME/.config/wrappers${PATH:+:${PATH}}"
|
||||||
|
PATH="$HOME/.config/scripts${PATH:+:${PATH}}"
|
||||||
|
PATH="$HOME/.local/bin${PATH:+:${PATH}}"
|
||||||
|
|
||||||
# Common
|
# Common
|
||||||
export \
|
export \
|
||||||
GIT="ssh://git@gitlab.com/tavo-wasd" \
|
GIT="ssh://git@gitlab.com/tavo-wasd" \
|
||||||
|
|
5
shell/keybinds
Normal file
5
shell/keybinds
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
bind '"\C-e":"dragon -x \* 2>/dev/null\C-m"'
|
||||||
|
bind '"\C-y":"copy_output\C-m"'
|
||||||
|
bind '"\C-f":"fzf_nav\C-m"'
|
|
@ -95,6 +95,9 @@ function OpenTerminal()
|
||||||
endfunction
|
endfunction
|
||||||
nnoremap <C-t> :call OpenTerminal()<CR>
|
nnoremap <C-t> :call OpenTerminal()<CR>
|
||||||
|
|
||||||
|
" Custom commands
|
||||||
|
command SourceVimrc :source ~/.config/vim/vimrc
|
||||||
|
|
||||||
" Plugins
|
" Plugins
|
||||||
if empty(glob('~/.config/vim/autoload/plug.vim'))
|
if empty(glob('~/.config/vim/autoload/plug.vim'))
|
||||||
silent !curl -fLo ~/.config/vim/autoload/plug.vim --create-dirs
|
silent !curl -fLo ~/.config/vim/autoload/plug.vim --create-dirs
|
||||||
|
|
Loading…
Reference in a new issue