Skip to content

ChrisTitusTech/mybash

Repository files navigation

ChrisTitusTech's .bashrc Configuration (Linux/Mac)

SCR-20260713-cpkx

Overview

This repository provides a comprehensive .bashrc configuration along with supporting scripts and configuration files to enhance your terminal experience in Unix-like operating systems. It configures the shell session by setting up aliases, defining functions, customizing the prompt, and more, significantly improving the terminal's usability and power.

Table of Contents

Installation

To install the .bashrc configuration, execute the following commands in your terminal:

git clone --depth=1 https://github.com/christitustech/mybash.git
cd mybash
./setup.sh

The setup.sh script automates the installation process by:

  • Creating necessary directories (~/.local/share/mybash, ~/.config/starship, and ~/.config/fastfetch)
  • Copying the managed repository files into ~/.local/share/mybash
  • Installing Homebrew on macOS if it is not already installed
  • Installing Bash 5 with Homebrew on macOS
  • Adding Homebrew Bash to /etc/shells and setting it as the default login shell on macOS
  • Installing dependencies (bash-completion, neovim, starship, fzf, zoxide)
  • Installing Starship and JetBrainsMono Nerd Font on Linux
  • Selecting JetBrainsMono Nerd Font in Ptyxis or GNOME Terminal when available
  • Installing the MesloLGS Nerd Font required for the prompt on macOS when available
  • Linking configuration files from ~/.local/share/mybash to your home directory
  • Linking the fastfetch config to ~/.config/fastfetch/config.jsonc
  • Ensuring ~/.bash_profile initializes Homebrew on macOS
  • Ensuring ~/.bash_profile sources ~/.bashrc on macOS
  • Setting up additional utilities like fastfetch

On macOS, setup.sh may prompt for your password when it adds Homebrew Bash to /etc/shells and changes your default shell. Restart Terminal after installation, then verify with:

echo "$SHELL"
bash --version

$SHELL should point to the Homebrew Bash path, such as /opt/homebrew/bin/bash on Apple Silicon or /usr/local/bin/bash on Intel Macs. On Linux, ensure you have the required permissions and a supported package manager.

Switching Color Palettes

Use starship-theme to recolor the prompt without changing its layout:

starship-theme          # interactive picker
starship-theme fedora   # apply a palette directly
starship-theme list     # list available palettes

Available palettes include Ubuntu, Claude, Arch, Fedora, Debian, Mint, Manjaro, Pop!_OS, Kali, Gentoo, Dracula, and the original Nord theme.

Starship color palettes

Uninstallation

To uninstall the .bashrc configuration, run:

cd mybash
chmod +x uninstall.sh
./uninstall.sh
./uninstall.sh --keep-deps

Use --keep-deps to remove the mybash configuration while retaining installed software and fonts.

The uninstall.sh script reverses the installation process by:

  • Removing installed dependencies
  • Uninstalling fonts
  • Removing symbolic links to configuration files
  • Restoring the .bashrc backup created during installation
  • Restoring previous Ptyxis or GNOME Terminal font settings
  • Deleting the ~/.local/share/mybash directory
  • Cleaning up additional utilities like starship, fzf, and zoxide

After running the script, it's recommended to restart your shell to apply the changes.

Configuration Files

.bashrc

The .bashrc file defines aliases, functions, and environment variables to enhance your shell experience. Key features include:

  • Aliases: Shortcuts for common commands (e.g., alias cp='cp -i')
  • Functions: Custom functions for tasks like extracting archives and copying files with progress

starship.toml

The starship.toml file configures the Starship prompt, providing a highly customizable and informative shell prompt. It includes:

  • Theme Settings: Defines colors and symbols for different prompt segments
  • Module Configurations: Customizes modules like python, git, docker_context, and various programming languages
  • Format Customization: Structures the layout and truncation of paths for a cleaner look

config.jsonc

The config.jsonc file configures fastfetch, a system information tool. It includes:

  • Logo and Display Settings: Customizes the appearance of system logos and separators
  • Modules: Defines which system information modules to display, such as CPU, GPU, OS, kernel, and uptime
  • Custom Sections: Adds custom formatted sections for hardware and software information

Key Features

  1. Aliases and Functions

    • Shortcuts for common commands
    • Custom functions for complex operations (e.g., extracting archives, copying with progress)
  2. Prompt Customization and History Management

    • Configures PROMPT_COMMAND for automatic history saving
    • Manages history file size and handles duplicates
  3. Enhancements and Utilities

    • Improves command output readability with colors
    • Introduces safer file operations (e.g., using trash instead of rm)
    • Integrates Zoxide for easy directory navigation
  4. Installation and Configuration Helpers

    • Auto-installs necessary utilities based on system type
    • Provides functions to edit important configuration files

Advanced Functions

  • System information display
  • Networking utilities (e.g., IP address checks)
  • Resource monitoring tools

System-Specific Configurations

  • Editor settings (NeoVim as default)
  • Conditional aliases based on system type
  • Package manager-specific commands

Conclusion

This .bashrc configuration offers a powerful and customizable terminal environment suitable for various Unix-like systems. It enhances productivity through smart aliases, functions, and integrated tools while maintaining flexibility for system-specific needs. Whether you're a developer, system administrator, or power user, this setup aims to make your terminal experience more efficient and enjoyable.

For any issues, suggestions, or contributions, please open an issue or pull request in this repository. We welcome community involvement to make this configuration even better!

About

My Bash profile - Highly customized Starship Theme - Just imagine Powerlevel10k and Nord Theme had a baby.

Resources

License

Stars

653 stars

Watchers

15 watching

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors

Languages