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

@@ -1,9 +1,6 @@
alias ls='ls --color=auto'
alias lah='ls -lah'
alias ll='lah'
alias v=vim
alias vim=nvim
alias nvim=lvim
# folders
alias gh="cd"

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"

5
home/bashrc.d/01_wal Normal file
View File

@@ -0,0 +1,5 @@
#(cat $HOME/.cache/wal/sequences &)
#(source $HOME/.cache/wal/colors-tty.sh &)

View File

@@ -1,2 +1,23 @@
alias r=ranger
alias r=ranger_cd
ranger() {
if [ -z "$RANGER_LEVEL" ]; then
/usr/bin/ranger "$@"
else
exit
fi
}
ranger_cd() {
temp_file="$(mktemp -t "ranger_cd.XXXXXXXXXX")"
ranger --choosedir="$temp_file" -- "${@:-$PWD}"
if chosen_dir="$(cat -- "$temp_file")" && [ -n "$chosen_dir" ] && [ "$chosen_dir" != "$PWD" ]; then
cd -- "$chosen_dir"
fi
rm -f -- "$temp_file"
}
if [ "$RANGERCD" ]; then unset RANGERCD && ranger_cd; fi
#$RANGERCD && unset RANGERCD && ranger_cd

8
home/bashrc.d/vim Normal file
View File

@@ -0,0 +1,8 @@
alias v=vim
alias vim=nvim
#alias lvim="NVIM_APPNAME=nvim-lazy nvim"
alias lvim="NVIM_APPNAME=nvim nvim"
alias avim="NVIM_APPNAME=nvim-astro nvim"
alias cvim="NVIM_APPNAME=nvim-chad nvim"

View File

@@ -17,8 +17,6 @@ src_files() {
src_files "$HOME/.profile.d"
if [ -f ~/.bashrc ];
then
. ~/.bashrc;
fi
PATH=$PATH:$HOME/bin export PATH
[[ -f $HOME/.bashrc ]] && . $HOME/.bashrc
export PATH=$PATH:$HOME/.local/bin

View File

@@ -1 +1 @@
PATH="/opt/forticlient:$PATH"
export PATH="/opt/forticlient:$PATH"

4
home/profile.d/vim Normal file
View File

@@ -0,0 +1,4 @@
export EDITOR=nvim
export VISUAL=nvim