Skip to content

Commit

Permalink
Merge pull request #115 from andresgongora/develop
Browse files Browse the repository at this point in the history
synth-shell v2.0
  • Loading branch information
andresgongora authored Jun 22, 2019
2 parents 09dd7d1 + 2366180 commit 8e4d97c
Show file tree
Hide file tree
Showing 29 changed files with 272 additions and 2,490 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bash-tools"]
path = bash-tools
url = https://github.com/andresgongora/bash-tools.git
214 changes: 83 additions & 131 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,121 +1,75 @@
<!--------------------------------------+-------------------------------------->
# Introduction
<!--------------------------------------+-------------------------------------->
My personal collection of bash scripts. Their application varies wildly from
script to script, including eyecandy for the terminal, productivity tools,
and sys-administration helpers. You can find more details and similar tools on
[Yet Another Linux'n Electronics Blog](https://yalneb.blogspot.com/).
![synth-shell](doc/synth-shell.jpg)


*DISCLAIMER*
Note that some script snippets might be from third parties.
I collected them over many years from forums, wikis, and chats.
The original authors, if known, are referenced within the individual scripts.
If you recognize a snippet and the file has no reference
(specially in the older ones), kindly let me know.


![Example with status.sh and fancy-bash-prompt.sh](doc/screenshot.png)


<!--------------------------------------+-------------------------------------->
# Introduction
<!--------------------------------------+-------------------------------------->

**synth-bash** 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/).



<!--------------------------------------+-------------------------------------->
# Installation
<!--------------------------------------+-------------------------------------->

### Automatic insallation (system wide)

The quickuest way to get started is to simply run the installation script.
Simply download the git repository and run the install script as follows.
The script will prompt you and guide you through the installation process.
```
git clone --recursive https://github.com/andresgongora/scripts.git
chmod +x scripts/install/install.sh
scripts/install/install.sh
rm -fr scripts
```


<!--------------------------------------+-------------------------------------->
# Setup
<!--------------------------------------+-------------------------------------->

### Manual insallation (current user only)
### Automatic setup (system wide)

Alternatively, you may install the script manually for you current user
(no elevated privileges required). Simply clone this repository and then
tell your .bashrc file to source those scripts you want. When you install the
scripts as a user, you have to store them somewhere on your system. For this,
we suggest the folder ~/scripts, but feel free to use any other location.
The recommended way to install synth-shell is to run the provided setup script.
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 commands in your shell:
```
## Clone repository to your computer
git clone --recursive https://github.com/andresgongora/scripts.git
cd scripts
## Source individual scripts. Choose the ones you want (or all).
echo "source $(pwd)/terminal/fancy-bash-prompt.sh" >> ~/.bashrc
echo "source $(pwd)/terminal/alias.sh" >> ~/.bashrc
echo "source $(pwd)/terminal/status.sh" >> ~/.bashrc
git clone --recursive https://github.com/andresgongora/synth-shell.git
chmod +x synth-shell/setup.sh
synth-shell/setup.sh
rm -fr synth-shell
```



### Dependencies

If you want to use `fancy-bash-promt.sh` you also need power-line fonts.
Depending on your distro you can install it as:
```
## ArchLinux
#### ArchLinux
sudo pacman -S powerline-fonts
## Debian, Ubuntu
#### Debian, Ubuntu
sudo apt install fonts-powerline
```



### Script configuration/customization

Lastly, you may configure your scripts by first copying the individual
`*.config.example`-files included in this repo to your user's
`~/.config/scripts/` folder. First create a the configuration folder
for your user under `~/.config`, and then copy the desired configuration files
for the scripts you want.
```
## Create configuration folder
mkdir -p ~/.config/scripts
## Configuration for status.sh
cp /usr/local/bin/scripts/config_templates/status.config.example ~/.config/scripts/status.config
## Configuration for fancy-bash-prompt.sh
cp /usr/local/bin/scripts/config_templates/fancy-bash-prompt.config.example ~/.config/scripts/fancy-bash-prompt.config
```


Then you can modify them for your needs. For example, to configure
the colors in`fancy-bash-promt.sh` or `status.sh`, you can do as follows:
You can configure your scripts by modifying the corresponding configurtion
files. In addition to said files, you can also find configuration examples
in the following folder.
```
## Colors and behaviour of status.sh
nano ~/.config/scripts/status.config
## If you installed synth-shell for your user only
~/.config/synth-shell/
## Colors of fancy-bash-promt.sh
nano ~/.config/scripts/fancy-bash-prompt.config
## If you isntalled it system-wide
~/etc/synth-shell/
```

Alternatively, you can use any of the example configuration files contained
inside the example folders `/scripts/config_templates/*.examples/` by renaming
them, and you cal also apply a system-wide configuration by modifying the conf
files in `/etc/andresgongora/scripts/`; which are automatically created when
using the installer.




### Manual instalation of individual scripts
If you want to skip the above steps, and are only intereset in a very
specific script, you can easily use it by its own.
However, some scripts might source other scripts from the `common` folder,
However, some scripts might source other scripts from the `bash-tools` folder,
as they provided shared functioanlities to all scripts. If you are interested
in a single script from my collection, check whether it depends on a common
script, and copy the content of it into the script you want.
Expand All @@ -127,70 +81,40 @@ your manual intervention. Check the content of each script for details.



<!--------------------------------------+-------------------------------------->
# Uninstallation
<!--------------------------------------+-------------------------------------->

