https://github.com/cdriehuys/magic-mirror-controller
https://github.com/cdriehuys/magic-mirror-controller
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cdriehuys/magic-mirror-controller
- Owner: cdriehuys
- License: mit
- Created: 2023-03-10T03:27:40.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-15T03:44:54.000Z (almost 3 years ago)
- Last Synced: 2025-01-07T07:44:09.355Z (about 1 year ago)
- Language: Go
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Magic Mirror Controller
A simple REST controller for managing the display of a magic mirror. The API
allows for turning the mirror on and off, querying the display's state, and
refreshing the browser window showing the mirror.
## Building
```bash
GOOS=linux GOARCH=arm64 go build -o build/magic-mirror-controller
```
## Display Power
This program is essentially a wrapper around the following two commands which
turn the display on and off:
```bash
xrandr --display :0.0 --output HDMI-1 --off
xrandr --display :0.0 --output HDMI-1 --auto --rotate left
```
We also use `xdotool` to refresh the mirror display:
```bash
window_id="$(DISPLAY=:0.0 xdotool search --name 'Mozilla Firefox')"
DISPLAY=:0.0 xdotool key --window "${window_id}" F5
```