From 40cab168f9f1a39455ae7fe1563517dd970579df Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Mon, 10 Jun 2024 11:02:34 +0200 Subject: [PATCH] shell: update ps1 --- files/shell/.bashrc | 21 ++++++--------------- files/shell/.shellrc.alias | 4 ++-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/files/shell/.bashrc b/files/shell/.bashrc index bc90518..0e36c18 100644 --- a/files/shell/.bashrc +++ b/files/shell/.bashrc @@ -12,11 +12,7 @@ esac git_branch() { if $(git rev-parse --git-dir > /dev/null 2>&1); then local branch_name=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/') - if [[ $(uname) == "OpenBSD" ]]; then - echo "(${branch_name}) " - else - echo "(${branch_name} ) " - fi + echo "${branch_name} " fi } @@ -34,26 +30,21 @@ NEWLINE=$'\n' PROMPT_COMMAND=__prompt_command __prompt_command() { local EXIT="$?" + + # Shorten $PWD, if it's too long if [ $COLUMNS -lt 80 ]; then export PROMPT_DIRTRIM=1 else export PROMPT_DIRTRIM=0 fi - export PS1="${HOST} ${DIR} ${GIT_NIX}${NEWLINE}" - if [[ $(uname) == "OpenBSD" ]]; then - local red_lambda='\[\033[0;31m\]>\[\033[00m\] ' - local green_lambda='\[\033[0;32m\]>\[\033[00m\] ' - else - local red_lambda='\[\033[0;31m\]󱞩\[\033[00m\] ' - local green_lambda='\[\033[0;32m\]󱞩\[\033[00m\] ' - fi + export PS1="${HOST} ${DIR} ${GIT_NIX}${NEWLINE}" if [ $EXIT != 0 ] then - PS1+=$red_lambda + PS1+='\[\033[0;31m\]$\[\033[00m\] ' else - PS1+=$green_lambda + PS1+='\[\033[0;32m\]$\[\033[00m\] ' fi } diff --git a/files/shell/.shellrc.alias b/files/shell/.shellrc.alias index dac0068..5d577c4 100644 --- a/files/shell/.shellrc.alias +++ b/files/shell/.shellrc.alias @@ -22,7 +22,7 @@ alias dh1='du . -h -d1' alias dhs='du . -hs' alias diff_dir='diff -qr' alias g='git' -alias l='eza --icons --hyperlink' +alias l='ls --color --hyperlink' alias nd="nix develop ." alias nssh='SSH_AUTH_SOCK= ssh' alias s='kitten ssh' @@ -57,7 +57,7 @@ ocr() { return fi name=${file%%.*} - ocrmypdf -l ger+eng --output-type pdf $file ${name}.ocr.pdf + ocrmypdf -l deu+eng --output-type pdf $file ${name}.ocr.pdf } # private laptop acpi magic