Updated
updated everything
|
@ -1,17 +0,0 @@
|
||||||
### STARTING XSESSION
|
|
||||||
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]
|
|
||||||
then
|
|
||||||
startx
|
|
||||||
fi
|
|
||||||
export GST_VAAPI_ALL_DRIVERS=1
|
|
||||||
export EDITOR="nvim" # $EDITOR use neovim
|
|
||||||
#export EDITOR="emacsclient -t -a ''" # $EDITOR use Emacs in terminal
|
|
||||||
#export VISUAL="emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode
|
|
||||||
export READER="zathura"
|
|
||||||
export TERMINAL="alacritty"
|
|
||||||
export BROWSER="qutebrowser"
|
|
||||||
export WM="dwm"
|
|
||||||
export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"}
|
|
||||||
export XDG_CACHE_HOME=${XDG_CACHE_HOME:="$HOME/.cache"}
|
|
||||||
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"}
|
|
||||||
source $HOME/.bashrc
|
|
255
.bashrc
|
@ -1,255 +0,0 @@
|
||||||
## ____ __
|
|
||||||
## / __ \_________ _/ /_____
|
|
||||||
## / / / / ___/ __ `/ //_/ _ \
|
|
||||||
## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
|
|
||||||
## /_____/_/ \__,_/_/|_|\___/ My custom bash config
|
|
||||||
##
|
|
||||||
|
|
||||||
### EXPORT ###
|
|
||||||
export TERM="xterm-256color" # getting proper colors
|
|
||||||
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
|
|
||||||
|
|
||||||
# use bash-completion, if available
|
|
||||||
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
|
|
||||||
. /usr/share/bash-completion/bash_completion
|
|
||||||
|
|
||||||
# if not running interactively, don't do anything
|
|
||||||
[[ $- != *i* ]] && return
|
|
||||||
|
|
||||||
# use neovim for vim if present.
|
|
||||||
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
|
|
||||||
|
|
||||||
# use $XINITRC variable if file exists.
|
|
||||||
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
|
|
||||||
|
|
||||||
### SET VI MODE ###
|
|
||||||
# Comment this line out to enable default emacs-like bindings
|
|
||||||
set -o vi
|
|
||||||
bind -m vi-command 'Control-l: clear-screen'
|
|
||||||
bind -m vi-insert 'Control-l: clear-screen'
|
|
||||||
|
|
||||||
### PATH ###
|
|
||||||
if [ -d "$HOME/.bin" ] ;
|
|
||||||
then PATH="$HOME/.bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "$HOME/.local/bin" ] ;
|
|
||||||
then PATH="$HOME/.local/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "$HOME/Applications" ] ;
|
|
||||||
then PATH="$HOME/Applications:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### CHANGE TITLE OF TERMINALS ###
|
|
||||||
case ${TERM} in
|
|
||||||
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|alacritty|st|konsole*)
|
|
||||||
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
|
|
||||||
;;
|
|
||||||
screen*)
|
|
||||||
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
### SHOPT ###
|
|
||||||
shopt -s autocd # change to named directory
|
|
||||||
shopt -s cdspell # autocorrects cd misspellings
|
|
||||||
shopt -s cmdhist # save multi-line commands in history as single line
|
|
||||||
shopt -s dotglob
|
|
||||||
shopt -s histappend # do not overwrite history
|
|
||||||
shopt -s expand_aliases # expand aliases
|
|
||||||
shopt -s checkwinsize # checks term size when bash regains control
|
|
||||||
|
|
||||||
# ignore upper and lowercase when TAB completion
|
|
||||||
bind "set completion-ignore-case on"
|
|
||||||
|
|
||||||
# sudo not required for some system commands
|
|
||||||
for command in mount umount poweroff reboot ; do
|
|
||||||
alias $command="sudo $command"
|
|
||||||
done; unset command
|
|
||||||
|
|
||||||
### ARCHIVE EXTRACTION ###
|
|
||||||
# usage: ex <file>
|
|
||||||
ex ()
|
|
||||||
{
|
|
||||||
if [ -f "$1" ] ; then
|
|
||||||
case $1 in
|
|
||||||
*.tar.bz2) tar xjf $1 ;;
|
|
||||||
*.tar.gz) tar xzf $1 ;;
|
|
||||||
*.bz2) bunzip2 $1 ;;
|
|
||||||
*.rar) unrar x $1 ;;
|
|
||||||
*.gz) gunzip $1 ;;
|
|
||||||
*.tar) tar xf $1 ;;
|
|
||||||
*.tbz2) tar xjf $1 ;;
|
|
||||||
*.tgz) tar xzf $1 ;;
|
|
||||||
*.zip) unzip $1 ;;
|
|
||||||
*.Z) uncompress $1;;
|
|
||||||
*.7z) 7z x $1 ;;
|
|
||||||
*.deb) ar x $1 ;;
|
|
||||||
*.tar.xz) tar xf $1 ;;
|
|
||||||
*.tar.zst) unzstd $1 ;;
|
|
||||||
*) echo "'$1' cannot be extracted via ex()" ;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "'$1' is not a valid file"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
### ALIASES ###
|
|
||||||
# navigation
|
|
||||||
up () {
|
|
||||||
local d=""
|
|
||||||
local limit="$1"
|
|
||||||
|
|
||||||
# Default to limit of 1
|
|
||||||
if [ -z "$limit" ] || [ "$limit" -le 0 ]; then
|
|
||||||
limit=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for ((i=1;i<=limit;i++)); do
|
|
||||||
d="../$d"
|
|
||||||
done
|
|
||||||
|
|
||||||
# perform cd. Show error if cd fails
|
|
||||||
if ! cd "$d"; then
|
|
||||||
echo "Couldn't go up $limit dirs.";
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# cd
|
|
||||||
alias \
|
|
||||||
..="cd .." \
|
|
||||||
.2="cd ../.." \
|
|
||||||
.3="cd ../../.." \
|
|
||||||
.4="cd ../../../.." \
|
|
||||||
.5="cd ../../../../.."
|
|
||||||
|
|
||||||
# bat as cat
|
|
||||||
[ -x "$(command -v bat)" ] && alias cat="bat"
|
|
||||||
|
|
||||||
# DOOM Emacs
|
|
||||||
[ -x "$(command -v emacs)" ] && alias \
|
|
||||||
em="/usr/bin/emacs -nw" \
|
|
||||||
emacs="emacsclient -c -a 'emacs'" \
|
|
||||||
doomsync="~/.emacs.d/bin/doom sync" \
|
|
||||||
doomdoctor="~/.emacs.d/bin/doom doctor" \
|
|
||||||
doomupgrade="~/.emacs.d/bin/doom upgrade" \
|
|
||||||
doompurge="~/.emacs.d/bin/doom purge"
|
|
||||||
|
|
||||||
# Changing "ls" to "exa"
|
|
||||||
alias \
|
|
||||||
ls="exa -al --color=always --group-directories-first" \
|
|
||||||
la="exa -a --color=always --group-directories-first" \
|
|
||||||
ll="exa -l --color=always --group-directories-first" \
|
|
||||||
lt="exa -aT --color=always --group-directories-first" \
|
|
||||||
l.='exa -a | egrep "^\."'
|
|
||||||
|
|
||||||
# xbps
|
|
||||||
[ -x "$(command -v xbps-query)" ] && alias \
|
|
||||||
xb-up="sudo xbps-install -Su && xcheckrestart" \
|
|
||||||
xb-get="sudo xbps-install -S" \
|
|
||||||
xb-rmv="sudo xbps-remove -R" \
|
|
||||||
xb-rmv-sec="sudo xbps-remove" \
|
|
||||||
xb-qry="sudo xbps-query" \
|
|
||||||
xb-cln="sudo xbps-remove -o && sudo xbps-remove -O"
|
|
||||||
|
|
||||||
# pacman
|
|
||||||
[ -x "$(command -v pacman)" ] && alias \
|
|
||||||
pac-up="sudo pacman -Syyu" \
|
|
||||||
pac-get="sudo pacman -S" \
|
|
||||||
pac-rmv="sudo pacman -Rcns" \
|
|
||||||
pac-rmv-sec="sudo pacman -Runs" \
|
|
||||||
pac-qry="sudo pacman -Ss" \
|
|
||||||
pac-cln="sudo pacman -Scc"
|
|
||||||
|
|
||||||
# colorize grep output (good for log files)
|
|
||||||
alias \
|
|
||||||
grep="grep --color=auto" \
|
|
||||||
egrep="egrep --color=auto" \
|
|
||||||
fgrep="fgrep --color=auto"
|
|
||||||
|
|
||||||
# git
|
|
||||||
alias \
|
|
||||||
addup="git add -u" \
|
|
||||||
addall="git add ." \
|
|
||||||
branch="git branch" \
|
|
||||||
checkout="git checkout" \
|
|
||||||
clone="git clone" \
|
|
||||||
commit="git commit -m" \
|
|
||||||
fetch="git fetch" \
|
|
||||||
pull="git pull origin" \
|
|
||||||
push="git push origin" \
|
|
||||||
stat="git status" \
|
|
||||||
tag="git tag" \
|
|
||||||
newtag="git tag -a"
|
|
||||||
|
|
||||||
# adding flags
|
|
||||||
alias \
|
|
||||||
df="df -h" \
|
|
||||||
free="free -m" \
|
|
||||||
newsboat="newsboat -u ~/.config/newsboat/urls"
|
|
||||||
|
|
||||||
# multimedia scripts
|
|
||||||
alias \
|
|
||||||
fli="flix-cli" \
|
|
||||||
ani="ani-cli" \
|
|
||||||
aniq="ani-cli -q"
|
|
||||||
|
|
||||||
# audio
|
|
||||||
alias \
|
|
||||||
mx="pulsemixer" \
|
|
||||||
amx="alsamixer" \
|
|
||||||
mk="cmus" \
|
|
||||||
ms="cmus" \
|
|
||||||
music="cmus"
|
|
||||||
|
|
||||||
# power management
|
|
||||||
alias \
|
|
||||||
po="loginctl poweroff" \
|
|
||||||
sp="loginctl suspend" \
|
|
||||||
rb="loginctl reboot"
|
|
||||||
|
|
||||||
# file management
|
|
||||||
alias \
|
|
||||||
fm="./.config/vifm/scripts/vifmrun" \
|
|
||||||
file="./.config/vifm/scripts/vifmrun" \
|
|
||||||
flm="./.config/vifm/scripts/vifmrun" \
|
|
||||||
vifm="./.config/vifm/scripts/vifmrun" \
|
|
||||||
rm="rm -vI" \
|
|
||||||
mv="mv -iv" \
|
|
||||||
cp="cp -iv" \
|
|
||||||
mkd="mkdir -pv"
|
|
||||||
|
|
||||||
# ps
|
|
||||||
alias \
|
|
||||||
psa="ps auxf" \
|
|
||||||
psgrep="ps aux | grep -v grep | grep -i -e VSZ -e" \
|
|
||||||
psmem="ps auxf | sort -nr -k 4" \
|
|
||||||
pscpu="ps auxf | sort -nr -k 3"
|
|
||||||
|
|
||||||
# youtube
|
|
||||||
alias \
|
|
||||||
yta-aac="yt-dlp --extract-audio --audio-format aac" \
|
|
||||||
yta-best="yt-dlp --extract-audio --audio-format best" \
|
|
||||||
yta-flac="yt-dlp --extract-audio --audio-format flac" \
|
|
||||||
yta-m4a="yt-dlp --extract-audio --audio-format m4a" \
|
|
||||||
yta-mp3="yt-dlp --extract-audio --audio-format mp3" \
|
|
||||||
yta-opus="yt-dlp --extract-audio --audio-format opus" \
|
|
||||||
yta-vorbis="yt-dlp --extract-audio --audio-format vorbis" \
|
|
||||||
yta-wav="yt-dlp --extract-audio --audio-format wav" \
|
|
||||||
ytv-best="yt-dlp -f bestvideo+bestaudio" \
|
|
||||||
yt="ytfzf -f -t" \
|
|
||||||
ytm="ytfzf -m"
|
|
||||||
|
|
||||||
# network and bluetooth
|
|
||||||
alias \
|
|
||||||
netstats="nmcli dev" \
|
|
||||||
wfi="nmtui-connect" \
|
|
||||||
wfi-scan="nmcli dev wifi list" \
|
|
||||||
wfi-edit="nmtui-edit" \
|
|
||||||
wfi-on="nmcli radio wifi on" \
|
|
||||||
wfi-off="nmcli radio wifi off" \
|
|
||||||
blt="bluetoothctl"
|
|
||||||
|
|
||||||
### SETTING THE STARSHIP PROMPT ###
|
|
||||||
eval "$(starship init bash)"
|
|
|
@ -1,235 +0,0 @@
|
||||||
## ____ __
|
|
||||||
## / __ \_________ _/ /_____
|
|
||||||
## / / / / ___/ __ `/ //_/ _ \
|
|
||||||
## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
|
|
||||||
## /_____/_/ \__,_/_/|_|\___/ My custom fish config
|
|
||||||
##
|
|
||||||
|
|
||||||
if status is-interactive
|
|
||||||
# Commands to run in interactive sessions can go here
|
|
||||||
end
|
|
||||||
|
|
||||||
### EXPORT
|
|
||||||
set -U fish_greeting ""
|
|
||||||
set EDITOR "nvim" # $EDITOR use neovim
|
|
||||||
set READER "zathura"
|
|
||||||
set TERMINAL "alacritty"
|
|
||||||
set BROWSER "qutebrowser"
|
|
||||||
set WM "dwm"
|
|
||||||
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
|
|
||||||
|
|
||||||
### ADDING TO THE PATH
|
|
||||||
# First line removes the path; second line sets it. Without the first line,
|
|
||||||
# your path gets massive and fish becomes very slow.
|
|
||||||
set -e fish_user_paths
|
|
||||||
set -U fish_user_paths $HOME/.local/bin $HOME/Applications $fish_user_paths
|
|
||||||
|
|
||||||
# Vi mode
|
|
||||||
function fish_user_key_bindings
|
|
||||||
# fish_default_key_bindings
|
|
||||||
fish_vi_key_bindings
|
|
||||||
end
|
|
||||||
|
|
||||||
### AUTOCOMPLETE AND HIGHLIGHT COLORS ###
|
|
||||||
set fish_color_normal brcyan
|
|
||||||
set fish_color_autosuggestion '#7d7d7d'
|
|
||||||
set fish_color_command brcyan
|
|
||||||
set fish_color_error '#ff6c6b'
|
|
||||||
set fish_color_param brcyan
|
|
||||||
|
|
||||||
### FUNCTIONS
|
|
||||||
# Functions needed for !! and !$
|
|
||||||
function __history_previous_command
|
|
||||||
switch (commandline -t)
|
|
||||||
case "!"
|
|
||||||
commandline -t $history[1]; commandline -f repaint
|
|
||||||
case "*"
|
|
||||||
commandline -i !
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function __history_previous_command_arguments
|
|
||||||
switch (commandline -t)
|
|
||||||
case "!"
|
|
||||||
commandline -t ""
|
|
||||||
commandline -f history-token-search-backward
|
|
||||||
case "*"
|
|
||||||
commandline -i '$'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# The bindings for !! and !$
|
|
||||||
if [ $fish_key_bindings = "fish_vi_key_bindings" ];
|
|
||||||
bind -Minsert ! __history_previous_command
|
|
||||||
bind -Minsert '$' __history_previous_command_arguments
|
|
||||||
else
|
|
||||||
bind ! __history_previous_command
|
|
||||||
bind '$' __history_previous_command_arguments
|
|
||||||
end
|
|
||||||
|
|
||||||
# Function for creating a backup file
|
|
||||||
# ex: backup file.txt
|
|
||||||
# result: copies file as file.txt.bak
|
|
||||||
function backup --argument filename
|
|
||||||
cp $filename $filename.bak
|
|
||||||
end
|
|
||||||
|
|
||||||
# Function for copying files and directories, even recursively.
|
|
||||||
# ex: copy DIRNAME LOCATIONS
|
|
||||||
# result: copies the directory and all of its contents.
|
|
||||||
function copy
|
|
||||||
set count (count $argv | tr -d \n)
|
|
||||||
if test "$count" = 2; and test -d "$argv[1]"
|
|
||||||
set from (echo $argv[1] | trim-right /)
|
|
||||||
set to (echo $argv[2])
|
|
||||||
command cp -r $from $to
|
|
||||||
else
|
|
||||||
command cp $argv
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Function for printing a column (splits input on whitespace)
|
|
||||||
# ex: echo 1 2 3 | coln 3
|
|
||||||
# output: 3
|
|
||||||
function coln
|
|
||||||
while read -l input
|
|
||||||
echo $input | awk '{print $'$argv[1]'}'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Function for printing a row
|
|
||||||
# ex: seq 3 | rown 3
|
|
||||||
# output: 3
|
|
||||||
function rown --argument index
|
|
||||||
sed -n "$index p"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Function for ignoring the first 'n' lines
|
|
||||||
# ex: seq 10 | skip 5
|
|
||||||
# results: prints everything but the first 5 lines
|
|
||||||
function skip --argument n
|
|
||||||
tail +(math 1 + $n)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Function for taking the first 'n' lines
|
|
||||||
# ex: seq 10 | take 5
|
|
||||||
# results: prints only the first 5 lines
|
|
||||||
function take --argument number
|
|
||||||
head -$number
|
|
||||||
end
|
|
||||||
|
|
||||||
### ALIASES
|
|
||||||
# navigation
|
|
||||||
alias ..='cd ..'
|
|
||||||
alias .2='cd ../..'
|
|
||||||
alias .3='cd ../../..'
|
|
||||||
alias .4='cd ../../../..'
|
|
||||||
alias .5='cd ../../../../..'
|
|
||||||
|
|
||||||
# bat as cat
|
|
||||||
alias cat='bat'
|
|
||||||
|
|
||||||
# editors
|
|
||||||
alias vim='nvim'
|
|
||||||
|
|
||||||
# Changing "ls" to "exa"
|
|
||||||
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
|
|
||||||
alias la='exa -a --color=always --group-directories-first' # all files and dirs
|
|
||||||
alias ll='exa -l --color=always --group-directories-first' # long format
|
|
||||||
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
|
||||||
alias l.='exa -a | egrep "^\."'
|
|
||||||
|
|
||||||
# xbps
|
|
||||||
alias xb-up='sudo xbps-install -Su && xcheckrestart' # Refresh pkglist & update standard pkgs
|
|
||||||
alias xb-get='sudo xbps-install -S' # Install a package
|
|
||||||
alias xb-rmv='sudo xbps-remove -R' # Remove a package with all its dependencies
|
|
||||||
alias xb-rmv-sec='sudo xbps-remove' # Remove a package with all its dependencies (secure way)
|
|
||||||
alias xb-qry='sudo xbps-query' # Repo query
|
|
||||||
alias xb-cln='sudo xbps-remove -o && sudo xbps-remove -O' # remove orphaned packages
|
|
||||||
|
|
||||||
# Colorize grep output (good for log files)
|
|
||||||
alias grep='grep --color=auto'
|
|
||||||
alias egrep='egrep --color=auto'
|
|
||||||
alias fgrep='fgrep --color=auto'
|
|
||||||
|
|
||||||
# confirm before overwriting something
|
|
||||||
alias rm='rm -i'
|
|
||||||
alias mv='mv -i'
|
|
||||||
alias cp='cp -i'
|
|
||||||
|
|
||||||
# git
|
|
||||||
alias addup='git add -u'
|
|
||||||
alias addall='git add .'
|
|
||||||
alias branch='git branch'
|
|
||||||
alias checkout='git checkout'
|
|
||||||
alias clone='git clone'
|
|
||||||
alias commit='git commit -m'
|
|
||||||
alias fetch='git fetch'
|
|
||||||
alias pull='git pull origin'
|
|
||||||
alias push='git push origin'
|
|
||||||
alias stat='git status' # 'status' is protected name so using 'stat' instead
|
|
||||||
alias tag='git tag'
|
|
||||||
alias newtag='git tag -a'
|
|
||||||
|
|
||||||
# adding flags
|
|
||||||
alias df='df -h' # human-readable sizes
|
|
||||||
alias free='free -m' # show sizes in MB
|
|
||||||
alias newsboat='newsboat -u ~/.config/newsboat/urls' # start newsboat with my urls file
|
|
||||||
|
|
||||||
# ani-cli
|
|
||||||
alias ani='ani-cli'
|
|
||||||
alias ani-q='ani-cli -q' # to select video quality
|
|
||||||
|
|
||||||
# ytfzf
|
|
||||||
alias yt='ytfzf -f -t'
|
|
||||||
|
|
||||||
# flix-cli
|
|
||||||
alias flix-cli='flix-cli'
|
|
||||||
|
|
||||||
# mount and unmount drives
|
|
||||||
alias mnt='sudo mount'
|
|
||||||
alias umnt='sudo umount'
|
|
||||||
|
|
||||||
# mixers
|
|
||||||
alias mx='pulsemixer'
|
|
||||||
alias amx='alsamixer'
|
|
||||||
|
|
||||||
# music player
|
|
||||||
alias mk='cmus'
|
|
||||||
|
|
||||||
# power management
|
|
||||||
alias po='loginctl poweroff'
|
|
||||||
alias sp='loginctl suspend'
|
|
||||||
alias rb='loginctl reboot'
|
|
||||||
|
|
||||||
# file manager
|
|
||||||
alias fm='./.config/vifm/scripts/vifmrun'
|
|
||||||
alias vifm='./.config/vifm/scripts/vifmrun'
|
|
||||||
|
|
||||||
# ps
|
|
||||||
alias psa="ps auxf"
|
|
||||||
alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
|
|
||||||
alias psmem='ps auxf | sort -nr -k 4'
|
|
||||||
alias pscpu='ps auxf | sort -nr -k 3'
|
|
||||||
|
|
||||||
# youtube-dl
|
|
||||||
alias yta-aac="yt-dlp --extract-audio --audio-format aac "
|
|
||||||
alias yta-best="yt-dlp --extract-audio --audio-format best "
|
|
||||||
alias yta-flac="yt-dlp --extract-audio --audio-format flac "
|
|
||||||
alias yta-m4a="yt-dlp --extract-audio --audio-format m4a "
|
|
||||||
alias yta-mp3="yt-dlp --extract-audio --audio-format mp3 "
|
|
||||||
alias yta-opus="yt-dlp --extract-audio --audio-format opus "
|
|
||||||
alias yta-vorbis="yt-dlp --extract-audio --audio-format vorbis "
|
|
||||||
alias yta-wav="yt-dlp --extract-audio --audio-format wav "
|
|
||||||
alias ytv-best="yt-dlp -f bestvideo+bestaudio "
|
|
||||||
|
|
||||||
# Network Manager and bluetooth
|
|
||||||
alias netstats='nmcli dev'
|
|
||||||
alias wfi='nmtui-connect'
|
|
||||||
alias wfi-scan='nmcli dev wifi list'
|
|
||||||
alias wfi-edit='nmtui-edit'
|
|
||||||
alias wfi-on='nmcli radio wifi on'
|
|
||||||
alias wfi-off='nmcli radio wifi off'
|
|
||||||
alias blt='bluetoothctl'
|
|
||||||
|
|
||||||
### SETTING THE STARSHIP PROMPT ###
|
|
||||||
eval "$(starship init bash)"
|
|
|
@ -1,130 +0,0 @@
|
||||||
let mapleader =","
|
|
||||||
|
|
||||||
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
|
|
||||||
echo "Downloading junegunn/vim-plug to manage plugins..."
|
|
||||||
silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
|
|
||||||
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
|
|
||||||
autocmd VimEnter * PlugInstall
|
|
||||||
endif
|
|
||||||
|
|
||||||
call plug#begin(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/plugged"'))
|
|
||||||
Plug 'tpope/vim-surround'
|
|
||||||
Plug 'preservim/nerdtree'
|
|
||||||
Plug 'junegunn/goyo.vim'
|
|
||||||
Plug 'jreybert/vimagit'
|
|
||||||
Plug 'lukesmithxyz/vimling'
|
|
||||||
Plug 'vimwiki/vimwiki'
|
|
||||||
Plug 'vim-airline/vim-airline'
|
|
||||||
Plug 'tpope/vim-commentary'
|
|
||||||
Plug 'ap/vim-css-color'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
set title
|
|
||||||
set bg=light
|
|
||||||
set go=a
|
|
||||||
set mouse=a
|
|
||||||
set nohlsearch
|
|
||||||
set clipboard+=unnamedplus
|
|
||||||
set noshowmode
|
|
||||||
set noruler
|
|
||||||
set laststatus=0
|
|
||||||
set noshowcmd
|
|
||||||
|
|
||||||
" Some basics:
|
|
||||||
nnoremap c "_c
|
|
||||||
set nocompatible
|
|
||||||
filetype plugin on
|
|
||||||
syntax on
|
|
||||||
set encoding=utf-8
|
|
||||||
set number relativenumber
|
|
||||||
" Enable autocompletion:
|
|
||||||
set wildmode=longest,list,full
|
|
||||||
" Disables automatic commenting on newline:
|
|
||||||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
|
||||||
" Perform dot commands over visual blocks:
|
|
||||||
vnoremap . :normal .<CR>
|
|
||||||
" Goyo plugin makes text more readable when writing prose:
|
|
||||||
map <leader>f :Goyo \| set bg=light \| set linebreak<CR>
|
|
||||||
" Spell-check set to <leader>o, 'o' for 'orthography':
|
|
||||||
map <leader>o :setlocal spell! spelllang=en_us<CR>
|
|
||||||
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
|
|
||||||
set splitbelow splitright
|
|
||||||
|
|
||||||
" Nerd tree
|
|
||||||
map <leader>n :NERDTreeToggle<CR>
|
|
||||||
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
|
|
||||||
if has('nvim')
|
|
||||||
let NERDTreeBookmarksFile = stdpath('data') . '/NERDTreeBookmarks'
|
|
||||||
else
|
|
||||||
let NERDTreeBookmarksFile = '~/.vim' . '/NERDTreeBookmarks'
|
|
||||||
endif
|
|
||||||
|
|
||||||
" vimling:
|
|
||||||
nm <leader><leader>d :call ToggleDeadKeys()<CR>
|
|
||||||
imap <leader><leader>d <esc>:call ToggleDeadKeys()<CR>a
|
|
||||||
nm <leader><leader>i :call ToggleIPA()<CR>
|
|
||||||
imap <leader><leader>i <esc>:call ToggleIPA()<CR>a
|
|
||||||
nm <leader><leader>q :call ToggleProse()<CR>
|
|
||||||
|
|
||||||
" Shortcutting split navigation, saving a keypress:
|
|
||||||
map <C-h> <C-w>h
|
|
||||||
map <C-j> <C-w>j
|
|
||||||
map <C-k> <C-w>k
|
|
||||||
map <C-l> <C-w>l
|
|
||||||
|
|
||||||
" Replace ex mode with gq
|
|
||||||
map Q gq
|
|
||||||
|
|
||||||
" Check file in shellcheck:
|
|
||||||
map <leader>s :!clear && shellcheck -x %<CR>
|
|
||||||
|
|
||||||
" Replace all is aliased to S.
|
|
||||||
nnoremap S :%s//g<Left><Left>
|
|
||||||
|
|
||||||
" Compile document, be it groff/LaTeX/markdown/etc.
|
|
||||||
map <leader>c :w! \| !compiler "<c-r>%"<CR>
|
|
||||||
|
|
||||||
" Open corresponding .pdf/.html or preview
|
|
||||||
map <leader>p :!opout <c-r>%<CR><CR>
|
|
||||||
|
|
||||||
" Ensure files are read as what I want:
|
|
||||||
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
|
|
||||||
map <leader>v :VimwikiIndex<CR>
|
|
||||||
let g:vimwiki_list = [{'path': '~/.local/share/nvim/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
|
|
||||||
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
|
|
||||||
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
|
|
||||||
autocmd BufRead,BufNewFile *.tex set filetype=tex
|
|
||||||
|
|
||||||
" Save file as sudo on files that require root permission
|
|
||||||
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
|
|
||||||
|
|
||||||
" Automatically deletes all trailing whitespace and newlines at end of file on save. & reset cursor position
|
|
||||||
autocmd BufWritePre * let currPos = getpos(".")
|
|
||||||
autocmd BufWritePre * %s/\s\+$//e
|
|
||||||
autocmd BufWritePre * %s/\n\+\%$//e
|
|
||||||
autocmd BufWritePre *.[ch] %s/\%$/\r/e
|
|
||||||
autocmd BufWritePre * cal cursor(currPos[1], currPos[2])
|
|
||||||
|
|
||||||
" Turns off highlighting on the bits of code that are changed, so the line that is changed is highlighted but the actual text that has changed stands out on the line and is readable.
|
|
||||||
if &diff
|
|
||||||
highlight! link DiffText MatchParen
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Function for toggling the bottom statusbar:
|
|
||||||
let s:hidden_all = 0
|
|
||||||
function! ToggleHiddenAll()
|
|
||||||
if s:hidden_all == 0
|
|
||||||
let s:hidden_all = 1
|
|
||||||
set noshowmode
|
|
||||||
set noruler
|
|
||||||
set laststatus=0
|
|
||||||
set noshowcmd
|
|
||||||
else
|
|
||||||
let s:hidden_all = 0
|
|
||||||
set showmode
|
|
||||||
set ruler
|
|
||||||
set laststatus=2
|
|
||||||
set showcmd
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
nnoremap <leader>h :call ToggleHiddenAll()<CR>
|
|
232
.zshrc
|
@ -1,232 +0,0 @@
|
||||||
## ____ __
|
|
||||||
## / __ \_________ _/ /_____
|
|
||||||
## / / / / ___/ __ `/ //_/ _ \
|
|
||||||
## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
|
|
||||||
## /_____/_/ \__,_/_/|_|\___/ My custom zsh config
|
|
||||||
##
|
|
||||||
|
|
||||||
### EXPORT
|
|
||||||
export TERM="xterm-256color" # getting proper colors
|
|
||||||
export HISTORY_IGNORE="(ls|cd|pwd|exit|sudo reboot|history|cd -|cd ..)"
|
|
||||||
export EDITOR="nvim" # $EDITOR use neovim
|
|
||||||
export READER="zathura"
|
|
||||||
export TERMINAL="alacritty"
|
|
||||||
export BROWSER="qutebrowser"
|
|
||||||
export WM="dwm"
|
|
||||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
|
||||||
export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"}
|
|
||||||
export XDG_CACHE_HOME=${XDG_CACHE_HOME:="$HOME/.cache"}
|
|
||||||
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"}
|
|
||||||
|
|
||||||
### SET MANPAGER
|
|
||||||
### "bat" as manpager
|
|
||||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
|
||||||
|
|
||||||
### SET VI MODE ###
|
|
||||||
# Comment this line out to enable default emacs-like bindings
|
|
||||||
bindkey -v
|
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
|
||||||
[[ $- != *i* ]] && return
|
|
||||||
|
|
||||||
### PATH
|
|
||||||
if [ -d "$HOME/.bin" ] ;
|
|
||||||
then PATH="$HOME/.bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "$HOME/.local/bin" ] ;
|
|
||||||
then PATH="$HOME/.local/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -d "$HOME/Applications" ] ;
|
|
||||||
then PATH="$HOME/Applications:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
### CHANGE TITLE OF TERMINALS
|
|
||||||
case ${TERM} in
|
|
||||||
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|alacritty|st|konsole*)
|
|
||||||
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
|
|
||||||
;;
|
|
||||||
screen*)
|
|
||||||
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
### Function extract for common file formats ###
|
|
||||||
SAVEIFS=$IFS
|
|
||||||
IFS=$(echo -en "\n\b")
|
|
||||||
|
|
||||||
function extract {
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
# display usage if no parameters given
|
|
||||||
echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
|
|
||||||
echo " extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
|
|
||||||
else
|
|
||||||
for n in "$@"
|
|
||||||
do
|
|
||||||
if [ -f "$n" ] ; then
|
|
||||||
case "${n%,}" in
|
|
||||||
*.cbt|*.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar)
|
|
||||||
tar xvf "$n" ;;
|
|
||||||
*.lzma) unlzma ./"$n" ;;
|
|
||||||
*.bz2) bunzip2 ./"$n" ;;
|
|
||||||
*.cbr|*.rar) unrar x -ad ./"$n" ;;
|
|
||||||
*.gz) gunzip ./"$n" ;;
|
|
||||||
*.cbz|*.epub|*.zip) unzip ./"$n" ;;
|
|
||||||
*.z) uncompress ./"$n" ;;
|
|
||||||
*.7z|*.arj|*.cab|*.cb7|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.pkg|*.rpm|*.udf|*.wim|*.xar)
|
|
||||||
7z x ./"$n" ;;
|
|
||||||
*.xz) unxz ./"$n" ;;
|
|
||||||
*.exe) cabextract ./"$n" ;;
|
|
||||||
*.cpio) cpio -id < ./"$n" ;;
|
|
||||||
*.cba|*.ace) unace x ./"$n" ;;
|
|
||||||
*)
|
|
||||||
echo "extract: '$n' - unknown archive method"
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "'$n' - file does not exist"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
IFS=$SAVEIFS
|
|
||||||
|
|
||||||
### ALIASES ###
|
|
||||||
|
|
||||||
# navigation
|
|
||||||
up () {
|
|
||||||
local d=""
|
|
||||||
local limit="$1"
|
|
||||||
|
|
||||||
# Default to limit of 1
|
|
||||||
if [ -z "$limit" ] || [ "$limit" -le 0 ]; then
|
|
||||||
limit=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
for ((i=1;i<=limit;i++)); do
|
|
||||||
d="../$d"
|
|
||||||
done
|
|
||||||
|
|
||||||
# perform cd. Show error if cd fails
|
|
||||||
if ! cd "$d"; then
|
|
||||||
echo "Couldn't go up $limit dirs.";
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
alias ..='cd ..'
|
|
||||||
alias .2='cd ../..'
|
|
||||||
alias .3='cd ../../..'
|
|
||||||
alias .4='cd ../../../..'
|
|
||||||
alias .5='cd ../../../../..'
|
|
||||||
|
|
||||||
# bat as cat
|
|
||||||
alias cat='bat'
|
|
||||||
|
|
||||||
# editors
|
|
||||||
alias vim='nvim'
|
|
||||||
|
|
||||||
# Changing "ls" to "exa"
|
|
||||||
alias ls='exa -al --color=always --group-directories-first' # my preferred listing
|
|
||||||
alias la='exa -a --color=always --group-directories-first' # all files and dirs
|
|
||||||
alias ll='exa -l --color=always --group-directories-first' # long format
|
|
||||||
alias lt='exa -aT --color=always --group-directories-first' # tree listing
|
|
||||||
alias l.='exa -a | egrep "^\."'
|
|
||||||
|
|
||||||
# xbps
|
|
||||||
alias xb-up='sudo xbps-install -Su && xcheckrestart' # Refresh pkglist & update standard pkgs
|
|
||||||
alias xb-get='sudo xbps-install -S' # Install a package
|
|
||||||
alias xb-rmv='sudo xbps-remove -R' # Remove a package with all its dependencies
|
|
||||||
alias xb-rmv-sec='sudo xbps-remove' # Remove a package with all its dependencies (secure way)
|
|
||||||
alias xb-qry='sudo xbps-query' # Repo query
|
|
||||||
alias xb-cln='sudo xbps-remove -o && sudo xbps-remove -O' # remove orphaned packages
|
|
||||||
|
|
||||||
# Colorize grep output (good for log files)
|
|
||||||
alias grep='grep --color=auto'
|
|
||||||
alias egrep='egrep --color=auto'
|
|
||||||
alias fgrep='fgrep --color=auto'
|
|
||||||
|
|
||||||
# confirm before overwriting something
|
|
||||||
alias rm='rm -i'
|
|
||||||
alias mv='mv -i'
|
|
||||||
alias cp='cp -i'
|
|
||||||
|
|
||||||
# git
|
|
||||||
alias addup='git add -u'
|
|
||||||
alias addall='git add .'
|
|
||||||
alias branch='git branch'
|
|
||||||
alias checkout='git checkout'
|
|
||||||
alias clone='git clone'
|
|
||||||
alias commit='git commit -m'
|
|
||||||
alias fetch='git fetch'
|
|
||||||
alias pull='git pull origin'
|
|
||||||
alias push='git push origin'
|
|
||||||
alias stat='git status' # 'status' is protected name so using 'stat' instead
|
|
||||||
alias tag='git tag'
|
|
||||||
alias newtag='git tag -a'
|
|
||||||
|
|
||||||
# adding flags
|
|
||||||
alias df='df -h' # human-readable sizes
|
|
||||||
alias free='free -m' # show sizes in MB
|
|
||||||
alias newsboat='newsboat -u ~/.config/newsboat/urls' # start newsboat with my urls file
|
|
||||||
|
|
||||||
# ani-cli
|
|
||||||
alias ani='ani-cli'
|
|
||||||
alias ani-q='ani-cli -q' # to select video quality
|
|
||||||
|
|
||||||
# ytfzf
|
|
||||||
alias yt='ytfzf -f -t'
|
|
||||||
|
|
||||||
# flix-cli
|
|
||||||
alias fli='flix-cli'
|
|
||||||
|
|
||||||
# mount and unmount drives
|
|
||||||
alias mnt='sudo mount'
|
|
||||||
alias umnt='sudo umount'
|
|
||||||
|
|
||||||
# mixers
|
|
||||||
alias mx='pulsemixer'
|
|
||||||
alias amx='alsamixer'
|
|
||||||
|
|
||||||
# music player
|
|
||||||
alias mk='cmus'
|
|
||||||
|
|
||||||
# power management
|
|
||||||
alias po='loginctl poweroff'
|
|
||||||
alias sp='loginctl suspend'
|
|
||||||
alias rb='loginctl reboot'
|
|
||||||
|
|
||||||
# file manager
|
|
||||||
alias fm='./.config/vifm/scripts/vifmrun'
|
|
||||||
alias vifm='./.config/vifm/scripts/vifmrun'
|
|
||||||
|
|
||||||
# ps
|
|
||||||
alias psa="ps auxf"
|
|
||||||
alias psgrep="ps aux | grep -v grep | grep -i -e VSZ -e"
|
|
||||||
alias psmem='ps auxf | sort -nr -k 4'
|
|
||||||
alias pscpu='ps auxf | sort -nr -k 3'
|
|
||||||
|
|
||||||
# youtube-dl
|
|
||||||
alias yta-aac="yt-dlp --extract-audio --audio-format aac "
|
|
||||||
alias yta-best="yt-dlp --extract-audio --audio-format best "
|
|
||||||
alias yta-flac="yt-dlp --extract-audio --audio-format flac "
|
|
||||||
alias yta-m4a="yt-dlp --extract-audio --audio-format m4a "
|
|
||||||
alias yta-mp3="yt-dlp --extract-audio --audio-format mp3 "
|
|
||||||
alias yta-opus="yt-dlp --extract-audio --audio-format opus "
|
|
||||||
alias yta-vorbis="yt-dlp --extract-audio --audio-format vorbis "
|
|
||||||
alias yta-wav="yt-dlp --extract-audio --audio-format wav "
|
|
||||||
alias ytv-best="yt-dlp -f bestvideo+bestaudio "
|
|
||||||
|
|
||||||
# Network Manager and bluetooth
|
|
||||||
alias netstats='nmcli dev'
|
|
||||||
alias wfi='nmtui-connect'
|
|
||||||
alias wfi-scan='nmcli dev wifi list'
|
|
||||||
alias wfi-edit='nmtui-edit'
|
|
||||||
alias wfi-on='nmcli radio wifi on'
|
|
||||||
alias wfi-off='nmcli radio wifi off'
|
|
||||||
alias blt='bluetoothctl'
|
|
||||||
|
|
||||||
### SETTING THE STARSHIP PROMPT ###
|
|
||||||
eval "$(starship init bash)"
|
|
|
@ -7,16 +7,11 @@ This is just a personal repository where i store all my dotfiles, you're free cl
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
If you want to get the full experience you need theese things:
|
If you want to get the full experience you need theese things:
|
||||||
* [my dwm build](https://github.com/d4r1us-drk/drk-dwm)
|
|
||||||
* [my dmenu build](https://github.com/d4r1us-drk/drk-dmenu)
|
|
||||||
* [my dwmblocks build](https://github.com/d4r1us-drk/drk-dwmblocks)
|
|
||||||
* [my dmenu scripts](https://github.com/d4r1us-drk/drk-dmenu_scripts)
|
* [my dmenu scripts](https://github.com/d4r1us-drk/drk-dmenu_scripts)
|
||||||
* [gruvbox-dark-gtk](https://github.com/jmattheis/gruvbox-dark-gtk)
|
* [gruvbox-dark-gtk](https://github.com/jmattheis/gruvbox-dark-gtk)
|
||||||
* [gruvbox-dark-icons-gtk](https://github.com/jmattheis/gruvbox-dark-icons-gtk)
|
* [gruvbox-dark-icons-gtk](https://github.com/jmattheis/gruvbox-dark-icons-gtk)
|
||||||
* [volantes-cursors](https://github.com/varlesh/volantes-cursors)
|
* [volantes-cursors](https://github.com/varlesh/volantes-cursors)
|
||||||
* mononoki Nerd Font
|
* mononoki Nerd Font
|
||||||
* xbacklight
|
|
||||||
* libinput & xf86-input-libinput
|
|
||||||
* lxsession
|
* lxsession
|
||||||
* picom
|
* picom
|
||||||
* dunst
|
* dunst
|
||||||
|
|
BIN
screenshot1.png
Before Width: | Height: | Size: 702 KiB After Width: | Height: | Size: 2 MiB |
BIN
screenshot2.png
Before Width: | Height: | Size: 424 KiB After Width: | Height: | Size: 1.4 MiB |
25
user/.bash_profile
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
### STARTING XSESSION
|
||||||
|
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]
|
||||||
|
then
|
||||||
|
startx
|
||||||
|
fi
|
||||||
|
|
||||||
|
### ENVIRONMENT VARIABLES
|
||||||
|
export GST_VAAPI_ALL_DRIVERS=1
|
||||||
|
export EDITOR="emacsclient -t -a ''" # $EDITOR use Emacs in terminal
|
||||||
|
export VISUAL="emacsclient -c -a emacs" # $VISUAL use Emacs in GUI mode
|
||||||
|
export READER="zathura" # Zathura as the pdf viewer
|
||||||
|
export TERMINAL="alacritty" # Alacritty as the default terminal emulator
|
||||||
|
export BROWSER="qutebrowser" # Qutebrowser as the default web browser
|
||||||
|
export WM="awesome" # AwesomeWM as the default Window Manager
|
||||||
|
export XDG_DATA_HOME=${XDG_DATA_HOME:="$HOME/.local/share"}
|
||||||
|
export XDG_CACHE_HOME=${XDG_CACHE_HOME:="$HOME/.cache"}
|
||||||
|
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:="$HOME/.config"}
|
||||||
|
export QT_QPA_PLATFORMTHEME=gtk2 # Qt theeming stuff
|
||||||
|
|
||||||
|
### AUTOSTART
|
||||||
|
/usr/bin/emacs --daemon & # Autostart the Emacs daemon
|
||||||
|
|
||||||
|
### BASHRC
|
||||||
|
source "$HOME"/.bashrc # Load the bashrc
|
257
user/.bashrc
Normal file
|
@ -0,0 +1,257 @@
|
||||||
|
## ____ __
|
||||||
|
## / __ \_________ _/ /_____
|
||||||
|
## / / / / ___/ __ `/ //_/ _ \
|
||||||
|
## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
|
||||||
|
## /_____/_/ \__,_/_/|_|\___/ My custom bash config
|
||||||
|
##
|
||||||
|
|
||||||
|
### EXPORT ###
|
||||||
|
export TERM="xterm-256color" # getting proper colors
|
||||||
|
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
|
||||||
|
|
||||||
|
# use bash-completion, if available
|
||||||
|
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
|
||||||
|
. /usr/share/bash-completion/bash_completion
|
||||||
|
|
||||||
|
# if not running interactively, don't do anything
|
||||||
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
|
# use neovim for vim if present.
|
||||||
|
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
|
||||||
|
|
||||||
|
# use $XINITRC variable if file exists.
|
||||||
|
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
|
||||||
|
|
||||||
|
### SET VI MODE ###
|
||||||
|
# Comment this line out to enable default emacs-like bindings
|
||||||
|
set -o vi
|
||||||
|
bind -m vi-command 'Control-l: clear-screen'
|
||||||
|
bind -m vi-insert 'Control-l: clear-screen'
|
||||||
|
|
||||||
|
### PATH ###
|
||||||
|
if [ -d "$HOME/.bin" ] ;
|
||||||
|
then PATH="$HOME/.bin:$PATH"
|
||||||
|
fi
|
||||||
|
if [ -d "$HOME/.local/bin" ] ;
|
||||||
|
then PATH="$HOME/.local/bin:$PATH"
|
||||||
|
fi
|
||||||
|
if [ -d "$HOME/Applications" ] ;
|
||||||
|
then PATH="$HOME/Applications:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
### CHANGE TITLE OF TERMINALS ###
|
||||||
|
case ${TERM} in
|
||||||
|
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|alacritty|st|konsole*)
|
||||||
|
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
|
||||||
|
;;
|
||||||
|
screen*)
|
||||||
|
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
### SHOPT ###
|
||||||
|
shopt -s autocd # change to named directory
|
||||||
|
shopt -s cdspell # autocorrects cd misspellings
|
||||||
|
shopt -s cmdhist # save multi-line commands in history as single line
|
||||||
|
shopt -s dotglob
|
||||||
|
shopt -s histappend # do not overwrite history
|
||||||
|
shopt -s expand_aliases # expand aliases
|
||||||
|
shopt -s checkwinsize # checks term size when bash regains control
|
||||||
|
|
||||||
|
# ignore upper and lowercase when TAB completion
|
||||||
|
bind "set completion-ignore-case on"
|
||||||
|
|
||||||
|
# sudo not required for some system commands
|
||||||
|
for command in mount umount poweroff reboot ; do
|
||||||
|
alias $command="sudo $command"
|
||||||
|
done; unset command
|
||||||
|
|
||||||
|
### ARCHIVE EXTRACTION ###
|
||||||
|
# usage: ex <file>
|
||||||
|
ex ()
|
||||||
|
{
|
||||||
|
if [ -f "$1" ] ; then
|
||||||
|
case $1 in
|
||||||
|
*.tar.bz2) tar xjf "$1" ;;
|
||||||
|
*.tar.gz) tar xzf "$1" ;;
|
||||||
|
*.bz2) bunzip2 "$1" ;;
|
||||||
|
*.rar) unrar x "$1" ;;
|
||||||
|
*.gz) gunzip "$1" ;;
|
||||||
|
*.tar) tar xf "$1" ;;
|
||||||
|
*.tbz2) tar xjf "$1" ;;
|
||||||
|
*.tgz) tar xzf "$1" ;;
|
||||||
|
*.zip) unzip "$1" ;;
|
||||||
|
*.Z) uncompress "$1";;
|
||||||
|
*.7z) 7zz x "$1" ;;
|
||||||
|
*.deb) ar x "$1" ;;
|
||||||
|
*.tar.xz) tar xf "$1" ;;
|
||||||
|
*.tar.zst) unzstd "$1" ;;
|
||||||
|
*) echo "'$1' cannot be extracted via ex()" ;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "'$1' is not a valid file"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
### ALIASES ###
|
||||||
|
# navigation
|
||||||
|
up () {
|
||||||
|
local d=""
|
||||||
|
local limit="$1"
|
||||||
|
|
||||||
|
# Default to limit of 1
|
||||||
|
if [ -z "$limit" ] || [ "$limit" -le 0 ]; then
|
||||||
|
limit=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for ((i=1;i<=limit;i++)); do
|
||||||
|
d="../$d"
|
||||||
|
done
|
||||||
|
|
||||||
|
# perform cd. Show error if cd fails
|
||||||
|
if ! cd "$d"; then
|
||||||
|
echo "Couldn't go up $limit dirs.";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# cd
|
||||||
|
alias \
|
||||||
|
..="cd .." \
|
||||||
|
.2="cd ../.." \
|
||||||
|
.3="cd ../../.." \
|
||||||
|
.4="cd ../../../.." \
|
||||||
|
.5="cd ../../../../.."
|
||||||
|
|
||||||
|
# bat as cat
|
||||||
|
[ -x "$(command -v bat)" ] && alias cat="bat"
|
||||||
|
|
||||||
|
# DOOM Emacs
|
||||||
|
[ -x "$(command -v emacs)" ] && alias \
|
||||||
|
em="/usr/bin/emacs -nw" \
|
||||||
|
emacs="emacsclient -c -a 'emacs'" \
|
||||||
|
doomsync="~/.emacs.d/bin/doom sync" \
|
||||||
|
doomdoctor="~/.emacs.d/bin/doom doctor" \
|
||||||
|
doomupgrade="~/.emacs.d/bin/doom upgrade" \
|
||||||
|
doompurge="~/.emacs.d/bin/doom purge"
|
||||||
|
|
||||||
|
# Changing "ls" to "exa"
|
||||||
|
alias \
|
||||||
|
ls="exa -al --color=always --group-directories-first" \
|
||||||
|
la="exa -a --color=always --group-directories-first" \
|
||||||
|
ll="exa -l --color=always --group-directories-first" \
|
||||||
|
lt="exa -aT --color=always --group-directories-first" \
|
||||||
|
l.='exa -a | egrep "^\."'
|
||||||
|
|
||||||
|
# xbps
|
||||||
|
[ -x "$(command -v xbps-query)" ] && alias \
|
||||||
|
xb-up="sudo xbps-install -Su && xcheckrestart" \
|
||||||
|
xb-get="sudo xbps-install -S" \
|
||||||
|
xb-rmv="sudo xbps-remove -R" \
|
||||||
|
xb-rmv-sec="sudo xbps-remove" \
|
||||||
|
xb-qry="sudo xbps-query" \
|
||||||
|
xb-cln="sudo xbps-remove -o && sudo xbps-remove -O"
|
||||||
|
|
||||||
|
# pacman
|
||||||
|
[ -x "$(command -v pacman)" ] && alias \
|
||||||
|
pac-up="sudo pacman -Syyu" \
|
||||||
|
pac-get="sudo pacman -S" \
|
||||||
|
pac-rmv="sudo pacman -Rcns" \
|
||||||
|
pac-rmv-sec="sudo pacman -Runs" \
|
||||||
|
pac-qry="sudo pacman -Ss" \
|
||||||
|
pac-cln="sudo pacman -Scc"
|
||||||
|
|
||||||
|
# colorize grep output (good for log files)
|
||||||
|
alias \
|
||||||
|
grep="grep --color=auto" \
|
||||||
|
egrep="egrep --color=auto" \
|
||||||
|
fgrep="fgrep --color=auto"
|
||||||
|
|
||||||
|
# git
|
||||||
|
alias \
|
||||||
|
addup="git add -u" \
|
||||||
|
addall="git add ." \
|
||||||
|
branch="git branch" \
|
||||||
|
checkout="git checkout" \
|
||||||
|
clone="git clone" \
|
||||||
|
commit="git commit -m" \
|
||||||
|
fetch="git fetch" \
|
||||||
|
pull="git pull origin" \
|
||||||
|
push="git push origin" \
|
||||||
|
stat="git status" \
|
||||||
|
tag="git tag" \
|
||||||
|
newtag="git tag -a"
|
||||||
|
|
||||||
|
# adding flags
|
||||||
|
alias \
|
||||||
|
df="df -h" \
|
||||||
|
free="free -m" \
|
||||||
|
newsboat="newsboat -u ~/.config/newsboat/urls"
|
||||||
|
|
||||||
|
# multimedia scripts
|
||||||
|
alias \
|
||||||
|
fli="flix-cli" \
|
||||||
|
ani="ani-cli" \
|
||||||
|
aniq="ani-cli -q"
|
||||||
|
|
||||||
|
# audio
|
||||||
|
alias \
|
||||||
|
mx="pulsemixer" \
|
||||||
|
amx="alsamixer" \
|
||||||
|
mk="cmus" \
|
||||||
|
ms="cmus" \
|
||||||
|
music="cmus"
|
||||||
|
|
||||||
|
# power management
|
||||||
|
[ -x "$(command -v xbps-query)" ] && alias \
|
||||||
|
po="loginctl poweroff" \
|
||||||
|
sp="loginctl suspend" \
|
||||||
|
rb="loginctl reboot"
|
||||||
|
[ -x "$(command -v pacman)" ] && alias \
|
||||||
|
po="systemctl poweroff" \
|
||||||
|
sp="systemctl suspend" \
|
||||||
|
rb="systemctl reboot"
|
||||||
|
|
||||||
|
# file management
|
||||||
|
alias \
|
||||||
|
fm="./.config/vifm/scripts/vifmrun" \
|
||||||
|
file="./.config/vifm/scripts/vifmrun" \
|
||||||
|
flm="./.config/vifm/scripts/vifmrun" \
|
||||||
|
vifm="./.config/vifm/scripts/vifmrun" \
|
||||||
|
rm="rm -vI" \
|
||||||
|
mv="mv -iv" \
|
||||||
|
cp="cp -iv" \
|
||||||
|
mkd="mkdir -pv"
|
||||||
|
|
||||||
|
# ps
|
||||||
|
alias \
|
||||||
|
psa="ps auxf" \
|
||||||
|
psgrep="ps aux | grep -v grep | grep -i -e VSZ -e" \
|
||||||
|
psmem="ps auxf | sort -nr -k 4" \
|
||||||
|
pscpu="ps auxf | sort -nr -k 3"
|
||||||
|
|
||||||
|
# youtube
|
||||||
|
alias \
|
||||||
|
yta-aac="yt-dlp --extract-audio --audio-format aac" \
|
||||||
|
yta-best="yt-dlp --extract-audio --audio-format best" \
|
||||||
|
yta-flac="yt-dlp --extract-audio --audio-format flac" \
|
||||||
|
yta-m4a="yt-dlp --extract-audio --audio-format m4a" \
|
||||||
|
yta-mp3="yt-dlp --extract-audio --audio-format mp3" \
|
||||||
|
yta-opus="yt-dlp --extract-audio --audio-format opus" \
|
||||||
|
yta-vorbis="yt-dlp --extract-audio --audio-format vorbis" \
|
||||||
|
yta-wav="yt-dlp --extract-audio --audio-format wav" \
|
||||||
|
ytv-best="yt-dlp -f bestvideo+bestaudio" \
|
||||||
|
yt="ytfzf -f -t" \
|
||||||
|
ytm="ytfzf -m"
|
||||||
|
|
||||||
|
# network and bluetooth
|
||||||
|
alias \
|
||||||
|
netstats="nmcli dev" \
|
||||||
|
wfi="nmtui-connect" \
|
||||||
|
wfi-scan="nmcli dev wifi list" \
|
||||||
|
wfi-edit="nmtui-edit" \
|
||||||
|
wfi-on="nmcli radio wifi on" \
|
||||||
|
wfi-off="nmcli radio wifi off" \
|
||||||
|
blt="bluetoothctl"
|
||||||
|
|
||||||
|
### SETTING THE STARSHIP PROMPT ###
|
||||||
|
eval "$(starship init bash)"
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 836 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 714 B After Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1,000 B After Width: | Height: | Size: 1,000 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 230 B After Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 230 B After Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 200 B After Width: | Height: | Size: 200 B |
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 225 B After Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 361 B After Width: | Height: | Size: 361 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |