From da7bdbebbdf15a6bba9f95f1cefaf57650a6f0f8 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 6 Oct 2024 03:28:24 +0200 Subject: [PATCH] Stop using login shell, reconfigure bash --- dotfiles/.bash_functions | 8 -------- dotfiles/.bash_profile | 20 -------------------- dotfiles/.bashrc | 13 +++---------- dotfiles/.config/alacritty/alacritty.toml | 3 +-- dotfiles/.environ | 19 +++++++++++++++++++ dotfiles/.profile | 9 +++++++++ 6 files changed, 32 insertions(+), 40 deletions(-) delete mode 100644 dotfiles/.bash_profile create mode 100644 dotfiles/.environ create mode 100644 dotfiles/.profile diff --git a/dotfiles/.bash_functions b/dotfiles/.bash_functions index 1ed8adb..4f3cee2 100644 --- a/dotfiles/.bash_functions +++ b/dotfiles/.bash_functions @@ -9,14 +9,6 @@ function parse_branch { $scmexe branch 2> /dev/null | awk '/^*/{$1="";sub(/^ /, "");print "("$0")"}' } -function appendpath { - if ! [[ "$PATH" =~ $1 ]] - then - PATH="$1:$PATH" - fi - export PATH -} - yell() { echo "$0: $*" >&2; } die() { yell "$*"; exit 1; } try() { "$@" || die "failed while trying to: $*"; } diff --git a/dotfiles/.bash_profile b/dotfiles/.bash_profile deleted file mode 100644 index 3c175c6..0000000 --- a/dotfiles/.bash_profile +++ /dev/null @@ -1,20 +0,0 @@ -# vim: set ft=sh: - -EDITOR=nvim -GIT_EDITOR=$EDITOR -HISTCONTROL=ignoredups:erasedups # Avoid duplicates -HISTFILESIZE=100000000 # big big history -HISTSIZE=100000000 # big big history -LIBVIRT_DEFAULT_URI='qemu:///system' -MANWIDTH=80 -RIPGREP_CONFIG_PATH=$HOME/.ripgreprc -SYSTEMD_EDITOR=$EDITOR -TERM=alacritty - -PYTHONDONTWRITEBYTECODE=1 -PYTHONUSERBASE=$HOME/.env/python - -[[ -f ~/.bashrc ]] && . ~/.bashrc - -# opam configuration -test -r /home/vladan/.opam/opam-init/init.sh && . /home/vladan/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true diff --git a/dotfiles/.bashrc b/dotfiles/.bashrc index ca002cb..24e6235 100644 --- a/dotfiles/.bashrc +++ b/dotfiles/.bashrc @@ -4,9 +4,8 @@ [[ $- != *i* ]] && return # Source global definitions. -if [ -f /etc/bashrc ]; then - . /etc/bashrc -fi +[[ -f /etc/bashrc ]] && source /etc/bashrc +[[ -f $HOME/.environ ]] && . $HOME/.environ # Append to history, don't overwrite. shopt -s histappend @@ -16,11 +15,6 @@ shopt -s histappend [[ -f $HOME/.bash_colors ]] && source "$HOME/.bash_colors" [[ -f $HOME/.bash_functions ]] && source "$HOME/.bash_functions" -# Local user bins -appendpath $HOME/.local/bin -appendpath $HOME/.cargo/bin -appendpath $HOME/.env/python/bin - # Save working dir on every prompt. export PROMPT_COMMAND='pwd > $HOME/.cwd' export PS1="${Yellow}\d \A ${Off}${Green}\u@\h: ${Off}\w ${Red}\$(parse_branch git)${BRed}\$(parse_branch fossil)${Off}\n-$ " @@ -35,6 +29,5 @@ if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) export SSH_AUTH_SOCK fi -GPG_TTY=$(tty) -export GPG_TTY +export GPG_TTY=$(tty) gpg-connect-agent updatestartuptty /bye >/dev/null diff --git a/dotfiles/.config/alacritty/alacritty.toml b/dotfiles/.config/alacritty/alacritty.toml index db94fc9..2f95351 100644 --- a/dotfiles/.config/alacritty/alacritty.toml +++ b/dotfiles/.config/alacritty/alacritty.toml @@ -401,7 +401,7 @@ key = "Minus" mods = "Control" [mouse] -hide_when_typing = false +hide_when_typing = true [[mouse.bindings]] action = "PasteSelection" @@ -415,7 +415,6 @@ save_to_clipboard = true semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" [shell] -args = ["--login"] program = "/bin/bash" [window] diff --git a/dotfiles/.environ b/dotfiles/.environ new file mode 100644 index 0000000..ebe8a3a --- /dev/null +++ b/dotfiles/.environ @@ -0,0 +1,19 @@ +# vim: set ft=sh: + +export EDITOR=nvim +export GIT_EDITOR=$EDITOR +export HISTCONTROL=ignoredups:erasedups # Avoid duplicates +export HISTFILESIZE=100000000 # big big history +export HISTSIZE=100000000 # big big history +export LIBVIRT_DEFAULT_URI='qemu:///system' +export MANWIDTH=80 +export RIPGREP_CONFIG_PATH=$HOME/.ripgreprc +export SYSTEMD_EDITOR=$EDITOR +export TERM=alacritty +export PYTHONDONTWRITEBYTECODE=1 +export TZ="Europe/Belgrade" + +# Local user bins +add_path() case :$PATH: in *:$1:*) ;; *) PATH=$1:$PATH;; esac +add_path $HOME/.local/bin +add_path $HOME/.cargo/bin diff --git a/dotfiles/.profile b/dotfiles/.profile new file mode 100644 index 0000000..c7cffbd --- /dev/null +++ b/dotfiles/.profile @@ -0,0 +1,9 @@ +# vim: set ft=sh: + +[ -f $HOME/.environ ] && source $HOME/.environ +[ $BASH == "/usr/bin/bash" ] && source $HOME/.bashrc + +MOZ_ENABLE_WAYLAND=1 +XDG_CURRENT_DESKTOP=sway +SDL_VIDEODRIVER=wayland +_JAVA_AWT_WM_NONREPARENTING=1