Skip to content

Commit fe2734f

Browse files
committed
Added a module docstring
1 parent d55b3a9 commit fe2734f

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Requirements
2020
* bash
2121

2222

23-
Installation
24-
============
23+
Installation & Usage
24+
====================
2525

2626
1. Save [`ps1.py`](ps1.py) to your computer somewhere (I put my copy at
2727
`~/share/ps1.py`)
@@ -30,7 +30,8 @@ Installation
3030

3131
PROMPT_COMMAND="$PROMPT_COMMAND"'; PS1="$(/usr/bin/python3 ~/share/ps1.py "${PS1_GIT:-}")"'
3232

33-
Replace `~/share/ps1.py` with the location you saved `ps1.py` at as
33+
Replace `/usr/bin/python3` with the path to your Python 3 interpreter, and
34+
replace `~/share/ps1.py` with the location you saved `ps1.py` at as
3435
appropriate.
3536

3637
3. Open a new shell
@@ -39,7 +40,7 @@ Installation
3940

4041
5. If the Git integration causes you trouble (either because something breaks
4142
or just because it's taking too long to run), it can be temporarily disabled
42-
by setting `PS1_GIT=off` in bash.
43+
by running `PS1_GIT=off` in bash.
4344

4445

4546
Git Status Symbols
@@ -62,7 +63,7 @@ relevant. From left to right, the symbols are:
6263
working tree:
6364
- Green: There are staged changes
6465
- Red: There are unstaged changes
65-
- Light yellow: There are both staged and unstaged changes
66+
- Bold light yellow: There are both staged and unstaged changes
6667
- `+` (bold red) — Indicates there are untracked files in the working tree
6768
- `[STATE]` (magenta) — Shows what activity Git is currently in the middle of,
6869
if any:

ps1.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
11
#!/usr/bin/python3
2+
"""
3+
Yet another bash prompt script
4+
5+
Here we have yet another script for Git-aware customization of the bash command
6+
prompt. Unlike all the other scripts, I wrote this one, so it's better.
7+
8+
Features:
9+
10+
- lets you know if you have mail in ``$MAIL``
11+
- shows chroot and `virtualenv <https://virtualenv.pypa.io>`_ prompt prefixes
12+
- automatically truncates the current directory path if it gets too long
13+
- shows the status of the current Git repository (see below)
14+
- thoroughly documented and easily customizable
15+
16+
Visit <https://github.com/jwodder/ps1.py> for more information.
17+
18+
19+
Installation & Usage
20+
====================
21+
22+
1. Save this script to your computer somewhere (I put my copy at
23+
``~/share/ps1.py``)
24+
25+
2. Add the following line to the end of your ``~/.bashrc``::
26+
27+
PROMPT_COMMAND="$PROMPT_COMMAND"'; PS1="$(/usr/bin/python3 ~/share/ps1.py "${PS1_GIT:-}")"'
28+
29+
Replace ``/usr/bin/python3`` with the path to your Python 3 interpreter,
30+
and replace ``~/share/ps1.py`` with the location you saved ``ps1.py`` at as
31+
appropriate.
32+
33+
3. Open a new shell
34+
35+
4. Enjoy!
36+
37+
5. If the Git integration causes you trouble (either because something breaks
38+
or just because it's taking too long to run), it can be temporarily disabled
39+
by running ``PS1_GIT=off`` in bash.
40+
"""
41+
242
from enum import Enum
343
import os
444
from pathlib import Path, PurePath

0 commit comments

Comments
 (0)