Add bash dotfiles

This commit is contained in:
Santiago Lo Coco 2025-01-30 21:21:01 +01:00
parent 3cb76879d5
commit f6193c489b
Signed by: slococo
GPG Key ID: F995EFC8B68B1ADF
4 changed files with 183 additions and 0 deletions

7
dotfiles/.bashrc Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc" ]; then
source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/aliasrc"
fi
eval "$(starship init bash)"

View File

@ -0,0 +1,87 @@
#!/bin/sh
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
alias e="$EDITOR" v="$EDITOR"
alias mpvgui='mpv --player-operation-mode=pseudo-gui'
alias wget='wget --hsts-file="$XDG_DATA_HOME/wget-hsts"'
alias adb='HOME="$XDG_DATA_HOME"/android adb'
alias nvidia-settings='nvidia-settings --config="$XDG_CONFIG_HOME"/nvidia/settings'
alias ll='ls -l' la='ls -al' l='ls -CF' lh='ls -lh'
alias ls="ls -hN --color=auto --group-directories-first"
alias grep="grep --color=auto"
alias diff="diff --color=auto"
gacp() {
git add .
local var="$@"
if [ $(echo "$var" | wc -c) -gt 70 ]; then
echo "Maximum characters: 72"
return 1
fi
git commit -m "$var" -S
git push
}
gac() {
git add .
local var="$@"
if [ $(echo "$var" | wc -c) -gt 70 ]; then
echo "Maximum characters: 72"
return 1
fi
git commit -m "$var" -S
}
gcmp() {
local var="$@"
if [ $(echo "$var" | wc -c) -gt 70 ]; then
echo "Maximum characters: 72"
return 1
fi
git commit -m "$var" -S
git push
}
alias exiftcl='exiftool -all='
alias exift='exiftool'
alias upgraded='grep -i upgraded /var/log/pacman.log | tac | less'
alias installed='grep -i installed /var/log/pacman.log | tac | less'
alias mirrors='reflector --country Austria --protocol https --sort rate --save /etc/pacman.d/mirrorlist'
alias open='xdg-open $(fzf)'
alias o='xdg-open'
alias zat='zathura --fork'
alias trash-dir='cd $HOME/.local/share/Trash'
alias val='valgrind --leak-check=full > valgrind.output 2>&1'
alias copy='xclip -selection clipboard'
function compile() {
sudo make clean && sudo make install
}
function rcomp() {
local file="${1//.rmd/}"
R -e "rmarkdown::render('$file.rmd', 'pdf_document')" && op $file.pdf
}
function fcd() {
local fd_options fzf_options target
fd_options=(
--hidden
--type directory
--exclude '.git'
)
fzf_options=(
--preview='tree -L 1 {}'
--bind=ctrl-space:toggle-preview
--exit-0
--keep-right
)
target="$(fd . "${1:-.}" "${fd_options[@]}" | fzf "${fzf_options[@]}")"
cd "$target" || return 1
}

View File

@ -0,0 +1,19 @@
$include /etc/inputrc
set editing-mode vi
$if mode=vi
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
set keymap vi-command
Control-l: clear-screen
Control-a: beginning-of-line
set keymap vi-insert
Control-l: clear-screen
Control-a: beginning-of-line
set completion-ignore-case on
$endif

View File

@ -0,0 +1,70 @@
#!/bin/sh
# unsetopt PROMPT_SP 2>/dev/null
export EDITOR=nvim
export TERM=st-256color
export TERMINAL=st
export TERMINAL_PROG=st
export BROWSER=librewolf
export PAGER='nvimpager -p'
export CM_SELECTIONS="clipboard"
export CM_DEBUG=1
export CM_OUTPUT_CLIP=0
export CM_MAX_CLIPS=10000
export CM_IGNORE_WINDOW="Bitwarden|KeePass"
export _JAVA_AWT_WM_NONREPARENTING=1
export QT_QPA_PLATFORMTHEME=gtk2
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
export XDG_CONFIG_HOME="$HOME"/.config
export XDG_CACHE_HOME="$HOME"/.cache
export XDG_DATA_HOME="$HOME"/.local/share
export XDG_STATE_HOME="$HOME"/.local/state
export CM_DIR="$XDG_CACHE_HOME"/clipmenu
export GOPATH="$XDG_CONFIG_HOME"/go
export R_HOME_USER="$XDG_CONFIG_HOME"/R
export R_PROFILE_USER="$XDG_CONFIG_HOME"/R/.Rprofile
export R_LIBS_USER="$XDG_CONFIG_HOME"/R/library
export R_HISTFILE="$XDG_CONFIG_HOME"/R/.Rhistory
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
#export GNUPGHOME="$XDG_DATA_HOME"/gnupg
export GRADLE_USER_HOME="$XDG_DATA_HOME"/gradle
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc
export XCURSOR_PATH=/usr/share/icons:"$XDG_DATA_HOME"/icons
export LESSHISTFILE="$XDG_CACHE_HOME"/less/history
export TERMINFO="$XDG_DATA_HOME"/terminfo
export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
export NVM_DIR="$XDG_DATA_HOME"/nvm
export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
export PSQL_HISTORY="$XDG_DATA_HOME"/psql_history
#export ZSH="$XDG_DATA_HOME"/oh-my-zsh
export ZDOTDIR="$XDG_CONFIG_HOME"/zsh
export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle
export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
export NUGET_PACKAGES="$XDG_CACHE_HOME"/NuGetPackages
export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
export MINIKUBE_HOME="$XDG_DATA_HOME"/minikube
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR"/gcr/ssh
export XINITRC="$XDG_CONFIG_HOME"/x11/xinitrc
export ANDROID_USER_HOME="$XDG_DATA_HOME"/android
export W3M_DIR="$XDG_DATA_HOME"/w3m
export PARALLEL_HOME="$XDG_CONFIG_HOME"/parallel
export INPUTRC="$XDG_CONFIG_HOME/shell/inputrc"
export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc
export HISTFILE="$XDG_STATE_HOME"/bash/history
export PATH="$HOME/.local/bin:$PATH"
if grep -q "i5" /proc/cpuinfo; then
export LAPTOP=""
fi
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
exec startx &> /dev/null
fi