use pywal to color alacritty and vim

This commit is contained in:
2024-05-15 22:27:50 +02:00
parent ebe7002e78
commit bfda0a9e27
41 changed files with 1532 additions and 658 deletions

View File

@@ -9,8 +9,8 @@
[[ $- == *i* ]] && source /usr/share/blesh/ble.sh --noattach
if [[ $- == *i* ]]; then # in interactive session
# vim mode
set -o vi
# vim mode
set -o vi
fi
colors() {
@@ -36,7 +36,8 @@ colors() {
printf " ${seq0}TEXT\e[m"
printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m"
done
echo; echo
echo
echo
done
}
@@ -44,12 +45,12 @@ colors() {
# Change the window title of X terminals
case ${TERM} in
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
;;
screen*)
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
;;
xterm* | rxvt* | Eterm* | aterm | kterm | gnome* | interix | konsole*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
;;
screen*)
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
;;
esac
use_color=true
@@ -59,26 +60,26 @@ use_color=true
# instead of using /etc/DIR_COLORS. Try to use the external file
# first to take advantage of user additions. Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
match_lhs=""
[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
[[ -z ${match_lhs} ]] \
&& type -P dircolors >/dev/null \
&& match_lhs=$(dircolors --print-database)
[[ -z ${match_lhs} ]] &&
type -P dircolors >/dev/null &&
match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
if ${use_color} ; then
if ${use_color}; then
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
if type -P dircolors >/dev/null ; then
if [[ -f ~/.dir_colors ]] ; then
if type -P dircolors >/dev/null; then
if [[ -f ~/.dir_colors ]]; then
eval $(dircolors -b ~/.dir_colors)
elif [[ -f /etc/DIR_COLORS ]] ; then
elif [[ -f /etc/DIR_COLORS ]]; then
eval $(dircolors -b /etc/DIR_COLORS)
fi
fi
if [[ ${EUID} == 0 ]] ; then
if [[ ${EUID} == 0 ]]; then
PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '
else
PS1='\[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] '
@@ -89,7 +90,7 @@ if ${use_color} ; then
alias egrep='egrep --colour=auto'
alias fgrep='fgrep --colour=auto'
else
if [[ ${EUID} == 0 ]] ; then
if [[ ${EUID} == 0 ]]; then
# show root@ when we don't have colors
PS1='\u@\h \W \$ '
else
@@ -105,12 +106,12 @@ unset use_color safe_term match_lhs sh
#alias np='nano -w PKGBUILD'
#alias more=less
xhost +local:root > /dev/null 2>&1
xhost +local:root >/dev/null 2>&1
set -o vi
export EDITOR="nvim"
export VISUAL="lvim"
export VISUAL="nvim"
# default
[[ $- != *i* ]] && return
@@ -124,11 +125,11 @@ PS1='[\u@\h \W]\$ '
# load pc individual bashrc content
if [ -e $HOME/.bashrc_individual ]; then
source $HOME/.bashrc_individual
source $HOME/.bashrc_individual
fi
export PATH=$PATH:$HOME/.local/bin
src_files() {
local f
for f in "$@"; do
@@ -147,8 +148,8 @@ if [ -e $HOME/.bash_aliases ]; then
source $HOME/.bash_aliases
fi
src_files "$HOME/.profile.d"
src_files "$HOME/.bashrc.d"
[[ ${BLE_VERSION-} ]] && ble-attach
BASHRC="loaded"