From effd08ba3063cde8427fc32909efa657d5a1f3bc Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 23 Aug 2023 15:56:49 +0200 Subject: Updated install script and fixed outdated config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After trying up this whole thing on a fresh VM I got into a lot of old stuff that needed some updating (e.g. GNU Emacs' configuration which is now handled through Doom). Other than that, I have also added a few goodies when I'm using this on a VM, like a proper size for the TTY. Signed-off-by: Miquel Sabaté Solà --- .bashrc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index 0ef012d..38e9ebf 100644 --- a/.bashrc +++ b/.bashrc @@ -23,6 +23,18 @@ source_maybe() { fi } +## +# If we are inside of a VM, chances are that the TTY size is borked. Let's +# resize the TTY to the actual terminal size. + +if grep -Fq "hypervisor" /proc/cpuinfo; then + if [ -x "$(command -v resize)" ]; then + eval `resize` + else + echo "Consider installing the `resize` binary if you want a proper TTY size." + fi +fi + ## # XDG: sourcing the variables on $HOME/.config/user-dirs.dirs might ease up the # configuration of other tools. @@ -109,7 +121,7 @@ export GOPATH=$HOME # The g utility. See: https://github.com/mssola/g source_maybe "$HOME/.g.sh" -source_maybe "$HOME/.gcompletion.sh" +source_maybe "$HOME/.git-prompt.sh" # Complete the `docker` command if possible. source_maybe "$HOME/.dockercompletion.sh" @@ -161,8 +173,10 @@ alias ssh="gpg-connect-agent updatestartuptty /bye >/dev/null; ssh" alias ip="ip --color" alias ipb="ip --color --brief" -# Add the binaries of Doom Emacs into my PATH. +# Add the binaries of Doom Emacs into my PATH (either on the traditional +# `~/.emacs.d` or the XDG-conformant `~/.config/emacs`). export PATH=$PATH:$HOME/.emacs.d/bin +export PATH=$PATH:$HOME/.config/emacs/bin # If we have Rust's source code, export the special `RUST_SRC_PATH`, since this # is useful for completion tools. -- cgit v1.2.3