mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
chore(lint): linting, tweaks, cleanup
This commit is contained in:
24
base/bashrc
Normal file → Executable file
24
base/bashrc
Normal file → Executable file
@@ -7,19 +7,27 @@ export DOTFILES="$HOME/.dotfiles"
|
||||
# Run x-load-configs in your terminal to reload the files.
|
||||
function x-load-configs()
|
||||
{
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
HOST="$(hostname -s)"
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
[ -r "$file" ] && source "$file"
|
||||
[ -r "$file-secret" ] && source "$file-secret"
|
||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||
done
|
||||
# global (exports|alias|functions) file for all hosts
|
||||
# shellcheck source=../config/exports
|
||||
[ -r "$file" ] && source "$file"
|
||||
# global secret file, git ignored
|
||||
# shellcheck source=../config/exports-secret
|
||||
[ -r "$file-secret" ] && source "$file-secret"
|
||||
# host specific (exports|alias|functions) file
|
||||
# shellcheck source=../config/exports
|
||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||
# host specific (exports|alias|functions) file, git ignored
|
||||
# shellcheck source=../config/exports
|
||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||
done
|
||||
}
|
||||
x-load-configs
|
||||
|
||||
# Import ssh keys in keychain
|
||||
ssh-add -A 2>/dev/null;
|
||||
ssh-add -A 2> /dev/null
|
||||
|
||||
# shellcheck source=../config/fzf/fzf.bash
|
||||
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
|
||||
|
||||
4
base/zshrc
Normal file → Executable file
4
base/zshrc
Normal file → Executable file
@@ -42,8 +42,7 @@ x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
|
||||
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
|
||||
autoload -Uz compinit
|
||||
|
||||
if type brew &>/dev/null
|
||||
then
|
||||
if type brew &> /dev/null; then
|
||||
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
|
||||
fi
|
||||
|
||||
@@ -70,4 +69,3 @@ have antigen && {
|
||||
|
||||
# Start starship
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
# Configuration for Alacritty, the GPU enhanced terminal emulator
|
||||
|
||||
# Any items in the `env` entry below will be added as
|
||||
|
||||
6
install
6
install
@@ -27,9 +27,9 @@ git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||
if [ "${DOTBOT_HOST}" != "" ]; then
|
||||
DOTBOT_HOST_CONFIG="${BASEDIR}/hosts/${DOTBOT_HOST}/${CONFIG}"
|
||||
echo "-> Trying if host config can be found: ${DOTBOT_HOST_CONFIG}"
|
||||
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] &&
|
||||
echo "(!) Found $DOTBOT_HOST_CONFIG" &&
|
||||
"$DOTBOT_BIN_PATH" \
|
||||
[ -r "$DOTBOT_HOST_CONFIG" ] && [ -f "$DOTBOT_HOST_CONFIG" ] \
|
||||
&& echo "(!) Found $DOTBOT_HOST_CONFIG" \
|
||||
&& "$DOTBOT_BIN_PATH" \
|
||||
-d "$BASEDIR" \
|
||||
--plugin-dir=tools/dotbot-brew \
|
||||
--plugin-dir=tools/dotbot-include \
|
||||
|
||||
@@ -250,10 +250,8 @@ function section_dotfiles
|
||||
~/.local/share/nvim \
|
||||
~/.local/state/nvim \
|
||||
~/.cache/nvim \
|
||||
~/.config/astronvim \
|
||||
~/.config/nvim
|
||||
msg_ok "Deleted old nvim files"
|
||||
ln -s "$DOTFILES/config/astronvim" ~/.config/astronvim
|
||||
msg_ok "Deleted old nvim files (share, state and cache + config)"
|
||||
ln -s "$DOTFILES/config/nvim" ~/.config/nvim
|
||||
msg_ok "Linked nvim and astronvim"
|
||||
have npm && $0 install npm
|
||||
|
||||
@@ -16,21 +16,22 @@ COLOR_S='\033[0;36m'
|
||||
RESET='\033[0m'
|
||||
|
||||
# Print time-based personalized message, using figlet & lolcat if availible
|
||||
function welcome_greeting () {
|
||||
function welcome_greeting()
|
||||
{
|
||||
h=$(date +%H)
|
||||
if [ "$h" -lt 04 ] || [ "$h" -gt 22 ];
|
||||
then greeting="Good Night"
|
||||
elif [ "$h" -lt 12 ];
|
||||
then greeting="Good morning"
|
||||
elif [ "$h" -lt 18 ];
|
||||
then greeting="Good afternoon"
|
||||
elif [ "$h" -lt 22 ];
|
||||
then greeting="Good evening"
|
||||
if [ "$h" -lt 04 ] || [ "$h" -gt 22 ]; then
|
||||
greeting="Good Night"
|
||||
elif [ "$h" -lt 12 ]; then
|
||||
greeting="Good morning"
|
||||
elif [ "$h" -lt 18 ]; then
|
||||
greeting="Good afternoon"
|
||||
elif [ "$h" -lt 22 ]; then
|
||||
greeting="Good evening"
|
||||
else
|
||||
greeting="Hello"
|
||||
fi
|
||||
WELCOME_MSG="$greeting $USER!"
|
||||
if hash lolcat 2>/dev/null && hash figlet 2>/dev/null; then
|
||||
if hash lolcat 2> /dev/null && hash figlet 2> /dev/null; then
|
||||
echo "${WELCOME_MSG}" | figlet | lolcat
|
||||
else
|
||||
echo -e "$COLOR_P${WELCOME_MSG}${RESET}\n"
|
||||
@@ -38,8 +39,9 @@ function welcome_greeting () {
|
||||
}
|
||||
|
||||
# Print system information with neofetch, if it's installed
|
||||
function welcome_sysinfo () {
|
||||
if hash neofetch 2>/dev/null; then
|
||||
function welcome_sysinfo()
|
||||
{
|
||||
if hash neofetch 2> /dev/null; then
|
||||
neofetch --shell_version off \
|
||||
--disable kernel distro shell resolution cpu gpu de wm wm_theme theme icons terminal \
|
||||
--backend off \
|
||||
@@ -50,7 +52,8 @@ function welcome_sysinfo () {
|
||||
}
|
||||
|
||||
# Print todays info: Date, IP, weather, etc
|
||||
function welcome_today () {
|
||||
function welcome_today()
|
||||
{
|
||||
timeout=1
|
||||
echo -e "\033[1;34mToday\n------"
|
||||
|
||||
@@ -62,7 +65,7 @@ function welcome_today () {
|
||||
echo -e "${RESET}"
|
||||
|
||||
# Print IP address
|
||||
if hash ip 2>/dev/null; then
|
||||
if hash ip 2> /dev/null; then
|
||||
ip_address=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
|
||||
ip_interface=$(ip route get 8.8.8.8 | awk -F"dev " 'NR==1{split($2,a," ");print a[1]}')
|
||||
echo -e "${COLOR_S}🌐 IP: $(curl -s -m $timeout 'https://ipinfo.io/ip') (${ip_address} on ${ip_interface})"
|
||||
@@ -71,23 +74,11 @@ function welcome_today () {
|
||||
}
|
||||
|
||||
# Putting it all together
|
||||
function welcome() {
|
||||
function welcome()
|
||||
{
|
||||
welcome_greeting
|
||||
welcome_sysinfo
|
||||
welcome_today
|
||||
}
|
||||
|
||||
# Determine if file is being run directly or sourced
|
||||
([[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|
||||
|| [[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" \
|
||||
&& printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] \
|
||||
|| [[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)
|
||||
) && sourced=1 || sourced=0
|
||||
|
||||
# If script being called directly run immediately
|
||||
if [ "$sourced" -eq 0 ]; then
|
||||
welcome "$@"
|
||||
fi
|
||||
|
||||
# EOF
|
||||
|
||||
welcome "$@"
|
||||
|
||||
@@ -29,7 +29,7 @@ for pkg in "${packages[@]}"; do
|
||||
# Skip comments
|
||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||
|
||||
msg "Installing cargo package $pkg"
|
||||
msg_run "Installing cargo package $pkg"
|
||||
cargo install "$pkg"
|
||||
|
||||
echo ""
|
||||
|
||||
@@ -9,6 +9,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
}
|
||||
|
||||
packages=(
|
||||
"pipx"
|
||||
"libtmux"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user