Quite some changed

This commit is contained in:
cubernetes 2023-08-06 20:54:00 +02:00
parent 5d4a27e015
commit f56563b762
4 changed files with 92 additions and 149 deletions

139
.bashrc
View File

@ -57,6 +57,71 @@ HISTCONTROL='ignoredups:erasedups:ignorespace'
# PROMPT_COMMAND="history -n; history -w; history -c; history -r"
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
if 2>/dev/null 1>&2 command -v nvim; then
alias v='nvim'
alias vi='nvim'
alias vim='nvim'
elif 2>/dev/null 1>&2 command -v vim; then
alias v='vim'
alias vi='vim'
elif 2>/dev/null 1>&2 command -v nvi; then
alias v='nvi'
alias vi='nvi'
elif 2>/dev/null 1>&2 command -v vi; then
alias v='vi'
fi
alias v='nvim'
alias vim='nvim'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias sudo='sudo '
alias watch='watch '
alias tmux='tmux -2'
alias open='xdg-open'
alias xcopy='xsel --clipboard --input'
alias xpaste='xsel --clipboard --output'
alias aptclean='sudo apt -y update && sudo apt -y full-upgrade &&
sudo apt -y dist-upgrade && sudo apt -y autoremove &&
sudo apt -y clean'
alias paruuu='yes | sudo pacman -Sy archlinux-keyring &&
yes | sudo pacman -Syyuu && yes | paru'
alias pacman='pacman --color=auto'
alias pcker='nvim "${HOME}"/.config/nvim/lua/*/packer.lua'
alias after='nvim "${HOME}"/.config/nvim/after/plugin'
alias l='\ls --width="${COLUMNS}" --sort=time --time=mtime --color=auto --time-style=long-iso -bharZ1l'
# alias l='lsd --timesort --color=auto -harZ1l'
alias ll='\ls --width="${COLUMNS}" --sort=time --time=mtime --color=auto --fu -bharZ1l'
alias ls='\ls --width="${COLUMNS}" --color=auto -bC'
alias ip='ip --color=auto'
alias grep='grep --color=auto'
alias diff='diff --width="${COLUMNS}" --color=auto'
alias less='less -SR'
alias dmesg='dmesg --color=auto --reltime --human --nopager --decode'
alias free='free -mht'
alias tree='tree --dirsfirst -C'
alias francinette='"${HOME}"/francinette/tester.sh'
alias paco='"${HOME}"/francinette/tester.sh'
alias wttr='curl wttr.in'
alias s='sudo $(fc -nl -2 | head -1 | cut -c3-)' # cut -c2- for bash posix mode
alias colors='bash -c "$(curl --silent --location \
"https://gist.githubusercontent.com/HaleTom/\
89ffe32783f89f403bba96bd7bcd1263/raw"
)"'
alias sl='sl -GwFdcal'
alias cmatrix='cmatrix -u3 -Cred'
alias gca='git add -u && git commit -m "Automatic add"'
alias watch='watch -tcn.1'
alias pacop='clear && 2>/dev/null paco && 2>/dev/null paco --strict'
alias norm='alacritty -e sh -c '\''watch -cn.5 \
norminette -R CheckForbiddenSourceHeader'\'' & disown'
alias norm2='alacritty -e sh -c '\''watch -cn.5 \
norminette -R CheckForbiddenSourceHeader \| \
xargs -I{} printf \"{} \#\#\# \"'\'' & disown'
alias dotconf='git --git-dir="${HOME}"/.dotfiles/ --work-tree="${HOME}"'
2>/dev/null dotconf config status.showUntrackedFiles no
function skill () {
if [ -n "${1}" ] ; then
# shellcheck disable=SC2046,SC2009
@ -138,70 +203,6 @@ function clone42 () {
} || { printf '%s\n' "Could not clone repo!"; }
}
if 2>/dev/null 1>&2 command -v nvim; then
alias v='nvim'
alias vi='nvim'
alias vim='nvim'
elif 2>/dev/null 1>&2 command -v vim; then
alias v='vim'
alias vi='vim'
elif 2>/dev/null 1>&2 command -v nvi; then
alias v='nvi'
alias vi='nvi'
elif 2>/dev/null 1>&2 command -v vi; then
alias v='vi'
fi
alias v='nvim'
alias vim='nvim'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias sudo='sudo '
alias watch='watch '
alias tmux='tmux -2'
alias open='xdg-open'
alias xcopy='xsel --clipboard --input'
alias xpaste='xsel --clipboard --output'
alias aptclean='sudo apt -y update && sudo apt -y full-upgrade &&
sudo apt -y dist-upgrade && sudo apt -y autoremove &&
sudo apt -y clean'
alias paruuu='yes | sudo pacman -Sy archlinux-keyring &&
yes | sudo pacman -Syyuu && yes | paru'
alias pacman='pacman --color=auto'
alias pcker='nvim "${HOME}"/.config/nvim/lua/*/packer.lua'
alias after='nvim "${HOME}"/.config/nvim/after/plugin'
alias l='\ls --width="${COLUMNS}" --sort=time --time=mtime --color=auto --time-style=long-iso -bFharZ1l'
alias ll='\ls --width="${COLUMNS}" --sort=time --time=mtime --color=auto --fu -bFharZ1l'
alias ls='\ls --width="${COLUMNS}" --color=auto -bC'
alias ip='ip --color=auto'
alias grep='grep --color=auto'
alias diff='diff --width="${COLUMNS}" --color=auto'
alias less='less -SR'
alias dmesg='dmesg --color=auto --reltime --human --nopager --decode'
alias free='free -mht'
alias tree='tree --dirsfirst -C'
alias francinette='"${HOME}"/francinette/tester.sh'
alias paco='"${HOME}"/francinette/tester.sh'
alias wttr='curl wttr.in'
alias s='sudo $(fc -nl -2 | head -1 | cut -c3-)' # cut -c2- for bash posix mode
alias colors='bash -c "$(curl --silent --location \
"https://gist.githubusercontent.com/HaleTom/\
89ffe32783f89f403bba96bd7bcd1263/raw"
)"'
alias sl='sl -GwFdcal'
alias cmatrix='cmatrix -u3 -Cred'
alias gca='git add -u && git commit -m "Automatic add"'
alias watch='watch -tcn.1'
alias pacop='clear && 2>/dev/null paco && 2>/dev/null paco --strict'
alias norm='alacritty -e sh -c '\''watch -cn.5 \
norminette -R CheckForbiddenSourceHeader'\'' & disown'
alias norm2='alacritty -e sh -c '\''watch -cn.5 \
norminette -R CheckForbiddenSourceHeader \| \
xargs -I{} printf \"{} \#\#\# \"'\'' & disown'
alias dotconf='git --git-dir="${HOME}"/.dotfiles/ --work-tree="${HOME}"'
2>/dev/null dotconf config status.showUntrackedFiles no
# shellcheck disable=SC2016
export GIT_SSH_COMMAND='ssh -oIdentitiesOnly=yes -F"${HOME}"/.ssh/config'
export TERM='xterm-256color'
@ -215,6 +216,7 @@ export EDITOR="$(2>/dev/null command -v vim ||
export SUDO_EDITOR="${EDITOR}"
export GIT_PS1_SHOWDIRTYSTATE='1'
export MANPAGER='nvim +Man!'
[ -z "${DISPLAY}" ] && echo 'Warning: DISPLAY is not set'
###################### PROMPT STUFF #######################
@ -261,6 +263,15 @@ else
fi
######################### PROMPT STUFF END #######################
# Key Repeat/Delay Rate
2>/dev/null xset r rate 200 60
# Disable bell
2>/dev/null xset -b
# sudo kbdrate --rate=30.0 --delay=250
# shellcheck disable=SC1091
if [ -f "${HOME}"/.userbashrc ]; then . "${HOME}"/.userbashrc; fi
# Simplified *Bash* Prompt, e.g. for tty/system/linux console
# unset PS0; PS1='\033[94m\u\033[37m@\033[32m\h\033[37m@\033[33m$(basename -- "$(tty)") \033[36m\w \033[35m\$\033[m '

