chore: Update to use bash instead of zsh

This commit is contained in:
Menno van Leeuwen 2024-10-21 15:27:07 +02:00
parent 80edbfc48c
commit f3ee35f577
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE
29 changed files with 132 additions and 167 deletions

93
.bashrc Normal file
View File

@ -0,0 +1,93 @@
# HISTFILE Configuration (Bash equivalent)
HISTFILE=~/.bash_history
HISTSIZE=1000
HISTFILESIZE=2000 # Adjusted to match both histfile and size criteria
# Alias Definitions
alias docker-compose='docker compose'
alias gg='git pull'
alias gl='git log --stat'
alias l="eza --header --long --git --group-directories-first --group --icons --color=always --sort=name --hyperlink -o --no-permissions"
alias ll='l'
alias la='l -a'
alias ddpul='docker compose down && docker compose pull && docker compose up -d && docker compose logs -f'
alias cat='bat'
# Docker Aliases
alias d='docker'
alias dc='docker compose'
alias dce='docker compose exec'
alias dcl='docker compose logs'
alias dcd='docker compose down'
alias dcu='docker compose up'
alias dcp='docker compose ps'
alias dcps='docker compose ps'
alias dcr='docker compose run'
# Git aliases
alias g='git'
alias gs='git status -s'
alias gst='git status'
alias ga='git add'
alias gc='git commit'
alias gcm='git commit -m'
alias gco='git checkout'
alias gcb='git checkout -b'
# netstat port in use check
alias port='netstat -atupn | grep LISTEN'
# Hotkeys daemon
alias hk='dotf hotkey-daemon'
# Alias for ls to l but only if it's an interactive shell because we don't want to override ls in scripts which could blow up in our face
if [ -t 1 ]; then
alias ls='l'
fi
# Alias for ssh.exe and ssh-add.exe on Windows WSL (microsoft-standard-WSL2)
if [[ $(uname -a) == *"microsoft-standard-WSL2"* ]]; then
source $HOME/.agent-bridge.sh
alias op='op.exe'
fi
# PATH Manipulation
export PATH=$PATH:$HOME/.local/bin
export PATH=$PATH:$HOME/.cargo/bin
export PATH=$PATH:$HOME/dotfiles/bin
# Go Configuration
export GOPATH=$HOME/.go
export GOROOT=$HOME/.go-root
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
# Tradaware / DiscountOffice Configuration
if [ -d "/home/menno/Projects/Work" ]; then
export TRADAWARE_FROM_SOURCE=true
fi
# pyenv Configuration
export PYENV_ROOT="$HOME/.pyenv"
if [[ -d $PYENV_ROOT/bin ]]; then
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
fi
# Flutter Environment
if [ -d "$HOME/flutter" ]; then
export PATH="$PATH:$HOME/flutter/bin"
export CHROME_EXECUTABLE=/usr/bin/brave-browser
fi
# 1Password Source Plugin (Assuming bash compatibility)
if [ -f /home/menno/.config/op/plugins.sh ]; then
source /home/menno/.config/op/plugins.sh
fi
# Starship Prompt Initialization (Adapted for Bash)
eval "$(starship init bash)"
# Display a welcome message for interactive shells
if [ -t 1 ]; then
dotf term
fi

125
.zshrc
View File

