This commit is contained in:
2026-01-24 05:35:50 +00:00
parent bdd64ebe76
commit 4d8c196773

142
README.md
View File

@@ -2,12 +2,12 @@
Elegant, portable, and easy-to-install Bash prompt with: Elegant, portable, and easy-to-install Bash prompt with:
✨ Two color zones - ✨ Two color zones
🌅 Time-based emoji accents - 🌅 Time-based emoji accents
🖥️ Fallback when Nerd Fonts arent available - 🖥️ Fallback when Nerd Fonts arent available
📍 Shortened but informative path - 📍 Shortened but informative path
🔘 Status-colored prompt arrow - 🔘 Status-colored prompt arrow
🧠 Works on Linux, WSL, and macOS - 🧠 Works on Linux, WSL, and macOS
--- ---
@@ -26,29 +26,35 @@ Elegant, portable, and easy-to-install Bash prompt with:
## 🗂️ Repo Structure ## 🗂️ Repo Structure
```text
dotfiles/ dotfiles/
├── ps1/ ├── ps1/
│ └── ps1.sh └── ps1.sh
├── install/ ├── install/
│ ├── install-linux-global.sh ├── install-linux-global.sh
│ ├── install-macos-user.sh ├── install-macos-user.sh
│ └── install-nerdfont.sh └── install-nerdfont.sh
└── README.md └── README.md
```
---
## Banner (hostname + punchline + sysinfo) ## Banner (hostname + punchline + sysinfo)
På Linux/WSL lastes også et banner ved login: På Linux/WSL lastes også et banner ved login:
- `figlet $(hostname)` i farger - `figlet $(hostname)` i farger
- `figlet -f digital "<punchline>"` i farger - `figlet -f digital "<punchline>"` i farger
- `landscape-sysinfo` (hvis tilgjengelig) - `landscape-sysinfo` (hvis tilgjengelig)
### Punchline (global) ### Punchline (global)
Banneret leser punchline fra: Banneret leser punchline fra:
- `/etc/ps1-punchline` - `/etc/ps1-punchline`
Sett punchline slik: Sett punchline slik:
```bash ```bash
echo "Din punchline" | sudo tee /etc/ps1-punchline >/dev/null echo "Din punchline" | sudo tee /etc/ps1-punchline >/dev/null
``` ```
@@ -62,103 +68,141 @@ echo "Din punchline" | sudo tee /etc/ps1-punchline >/dev/null
```bash ```bash
sudo bash install/install-linux-global.sh sudo bash install/install-linux-global.sh
``` ```
This: This:
Installs the prompt module to /etc/profile.d/ps1.sh - Installs the prompt module to `/etc/profile.d/ps1.sh`
- Sources it in `/etc/bash.bashrc` so all users get the prompt
- After install, open a new shell to see the prompt
Sources it in /etc/bash.bashrc so all users get the prompt ### 🍏 macOS (per-user)
After install, open a new shell to see the prompt. ```bash
🍏 macOS (per-user)
bash install/install-macos-user.sh bash install/install-macos-user.sh
```
This: This:
Copies ps1/ps1.sh to ~/.config/ps1/ps1.sh - Copies `ps1/ps1.sh` to `~/.config/ps1/ps1.sh`
- Adds a source block in `~/.bashrc` and `~/.bash_profile`
Adds source block in ~/.bashrc and ~/.bash_profile - Open a new terminal or reload your shell:
Open a new terminal or reload your shell:
```bash
source ~/.bashrc source ~/.bashrc
🖼️ Nerd Fonts (optional but recommended) ```
### 🖼️ Nerd Fonts (optional but recommended)
Nerd Fonts provide the best display for glyphs (powerline symbols): Nerd Fonts provide the best display for glyphs (powerline symbols):
```bash
bash install/install-nerdfont.sh bash install/install-nerdfont.sh
```
After install: After install:
Open your terminal settings - Open your terminal settings
- Set font to JetBrainsMono Nerd Font (or any Nerd Font)
- Terminal must use a Nerd Font for glyphs like ``, ``, `` to render correctly
Set font to JetBrainsMono Nerd Font (or any Nerd Font) ---
Terminal must use a Nerd Font for glyphs like , ,  to render correctly. ## ⚙️ Overrides (Optional)
⚙️ Overrides (Optional)
Sometimes autodetection doesnt work (e.g., on macOS without fontconfig): Sometimes autodetection doesnt work (e.g., on macOS without fontconfig):
Force Nerd Font glyphs: Force Nerd Font glyphs:
```bash
export PS1_FORCE_NF=1 export PS1_FORCE_NF=1
```
Force fallback (no powerline glyphs): Force fallback (no powerline glyphs):
```bash
export PS1_FORCE_ASCII=1 export PS1_FORCE_ASCII=1
Add these to your ~/.bashrc or ~/.bash_profile. ```
Add these to your `~/.bashrc` or `~/.bash_profile`.
---
## 🙅 Disable Prompt (per user)
🙅 Disable Prompt (per user)
If you want to disable the global prompt for your account: If you want to disable the global prompt for your account:
Temporarily in a shell: Temporarily in a shell:
```bash
export DISABLE_GLOBAL_PS1=1 export DISABLE_GLOBAL_PS1=1
```
Permanently: Permanently:
```bash
mkdir -p ~/.config/ps1 mkdir -p ~/.config/ps1
touch ~/.config/ps1/disable touch ~/.config/ps1/disable
```
To re-enable: To re-enable:
```bash
rm -f ~/.config/ps1/disable rm -f ~/.config/ps1/disable
🧪 Testing ```
---
## 🧪 Testing
After install, open a new shell and run: After install, open a new shell and run:
```bash
bash -i -c 'echo OK' bash -i -c 'echo OK'
```
If you see a prompt with colors and emoji, things are working. If you see a prompt with colors and emoji, things are working.
💡 Usage Notes ---
Font matters: Even with Nerd Fonts installed, you must select them in your terminal settings.
## 💡 Usage Notes
Font matters: even with Nerd Fonts installed, you must select them in your terminal settings.
Works on terminals like: Works on terminals like:
GNOME Terminal - GNOME Terminal
- iTerm2
- Kitty
- VS Code integrated terminal
- Windows Terminal (WSL)
iTerm2 If you see squares or missing glyphs, your terminal is likely using a non-Nerd font.
Kitty ---
VS Code integrated terminal ## 📸 Example Prompt
Windows Terminal (WSL)
If you see squares or missing glyphs, your terminal is likely using a non-Nerd font.
📸 Example Prompt
This prompt shows: This prompt shows:
<p align="center"> <p align="center">
<img src="images/image.png" width="900"> <img src="images/image.png" width="900">
</p> </p>
With exit-status colored arrow and emoji reflecting time of day. With exit-status colored arrow and emoji reflecting time of day.
🛠️ Contribution ---
## 🛠️ Contribution
Want to help improve this project? Want to help improve this project?
Fork the repository - Fork the repository
- Make your changes
- Open a merge request
- Please keep consistent colors and styles
Make your changes ---
Open a merge request ## 📄 License
Please keep consistent colors and styles. MIT © 2026 Your Name
📄 License
MIT © 2026 Your Name