2022-02-03
This commit is contained in:
parent
f86b8496ec
commit
db393215ce
55 changed files with 1907 additions and 0 deletions
21
home/dot-local/bin/extract
Normal file
21
home/dot-local/bin/extract
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -f $1 ]]; then
|
||||
case $1 in
|
||||
*.tar) tar xf "$1" ;;
|
||||
*.tgz) tar xzf "$1" ;;
|
||||
*.tar.gz) tar xzf "$1" ;;
|
||||
*.tbz2) tar xjf "$1" ;;
|
||||
*.tar.bz2) tar xjf "$1" ;;
|
||||
*.bz2) bunzip2 "$1" ;;
|
||||
*.rar) rar x "$1" ;;
|
||||
*.gz) gunzip "$1" ;;
|
||||
*.zip) unzip "$1" ;;
|
||||
*.Z) uncompress "$1" ;;
|
||||
*.7z) 7z x "$1" ;;
|
||||
*.xz) xz -d "$1" ;;
|
||||
*) echo "'$1' cannot be extracted via extract" ;;
|
||||
esac
|
||||
else
|
||||
echo "'$1' is not a valid file"
|
||||
fi
|
11
home/dot-local/bin/man
Executable file
11
home/dot-local/bin/man
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
exec env \
|
||||
LESS_TERMCAP_mb="$(printf "\e[01;31m")" \
|
||||
LESS_TERMCAP_md="$(printf "\e[01;32m")" \
|
||||
LESS_TERMCAP_me="$(printf "\e[0m")" \
|
||||
LESS_TERMCAP_se="$(printf "\e[0m")" \
|
||||
LESS_TERMCAP_so="$(printf "\e[01;44;33m")" \
|
||||
LESS_TERMCAP_ue="$(printf "\e[0m")" \
|
||||
LESS_TERMCAP_us="$(printf "\e[01;36m")" \
|
||||
man "$@"
|
16
home/dot-local/bin/mkcache
Executable file
16
home/dot-local/bin/mkcache
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
for file in "${@:-"${PWD}"}"; do
|
||||
if [[ ! -d "${file}" ]]; then
|
||||
printf $"%s: cannot create cache directory tag '%s': %s\n" \
|
||||
"${0##*/}" "${file}" $"File is not a directory" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
cat >"${file}/CACHEDIR.TAG" <<EOF
|
||||
Signature: 8a477f597d28d172789f06886806bc55
|
||||
# This file is a cache directory tag created by bash.
|
||||
# For information about cache directory tags see https://bford.info/cachedir/
|
||||
EOF
|
||||
|
||||
done
|
5
home/dot-local/bin/run-bash
Executable file
5
home/dot-local/bin/run-bash
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source "/home/louis/Documents/dotfiles/home/dot-local/lib/bash/init.sh"
|
||||
|
||||
abort 1 "ups"
|
26
home/dot-local/bin/update-code
Executable file
26
home/dot-local/bin/update-code
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
: "${LIB_SHELL_PATH:="${XDG_LIB_HOME:-"${HOME}/.local/lib"}/bash"}"
|
||||
|
||||
LIB_SHELL_PATH="/home/louis/Documents/dotfiles/home/dot-local/lib/bash"
|
||||
|
||||
# shellcheck disable=SC2015
|
||||
[[ -e "${LIB_SHELL_PATH}/common.sh" ]] && {
|
||||
export IMPORTPATH="${PWD}:${LIB_SHELL_PATH}"
|
||||
# shellcheck source=home/dot-local/lib/bash/common.sh
|
||||
source "${LIB_SHELL_PATH}/common.sh" >/dev/null 2>&1
|
||||
} || { echo "error: cannot load common shell lib" >&2; exit 1; }
|
||||
|
||||
import "github-api.sh"
|
||||
|
||||
function @report() {
|
||||
printf "➜ %s of vscodium is avaiable\n" "${@}"
|
||||
}
|
||||
|
||||
while read -r version link; do
|
||||
if ! rpm -qa | grep "codium-${version}" >/dev/null; then
|
||||
@report "version ${version}"
|
||||
sudo dnf install -y "${link}"
|
||||
else
|
||||
@report "no new version"
|
||||
fi
|
||||
done < <(SUFFIX="$(uname -i).rpm" github_latest_release_assets 'vscodium')
|
Loading…
Add table
Add a link
Reference in a new issue