Compare commits

...

3 Commits

1 changed files with 27 additions and 18 deletions

39
.bashrc
View File

@ -74,12 +74,14 @@ elif 2>/dev/null 1>&2 command -v vi; then
fi fi
alias gdb='gdb -q' alias gdb='gdb -q'
alias objdump='objdump --disassembler-color=extended-color -Mintel'
alias v='nvim' alias v='nvim'
alias vim='nvim' alias vim='nvim'
alias ..='cd ..' alias ..='cd ..'
alias ...='cd ../..' alias ...='cd ../..'
alias ....='cd ../../..' alias ....='cd ../../..'
alias sudo='sudo ' alias sudo='sudo '
alias s='eval sudo $(fc -nl -2 | head -1 | cut -c3-)' # cut -c2- for bash posix mode
alias watch='watch ' alias watch='watch '
alias tmux='tmux -2' alias tmux='tmux -2'
alias open='xdg-open' alias open='xdg-open'
@ -106,7 +108,6 @@ alias tree='tree --dirsfirst -C'
alias francinette='"${HOME-}"/francinette/tester.sh' alias francinette='"${HOME-}"/francinette/tester.sh'
alias paco='"${HOME-}"/francinette/tester.sh' alias paco='"${HOME-}"/francinette/tester.sh'
alias wttr='curl wttr.in' 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 \ alias colors='bash -c "$(curl --silent --location \
"https://gist.githubusercontent.com/HaleTom/\ "https://gist.githubusercontent.com/HaleTom/\
89ffe32783f89f403bba96bd7bcd1263/raw" 89ffe32783f89f403bba96bd7bcd1263/raw"
@ -152,20 +153,28 @@ function paruuu () {
# shellcheck disable=SC2162 # shellcheck disable=SC2162
read read
else else
clear
# shellcheck disable=SC2033 # shellcheck disable=SC2033
time ( time (
printf "\033[30;41m%s\033[m\n" "pacman -Sy archlinux-keyring" \ printf '\033[30;41m%s\033[m\n' 'Cache credentials for sudo:' \
&& sudo -v \
&& printf '\033[30;41m%s\033[m\n' 'Updating mirrorlist' \
&& curl -sSL "https://archlinux.org/mirrorlist/?country=DE&protocol=https&use_mirror_status=on" \
| sed -e 's/^#Server/Server/' -e '/^#/d' \
| rankmirrors -n 8 - \
| sudo tee /etc/pacman.d/mirrorlist \
&& clear \
&& printf '\033[30;41m%s\033[m\n' 'pacman -Sy archlinux-keyring' \
&& yes | sudo pacman -Sy archlinux-keyring \ && yes | sudo pacman -Sy archlinux-keyring \
&& printf "\033[30;41m%s\033[m\n" "pacman -Syyuu --noconfirm" \ && printf '\033[30;41m%s\033[m\n' 'pacman -Syyuu --noconfirm' \
&& yes | sudo pacman -Syyuu --noconfirm \ && yes | sudo pacman -Syyuu --noconfirm \
&& printf "\033[30;41m%s\033[m\n" "paru -Syu --devel --noconfirm" \ && printf '\033[30;41m%s\033[m\n' 'paru -Syyu --devel --noconfirm' \
&& yes | paru -Syu --devel --noconfirm \ && yes | paru -Syyu --devel --noconfirm \
&& printf "\033[30;41m%s\033[m\n" "pacman -Qtdq | pacman -Rns -" \ && printf '\033[30;41m%s\033[m\n' 'pacman -Qtdq | pacman -Rns -' \
&& { pacman -Qtdq | 2>/dev/null sudo pacman --noconfirm -Rns - \ && { pacman -Qtdq | 2>/dev/null sudo pacman --noconfirm -Rns - \
|| printf "\033[30;42m%s\033[m\n" "No pacman orphan packages :)!"; } \ || printf '\033[30;42m%s\033[m\n' 'No pacman orphan packages :)!'; } \
&& printf "\033[30;42m%s\033[m\n" "###### Done without error ######" \ && yes | paru -Scc -d \
|| printf "\033[30;41m%s\033[m\n" "###### Some error occured! ######" && printf '\n\033[30;42m%s\033[m\n' '###### Done without error ######' \
|| printf '\n\033[30;41m%s\033[m\n' '###### Some error occured! ######'
) )
fi fi
} }
@ -186,8 +195,8 @@ function wpa_restart () {
} }
function bat () { function bat () {
2>/dev/null command -v batcat && { batcat "${@-}"; return 0; } 2>/dev/null command -v batcat && { batcat "${@}"; return 0; }
2>/dev/null command -v bat && { $(type -P bat) "${@-}"; return 0; } 2>/dev/null command -v bat && { $(type -P bat) "${@}"; return 0; }
{ printf '%s\n' "bat not found"; return 1; } { printf '%s\n' "bat not found"; return 1; }
} }
@ -207,7 +216,7 @@ function norminette () {
printf "%s\n%b\n" "Norminette v${vers-} instead of v${newst-} detected."\ printf "%s\n%b\n" "Norminette v${vers-} instead of v${newst-} detected."\
'\033[31mPlease up-/downgrade\033[m' '\033[31mPlease up-/downgrade\033[m'
fi fi
$(type -P norminette) -R CheckForbiddenSourceHeader "${@-}" $(type -P norminette) -R CheckForbiddenSourceHeader "${@}"
} }
function __norm () { function __norm () {
@ -379,9 +388,9 @@ if [ -f "${HOME}"/.userbashrc ]; then . "${HOME}"/.userbashrc; fi
alias new_mp_project='clear && builtin cd -P ./ && python3 -m venv ./env/ && . ./env/bin/activate && pip install --no-input opencv-python mediapipe && pip freeze > ./requirements.txt && printf '\''#!/usr/bin/env python3\n\nfrom typing import NoReturn\n\nimport mediapipe as mp\nimport cv2\n\n\ndef main() -> NoReturn:\n\tpass\n\nif __name__ == '\''"'\''"'\''__main__'\''"'\''"'\'':\n\tmain()\n'\'' 1>./main.py && chmod +x ./main.py && printf '\''__pycache__/\nenv/\n'\'' 1>.gitignore && git init && git add -A && git commit -m '\''Initial commit'\'' && git ls-files && echo Done' alias new_mp_project='clear && builtin cd -P ./ && python3 -m venv ./env/ && . ./env/bin/activate && pip install --no-input opencv-python mediapipe && pip freeze > ./requirements.txt && printf '\''#!/usr/bin/env python3\n\nfrom typing import NoReturn\n\nimport mediapipe as mp\nimport cv2\n\n\ndef main() -> NoReturn:\n\tpass\n\nif __name__ == '\''"'\''"'\''__main__'\''"'\''"'\'':\n\tmain()\n'\'' 1>./main.py && chmod +x ./main.py && printf '\''__pycache__/\nenv/\n'\'' 1>.gitignore && git init && git add -A && git commit -m '\''Initial commit'\'' && git ls-files && echo Done'
function x () { function x () {
cc -std=c89 -Wall -Wextra -pedantic -Werror -Wconversion -g3 -O0 -o main ./*.c && ./main "${@-}" cc -std=c89 -Wall -Wextra -pedantic -Werror -Wconversion -g3 -O0 -o main ./*.c && ./main "${@}"
rm -f ./main rm -f ./main
} }
function x2 () { function x2 () {
cc -std=c89 -Wall -Wextra -pedantic -Werror -Wconversion -g3 -O0 -o main ./*.c && ./main "${@-}" cc -std=c89 -Wall -Wextra -pedantic -Werror -Wconversion -g3 -O0 -o main ./*.c && ./main "${@}"
} }