init
This commit is contained in:
commit
fa30fdf051
4 changed files with 71 additions and 0 deletions
57
.bashrc
Normal file
57
.bashrc
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
#
|
||||
# ~/.bashrc
|
||||
#
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
alias ls='ls --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias pacman-remove-dependencies='sudo bash -c "pacman -Qtdq | pacman -Rns -"'
|
||||
PS1='[\u@\h \W]\$ '
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
if [[ -e /tmp/user/1000 ]]; then
|
||||
mkdir -p /tmp/user/1000/Downloads
|
||||
xdg-user-dirs-update --set DOWNLOAD /tmp/user/1000/Downloads
|
||||
if (mount | grep "/home/aly/Downloads" >/dev/null); then
|
||||
sudo mount -o bind,remount /tmp/user/1000/Downloads /home/aly/Downloads
|
||||
else
|
||||
sudo mount -o bind /tmp/user/1000/Downloads /home/aly/Downloads
|
||||
fi
|
||||
fi
|
||||
|
||||
rbw --version >/dev/null && eval "$(rbw gen-completions bash)"
|
||||
if starship --version >/dev/null; then
|
||||
function set_win_title() {
|
||||
local cmd=" ($@)"
|
||||
if [[ "$cmd" == " (starship_precmd)" || "$cmd" == " ()" ]]
|
||||
then
|
||||
cmd=""
|
||||
fi
|
||||
if [[ $PWD == $HOME ]]
|
||||
then
|
||||
if [[ $SSH_TTY ]]
|
||||
then
|
||||
echo -ne "\033]0; 🏛️ @$HOSTNAME:~ $cmd\a" < /dev/null
|
||||
else
|
||||
echo -ne "\033]0; 🏠 $HOSTNAME:~ $cmd\a" < /dev/null
|
||||
fi
|
||||
else
|
||||
BASEPWD=$(basename "$PWD")
|
||||
if [[ $SSH_TTY ]]
|
||||
then
|
||||
echo -ne "\033]0; 🌩️ @$HOSTNAME:$PWD $cmd\a" < /dev/null
|
||||
else
|
||||
echo -ne "\033]0; 📁 $HOSTNAME:$PWD $cmd\a" < /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
starship_precmd_user_func="set_win_title"
|
||||
eval "$(starship init bash)"
|
||||
trap "$(trap -p DEBUG | awk -F"'" '{print $2}');set_win_title \${BASH_COMMAND}" DEBUG
|
||||
fi
|
||||
export EDITOR=vim
|
||||
. $HOME/.secrets
|
||||
Loading…
Add table
Add a link
Reference in a new issue