@ -1,125 +0,0 @@
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
zstyle :compinstall filename '/home/menno/.zshrc'
autoload -Uz compinit
compinit
# Oh My Zsh installation
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"
ENABLE_CORRECTION="false"
plugins=(
git
docker
1password
ubuntu
sudo
screen
brew
ufw
zsh-interactive-cd
zsh-navigation-tools
yarn
vscode
composer
laravel
golang
httpie
)
source $ZSH/oh-my-zsh.sh
eval "$(starship init zsh)"
#####################
# PATH Manipulation #
#####################
# Add ~/.local/bin to PATH
export PATH=$PATH:$HOME/.local/bin
# Add ~/.cargo/bin to PATH
export PATH=$PATH:$HOME/.cargo/bin
# Add dotfiles bin to PATH
export PATH=$PATH:$HOME/dotfiles/bin
#####################
# Alias Definitions #
#####################
# Aliases
alias docker-compose='docker compose'
alias gg='git pull'
alias gl='git log --stat'
alias l='eza --header --long --git --group-directories-first --group --icons --color=always --sort=name --hyperlink -o --no-permissions'
alias ll='l'
alias la='l -a'
alias ddpul='docker compose down && docker compose pull && docker compose up -d && docker compose logs -f'
alias cat='bat'
# Docker Aliases
alias d='docker'
alias dc='docker compose'
alias dce='docker compose exec'
alias dcl='docker compose logs'
alias dcd='docker compose down'
alias dcu='docker compose up'
alias dcp='docker compose ps'
alias dcps='docker compose ps'
alias dcr='docker compose run'
# Hotkeys daemon
alias hk='dotf hotkey-daemon'
# Alias for ls to l but only if it's a interactive shell because we don't want to override ls in scripts which could blow up in our face
if [ -t 1 ]; then
alias ls='l'
fi
# Alias for ssh.exe and ssh-add.exe on Windows WSL (microsoft-standard-WSL2)
if [[ $(uname -a) == *"microsoft-standard-WSL2"* ]]; then
alias op='op.exe'
fi
######################
# Export Definitions #
######################
# Tradaware / DiscountOffice
if [ -d "/home/menno/Projects/Work" ]; then
export TRADAWARE_PATH=/home/menno/Projects/Work
source $TRADAWARE_PATH/bin/helpers/source.sh
export PATH=$PATH:$TRADAWARE_PATH/bin/utilities
fi
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# Rocm related workaround
export HSA_OVERRIDE_GFX_VERSION=11.0.0
# If $HOME/flutter exists, add it to the PATH
if [ -d "$HOME/flutter" ]; then
export PATH="$PATH:$HOME/flutter/bin"
fi
# Flutter related environment variables
export CHROME_EXECUTABLE=/usr/bin/brave-browser
# 1Password source gh plugin
source /home/menno/.config/op/plugins.sh
#####################
# End of the line...#
#####################
# Show welcome message, but only if the terminal is interactive
if [ -t 1 ]; then
dotf term
fi

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
@ -76,7 +76,7 @@ run_startup_scripts() {
touch $HOME/dotfiles/logs/startup/$command_key.log
# Run the command in a new screen session named after the command_key
screen -dmS $command_key zsh -c "eval $command > $HOME/dotfiles/logs/startup/$command_key.log 2>&1"
screen -dmS $command_key bash -c "eval $command > $HOME/dotfiles/logs/startup/$command_key.log 2>&1"
sleep $(echo "scale=2; $delay_between_ms / 1000" | bc)
if ! screen -list | grep -q $command_key; then

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
source $HOME/dotfiles/bin/helpers/keyboard_shortcuts.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
@ -173,10 +173,6 @@ tailscalecmd() {
}
extensions() {
printfe "%s\n" "cyan" "Ensuring Oh My Zsh is installed..."
source $HOME/dotfiles/bin/helpers/ohmyzsh.sh
ensure_ohmyzsh_installed
printfe "%s\n" "cyan" "Ensuring GNOME Extensions are installed..."
source $HOME/dotfiles/bin/helpers/gnome_extensions.sh
ensure_gnome_extensions_installed
@ -234,12 +230,12 @@ terminal() {
}
default_shell() {
printfe "%s\n" "cyan" "Setting zsh as default shell..."
if [ "$SHELL" != "/usr/bin/zsh" ]; then
printfe "%s\n" "yellow" " - Setting zsh as default shell"
chsh -s /usr/bin/zsh
printfe "%s\n" "cyan" "Setting bash as default shell..."
if [ "$SHELL" != "/usr/bin/bash" ]; then
printfe "%s\n" "yellow" " - Setting bash as default shell"
chsh -s /usr/bin/bash
else
printfe "%s\n" "green" " - zsh is already the default shell"
printfe "%s\n" "green" " - bash is already the default shell"
fi
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
export DOTFILES_CONFIG=$HOME/dotfiles/config/config.yaml

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
# In case we run Pop!_OS let's use `cosmic-screenshot --interactive`, otherwise default to `flameshot gui`
if [[ -x "$(command -v cosmic-screenshot)" ]]; then

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
ensure_docker_installed() {
# if docker is already installed, skip the installation

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
#Color print function, usage: println "message" "color"
println() {

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh
@ -48,7 +48,7 @@ ensure_keyboard_shortcuts() {
# Start swhkd
printfe "%s\n" "green" " - starting swhkd..."
printfe "%s\n" "yellow" " Note: this will likely show a password prompt, please enter your password"
screen -dmS swhkd zsh -c "$HOME/dotfiles/bin/actions/hotkey-daemon.sh"
screen -dmS swhkd bash -c "$HOME/dotfiles/bin/actions/hotkey-daemon.sh"
# Check if this is gnome DESKTOP_SESSION is gnome, if not we can stop here
# The next part is just for setting up custom shortcuts in GNOME

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
ensure_tailscale_installed() {
# if tailscale is already installed, skip the installation

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
#!/usr/bin/env bash
source $HOME/dotfiles/bin/helpers/functions.sh

View File

@ -36,10 +36,10 @@ config:
target: ~/.ssh/authorized_keys
chmod: 600
# Zshrc
zshrc:
source: ~/dotfiles/.zshrc
target: ~/.zshrc
# bashrc
bashrc:
source: ~/dotfiles/.bashrc
target: ~/.bashrc
# VSCode settings
vscode:
@ -161,7 +161,8 @@ config:
apt:
repos:
apps:
- zsh
- bash
- bash-completion
- solaar
- git
- curl

View File

@ -2,7 +2,7 @@
# Prepare, we need at least these minimal packages to continue ...
sudo apt update
sudo apt install curl zsh nala pipx apt-transport-https ca-certificates gnupg -y
sudo apt install curl nala pipx apt-transport-https ca-certificates gnupg -y
# Ensure shyaml is available
echo "Ensuring shyaml is installed..."