Move to shared punktdateien-bashrc
This commit is contained in:
parent
beefd1dc57
commit
26338865f7
15 changed files with 29 additions and 266 deletions
1
bash/bashrc.d/.gitignore
vendored
1
bash/bashrc.d/.gitignore
vendored
|
@ -1 +0,0 @@
|
|||
config.sh
|
|
@ -1,25 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2139
|
||||
|
||||
# StarOpenSource Development
|
||||
alias "besseretests=godot --headless -d -v -s --path . addons/besseretests/src/cmd.gd"
|
||||
alias "besseretests-gui=godot -d -v -s --path . addons/besseretests/src/cmd.gd"
|
||||
|
||||
# Safety
|
||||
alias "rm=rm -ri"
|
||||
|
||||
# CPU Governor
|
||||
alias "finfo=sudo cpupower frequency-info"
|
||||
alias "fset=sudo cpupower frequency-set -g"
|
||||
|
||||
# Fun ;)
|
||||
alias "fireplace=$(which fireplace) -f 60 -t 13"
|
||||
alias "quote=fortune -s linux debian|cowsay"
|
||||
|
||||
# Replacements
|
||||
alias "ls=$(which eza) ${ARGS_EZA}"
|
||||
alias "dir=$(which eza) ${ARGS_EZA}"
|
||||
alias "eza=$(which eza) ${ARGS_EZA}"
|
||||
alias "more=$(which moar) ${ARGS_MOAR}"
|
||||
alias "less=$(which moar) ${ARGS_MOAR}"
|
||||
alias "moar=$(which moar) ${ARGS_MOAR}"
|
|
@ -1,128 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
function osu-oszimport() {
|
||||
if [ ! -f "${HOME}/.cache/osu.AppImage" ]; then
|
||||
echo "--> Could not find ~/.cache/osu.AppImage"
|
||||
echo " Please download and start osu! using osu!boot first."
|
||||
else
|
||||
for file in *.osz; do
|
||||
if [ "${file}" == "*.osz" ]; then
|
||||
echo "--> No .osz file has been found"
|
||||
else
|
||||
echo "--> Importing ${file}"
|
||||
~/.cache/osu.AppImage "${file}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
function godot-setup() {
|
||||
(
|
||||
set -eo pipefail
|
||||
if [ ! -f "project.godot" ]; then
|
||||
echo ":: Error: No project.godot file was found."
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -n "$HELP" ]; then
|
||||
echo ":: Available environment variables:"
|
||||
echo " \$CORE_BRANCH=<develop|stable>"
|
||||
echo " \$INSTALL_SUI=<false|true>"
|
||||
echo " \$INSTALL_VENUS=<false|true>"
|
||||
echo ""
|
||||
echo ":: Note: The first listed value is the default"
|
||||
echo " for that specific environment variable."
|
||||
exit
|
||||
fi
|
||||
if [ -z "$CORE_BRANCH" ]; then CORE_BRANCH=develop; fi
|
||||
if [ -z "$INSTALL_SUI" ]; then INSTALL_SUI=false; fi
|
||||
if [ -z "$INSTALL_VENUS" ]; then INSTALL_VENUS=false; fi
|
||||
|
||||
if [ ! -d ".git" ]; then
|
||||
echo ":: Initializing git repository"
|
||||
git init -b develop
|
||||
fi
|
||||
|
||||
echo ":: Creating files"
|
||||
wget -q --show-progress "https://www.gnu.org/licenses/agpl-3.0.txt" -O LICENSE
|
||||
cat << EOF >> README.md
|
||||
# New project
|
||||
You need to fill this README.md out.
|
||||
EOF
|
||||
|
||||
echo ":: Removing default icon"
|
||||
rm -rf icon.png
|
||||
|
||||
echo ":: Creating directories"
|
||||
mkdir -p src scenesrc assets/{images,sprites,music,sfx,fonts,themes} dist/submodules addons
|
||||
|
||||
echo ":: Installing CORE"
|
||||
git submodule add https://git.staropensource.de/StarOpenSource/CORE-distrib-git.git dist/submodules/CORE
|
||||
(
|
||||
cd dist/submodules/CORE
|
||||
git checkout "$CORE_BRANCH"
|
||||
)
|
||||
ln -s dist/submodules/CORE CORE
|
||||
|
||||
if [ "$INSTALL_SUI" == "true" ]; then
|
||||
echo ":: Installing StarOpenSource UI"
|
||||
git submodule add https://git.staropensource.de/StarOpenSource/SUI-distrib.git dist/submodules/SUI
|
||||
ln -s ../dist/submodules/SUI addons/SUI
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_VENUS" == "true" ]; then
|
||||
echo ":: Installing Venus"
|
||||
git submodule add https://git.staropensource.de/StarOpenSource/venus.git dist/submodules/Venus
|
||||
ln -s ../dist/submodules/Venus addons/venus
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
function cleanhome() {
|
||||
echo ":: Cleaning ~"
|
||||
rm -rf "${HOME}/.dotnet" "${HOME}/.fltk" "${HOME}/.gradle" "${HOME}/.hyprland" \
|
||||
"${HOME}/.java" "${HOME}/.npm" "${HOME}/.nuget" "${HOME}/.nvm" "${HOME}/.openjfx" \
|
||||
"${HOME}/.pki" "${HOME}/.vnc" "${HOME}/.yarn" "${HOME}/go" "${HOME}/.lesshst" \
|
||||
"${HOME}/.wget-hsts" "${HOME}/.yarnrc" "${HOME}/package-lock.json" "${HOME}/package.json" \
|
||||
"${HOME}/node_modules" "${HOME}/.npmrc" "${HOME}/.gtkrc-2.0" "${HOME}/.electron-gyp" \
|
||||
"${HOME}/.python_history" "${HOME}/.m2" "${HOME}/.mono" "${HOME}/.local/share/NuGet"
|
||||
}
|
||||
|
||||
function extract(){
|
||||
if [ -z "${1}" ]; then
|
||||
echo ":: Error: No file given."
|
||||
return 1
|
||||
fi
|
||||
if [ -f "${1}" ]; then
|
||||
case "${1}" in
|
||||
*.tar|*.tar.xz) tar xf "${1}" ;;
|
||||
*.tar.bz2) tar xjf "${1}" ;;
|
||||
*.tar.gz|*.tgz) tar xzf "${1}" ;;
|
||||
*.tar.zst) unzstd "${1}" ;;
|
||||
*.tbbz2) tar xjf "${1}" ;;
|
||||
*.gz) gunzip "${1}" ;;
|
||||
*.xz) xz -d "${1}" ;;
|
||||
*.bz2) bunzip2 "${1}" ;;
|
||||
*.rar) unrar x "${1}" ;;
|
||||
*.zip|*.jar) unzip "${1}" ;;
|
||||
*.7z) 7z x "${1}" ;;
|
||||
*.Z) uncompress "${1}" ;;
|
||||
*.deb) ar x "${1}" ;;
|
||||
*)
|
||||
echo ":: Error: Invalid archive"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
elif [ -d "${1}" ]; then
|
||||
## is it a bird? is it a dir?
|
||||
echo ":: Error: Is a directory"
|
||||
return 1
|
||||
elif [ -a "${1}" ]; then
|
||||
## if block device or something
|
||||
echo ":: Error: jeremystartm's bashrc implementation of the extract command only supports files."
|
||||
return 1
|
||||
else
|
||||
## not found
|
||||
echo ":: Error: No such file or directory"
|
||||
return 1
|
||||
fi
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
export "PATH=${PATH}:${HOME}/.local/bin:${HOME}/.local/share/flatpak/exports/bin:${HOME}/.cargo/bin"
|
|
@ -1,21 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Arguments for some programs
|
||||
export "ARGS_EZA=--long --binary --mounts --no-git --color=always --color-scale=size --color-scale-mode=fixed --no-quotes --smart-group --almost-all --sort name"
|
||||
export "ARGS_MOAR=-colors 16M -statusbar bold --style dracula"
|
||||
|
||||
# General
|
||||
export "PAGER=$(which moar) ${ARGS_MOAR}"
|
||||
|
||||
# Wine
|
||||
export "WINEDEBUG=-all"
|
||||
|
||||
# Rust
|
||||
export "RUSTFLAGS=-Z threads=$(nproc)"
|
||||
|
||||
# PNPM
|
||||
export PNPM_HOME="/home/jeremystartm/.local/share/pnpm"
|
||||
case ":$PATH:" in
|
||||
*":$PNPM_HOME:"*) ;;
|
||||
*) export PATH="$PNPM_HOME:$PATH" ;;
|
||||
esac
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
source "/usr/share/icons-in-terminal/icons_bash.sh"
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
source /usr/share/nvm/init-nvm.sh
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
export SDKMAN_DIR="$HOME/.sdkman"
|
||||
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
eval "$(starship init bash)"
|
|
@ -1,2 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
env "BASHRC=true" dotfiles-updatechecker
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
quote
|
|
@ -1,64 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2154
|
||||
|
||||
cd "${HOME:?}/.bashrc.d" || (
|
||||
echo ":: Can't cd into ${HOME:?}/.bashrc.d"
|
||||
exit 1
|
||||
)
|
||||
|
||||
# Initialize basic stuff
|
||||
[[ -f "init.d/path.sh" ]] && source "init.d/path.sh"
|
||||
[[ -f "init.d/variables.sh" ]] && source "init.d/variables.sh"
|
||||
[[ -f "init.d/aliases.sh" ]] && source "init.d/aliases.sh"
|
||||
[[ -f "init.d/functions.sh" ]] && source "init.d/functions.sh"
|
||||
|
||||
# Create new configuration file
|
||||
[[ ! -f "config.sh" ]] && $(which cat) << EOF >> config.sh
|
||||
#!/usr/bin/env bash
|
||||
CONFIG_FLOW_CONTROL=0
|
||||
CONFIG_AUTOSAVE_HISTORY=1
|
||||
CONFIG_CUSTOM_PROMPT=1
|
||||
CONFIG_EDITOR=nano
|
||||
CONFIG_REPLACE_PKGMGR_ORIGINAL=pacman
|
||||
CONFIG_REPLACE_PKGMGR_REPLACEMENT=paru
|
||||
EOF
|
||||
|
||||
# Load configuration file
|
||||
source "config.sh"
|
||||
|
||||
# Process configuration changes
|
||||
# -> Flow control
|
||||
[[ "${CONFIG_FLOW_CONTROl}" == "0" ]] && stty -ixon
|
||||
[[ "${CONFIG_FLOW_CONTROL}" == "1" ]] && stty ixon
|
||||
|
||||
# -> Autosave history
|
||||
[[ "${CONFIG_AUTOSAVE_HISTORY}" == "1" ]] && export "PROMPT_COMMAND=history -a"
|
||||
|
||||
# -> Custom prompt
|
||||
if [[ "${CONFIG_CUSTOM_PROMPT}" == "1" ]]; then
|
||||
export "PS1=\[\033[38;5;33m\][\[$(tput sgr0)\]\[\033[38;5;38m\]\u\[$(tput sgr0)\]\[\033[38;5;33m\]@\[$(tput sgr0)\]\[\033[38;5;38m\]\H\[$(tput sgr0)\]\[\033[38;5;33m\]:\[$(tput sgr0)\]\[\033[38;5;38m\]\W\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;214m\]\$?\[$(tput sgr0)\]\[\033[38;5;33m\]]\\$\[$(tput sgr0)\] "
|
||||
export "PS2=\[\033[38;5;196m\][incomplete]: \033[0;10m"
|
||||
export "PS4=\${0}:\${LINENO}+ "
|
||||
fi
|
||||
|
||||
# -> Editor
|
||||
export "EDITOR=${CONFIG_EDITOR}"
|
||||
|
||||
# -> Package manager replacement
|
||||
if [ -n "${CONFIG_REPLACE_PKGMGR_ORIGINAL}" ] && [ -n "${CONFIG_REPLACE_PKGMGR_REPLACEMENT}" ]; then
|
||||
# shellcheck disable=SC2139
|
||||
alias "${CONFIG_REPLACE_PKGMGR_ORIGINAL}=${CONFIG_REPLACE_PKGMGR_REPLACEMENT}"
|
||||
fi
|
||||
|
||||
|
||||
# Initialize shell programs
|
||||
for file in programs.d/*; do
|
||||
# shellcheck disable=SC1090
|
||||
source "${file}"
|
||||
done
|
||||
|
||||
# Run startup scripts
|
||||
for file in startup.d/*; do
|
||||
# shellcheck disable=SC1090
|
||||
source "${file}"
|
||||
done
|
17
bin/updater
17
bin/updater
|
@ -5,20 +5,25 @@ cd "${HOME}/.dotfiles" || (
|
|||
)
|
||||
|
||||
# Define updater version
|
||||
LOCAL_UPDATER_VERSION=3
|
||||
LOCAL_UPDATER_VERSION=4
|
||||
|
||||
case "${STAGE}" in
|
||||
1)
|
||||
# 0 - 2 -> 3
|
||||
if [ -z "${UPDATER_VERSION}" ] || [ "${UPDATER_VERSION}" -lt "3" ]; then
|
||||
echo ":: S1 | Unlinking legacy file paths"
|
||||
echo ":: S1 | Updating to UPDATER_VERSION 3"
|
||||
./uninstall.sh --remove-legacy-paths
|
||||
fi
|
||||
|
||||
# 3 -> 4
|
||||
if [ ${UPDATER_VERSION}" -lt "4" ]; then
|
||||
echo ":: S1 | Updating to UPDATER_VERSION 4"
|
||||
./uninstall.sh --remove-unshared-bashrcd
|
||||
fi
|
||||
|
||||
|
||||
echo ":: S1 | Uninstalling & unlinking (safety measure)"
|
||||
./uninstall.sh
|
||||
else
|
||||
echo ":: S1 | Uninstalling"
|
||||
./uninstall.sh
|
||||
fi
|
||||
|
||||
echo ":: S1 | Installing"
|
||||
./install.sh
|
||||
|
|
11
install.sh
11
install.sh
|
@ -17,6 +17,15 @@ function link() {
|
|||
}
|
||||
|
||||
# update/clone repositories
|
||||
[[ ! -d "repositories/punktdateien-bashrc" ]] && git clone "https://git.staropensource.de/JeremyStarTM/punktdateien-bashrc.git" repositories/punktdateien-bashrc
|
||||
(
|
||||
cd repositories/punktdateien-bashrc || (
|
||||
echo ":: Error: Can't cd into repositories/punktdateien-bashrc"
|
||||
exit 1
|
||||
)
|
||||
git pull
|
||||
)
|
||||
|
||||
[[ ! -d "repositories/dracula-mc" ]] && git clone "https://github.com/dracula/midnight-commander.git" repositories/dracula-mc
|
||||
(
|
||||
cd repositories/dracula-mc || (
|
||||
|
@ -35,7 +44,7 @@ link "repositories/dracula-mc/skins/dracula256.ini" ".local/share/mc/skins/dracu
|
|||
|
||||
# bash
|
||||
link "bash/bashrc" ".bashrc"
|
||||
link "bash/bashrc.d" ".bashrc.d"
|
||||
link "repositories/punktdateien-bashrc" ".bashrc.d"
|
||||
link "bash/bin/launch-menu" ".local/bin/launch-menu"
|
||||
link "bash/jobrunner/daemon.sh" ".local/bin/jobrunner"
|
||||
link "bash/jobrunner/runjob.sh" ".local/bin/jobrunner-runjob"
|
||||
|
|
|
@ -81,7 +81,12 @@ for arg in "${@}"; do
|
|||
rm -rf "jstmbash" "dracula-mc"
|
||||
|
||||
echo ":: Unlinked legacy paths"
|
||||
exit 1
|
||||
exit 0
|
||||
;;
|
||||
"--remove-unshared-bashrcd")
|
||||
echo ":: Removing unshared bashrc.d"
|
||||
FORCED_UNLINKING=y unlink ".bashrc.d"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo ":: Warning: Unknown argument \"${arg}\""
|
||||
|
|
Loading…
Reference in a new issue