nicer bash test

This commit is contained in:
Tobias Powalowski 2023-01-31 17:46:57 +01:00
parent 27a578801d
commit 72d93fccac
2 changed files with 12 additions and 7 deletions

View file

@ -1,9 +1,13 @@
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
# check on bash
[[ -n "${BASH_VERSION:-}" ]] || return
# color output
alias ls='ls --color=auto'
alias grep='grep --color=auto'
# set neovim default editor
# set neovim as default editor
alias vi='nvim'
alias vim='nvim'
alias edit='nvim'

View file

@ -1,9 +1,10 @@
# SPDX-License-Identifier: GPL-2.0-only
# created by Tobias Powalowski <tpowa@archlinux.org>
if [[ "${0}" == "-bash" ]]; then
if [[ "${UID}" == 0 ]]; then
PS1='[\e[1;31m\u\e[m@\e[1;32m\h\e[m \W]\$ '
else
PS1='[\e[1;34m\u\e[m@\e[1;32m\h\e[m \W]\$ '
fi
# check on bash
[[ -n "${BASH_VERSION:-}" ]] || return
if [[ "${UID}" == 0 ]]; then
PS1='[\e[1;31m\u\e[m@\e[1;32m\h\e[m \W]\$ '
else
PS1='[\e[1;34m\u\e[m@\e[1;32m\h\e[m \W]\$ '
fi