Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tushev authored Dec 29, 2021
1 parent 88f4b02 commit c51a6d1
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,38 @@
# TrayAppControl -
# TrayAppControl
[![MIT license](https://img.shields.io/github/license/tushev/trayappcontrol)](https://github.com/tushev/trayappcontrol/blob/main/LICENSE.txt)
![Language: C#](https://img.shields.io/badge/lang-C%23-blueviolet)
![Language: C#](https://img.shields.io/badge/lang-C%23-brightgreen) ![.NET Framework: 4.7.2](https://img.shields.io/badge/.NET%20Framework-4.7.2-blueviolet)
![OS: Windows](https://img.shields.io/badge/OS-Windows-blue)
                                                                               [![CodeFactor](https://www.codefactor.io/repository/github/tushev/trayappcontrol/badge)](https://www.codefactor.io/repository/github/tushev/trayappcontrol)[¹](#-license-mit)
                                                                                                   [![CodeFactor](https://www.codefactor.io/repository/github/tushev/trayappcontrol/badge)](https://www.codefactor.io/repository/github/tushev/trayappcontrol)

A handy tool that allows to simultaneously start and stop a set of processes from system tray[^2].

Key features:
* Allows to hide console windows 🖥 👍
**Key features:**
* Allows to **hide console windows** 🖥 👍
* Allows to control **one** or **multiple** processes
* Allows to use different sets of commands for **Start** and **Stop** actions.

![ui](/docs/ui.png?raw=true)

It is very handy in case you work with apps that cannot hide their console window, i.e. Apache[^4].

## ✔ Usage
* [Download](https://github.com/tushev/trayappcontrol/releases) the app, extract the archive somewhere (or compile the code).
* Create an YAML file that describes your service (see below)
* Create shortcut (in `Startup Apps` if desired) or a `.cmd` that launches the app:<br>`TrayAppControl.exe C:\full\path\to\service.yaml`
* [Download](https://github.com/tushev/trayappcontrol/releases) the app, extract the archive somewhere _(or compile the code)_.
* Create an YAML file that describes your service (see [below](#example-configuration))
* Create a shortcut (in `Startup Apps` if desired) or a `.cmd` that launches the app:<br>`TrayAppControl.exe C:\full\path\to\service.yaml`

⚠ Tested on Windows 10 21H1. Not tested on other versions.
ℹ Tested on Windows 10 21H1. Not tested on other versions.

If necessary, you can launch multiple instances of TrayAppControl with different configuration files:
```cmd
TrayAppControl.exe C:\full\path\to\web-service.yaml
TrayAppControl.exe C:\full\path\to\ml-service.yaml
```

## Example configuration

The following example `.yaml` file illustrates the full range of capabilities of TrayAppControl:
The following example `.yaml` file illustrates the full range of capabilities of TrayAppControl.

It defines a problem-specific set of `nginx + Apache + MariaDB + PHP7/PHP8` used in a local dev environment.

```yaml
# This file defines a set of executables (a "service") that will be controlled by TrayAppControl
Expand All @@ -33,11 +42,11 @@ icon-running: C:\TrayAppControl\sample\running.ico
icon-stopped: C:\TrayAppControl\sample\stopped.ico

# if true, the service will be started immediately on TrayAppControl start
# if false, you have menually start them via context menu
# if false, you have to manually start it via context menu
start-immediately: true

# if true, the service will be stopped when TrayAppControl app is being closed
# (either per user request or shutdown/reboot/logout)
# (either per user request or on shutdown/reboot/logout)
# if false, the service will be left "as is"
stop-on-shutdown: true
# NOTE: do not rely on this feature, it is not guaranteed that it will work in 100% cases
Expand All @@ -60,32 +69,32 @@ managed-apps:

# these commands will be executed on "Start" action "as is", without remembering process handles
on-start:
- command: C:\nginx\nginx.exe
- command: C:\nginx\nginx.exe
workdir: C:\nginx
hide-window: true

- command: C:\mysql\bin\mysqld.exe
- command: C:\mysql\bin\mysqld.exe
arguments: --skip-grant-tables --log_syslog=0
hide-window: true

# these commands will be simply executed on "Stop" action "as is"
# these commands will be executed on "Stop" action "as is"
on-stop:
- command: C:\mysql\bin\mysqladmin.exe
- command: C:\mysql\bin\mysqladmin.exe
arguments: -u root shutdown
hide-window: true

- command: C:\nginx\nginx.exe
- command: C:\nginx\nginx.exe
arguments: -s stop
workdir: C:\nginx
hide-window: true
```
This example configuration defines a set of `nginx + Apache + MariaDB + PHP7/PHP8` for local development:
* **Start service**:
With this example configuration, TrayAppControl:
* On **Start service**:
* Launches two[^3] instances of `C:\httpd\bin\httpd.exe`, hides their windows, remembers their process handles
* Launches `nginx` process _(without remembering its process handle)_
* Launches `mysqld` process _(without remembering its process handle)_
* **Stop service**:
* On **Stop service**:
* Terminates "remembered" Apache processes
* Executes `nginx -s stop` command
* Executes `mysqladmin -u root shutdown` command
Expand All @@ -105,18 +114,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
* [Full license text ](src/LICENSE.txt)
* [Full license text ](LICENSE.txt)
* [Acknowledgements and licenses for 3rd party components](3rdparty_licensing/3RDPARTY.txt)
<details>
<summary>📝 Codestyle notes</summary>
<br>
[![CodeFactor](https://www.codefactor.io/repository/github/tushev/trayappcontrol/badge)](https://www.codefactor.io/repository/github/tushev/trayappcontrol)
(`¹`) <sub>Please note that _blank-line related rules_ such as `The code must not contain multiple blank lines in a row.`, `A closing curly bracket must not be preceded by a blank line.`, `An opening curly bracket must not be followed by a blank line` etc **are disabled** in CodeFactor.</sub>
</details>
[^2]: Officially known as **Taskbar Notification Area**.
[^3]: With different params (i.e. `-D php8`) to be used with the corresponding `<IfDefine>` sections.
[^4]: While Apache can be installed as Windows service (`httpd -k install`), it is not always convenient to run it as a service.
[^3]: With different params (i.e. `-D php8`) to be used with the corresponding `<IfDefine>` sections of `httpd.conf`.
[^4]: While Apache can be installed as Windows service (`httpd -k install`), it is not always convenient to run it as a service.

0 comments on commit c51a6d1

Please sign in to comment.