Skip to content

Commit bcd8ac1

Browse files
2 parents 4c29a32 + 4320408 commit bcd8ac1

File tree

6 files changed

+535
-293
lines changed

6 files changed

+535
-293
lines changed

.bashrc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
iatest=$(expr index "$-" i)
33

44
#######################################################
5-
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me
5+
# SOURCED ALIASES AND SCRIPTS BY zachbrowne.me
66
#######################################################
7-
if [ -f /usr/bin/fastfetch ]; then
8-
fastfetch
7+
if command -v fastfetch 2>/dev/null; then
8+
fastfetch
99
fi
1010

1111
# Source global definitions
@@ -93,22 +93,22 @@ export LESS_TERMCAP_ue=$'\E[0m'
9393
export LESS_TERMCAP_us=$'\E[01;32m'
9494

9595
#######################################################
96-
# MACHINE SPECIFIC ALIAS'S
96+
# MACHINE SPECIFIC ALIASES
9797
#######################################################
9898

99-
# Alias's for SSH
99+
# aliases for SSH
100100
# alias SERVERNAME='ssh YOURWEBSITE.com -l USERNAME -p PORTNUMBERHERE'
101101

102-
# Alias's to change the directory
102+
# aliases to change the directory
103103
alias web='cd /var/www/html'
104104

105-
# Alias's to mount ISO files
105+
# aliases to mount ISO files
106106
# mount -o loop /home/NAMEOFISO.iso /home/ISOMOUNTDIR/
107107
# umount /home/NAMEOFISO.iso
108108
# (Both commands done as root only.)
109109

110110
#######################################################
111-
# GENERAL ALIAS'S
111+
# GENERAL ALIASES
112112
#######################################################
113113
# To temporarily bypass an alias, we precede the command with a \
114114
# EG: the ls command is aliased, but to use the normal ls command you would type \ls
@@ -126,7 +126,7 @@ alias hlp='less ~/.bashrc_help'
126126
# alias to show the date
127127
alias da='date "+%Y-%m-%d %A %T %Z"'
128128

129-
# Alias's to modified commands
129+
# aliases to modified commands
130130
alias cp='cp -i'
131131
alias mv='mv -i'
132132
alias rm='trash -v'
@@ -156,7 +156,7 @@ alias bd='cd "$OLDPWD"'
156156
# Remove a directory and all files
157157
alias rmd='/bin/rm --recursive --force --verbose '
158158

159-
# Alias's for multiple directory listing commands
159+
# aliases for multiple directory listing commands
160160
alias la='ls -Alh' # show hidden files
161161
alias ls='ls -aFh --color=always' # add colors and file type extensions
162162
alias lx='ls -lXBh' # sort by extension
@@ -202,19 +202,19 @@ alias checkcommand="type -t"
202202
# Show open ports
203203
alias openports='netstat -nape --inet'
204204

205-
# Alias's for safe and forced reboots
205+
# aliases for safe and forced reboots
206206
alias rebootsafe='sudo shutdown -r now'
207207
alias rebootforce='sudo shutdown -r -n now'
208208

209-
# Alias's to show disk space and space used in a folder
209+
# aliases to show disk space and space used in a folder
210210
alias diskspace="du -S | sort -n -r |more"
211211
alias folders='du -h --max-depth=1'
212212
alias folderssort='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn'
213213
alias tree='tree -CAhF --dirsfirst'
214214
alias treed='tree -CAFd'
215215
alias mountedinfo='df -hT'
216216

217-
# Alias's for archives
217+
# aliases for archives
218218
alias mktar='tar -cvf'
219219
alias mkbz2='tar -cvjf'
220220
alias mkgz='tar -cvzf'

README.md

Lines changed: 99 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,121 @@
1-
## Overview of ChrisTitusTech's `.bashrc` Configuration
1+
# ChrisTitusTech's `.bashrc` Configuration
22

3-
The `.bashrc` file is a script that runs every time a new terminal session is started in Unix-like operating systems. It is used to configure the shell session, set up aliases, define functions, and more, making the terminal easier to use and more powerful. Below is a summary of the key sections and functionalities defined in the provided `.bashrc` file.
3+
## Overview
44

