Skip to content

Commit

Permalink
Merge pull request #122 from andresgongora/develop
Browse files Browse the repository at this point in the history
v2.1.1
  • Loading branch information
andresgongora authored Jul 4, 2019
2 parents b76c1d8 + fd80562 commit 09b9271
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 9 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
![synth-shell](doc/synth-shell.jpg)

**synth-bash** is a collection of small scripts meant to improve your terminal
**synth-shell** is a collection of small scripts meant to improve your terminal
and overal productivity - small tweaks can go a long way.
You can find more details and similar tools on
[Yet Another Linux'n Electronics Blog](https://yalneb.blogspot.com/).


- System status report with the most relevan information when you open up a new
terminal. It also works over SSH to monitor your server or RaspberryPi!!
- Fancy bash prompt with colors. Makes separating your input from
command-outputs that much easier.
- More coming soon...



<br/><br/>

Expand All @@ -22,12 +29,15 @@ This will guide you step by step through the process and let you choose what
to install. It will also allow you to install the script for your user only,
or system-wide (super user privileges required). To proceed,
[open and play this link in a separate tab](https://www.youtube.com/watch?v=k6ZMYWPQID0),
and execute the following:
and execute the following to feel like
[Hackerman](https://www.youtube.com/watch?v=KEkrWRHCDQU&list=WL&index=63&t=0s):
```
git clone --recursive https://github.com/andresgongora/synth-shell.git
chmod +x synth-shell/setup.sh
synth-shell/setup.sh
rm -fr synth-shell
bash
source ~/.bashrc
```


Expand Down
Binary file modified doc/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions synth-shell/alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ alias free='\free -mht'
##==============================================================================
## COMMAND OVERRIDES
##==============================================================================

## GET CURRENT FOLDER
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"


## BETTER LS
BETTER_LS_FILE="$DIR/better-ls.sh"
if [ -f $BETTER_LS_FILE ]; then
chmod +x "$BETTER_LS_FILE"
Expand All @@ -56,6 +59,8 @@ if [ -f /usr/bin/bat ]; then
alias cat='bat' ## Replace cat with bat
fi


## BETTER HISTORY
BETTER_HISTORY_FILE="$DIR/better-history.sh"
if [ -f $BETTER_HISTORY_FILE ]; then
source "$BETTER_HISTORY_FILE"
Expand Down
14 changes: 7 additions & 7 deletions synth-shell/status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -528,20 +528,20 @@ printInfoLocalIPv4()
printInfoExternalIPv4()
{
if ( which dig > /dev/null 2>&1 ); then
local ip=$($(which dig) TXT -4 +short \
local ip=$(dig +time=3 +tries=1 TXT -4 +short \
o-o.myaddr.l.google.com @ns1.google.com |\
awk -F\" '{print $2}')

elif ( which nslookup > /dev/null 2>&1 ); then
local ip=$($(which nslookup) -q=txt \
local ip=$(nslookup -timeout=3 -q=txt \
o-o.myaddr.l.google.com 216.239.32.10 |\
awk -F \" 'BEGIN{RS="\r\n"}{print $2}END{RS="\r\n"}')

elif ( which curl > /dev/null 2>&1 ); then
local ip=$($(which curl2>&1 ) -s https://api.ipify.org)
local ip=$(curl -s https://api.ipify.org)

elif ( which wget > /dev/null 2>&1 ); then
local ip=$($(which wget) -q -O - https://api.ipify.org)
local ip=$(wget -q -O - https://api.ipify.org)
else
local result="Error"
fi
Expand Down Expand Up @@ -993,7 +993,7 @@ printHogsCPU()


## CHECK CPU LOAD
local current=$(awk '{avg_1m=($1)} END {printf "%3.0f", avg_1m}' /proc/loadavg)
local current=$(awk '{avg_1m=($1)} END {printf "%3.2f", avg_1m}' /proc/loadavg)
local max=$(nproc --all)
local percent=$(bc <<< "$current*100/$max")

Expand Down Expand Up @@ -1174,8 +1174,8 @@ local print_extra_new_line_bot=true


## LOAD USER CONFIGURATION
local user_config_file="$HOME/.config/scripts/status.config"
local sys_config_file="/etc/andresgongora/scripts/status.config"
local user_config_file="$HOME/.config/synth-shell/status.config"
local sys_config_file="/etc/andresgongora/synth-shell/status.config"
if [ -f $user_config_file ]; then
source $user_config_file
elif [ -f $sys_config_file ]; then
Expand Down

0 comments on commit 09b9271

Please sign in to comment.