Removing the script is very easy. If you installed it with the auto-installer,
and assuming you installed the scripts for your user only,
you can run te following uninstall script:
### Uninstallation
It's hard to say goodbye, but we had good times together, didn't we? :)
Simply run the following commands and everything will be as before:
```
~/.config/scripts/uninstall.sh
git clone --recursive https://github.com/andresgongora/synth-shell.git
chmod +x synth-shell/setup.sh
synth-shell/setup.sh uninstall
rm -fr synth-shell
```


If this does not work, you can run the main install script, which also offers
an option to uninstall everything installed on your system.
```
git clone --recursive https://github.com/andresgongora/scripts.git
chmod +x scripts/install/install.sh
scripts/install/install.sh uninstall
rm -fr scripts
```


If you installed them manually, all you ahve to do is edit your user's bashrc
file, either by removing the call to the script all together, or just commenting
them out. You can do so from the terminal running nano.
```
nano ~/.bashrc
```


<!--------------------------------------+-------------------------------------->
# Overview
<!--------------------------------------+-------------------------------------->

![Example with status.sh and fancy-bash-prompt.sh](doc/screenshot.png)


### status.sh
Provides a report of your system status at one glance everytime you open a
new terminal. If it detects that any parameter (e.g. system load, memory, etc.)
is over a critical threshold, it will provide a warning and additional
information to identify the culprit. I also plot a configurable logo, so
you may impress your crush from the library with your unique ASCII art.

<!--------------------------------------+-------------------------------------->
# Overview
<!--------------------------------------+-------------------------------------->

| Folder | Script | Description |
|----------------------- |-------------------------------- |------------------------------------------------------ |
| | | |
| common | color.sh | Colorize and format command line text |
| common | load_config.sh | Retrieve script configurations from a file |
| | | |
| maintenance/archlinux | archlinux-update-helper.sh | An attempt to make ArchLinux updates more convenient |
| maintenance/archlinux | yaourt-setup.sh | Quick install many usefull packages |
| maintenance/linux | clean_tmp_folder.sh | Remove old files from /tmp |
| maintenance/network | iptables-fast-setup.sh | Useful rules for IPTABLES |
| maintenance/network | iptables-reset.sh | |
| maintenance/network | scp-speed-test.sh | Test remote copy command (SCP) speed |
| maintenance/services | oc-perms.sh | Secure file permissions for OwnCloud - After update |
| maintenance/services | sharkoon-renew-certificates.sh | Renew certificates for one of my servers |
| | | |
| terminal | alias.sh | Aliases of common commands for better productivity |
| terminal | better-history.sh | Configure and wrap the `history` comand |
| terminal | better-ls.sh | Wrap the `ls` comand for extra utility |
| terminal | fancy-bash-promt.sh | PowerLine style bash prompt |
| terminal | status.sh | Bash promt greeter with status report |
| | | |
| utils | invert-colors.sh | Invert X11 colors |
| utils | listtty.sh | Display available tty interfaces |
| utils | my-audacious-delete.sh | Delete from HDD currently playing track |
| utils | steam.sh | Helper script to fix steam of linux |
| | | |
### fancy-bash-prompt.sh
Adds colors and triangular separators to you bash prompt. The triangles are
placed in an overlaping pattern to avoid accidental cuts if you were to touch
them.



Expand All @@ -216,11 +140,11 @@ these scripts in [AUTHORS.md](AUTHORS.md). Thanks to all of you!
* Add your own scripts: do you have some cool scripts you wold like to
add to this collection? Don't hesitate to create a pull-request or,
alternatively, contact the authors over email.
* [Report a bug](https://github.com/andresgongora/scripts/issues):
* [Report a bug](https://github.com/andresgongora/synth-shell/issues):
if you notice that something is not right, tell us.
We'll try to fix it ASAP.
* Become a developer: fork this repo and become an active developer!
Take a look at the [issuess](https://github.com/andresgongora/scripts/issues)
Take a look at the [issuess](https://github.com/andresgongora/synth-shell/issues)
for suggestions of where to start. Also, take a look at our
[coding style](coding_style.md).
* Push your one-time changes: even if its a tiny change,
Expand All @@ -247,6 +171,34 @@ There are two branches in this repository:



<!--------------------------------------+-------------------------------------->
# About
<!--------------------------------------+-------------------------------------->

Why **synth-shell**? That's a quite easy question. Its started out as a loose
bunch of (super simple) scripts that I kept around to aid me during
system maintenance. But after a while, a started to get the hang out of bash
and wrote more complex stuff. I wanted my code not only to work
and be purely useful, but also to provide some eye-candy.

Naturally, it didn't start the way you see it today. Many scripts started out as
an ugly attempt to get the behaviour I wanted, but using many snippets from
different third parties. This meant that the code was usually quite ugly and
full of bugs - not because of the third parties, but because of the way I
integrated them. yet over time, I rewrote all scripts from scratch, removed
the fluff, and also got lot's of help by super friendly and engaged
[contributors](AUTHORS.md). The result is what you see today.
I admit it, it's nothing fancy, but writing these scripts provided me with
lots of joy.

And about the name? That's quite easy. I spent most of my coding frenzy
listening to [SynthWave](https://en.wikipedia.org/wiki/Synthwave).






<!--------------------------------------+-------------------------------------->
# License
<!--------------------------------------+-------------------------------------->
Expand Down
1 change: 1 addition & 0 deletions bash-tools
Submodule bash-tools added at c84149
Loading

0 comments on commit 8e4d97c

Please sign in to comment.