View File

@ -2,8 +2,12 @@ function ColorMyPencils(color)
color = color or "rose-pine"
vim.cmd.colorscheme(color)
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end
-- For inside
ColorMyPencils("gruvbox")
-- For outside
-- ColorMyPencils("shine")

View File

@ -1,3 +1,7 @@
if ! ps aux|grep -v grep|grep startx 1>/dev/null; then
startx 1>/home/tosuman/.startx.log 2>&1
fi
# if running bash
if [ -n "$BASH_VERSION" ] ; then
# include .bashrc if it exists
@ -5,79 +9,3 @@ if [ -n "$BASH_VERSION" ] ; then
. "$HOME/.bashrc"
fi
fi
pathadd () {
# just works
NORM_PATH=":${PATH}:"
NORM_PATH="$(printf '%s' "${NORM_PATH}" | sed 's/::/:/g')"
# TODO: Handle Slashes
NORM_PATH_TO_ADD=":${1}:"
NORM_PATH_TO_ADD="$(printf '%s' "${NORM_PATH_TO_ADD}" | sed 's/::/:/g' | sed 's/::/:/g')"
if [ "$(printf '%s' "${-}" | sed 's/r//')" = "${-}" ] && [ -d "${1}" ] && [ "$(printf '%s' "${NORM_PATH}" | sed "s/$(printf '%s' "${NORM_PATH_TO_ADD}" | awk '{gsub("\x2f", "\x5c\x2f"); print $0}')//")" = "${NORM_PATH}" ]; then
PATH="${PATH:+"${PATH%:}"}${NORM_PATH_TO_ADD%:}"
fi
}
export -f pathadd
ld_lib_path_add () {
# just works
NORM_PATH=":${PATH}:"
NORM_PATH="$(printf '%s' "${NORM_PATH}" | sed 's/::/:/g')"
# TODO: Handle Slashes
NORM_PATH_TO_ADD=":${1}:"
NORM_PATH_TO_ADD="$(printf '%s' "${NORM_PATH_TO_ADD}" | sed 's/::/:/g' | sed 's/::/:/g')"
if [ "$(printf '%s' "${-}" | sed 's/r//')" = "${-}" ] && [ -d "${1}" ] && [ "$(printf '%s' "${NORM_PATH}" | sed "s/$(printf '%s' "${NORM_PATH_TO_ADD}" | awk '{gsub("\x2f", "\x5c\x2f"); print $0}')//")" = "${NORM_PATH}" ]; then
PATH="${PATH:+"${PATH%:}"}${NORM_PATH_TO_ADD%:}"
fi
}
export -f ld_lib_path_add
# shellcheck disable=SC2155
export XDG_RUNTIME_DIR=/run/user/"$(id -u)"
# shellcheck disable=SC2155
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/$(id -u)"/ssh-agent.socket
export USER42='tischmid'
export EMAIL42='timo42@proton.me'
export MAIL='timo42@proton.me'
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
export GOPATH="${HOME}"/go
ld_lib_path_add "${LD_LIBRARY_PATH}:${HOME}/.local/lib"
export LD_LIBRARY_PATH
pathadd '/bin'
pathadd '/sbin'
pathadd '/usr/bin'
pathadd '/usr/sbin'
pathadd '/usr/local/bin'
pathadd '/usr/lcoal/sbin'
pathadd '/usr/local/games'
pathadd '/usr/games'
pathadd '/snap/bin'
pathadd "${HOME}"/bin
pathadd "${HOME}"/.local/bin
pathadd "${HOME}"/.local/include
pathadd "${HOME}"/.brew/bin
pathadd "${GOPATH}"/bin
export PATH
# add cargo bin to path
if [ -f "${HOME}"/.cargo/env ] || [ -r "${HOME}"/.cargo/env ]; then
. "${HOME}"/.cargo/env
fi
export NVM_DIR="${HOME}"/.nvm
# shellcheck disable=SC1091
[ -s "${NVM_DIR}"/nvm.sh ] && . "${NVM_DIR}"/nvm.sh
# shellcheck disable=SC1091
[ -s "${NVM_DIR}"/bash_completion ] && . "${NVM_DIR}"/bash_completion
if ! ps aux|grep -v grep|grep startx 1>/dev/null; then
2>/dev/null startx
fi

View File

@ -5,11 +5,6 @@ set -g mouse on
bind-key -T copy-mode-vi WheelUpPane send -N2 -X scroll-up
bind-key -T copy-mode-vi WheelDownPane send -N2 -X scroll-down
# CTRL-Space instead of CTRL-B as prefix
unbind C-b
set-option -g prefix C-Space
bind-key -n C-b send-prefix
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi V send -X select-line
@ -22,7 +17,7 @@ setw -g pane-base-index 1
set -g base-index 1
# Styling
set -g default-terminal "tmux-256color"
# set -g default-terminal "xterm-256color"
set -g status-style bg=#3c3836,fg=#a89984
set -g status-left "#[bg=#fb4934,fg=#3c3836]  #{session_name} #[bg=#fe8019,fg=#fb4943]#[bg=#504945,fg=#fe8019]"
set -g window-status-format "#[bg=#504945] #{window_index}-#{window_name} #{?#{==:#{window_index},#{session_windows}},#[bg=#3c3836 fg=#504945],}"
@ -39,6 +34,11 @@ set -g pane-active-border-style fg=#fb4934
# set-option -ga terminal-overrides ",xterm*:Tc"
set-option -g history-limit 50000
# CTRL-Space instead of CTRL-B as prefix
unbind C-b
set-option -g prefix C-Space
bind-key -n C-b send-prefix
bind-key -T prefix h select-pane -L
bind-key -T prefix j select-pane -D
bind-key -T prefix k select-pane -U
@ -49,4 +49,4 @@ bind-key -r -T prefix C-j resize-pane -D 2
bind-key -r -T prefix C-k resize-pane -U 2
bind-key -r -T prefix C-l resize-pane -R 2
bind-key -T prefix C-p popup
bind-key -T prefix C-u popup '/usr/local/bin/tmux_urls.py'