Skip to content

Commit ff03b26

Browse files
committed
Add more options, update detection, and move to tray icon.
1 parent 5839a48 commit ff03b26

File tree

9 files changed

+212
-47
lines changed

9 files changed

+212
-47
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,28 @@ Duplicate `config.template.json` in the `resources/app` folder to `config.json`,
1616

1717
You can also use this app from the command line, by providing the URL as the argument. Use `stream-overlay --help` to see all the available options.
1818

19+
## Interaction
20+
21+
You can see a list of your windows from the "Sylphweed's Stream Overlay" tray icon. Right click the icon to show the menu. You can also exit the app from here.
22+
23+
When a window is focused (by clicking it from the tray icon menu) it will have an opaque background, and a handle to drag it around. Once it loses focus, it will go back to transparent, and will ignore all mouse events. It will be click-through, so you can click the apps behind it.
24+
1925
## Fullscreen Apps
2026

21-
Stream Overlay doesn't work over fullscreen apps, so your app needs to be in "borderless window" or "borderless fullscreen" to allow Stream Overlay on top of it. If it's still not appearing on top, try setting it to windowed mode then back to borderless.
27+
Stream Overlay doesn't work over fullscreen apps, so your app needs to be in "borderless" or "borderless fullscreen" to allow Stream Overlay on top of it. If it's still not appearing on top, try setting it to windowed mode then back to borderless.
2228

23-
## Interaction
29+
## Config Options
30+
31+
These are the available options for each config entry (window):
2432

25-
When a window is focused (by clicking it on the taskbar/dock) it will have an opaque background, and a handle to drag it around. Once it loses focus, it will go back to transparent, and will ignore all mouse events. It will be click-through, so you can click the apps behind it.
33+
- `title`: The window title.
34+
- `url`: The URL of the page to show in the window.
35+
- `width`: The width, in pixels, of the window, if it's not full screen.
36+
- `height`: The height, in pixels, of the window, if it's not full screen.
37+
- `x`: The X coordinate, in pixels, of the window, if it's not full screen.
38+
- `y`: The Y coordinate, in pixels, of the window, if it's not full screen.
39+
- `opacity`: The opacity of the window as a number between 0 and 1, inclusive. This is not implemented in Linux.
40+
- `fullscreen`: Whether the window should be positioned full screen. (true/false) Be careful with this, as opaque windows can obscure your screen.
2641

2742
## Support Me
2843

assets/help.html

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,64 @@ <h2>Usage</h2>
4545
available options.
4646
</p>
4747

48-
<h2>Fullscreen Apps</h2>
48+
<h2>Interaction</h2>
4949

5050
<p>
51-
Stream Overlay doesn't work over fullscreen apps, so your app needs to be
52-
in "borderless window" or "borderless fullscreen" to allow Stream Overlay
53-
on top of it. If it's still not appearing on top, try setting it to
54-
windowed mode then back to borderless.
51+
You can see a list of your windows from the "Sylphweed's Stream Overlay"
52+
tray icon. Right click the icon to show the menu. You can also exit the
53+
app from here.
5554
</p>
5655

57-
<h2>Interaction</h2>
56+
<p>
57+
When a window is focused (by clicking it from the tray icon menu) it will
58+
have an opaque background, and a handle to drag it around. Once it loses
59+
focus, it will go back to transparent, and will ignore all mouse events.
60+
It will be click-through, so you can click the apps behind it.
61+
</p>
62+
63+
<h2>Fullscreen Apps</h2>
5864

5965
<p>
60-
When a window is focused (by clicking it on the taskbar/dock) it will have
61-
an opaque background, and a handle to drag it around. Once it loses focus,
62-
it will go back to transparent, and will ignore all mouse events. It will
63-
be click-through, so you can click the apps behind it.
66+
Stream Overlay doesn't work over fullscreen apps, so your app needs to be
67+
in "borderless" or "borderless fullscreen" to allow Stream Overlay on top
68+
of it. If it's still not appearing on top, try setting it to windowed mode
69+
then back to borderless.
6470
</p>
6571

