chore(shell): ifdef unicode chars

This commit is contained in:
Marco Thomas
2024-02-19 19:18:48 +01:00
parent 2a728e9849
commit 8d452a51fd
2 changed files with 14 additions and 5 deletions

View File

@@ -12,8 +12,12 @@ esac
git_branch() { git_branch() {
if $(git rev-parse --git-dir > /dev/null 2>&1); then 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/') 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} ) " echo "(${branch_name} ) "
fi fi
fi
} }
nix_env() { nix_env() {
@@ -32,8 +36,13 @@ __prompt_command() {
local EXIT="$?" local EXIT="$?"
export PS1="${HOST} ${DIR} ${GIT_NIX}${NEWLINE}" 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 red_lambda='\[\033[0;31m\]󱞩\[\033[00m\] '
local green_lambda='\[\033[0;32m\]󱞩\[\033[00m\] ' local green_lambda='\[\033[0;32m\]󱞩\[\033[00m\] '
fi
if [ $EXIT != 0 ] if [ $EXIT != 0 ]
then then

View File

@@ -21,7 +21,7 @@ alias nd="nix develop ."
alias nssh='SSH_AUTH_SOCK= ssh' alias nssh='SSH_AUTH_SOCK= ssh'
alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE` alias o='xdg-open' # to change a mime use: `xdg-mime default APPLICATION HANDLE`
t(){ t(){
tmux new-session -A -s ${1:-🚀} tmux new-session -A -s ${1:-dev}
} }
### nmcli(1) ### nmcli(1)