Skip to content

Commit 7034d26

Browse files
Merge branch 'main' into main
2 parents b44d477 + e25862d commit 7034d26

File tree

6 files changed

+535
-297
lines changed

6 files changed

+535
-297
lines changed

.bashrc

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
#######################################################
77
if [ -f /usr/bin/fastfetch ]; then
88
fastfetch
@@ -64,10 +64,8 @@ if [[ $iatest -gt 0 ]]; then bind "set show-all-if-ambiguous On"; fi
6464
# Set the default editor
6565
export EDITOR=nvim
6666
export VISUAL=nvim
67-
alias pico='edit'
68-
alias spico='sedit'
69-
alias nano='edit'
70-
alias snano='sedit'
67+
alias spico='sudo pico'
68+
alias snano='sudo nano'
7169
alias vim='nvim'
7270

7371
# To have colors for ls and all grep commands such as grep, egrep and zgrep
@@ -95,22 +93,22 @@ export LESS_TERMCAP_ue=$'\E[0m'
9593
export LESS_TERMCAP_us=$'\E[01;32m'
9694

9795
#######################################################
98-
# MACHINE SPECIFIC ALIAS'S
96+
# MACHINE SPECIFIC ALIASES
9997
#######################################################
10098

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

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

107-
# Alias's to mount ISO files
105+
# aliases to mount ISO files
108106
# mount -o loop /home/NAMEOFISO.iso /home/ISOMOUNTDIR/
109107
# umount /home/NAMEOFISO.iso
110108
# (Both commands done as root only.)
111109

112110
#######################################################
113-
# GENERAL ALIAS'S
111+
# GENERAL ALIASES
114112
#######################################################
115113
# To temporarily bypass an alias, we precede the command with a \
116114
# EG: the ls command is aliased, but to use the normal ls command you would type \ls
@@ -128,7 +126,7 @@ alias hlp='less ~/.bashrc_help'
128126
# alias to show the date
129127
alias da='date "+%Y-%m-%d %A %T %Z"'
130128

131-
# Alias's to modified commands
129+
# aliases to modified commands
132130
alias cp='cp -i'
133131
alias mv='mv -i'
134132
alias rm='trash -v'
@@ -159,7 +157,7 @@ alias bd='cd "$OLDPWD"'
159157
# Remove a directory and all files
160158
alias rmd='/bin/rm --recursive --force --verbose '
161159

162-
# Alias's for multiple directory listing commands
160+
# aliases for multiple directory listing commands
163161
alias la='ls -Alh' # show hidden files
164162
alias ls='ls -aFh --color=always' # add colors and file type extensions
165163
alias lx='ls -lXBh' # sort by extension
@@ -205,19 +203,19 @@ alias checkcommand="type -t"
205203
# Show open ports
206204
alias openports='netstat -nape --inet'
207205

208-
# Alias's for safe and forced reboots
206+
# aliases for safe and forced reboots
209207
alias rebootsafe='sudo shutdown -r now'
210208
alias rebootforce='sudo shutdown -r -n now'
211209

212-
# Alias's to show disk space and space used in a folder
210+
# aliases to show disk space and space used in a folder
213211
alias diskspace="du -S | sort -n -r |more"
214212
alias folders='du -h --max-depth=1'
215213
alias folderssort='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn'
216214
alias tree='tree -CAhF --dirsfirst'
217215
alias treed='tree -CAFd'
218216
alias mountedinfo='df -hT'
219217

220-
# Alias's for archives
218+
# aliases for archives
221219
alias mktar='tar -cvf'
222220
alias mkbz2='tar -cvjf'
223221
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)