5-
## How to install
6-
```
7-
git clone --depth=1 https://github.com/ChrisTitusTech/mybash.git
5+
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.
6+
7+
## Table of Contents
8+
9+
- [Installation](#installation)
10+
- [Uninstallation](#uninstallation)
11+
- [Configuration Files](#configuration-files)
12+
- [.bashrc](#bashrc)
13+
- [starship.toml](#starshiptoml)
14+
- [config.jsonc](#configjsonc)
15+
- [Key Features](#key-features)
16+
- [Advanced Functions](#advanced-functions)
17+
- [System-Specific Configurations](#system-specific-configurations)
18+
- [Conclusion](#conclusion)
19+
20+
## Installation
21+
22+
To install the `.bashrc` configuration, execute the following commands in your terminal:
23+
24+
```sh
25+
git clone --depth=1 https://github.com/dacrab/mybash.git
826
cd mybash
9-
chmod +x setup.sh
1027
./setup.sh
1128
```
1229

13-
### Initial Setup and System Checks
30+
The `setup.sh` script automates the installation process by:
31+
32+
- Creating necessary directories (`linuxtoolbox/mybash`)
33+
- Cloning the repository
34+
- Installing dependencies (bash-completion, neovim, starship, fzf, zoxide)
35+
- Installing the MesloLGS Nerd Font required for the prompt
36+
- Linking configuration files (`.bashrc` and `starship.toml`) to your home directory
37+
- Setting up additional utilities like `fastfetch`
38+
39+
Ensure you have the required permissions and a supported package manager before running the script.
40+
41+
## Uninstallation
42+
43+
To uninstall the `.bashrc` configuration, run:
44+
45+
```sh
46+
cd mybash
47+
chmod +x uninstall.sh
48+
./uninstall.sh
49+
```
50+
51+
The `uninstall.sh` script reverses the installation process by:
52+
53+
- Removing installed dependencies
54+
- Uninstalling fonts
55+
- Removing symbolic links to configuration files
56+
- Deleting the `linuxtoolbox` directory
57+
- Cleaning up additional utilities like `starship`, `fzf`, and `zoxide`
58+
59+
After running the script, it's recommended to restart your shell to apply the changes.
60+
61+
## Configuration Files
62+
63+
### `.bashrc`
64+
65+
The `.bashrc` file defines aliases, functions, and environment variables to enhance your shell experience. Key features include:
66+
67+
- **Aliases**: Shortcuts for common commands (e.g., `alias cp='cp -i'`)
68+
- **Functions**: Custom functions for tasks like extracting archives and copying files with progress
69+
70+
### `starship.toml`
71+
72+
The `starship.toml` file configures the [Starship](https://starship.rs/) prompt, providing a highly customizable and informative shell prompt. It includes:
1473

15-
- **Environment Checks**: The script checks if it is running in an interactive mode and sets up the environment accordingly.
16-
- **System Utilities**: It checks for the presence of utilities like `fastfetch`, `bash-completion`, and system-specific configurations (`/etc/bashrc`).
74+
- **Theme Settings**: Defines colors and symbols for different prompt segments
75+
- **Module Configurations**: Customizes modules like `python`, `git`, `docker_context`, and various programming languages
76+
- **Format Customization**: Structures the layout and truncation of paths for a cleaner look
1777

18-
### Aliases and Functions
78+
### `config.jsonc`
1979

20-
- **Aliases**: Shortcuts for common commands are set up to enhance productivity. For example, `alias cp='cp -i'` makes the `cp` command interactive, asking for confirmation before overwriting files.
21-
- **Functions**: Custom functions for complex operations like `extract()` for extracting various archive types, and `cpp()` for copying files with a progress bar.
80+
The `config.jsonc` file configures [fastfetch](https://github.com/AlexRogalskiy/fastfetch), a system information tool. It includes:
2281

23-
### Prompt Customization and History Management
82+
- **Logo and Display Settings**: Customizes the appearance of system logos and separators
83+
- **Modules**: Defines which system information modules to display, such as CPU, GPU, OS, kernel, and uptime
84+
- **Custom Sections**: Adds custom formatted sections for hardware and software information
2485

25-
- **Prompt Command**: The `PROMPT_COMMAND` variable is set to automatically save the command history after each command.
26-
- **History Control**: Settings to manage the size of the history file and how duplicates are handled.
86+
## Key Features
2787

28-
### System-Specific Aliases and Settings
88+
1. **Aliases and Functions**
89+
- Shortcuts for common commands
90+
- Custom functions for complex operations (e.g., extracting archives, copying with progress)
2991

30-
- **Editor Settings**: Sets `nvim` (NeoVim) as the default editor.
31-
- **Conditional Aliases**: Depending on the system type (like Fedora), it sets specific aliases, e.g., replacing `cat` with `bat`.
92+
2. **Prompt Customization and History Management**
93+
- Configures PROMPT_COMMAND for automatic history saving
94+
- Manages history file size and handles duplicates
3295

33-
### Enhancements and Utilities
96+
3. **Enhancements and Utilities**
97+
- Improves command output readability with colors
98+
- Introduces safer file operations (e.g., using `trash` instead of `rm`)
99+
- Integrates Zoxide for easy directory navigation
34100

35-
- **Color and Formatting**: Enhancements for command output readability using colors and formatting for tools like `ls`, `grep`, and `man`.
36-
- **Navigation Shortcuts**: Aliases to simplify directory navigation, e.g., `alias ..='cd ..'` to go up one directory.
37-
- **Safety Features**: Aliases for safer file operations, like using `trash` instead of `rm` for deleting files, to prevent accidental data loss.
38-
- **Extensive Zoxide support**: Easily navigate with `z`, `zi`, or pressing Ctrl+f to launch zi to see frequently used navigation directories.
101+
4. **Installation and Configuration Helpers**
102+
- Auto-installs necessary utilities based on system type
103+
- Provides functions to edit important configuration files
39104

40-
### Advanced Functions
105+
## Advanced Functions
41106

42-
- **System Information**: Functions to display system information like `distribution()` to identify the Linux distribution.
43-
- **Networking Utilities**: Tools to check internal and external IP addresses.
44-
- **Resource Monitoring**: Commands to monitor system resources like disk usage and open ports.
107+
- System information display
108+
- Networking utilities (e.g., IP address checks)
109+
- Resource monitoring tools
45110

46-
### Installation and Configuration Helpers
111+
## System-Specific Configurations
47112

48-
- **Auto-Install**: A function `install_bashrc_support()` to automatically install necessary utilities based on the system type.
49-
- **Configuration Editors**: Functions to edit important configuration files directly, e.g., `apacheconfig()` for Apache server configurations.
113+
- Editor settings (NeoVim as default)
114+
- Conditional aliases based on system type
115+
- Package manager-specific commands
50116

51-
### Conclusion
117+
## Conclusion
52118

53-
This `.bashrc` file is a comprehensive setup that not only enhances the shell experience with useful aliases and functions but also provides system-specific configurations and safety features to cater to different user needs and system types. It is designed to make the terminal more user-friendly, efficient, and powerful for an average user.
119+
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.
54120

121+
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!

0 commit comments

Comments
 (0)