Skip to content

Commit

Permalink
docs: add READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
meskill committed Sep 28, 2022
1 parent 5f24a69 commit a54991e
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 5 deletions.
121 changes: 119 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,125 @@
# MysticLight Browser Cinema

Extension for Chromium-based browsers (Chromium, Chrome, Vivaldi, Edge, Yandex.Browser) that allows to disable lighting effects of your Mystic Light compatible (mostly comes under MSI trademark) RGB peripherals and components on event when browser enters fullscreen mode.

> Works only with installed [Mystic Light](https://www.msi.com/Landing/mystic-light-rgb-gaming-pc/mystic-light) and [companion app](#native-app) on Windows
 

## Why?

<img align="right" width="370" src="./assets/demonstration.gif">

Having gaming peripherals and components with fancy RGB led feels great, but it might become annoying while you are trying to watch movies or youtube videos. This extension just allows to automatically disable lighting of these devices when browsers enters fullscreen mode. When browsers leaves fullscreen your device settings will restore to previous state before fullscreen event.

&nbsp;

&nbsp;

&nbsp;

## Is my device supported?

- check your device info - if there any mention of "Mystic Light" then most likely it is supported
- you can check the [Mystic Light compatible products](https://www.msi.com/Landing/mystic-light-rgb-gaming-pc/compatible-products)
- if you have installed "Dragon Center" or "MSI Center" app you will see your device on the Mystic Light tab if it is supported

&nbsp;

&nbsp;

&nbsp;

&nbsp;

## Setup

## Native app
1. Make sure you have installed "MSI SDK" program installed on your device. This program is installed with either "Dragon Center" or "MSI Center" app - you can find download links [here](https://www.msi.com/Landing/mystic-light-rgb-gaming-pc/download).
2. Install [native-app](#native-app)
3. Install [browser extension](#browser-extension)

### Native app

1. Go to [releases page](https://github.com/meskill/mystic-light-browser-cinema/releases)
2. Find latest release
3. Locate download link with `Native-app installer` and click on it
4. After download run it to install native app

To verify that everything is set correctly:
1. Press `Win + R`, type `services.msc`, press enter
2. Locate `Mystic Light Browser Cinema` service
3. If it shows state `Running` then native-app is working


<p align="center">
<img align="center" height="280" src="./assets/running-service.png">
</p>

### Browser extension

1. Install `MysticLight Browser Cinema` extension from [github releases page](https://github.com/meskill/mystic-light-browser-cinema/releases)
2. Navigate to `chrome://extensions` and click "Details" on the newly installed extension.
3. Scroll down and make sure the "Allow access to file URLs" is enabled.

To verify that everything is set correctly:
1. In your browser go to `Menu -> More Tools -> Extension`
2. Locate `Mystic Light Browser Cinema` extension, click `Details`
3. Verify that extension and the "Allow access to file URLs" flag are enabled

<p align="center">
<img align="center" height="420" src="./assets/extension-settings.png">
</p>


## Uninstall

- Uninstall "Mystic Light Browser Extension" from your browser
- Uninstall "Mystic Light Browser Cinema" app from your system through "Add or remove programs" tab in windows settings


## Caveats

- Supports only `Windows`
- Changing device state not through MysticLight app wont be detected by the extension and that will mess up the lighting for you. So prefer to change light effects only through MSI app.
- Only default `%ProgramData%` location is supported. E.g. `C:\\ProgramData`

## Troubleshooting

### Browser extension shows alert with error "native-app not found"

Make sure you have installed [native-app](#native-app) and it is running:
- open start menu
- type "Services"
- open Services app
- locate "Mystic Light Browser Cinema" service
- make sure it is in "Running" state. If not try to start it manually
- if it doesn't help follow [this instruction](#no-answer-on-my-question)

### Device state doesn't reflect browser mode

Make sure you have followed [setup instruction](#setup) and have installed "MSI SDK" and native-app.

If you have everything installed follow [this instruction](#no-answer-on-my-question)

### No answer on my question

Please create Issue on [GitHub](https://github.com/meskill/mystic-light-browser-cinema/issues) with detailed report.

Provide next information:
- screenshot of opened MSI app that shows your MysticLight compatible devices
- screenshot of opened Windows Services app that shows that you have running "Mystic Light Browser Cinema" service
- send as an archive the logs from "C:\ProgramData\Mystic Light\Mystic Light Browser Cinema\logs" folder

## How does it work

You can find additional information in the related docs:

- [Browser extension](./chrome-extension/README.md)
- [Native-app](./native-app/README.md)

## Related Projects

## Chrome Extension
- [Steelseries Browser Cinema](https://github.com/meskill/steelseries-browser-cinema) - similar extension but only for Steelseries devices

## Credits

Expand Down
Binary file added assets/demonstration.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/extension-settings.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/running-service.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions chrome-extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Browser extension

Extension that can communicate with [native-app](../native-app/README.md) to change the state of MysticLight devices on browser events

## How does it work

- the extension is build using [Plasmo Framework](https://docs.plasmo.com)
- extension reads config file that is populated from the native-app (and that is why extension requires "Allow access to file URLs") in order to figure out how to communicate with it
- extension adds listener for browser fullscreen events
- when browser enters fullscreen the extension:
- requests current devices state and stores it in memory
- sends new state for devices with disabled lighting
- when browser exists fullscreen the extension:
- sends previous stored state to revert it to previous state
16 changes: 13 additions & 3 deletions native-app/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# Native-app

Native app written in Rust and wrapped in Windows service to provide interaction between `Mystic Light SDK` and `Mystic Light Browser Cinema` browser extension
Native app is written in Rust and wrapped in Windows service to provide interaction between `Mystic Light SDK` and `Mystic Light Browser Cinema` browser extension

## How does it work

- native-app is based on [mystic-light-sdk Rust crate](https://github.com/meskill/mystic-light-sdk) that provides a wrapper for the underlying [Mystic Light SDK](https://www.msi.com/Landing/mystic-light-rgb-gaming-pc/download#:~:text=MYSTIC%20LIGHT%20SDK%20FOR%20DEVELOPERS)
- native-app is basically a Windows service that implements next logic:
- starts a server that listens on a random port for requests
- writes additional information about its run parameters to "%ProgramData%\\Mystic Light\\Mystic Light Browser Cinema"
- on request it applies the changes through sdk to the hardware devices
- service itself and additional tools for its install/uninstall actions are implemented with [windows_service crate](https://github.com/mullvad/windows-service-rs)
- installer is made with [Inno Setup](https://jrsoftware.org/isinfo.php)

## Debug

Logs for service and install/uninstall tools are stored in directory `%ProgramData%\\Mystic Light\\Mystic Light Browser Cinema\\logs`

By default, logs contains events from app itself, underlying sdk and install/uninstall tools.
By default, logs contain events from app itself, underlying sdk and install/uninstall tools.

### Control log output

Expand All @@ -16,7 +26,7 @@ If env is not specified the default value will be used that roughly equals to `e

By specifying this options you may control what will be output to the logs files. To figure out how to specify this env refer to [tracing_subscriber](https://docs.rs/tracing-subscriber/0.3.15/tracing_subscriber/struct.EnvFilter.html#directives) documentation and look for the available targets below. This env should reside under `System Variables` not `User variables` as all of the apps are running from the administrator account, not user.

> After adding/changing env value you have to restart Mystic Light Browser Cinema service. It might be done through `Services` panel in Windows - just find the service, open context menu and pick up restart
> After adding/changing env value you have to restart Mystic Light Browser Cinema service. It might be done through `Services` panel in Windows - just find the service, open context menu and click restart
The most important targets in logging are:
- mystic_light_browser_cinema - logs from the app itself
Expand Down

0 comments on commit a54991e

Please sign in to comment.