Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: Xarishark
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Feature request
description: Something Director should do, or an external tool it could replace
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Director aims to do its job without helper tools. If you use an external command-line tool or script for displays, sound, TVs, frame-rate limits, or apps and links around a scene, tell us which one; the goal is to build it in natively.
- type: textarea
id: goal
attributes:
label: What do you want to do?
description: The setup or switch you're trying to make, in your own words.
validations:
required: true
- type: input
id: tool
attributes:
label: Tool or script this would replace
description: Optional. For example NirCmd, a display-switching CLI, rtss-cli, or a TV script, with the command you run.
- type: dropdown
id: where
attributes:
label: Where would you use it?
multiple: true
options:
- In a scene
- On the Now page
- From the command line, a shortcut or a Stream Deck
- type: input
id: hardware
attributes:
label: Hardware involved
description: GPU, monitors, audio devices or TV model, if it matters.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Thanks for helping. Bug reports, TV compatibility reports and pull requests are
- **Crashes**: Director saves a crash report and offers **Report on GitHub** the next time it starts. That opens a pre-filled issue; attach the crash file from `%LOCALAPPDATA%\Director\Logs\Crashes` if you can.
- **Bugs**: open an issue with your Windows version, your Director version (`director --version` or **Options → About**), the steps that went wrong, and recent log lines from **Options → Open logs folder** if they help. Logs never contain pairing keys, but they can contain device names; trim anything you'd rather not share.
- **TV compatibility**: follow [Test a Samsung or TCL TV](docs/TV_TESTING.md) and attach the exported report.
- **Feature requests**: use the [feature request form](https://github.com/Xarishark/Director/issues/new?template=feature.yml). If an external command-line tool or script fills a gap in your setup, name it; the aim is to build it into Director.
- **Security issues**: please don't open a public issue; see [SECURITY.md](SECURITY.md).

## Building
Expand Down
115 changes: 95 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,66 @@
<p align="center"><img src="assets/director.svg" width="96" height="96" alt="Director icon"></p>
<p align="center"><img src="assets/director.svg" width="104" height="104" alt="Director icon"></p>
<h1 align="center">Director</h1>
<p align="center">Switch your monitors, sound, and TV with one scene.</p>
<p align="center"><strong>Windows x64 · Preview</strong></p>
<p align="center"><a href="https://github.com/Xarishark/Director/releases/latest/download/Director-x64-setup.exe"><img src="https://img.shields.io/badge/Download_for_Windows-x64_setup-0078D4?style=for-the-badge&amp;logo=windows&amp;logoColor=white" alt="Download Director for Windows (x64 setup)"></a></p>
<p align="center"><sub>Latest release · <a href="https://github.com/Xarishark/Director/releases">All releases</a></sub></p>

Moving from your desk to the living room? A **TV Gaming** scene can wake the TV, switch your picture and sound to HDMI, cap the frame rate, and open Steam Big Picture. A **Desk** scene puts everything back. Every change is checked, and if a step fails Director restores what it changed.
<p align="center"><strong>Switch your monitors, sound, TV and frame-rate limit with one click.</strong><br>Desk to couch and back, from the window, a shortcut or a Stream Deck.</p>

<p align="center">
<img src="docs/images/scenes.png" width="49%" alt="The Scenes page with a sound-only scene and a TV gaming scene">
<img src="docs/images/displays.png" width="49%" alt="The Displays page with saved monitor layouts">
<a href="https://github.com/Xarishark/Director/releases/latest"><img src="https://img.shields.io/github/v/release/Xarishark/Director?label=release&color=F18068" alt="Latest release"></a>
<img src="https://img.shields.io/badge/Windows_11-24H2%2B-0078D4?logo=windows&logoColor=white" alt="Windows 11 24H2 or newer">
<a href="https://github.com/Xarishark/Director/actions/workflows/windows-build.yml"><img src="https://github.com/Xarishark/Director/actions/workflows/windows-build.yml/badge.svg" alt="Windows build"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License"></a>
<a href="https://github.com/sponsors/Xarishark"><img src="https://img.shields.io/badge/Sponsor-%E2%9D%A4-EA4AAA?logo=githubsponsors&logoColor=white" alt="Sponsor Director on GitHub"></a>
</p>

## What it does
<p align="center"><a href="https://github.com/Xarishark/Director/releases/latest/download/Director-x64-setup.exe"><img src="https://img.shields.io/badge/Download_for_Windows-x64_setup-0078D4?style=for-the-badge&amp;logo=windows&amp;logoColor=white" alt="Download Director for Windows (x64 setup)"></a></p>

<p align="center"><img src="docs/images/slideshow.webp" width="100%" alt="Director's Scenes, scene steps, Now, Displays and TV controls pages"></p>

<details>
<summary>All screenshots</summary>

| | |
| --- | --- |
| <img src="docs/images/scenes.png" alt="Scenes page"> | <img src="docs/images/scene-editor.png" alt="Scene steps"> |
| **Scenes**: switch everything in one click | **Scene steps**: run in order, undone together |
| <img src="docs/images/now.png" alt="Now page"> | <img src="docs/images/displays.png" alt="Displays page"> |
| **Now**: change screens, sound and FPS live | **Displays**: saved layouts with exact modes and HDR |
| <img src="docs/images/tv-controls.png" alt="TV controls"> | |
| **TVs**: wake, switch inputs, turn off | |

</details>

Moving from your desk to the living room? A **TV Gaming** scene wakes the TV, switches it to your PC, turns on the TV as your only screen, sends the sound over HDMI, caps the frame rate and opens Steam Big Picture. A **Desk** scene puts it all back. Director checks every change it makes, and if any step fails it restores what it changed.

## Highlights

- 📺 **TV control built in.** Pair **LG webOS**, **Samsung Tizen** and **TCL Android / Google TV** TVs directly over your network to wake them, switch inputs and turn them off. You don't need Python or Node scripts, TV command-line tools or a companion app. LG is fully supported; Samsung and TCL support is an early trial that still needs testing on real TVs, and [test reports](docs/TV_TESTING.md) are very welcome. [TVs →](docs/TVS.md)
- 🎬 **Scenes run as one flow.** Before → TV → Displays → Sound → FPS limit → After, in that order, with each change checked. If a step fails, Director restores your displays, default devices, volumes and FPS limit together. [Scenes →](docs/SCENES.md)
- ⏳ **Waits for your hardware.** A scene waits for the TV to wake and report the right input, then for its HDMI audio to appear after the screens switch. It never quietly picks a different device. **TV input protection** takes the input back when a console or streaming box grabs it at power-on.
- 🎯 **Frame-rate limits.** Set the global NVIDIA or RTSS limit per scene, including a **VRR-safe cap** worked out from the refresh rate of the screen you just switched to. [FPS →](docs/FPS.md)
- 🚪 **Leave and come back.** When-leaving steps close what the scene opened (for example `steam://close/bigpicture`), turn the TV off, and **End** returns you to your desk scene.
- 🖥️ **Sets up screens that are off.** Detects a TV's real resolutions, refresh rates and HDR by turning it on briefly, then restores your layout, so you can build its preset while it's off. [Displays →](docs/DISPLAYS.md)

## What a scene can change

| Area | What you can set |
| --- | --- |
| **Displays** | Which screens are on, their arrangement and primary, resolution, exact refresh rate, orientation, extend or mirror, and HDR |
| **Sound** | Default output (or the TV's HDMI audio), volume, mute, a separate calls device, and the microphone with its own volume and mute |
| **TV** | Wake it, switch to your PC's input, keep that input, turn it off when you leave |
| **FPS limit** | Global NVIDIA or RTSS limit, a VRR-safe cap, or no limit |
| **Apps and links** | Run apps (optionally waiting for them), open links or URIs, close apps, before, after or when leaving |
| **Return** | The scene to go back to when you end this one: **End** (or running the scene again) runs its leave steps and then applies the Return scene, for example your Default desk setup |

**Now** changes the same things live without saving anything, and every command is also available from the [command line](#command-line).

## No helper tools needed

Director talks to Windows, the NVIDIA driver, RTSS and your TV directly, from one native app written in Rust with a WinUI 3 interface. Setups held together with NirCmd, display-switching command-line tools, rtss-cli or TV scripts can retire them.

- **Scenes** switch everything together: a display layout, sound, a TV, an FPS limit, and apps or links to run before, after or when you leave. Run one from the window, a shortcut, a script or a Stream Deck.
- **Now** changes what's active right now without saving anything: arrange and switch screens, pick the output and volume, set the FPS limit.
- **Displays** saves monitor layouts: which screens are on, their arrangement, primary, resolution, refresh rate, orientation, mirroring and HDR.
- **TVs** pairs LG webOS TVs (plus Samsung Tizen and TCL Android / Google TV as previews) to wake them, switch inputs and turn them off over your network.
**Still using an external command-line tool for something in this space?** If it's about displays, sound, TVs, frame-rate limits, or apps and links around a scene, [open a feature request](https://github.com/Xarishark/Director/issues/new?template=feature.yml) saying which tool and what you use it for. The goal is to build that into Director natively.

## Install

Director needs **Windows 11, version 24H2 or newer** (x64). Download **Director-x64-setup.exe** with the button above and run it; setup installs the Windows App Runtime if it's missing and adds `director` to PATH. See [Install](docs/INSTALL.md) for details, quiet installs and uninstalling.
Director needs **Windows 11, version 24H2 or newer** (x64), because switching HDR per screen uses display APIs that Windows added in 24H2. Download **Director-x64-setup.exe** with the button above and run it. Setup installs the Windows App Runtime if it's missing and adds `director` to PATH. See [Install](docs/INSTALL.md) for quiet installs, updates and uninstalling.

## Quick start

Expand All @@ -32,18 +71,52 @@ Director needs **Windows 11, version 24H2 or newer** (x64). Download **Director-

## Command line

Every scene, preset, TV, screen and audio device has a CLI name: its name in lowercase with dashes, so "TV Gaming" is `tv-gaming`. The **>\_** button next to a name copies the exact command.
Every scene, preset, TV, screen and audio device has a CLI name: its name in lowercase with dashes, so "TV Gaming" is `tv-gaming`. The **>\_** button next to a name copies the exact command, ready for a [Stream Deck button or shortcut](#stream-deck-and-shortcuts).

```powershell
director list
director scene apply tv-gaming
director scene end
director display apply desk-monitors
director audio volume +5
director tv toggle living-room-tv
director fps set nvidia vrr
director list
```

`director --help` lists every command. Commands run without opening the window and return a non-zero exit code when something fails.

## Stream Deck and shortcuts

To run a command from a Stream Deck button, a desktop shortcut or a hotkey tool without a terminal window ever appearing, start it through Windows' console host in headless mode:

```text
conhost.exe --headless cmd.exe /c director scene apply tv-gaming
```

`director --help` lists every command. Commands run without opening the window.
On a Stream Deck, add a **System → Open** action and paste the whole line into its **App / File** field. Some useful buttons:

| Button | Command |
| --- | --- |
| Couch ↔ desk | `conhost.exe --headless cmd.exe /c director scene apply tv-gaming` |
| Back to desk | `conhost.exe --headless cmd.exe /c director scene end` |
| Volume up / down | `conhost.exe --headless cmd.exe /c director audio volume +5` (or `-5`) |
| Mute | `conhost.exe --headless cmd.exe /c director audio mute toggle` |
| TV on / off | `conhost.exe --headless cmd.exe /c director tv toggle living-room-tv` |

### One button to the couch and back

1. Save your everyday setup as a scene: the **Save everyday scene** card on an empty Scenes page saves it as **Default**.
2. Make a **TV Gaming** scene with the TV, the TV layout, **TV's sound** and anything else you want, such as an **After** link `steam://open/bigpicture` to open Steam Big Picture.
3. Optionally, add a **When leaving** link `steam://close/bigpicture` and turn on **Turn off the TV when you leave this scene** in its Prepare TV step.
4. In the TV Gaming scene, open **Return**, switch it on and choose **Default**. Save.
5. On your Stream Deck, add a **System → Open** action with `conhost.exe --headless cmd.exe /c director scene apply tv-gaming`.

Now the same button does both:

- **First press:** TV Gaming becomes active. The TV wakes, the screens and sound switch, and Big Picture opens.
- **Second press:** because TV Gaming is already active, Director runs its leave steps (Big Picture closes, the TV turns off) and then applies Default.

Turn on **Notify when CLI scenes fail** in Options to get a Windows notification if a press doesn't complete.

## Guides

Expand All @@ -53,6 +126,8 @@ director tv toggle living-room-tv

## Contributing

Bug reports, TV compatibility reports and pull requests are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md). Report security problems privately as described in [SECURITY.md](SECURITY.md). Release notes are in [CHANGELOG.md](CHANGELOG.md).
Bug reports, TV test reports, feature requests and pull requests are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md). Please report security problems privately as described in [SECURITY.md](SECURITY.md). Release notes are in [CHANGELOG.md](CHANGELOG.md).

## License

Director is written in Rust with a native WinUI 3 interface, and licensed under the [MIT License](LICENSE).
[MIT](LICENSE). Third-party components are listed in [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
2 changes: 1 addition & 1 deletion docs/SCENES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Before running any leave steps, Director checks that the Return scene still exis

## Shortcuts and the command line

The **>\_** button after a scene's name shows the commands for it, each with **Copy**: by CLI name (`director scene apply tv-gaming`, easy to read) and by ID (keeps working after a rename). Paste either into a Stream Deck action, a shortcut or a script. Setup adds `director` to PATH.
The **>\_** button after a scene's name shows the commands for it, each with **Copy**: by CLI name (`director scene apply tv-gaming`, easy to read) and by ID (keeps working after a rename). Paste either into a Stream Deck action, a shortcut or a script. Setup adds `director` to PATH. To run it without a terminal window appearing, prefix it with `conhost.exe --headless cmd.exe /c`, as shown in the [README](../README.md#stream-deck-and-shortcuts). With a **Return** step, one button applies the scene and a second press takes you back.

```text
director scene list
Expand Down
Binary file modified docs/images/displays.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/now.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/scene-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/scenes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/slideshow.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/tv-controls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/gui/now_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ impl DirectorApp {
if crate::gui::preset_cards_preview::ENABLED.load(std::sync::atomic::Ordering::Acquire) {
self.fps = crate::gui::fps_ui::FpsState::fixture();
self.now.fps_dirty = false;
let (layout, options) = crate::gui::preset_cards_preview::now_displays();
self.now.set_displays(layout, options);
self.now
.set_devices(self.outputs.clone(), self.inputs.clone());
return;
}
self.fps.live = None;
Expand Down
4 changes: 4 additions & 0 deletions src/gui/preset_cards_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ pub(crate) fn output(name: &str) -> std::path::PathBuf {
std::fs::create_dir_all(&dir).unwrap();
dir.join(name)
}
/// The demo screens and their modes, for the Now page in the preview.
pub(crate) fn now_displays() -> (Layout, Vec<Options>) {
(layout(), options())
}
fn layout() -> Layout {
let mut monitors = vec![];
for (i, name) in ["Desk monitor", "Portrait monitor", "Living room TV"]
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tv_controls_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ impl DirectorApp {
self.tv.ready_for_controls_preview();
self.tv.tvs = vec![Tv {
id: "test-controls-preview-missing-record".into(),
name: "TV controls preview (test fixture)".into(),
name: "Living room TV".into(),
address: "192.0.2.50".into(),
brand: Default::default(),
samsung: Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions src/gui/tv_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1403,11 +1403,11 @@ impl DirectorApp {
self.tv.ready = true;
self.tv.displays = vec![DisplayLink {
device_path: "test-preview-display".into(),
name: "Preview Windows display (test fixture)".into(),
name: "LG TV".into(),
}];
self.tv.draft = Some(Tv {
id: "test-guide-preview".into(),
name: "TV guide preview (test fixture)".into(),
name: "Living room TV".into(),
address: "192.0.2.50".into(),
brand: Default::default(),
samsung: Default::default(),
Expand Down
Loading