72+
<h2>Config Options</h2>
73+
74+
<p>These are the available options for each config entry (window):</p>
75+
76+
<ul>
77+
<li><code>title</code>: The window title.</li>
78+
<li><code>url</code>: The URL of the page to show in the window.</li>
79+
<li>
80+
<code>width</code>: The width, in pixels, of the window, if it's not
81+
full screen.
82+
</li>
83+
<li>
84+
<code>height</code>: The height, in pixels, of the window, if it's not
85+
full screen.
86+
</li>
87+
<li>
88+
<code>x</code>: The X coordinate, in pixels, of the window, if it's not
89+
full screen.
90+
</li>
91+
<li>
92+
<code>y</code>: The Y coordinate, in pixels, of the window, if it's not
93+
full screen.
94+
</li>
95+
<li>
96+
<code>opacity</code>: The opacity of the window as a number between 0
97+
and 1, inclusive. This is not implemented in Linux.
98+
</li>
99+
<li>
100+
<code>fullscreen</code>: Whether the window should be positioned full
101+
screen. (true/false) Be careful with this, as opaque windows can obscure
102+
your screen.
103+
</li>
104+
</ul>
105+
66106
<h2>Support Me</h2>
67107

68108
<p>

assets/page.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,23 @@
1111
http-equiv="X-Content-Security-Policy"
1212
content="default-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; child-src 'self' *"
1313
/>
14-
<title>SylphWeed's Stream Overlay</title>
14+
<title>Stream Overlay</title>
1515

1616
<link rel="stylesheet" href="./page.css" />
1717
</head>
1818
<body>
1919
<div class="drag-handle">
2020
<div class="bar">
21-
<span>SylphWeed's Stream Overlay</span>
21+
<span id="title">Stream Overlay</span>
22+
</div>
23+
<div id="close">
24+
<svg style="width: 16px; height: 16px" viewBox="0 0 24 24">
25+
<path
26+
fill="currentColor"
27+
d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
28+
/>
29+
</svg>
2230
</div>
23-
<div id="close">&times;</div>
2431
</div>
2532
<iframe
2633
src="about:blank"

assets/preload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { contextBridge, ipcRenderer } = require('electron');
33
contextBridge.exposeInMainWorld('electronAPI', {
44
onFocus: (callback) => ipcRenderer.on('focus', callback),
55
onBlur: (callback) => ipcRenderer.on('blur', callback),
6-
url: (callback) => ipcRenderer.on('url', callback),
7-
requestUrl: () => ipcRenderer.invoke('requestUrl'),
6+
config: (callback) => ipcRenderer.on('config', callback),
7+
requestConfig: () => ipcRenderer.invoke('requestConfig'),
88
requestClose: () => ipcRenderer.invoke('requestClose'),
99
});

assets/renderer.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ window.electronAPI.onFocus(() => document.body.classList.add('focused'));
22
window.electronAPI.onBlur(() => document.body.classList.remove('focused'));
33

44
const frame = document.getElementById('frame');
5-
window.electronAPI.url((_event, url) => (frame.src = url));
6-
window.electronAPI.requestUrl();
5+
window.electronAPI.config((_event, config) => {
6+
// Page title.
7+
document.getElementsByTagName('title')[0].innerText =
8+
config.title || 'Stream Overlay';
9+
// Title bar.
10+
document.getElementById('title').innerText = config.title || 'Stream Overlay';
11+
// Frame URL.
12+
frame.src = config.url;
13+
});
14+
window.electronAPI.requestConfig();
715

816
document
917
.getElementById('close')

config.template.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
[
22
{
3+
"title": "Chat",
34
"url": "https://streamlabs.com/widgets/chat-box/v1/YOURSECRETCODE",
45
"width": 450,
56
"height": 650,
67
"x": 50,
78
"y": -1
89
},
910
{
11+
"title": "Alerts",
1012
"url": "https://streamlabs.com/alert-box/v3/YOURSECRETCODE",
1113
"width": 600,
1214
"height": 600,

0 commit comments

Comments
 (0)