changed install method, added uninstall

main
czoczo 9 months ago
parent 64e6c9bf99
commit d8b98ede93
  1. 5
      .inputrc
  2. 36
      README.md
  3. 18
      getbb.sh
  4. 2
      prompt/bb.sh
  5. 0
      prompt/git-prompt.sh
  6. 5
      removebb.sh

@ -1,4 +1,5 @@
## arrow up ## BetterBash
# arrow up
"\e[A":history-search-backward "\e[A":history-search-backward
## arrow down # arrow down
"\e[B":history-search-forward "\e[B":history-search-forward

@ -2,6 +2,7 @@
## screenshot: ## screenshot:
![alt text](https://git.cz0.cz/czoczo/BetterBash/raw/branch/master/screenshot.png "BetterBash screenshot") ![alt text](https://git.cz0.cz/czoczo/BetterBash/raw/branch/master/screenshot.png "BetterBash screenshot")
## Features ## Features
- Rapid search history with up/down keyboard arrows
- Username (highlighted if root) and hostname. - Username (highlighted if root) and hostname.
- Unique avatar based on hostname (a bit like automatic avatars on StackOverflow), reduces the risk of terminal confusion. - Unique avatar based on hostname (a bit like automatic avatars on StackOverflow), reduces the risk of terminal confusion.
- Number of background processes. - Number of background processes.
@ -10,18 +11,33 @@
- Date and time. - Date and time.
- Current directory. - Current directory.
- Git status (if current directory inside git repository) - Git status (if current directory inside git repository)
## Quick install: ## Install:
with curl
``` ```
URL='https://git.cz0.cz/czoczo/BetterBash/raw/branch/master/.bshell' && \ curl https://cz0.cz/getbb | sh && . ~/.bashrc
DIR=~/.bshell && \
CMD='[ -f ~/.bshell/bb.sh ] && . ~/.bshell/bb.sh' && \
mkdir -p $DIR && \
wget $URL/bb.sh -O $DIR/bb.sh && \
wget $URL/git-prompt.sh -O $DIR/git-prompt.sh && \
grep -q "$CMD" ~/.bashrc || echo "$CMD" >> ~/.bashrc && \
source ~/.bashrc
``` ```
or just: with wget
``` ```
curl https://cz0.cz/getbb | sh && . ~/.bashrc curl https://cz0.cz/getbb | sh && . ~/.bashrc
``` ```
with openssl (no dependencies needed)
```
echo -e "GET /getbb HTTP/1.1\r\nHost: cz0.cz\r\nConnection: close\r\n\r\n" \
| openssl s_client -quiet -connect cz0.cz:443 2>/dev/null \
| sed '1,/^\r$/d' | sh && . ~/.bashrc
```
## Uninstall:
with curl
```
curl https://cz0.cz/removebb | sh && . ~/.bashrc
```
with wget
```
curl https://cz0.cz/removebb | sh && . ~/.bashrc
```
with openssl (no dependencies needed)
```
echo -e "GET /removebb HTTP/1.1\r\nHost: cz0.cz\r\nConnection: close\r\n\r\n" \
| openssl s_client -quiet -connect cz0.cz:443 2>/dev/null \
| sed '1,/^\r$/d' | sh && . ~/.bashrc
```

@ -1,8 +1,14 @@
URL='https://git.cz0.cz/czoczo/BetterBash/raw/branch/master/.bshell' && \ #!/bin/bash
DIR=~/.bshell && \ get_file() {
CMD='[ -f ~/.bshell/bb.sh ] && . ~/.bshell/bb.sh' && \ echo -e "GET /czoczo/BetterBash/raw/branch/master/$1 HTTP/1.1\r\nHost: git.cz0.cz\r\nConnection: close\r\n\r\n" \
| openssl s_client -quiet -connect cz0.cz:443 2>/dev/null \
| sed '1,/^\r$/d'
}
DIR=~/.bb && \
CMD="[ -f $DIR/bb.sh ] && . $DIR/bb.sh" && \
mkdir -p $DIR && \ mkdir -p $DIR && \
wget $URL/bb.sh -O $DIR/bb.sh && \ get_file /prompt/bb.sh && > $DIR/bb.sh && \
wget $URL/git-prompt.sh -O $DIR/git-prompt.sh && \ get_file /prompt/git-prompt.sh > $DIR/git-prompt.sh && \
get_file /.inputrc >> ~/.bb/.inputrc && \
grep -q "$CMD" ~/.bashrc || echo "$CMD" >> ~/.bashrc grep -q "$CMD" ~/.bashrc || echo "$CMD" >> ~/.bashrc

@ -99,7 +99,7 @@ function __prompt_command() {
LEFT="\n$BORDCOL\[\016\]$PR_ULCORNER$HBAR\[\017\]$WHITEB($USERCOL$USER$WHITEB@$GREEN\h:$cur_tty$WHITEB)$BORDCOL$HBAR$HBAR$WHITEB($CH$WHITEB)$BGPROCCOL" LEFT="\n$BORDCOL\[\016\]$PR_ULCORNER$HBAR\[\017\]$WHITEB($USERCOL$USER$WHITEB@$GREEN\h:$cur_tty$WHITEB)$BORDCOL$HBAR$HBAR$WHITEB($CH$WHITEB)$BGPROCCOL"
RIGHT="$EXIT$BORDCOL$HBAR$HBAR$HBAR$WHITEB($YELLOWB\d$WHITEB)$BORDCOL$HBAR$HBAR$HBAR$WHITEB($RCOL\t$WHITEB)$BORDCOL$HBAR$HBAR$HBAR$HBAR$BORDCOL\n\[\016\]$PR_LLCORNER\[\017\]$HBAR$WHITEB(\w)$BORDCOL$HBAR$WHITEB($GREEN\\\$$RST$GITPROMPT$WHITEB)$BORDCOL-> \[\e[0m\]" RIGHT="$EXIT$BORDCOL$HBAR$HBAR$HBAR$WHITEB($YELLOWB\d$WHITEB)$BORDCOL$HBAR$HBAR$HBAR$WHITEB($RCOL\t$WHITEB)$BORDCOL$HBAR$HBAR$HBAR$HBAR\n$BORDCOL\[\016\]$PR_LLCORNER\[\017\]$BORDCOL$HBAR$WHITEB(\w)$BORDCOL$HBAR$WHITEB($GREEN\\\$$RST$GITPROMPT$WHITEB)$BORDCOL-> \[\e[0m\]"
L_LEN="$USER$HOSTNAM$CH\j" L_LEN="$USER$HOSTNAM$CH\j"
R_LEN="XXX XXX XX, XX:XX:XX$RETURN_CODE" R_LEN="XXX XXX XX, XX:XX:XX$RETURN_CODE"

@ -0,0 +1,5 @@
#!/bin/bash
sed -i '/BetterBash/,+1d' ~./bashrc && \
sed -i '/BetterBash/,+4d' ~./inputrc && \
rm -r ~/.bb
Loading…
Cancel
Save