Skip to content

Commit 8db08c4

Browse files
author
veeck
committed
Merge branch 'mm_master' into mm_develop
2 parents 893a46c + af2a3f6 commit 8db08c4

File tree

19 files changed

+296
-268
lines changed

19 files changed

+296
-268
lines changed

.vitepress/theme/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ import "./style.css";
77
import BackToTopButton from "@miletorix/vitepress-back-to-top-button";
88
import "@miletorix/vitepress-back-to-top-button/style.css";
99

10+
function rewrite(path: string): string | null {
11+
// Example: VuePress legacy prefix
12+
if (path.startsWith("/development/"))
13+
return path.replace("/development/", "/module-development/");
14+
15+
return null;
16+
}
17+
1018
export default {
1119
extends: DefaultTheme,
1220
Layout: () => {
@@ -16,5 +24,13 @@ export default {
1624
},
1725
enhanceApp({ app, router, siteData }) {
1826
BackToTopButton(app);
27+
router.onBeforeRouteChange = (to) => {
28+
const next = rewrite(to);
29+
if (next && next !== to) {
30+
// Replace instead of push: avoids back-button loops
31+
router.go(next);
32+
return false; // cancel original navigation
33+
}
34+
};
1935
},
2036
} satisfies Theme;

configuration/autostart.md

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,28 @@ pm2 show mm
109109

110110
## Using systemd/systemctl
111111

112-
Systemctl is a control interface for systemd, a powerful service manager
113-
often found in full Linux systems. This approach works for both headless (serveronly) and full Electron UI modes.
112+
Systemctl is a control interface for systemd, a powerful service manager often
113+
found in full Linux systems. This approach works for both headless (serveronly)
114+
and full Electron UI modes.
114115

115116
The examples below assume:
116117

117118
- MagicMirror is installed in "/home/server/MagicMirror/"
118119
- Node.js is located at "/usr/bin/node" (Run `which node` if you're unsure.)
119120
- Systemd requires absolute paths for all binaries and directories.
120-
- Also, the examples use a user named "server" - replace it with your actual username.
121-
- Avoid running as "root" unless absolutely necessary - it increases security risks.
121+
- Also, the examples use a user named "server" - replace it with your actual
122+
username.
123+
- Avoid running as "root" unless absolutely necessary - it increases security
124+
risks.
122125

123126
### Full Electron UI Mode (Recommended for Desktop Auto-Login)
124127

125-
::: warning Note
126-
This section is tailored for **Raspberry Pi OS Desktop**. Users on other Linux distributions may need to adapt the configuration.
127-
:::
128+
::: warning Note This section is tailored for **Raspberry Pi OS Desktop**. Users
129+
on other Linux distributions may need to adapt the configuration. :::
128130

129-
For systems with graphical auto-login (e.g. Raspberry Pi OS Desktop), it's best to use a user systemd service. It starts automatically after the user session is fully initialized.
131+
For systems with graphical auto-login (e.g. Raspberry Pi OS Desktop), it's best
132+
to use a user systemd service. It starts automatically after the user session is
133+
fully initialized.
130134

131135
#### Create service file
132136

@@ -135,8 +139,9 @@ mkdir -p ~/.config/systemd/user
135139
nano ~/.config/systemd/user/magicmirror.service
136140
```
137141

138-
Note: Why "~/.config/systemd/user/"?
139-
User services run in the context of your desktop session, giving them access to DISPLAY (or WAYLAND_DISPLAY), sound, and other GUI resources.
142+
Note: Why "~/.config/systemd/user/"? User services run in the context of your
143+
desktop session, giving them access to DISPLAY (or WAYLAND_DISPLAY), sound, and
144+
other GUI resources.
140145

141146
#### Paste the following configuration (adjust paths as needed)
142147

@@ -160,8 +165,14 @@ WantedBy=default.target
160165
```
161166

162167
Notes:
163-
- %h is a systemd placeholder for the user’s home directory (e.g., /home/server). It’s safer than hardcoding paths.
164-
- Logging note: By default, this service does not write logs to disk to avoid excessive writes on SD cards. If you need logs for debugging, uncomment the StandardOutput and StandardError lines in the service file. Remember to disable them again after troubleshooting. The file is overwritten on every restart (due to `file:` mode).
168+
169+
- %h is a systemd placeholder for the user’s home directory (e.g.,
170+
/home/server). It’s safer than hardcoding paths.
171+
- Logging note: By default, this service does not write logs to disk to avoid
172+
excessive writes on SD cards. If you need logs for debugging, uncomment the
173+
StandardOutput and StandardError lines in the service file. Remember to
174+
disable them again after troubleshooting. The file is overwritten on every
175+
restart (due to `file:` mode).
165176

166177
#### Enable and start the service
167178

@@ -187,17 +198,20 @@ systemctl --user stop magicmirror.service
187198
systemctl --user disable magicmirror.service
188199
```
189200

190-
Tip: You can omit `.service` - `systemctl --user start magicmirror` works just as well.
201+
Tip: You can omit `.service` - `systemctl --user start magicmirror` works just
202+
as well.
191203

192204
#### Ensure auto-login is enabled
193205

194-
For this to work on boot, your system must auto-login to the desktop (no password prompt). On Raspberry Pi OS, configure this via
206+
For this to work on boot, your system must auto-login to the desktop (no
207+
password prompt). On Raspberry Pi OS, configure this via
195208

196209
`sudo raspi-config → System Options → Boot / Auto Login → Desktop Autologin`
197210

198211
### Headless Mode (serveronly)
199212

200-
Use this if you run MagicMirror without a local GUI (e.g., serving to remote browsers or using a separate display device).
213+
Use this if you run MagicMirror without a local GUI (e.g., serving to remote
214+
browsers or using a separate display device).
201215

202216
#### Create a system-wide service
203217

@@ -225,7 +239,8 @@ ExecStart=/usr/bin/node serveronly
225239
WantedBy=multi-user.target
226240
```
227241

228-
This runs as a background service - no GUI access. You’ll need a separate browser (on another device or locally) to view http://localhost:8080.
242+
This runs as a background service - no GUI access. You’ll need a separate
243+
browser (on another device or locally) to view http://localhost:8080.
229244

230245
#### Control the service (requires sudo)
231246

@@ -251,7 +266,8 @@ sudo systemctl disable magicmirror.service
251266

252267
### Auto-Starting a Browser (for serveronly mode)
253268

254-
If you still want a local display while using serveronly, auto-start Chromium in kiosk mode
269+
If you still want a local display while using serveronly, auto-start Chromium in
270+
kiosk mode
255271

256272
#### Edit the LXDE autostart file
257273

@@ -310,13 +326,17 @@ chmod +x ~/bin/start-chromium.sh
310326
### Troubleshooting
311327

312328
- **Service won’t start? Check logs**
329+
313330
```shell
314331
journalctl --user -u magicmirror -f # for user service
315332
sudo journalctl -u magicmirror -f # for system service
316333
```
334+
317335
Also you may look into `~/MagicMirror/magicmirror.log`.
318336

319-
- **Blank screen?** Verify DISPLAY=:0 and XAUTHORITY are set. Add lines below into your `~/.config/systemd/user/magicmirror.service`
337+
- **Blank screen?** Verify DISPLAY=:0 and XAUTHORITY are set. Add lines below
338+
into your `~/.config/systemd/user/magicmirror.service`
339+
320340
```shell
321341
Environment=DISPLAY=:0
322342
Environment=XAUTHORITY=%h/.Xauthority

configuration/introduction.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
};
2222
```
2323

24-
See [module configuration](/modules/configuration.md) for more information
25-
and examples.
24+
See [module configuration](/modules/configuration) for more information and
25+
examples.
2626

2727
4. Run your magic mirror. Refer back to
28-
[installation](/getting-started/installation.md) if you're not sure how to do
28+
[installation](/getting-started/installation) if you're not sure how to do
2929
so.
3030

3131
## More useful configuration of your MagicMirror
@@ -56,13 +56,13 @@ The following properties can be configured, place them above the modules item:
5656
| `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc. for the full list see: [List of ISO 639-1 codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) | `en` |
5757
| `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. | 24 |
5858
| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. | `metric` |
59-
| `electronOptions` | An optional array of Electron (browser) options. This allows configuration of e.g. the browser screen size and position (example: `electronOptions: { fullscreen: false, width: 800, height: 600 }`). Kiosk mode can be enabled by setting `kiosk: true`, `autoHideMenuBar: false` and `fullscreen: false`. More options can be found [here](https://github.com/electron/electron/blob/master/docs/api/browser-window.md). This will most likely be used in advanced installations, below. | [] |
59+
| `electronOptions` | An optional array of Electron (browser) options. This allows configuration of e.g. the browser screen size and position (example: `electronOptions: { fullscreen: false, width: 800, height: 600 }`). Kiosk mode can be enabled by setting `kiosk: true`, `autoHideMenuBar: false` and `fullscreen: false`. More options can be found [here](https://github.com/electron/electron/blob/master/docs/api/browser-window). This will most likely be used in advanced installations, below. | [] |
6060
| `electronSwitches` | An optional array of Electron switches. This allows configuration of electron app itself. <br> This properties will not affect the `serveronly` mode. Usually normal `MM` users don't need this property, but if you are a hard-core hacker, you might need this to handle Electron itself over `MagicMirror` provides. More options can be found [here](https://www.electronjs.org/docs/latest/api/command-line-switches) (Not all available switches are described there.)<br>example:`electronSwitches:["enable-transparent-visuals", "disable-gpu"];` | [] |
6161
| `customCss` | The path of the `custom.css` stylesheet. The default is `config/custom.css`. | `config/custom.css` |
62-
| `watchTargets` | An optional array of file paths to monitor when using `node --run server:watch`. When any of these files change, the server automatically restarts and connected browsers reload. Particularly useful when frequently modifying `config.js`, `custom.css`, or module files during development or setup. Example: `watchTargets: ["config/config.js", "config/custom.css", "modules/MMM-MyModule/MMM-MyModule.js"]`. See [Development Mode](/core-development/debugging.md#watch-mode-with-auto-reload) for more details. | `undefined` |
62+
| `watchTargets` | An optional array of file paths to monitor when using `node --run server:watch`. When any of these files change, the server automatically restarts and connected browsers reload. Particularly useful when frequently modifying `config.js`, `custom.css`, or module files during development or setup. Example: `watchTargets: ["config/config.js", "config/custom.css", "modules/MMM-MyModule/MMM-MyModule.js"]`. See [Development Mode](/core-development/debugging#watch-mode-with-auto-reload) for more details. | `undefined` |
6363

6464
After the above options, you will then add modules. See
65-
[module configuration](/modules/configuration.md) for more information.
65+
[module configuration](/modules/configuration) for more information.
6666

6767
### Advanced configuration and frequently asked how to configure examples
6868

core-development/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This documentation describes core MagicMirror² development.
99
## General
1010

1111
MagicMirror² is a community-driven development effort, and
12-
[contributions](/about/contributing.md) are welcome!
12+
[contributions](/about/contributing) are welcome!
1313

1414
In general, new features and bug fixes should be tracked against an
1515
[issue in the MagicMirror repo](https://github.com/MagicMirrorOrg/MagicMirror/issues).

enhanceApp.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ controlled by settings inside the `config/config.js` file by interface and ip:
143143
- Change `ipWhitelist` to the list of IP's you want to allow to connect
144144

145145
Sample Configuration below
146-
[and link to full configuration options](/configuration/introduction.md)
146+
[and link to full configuration options](/configuration/introduction)
147147

148148
```js
149149
let config = {

getting-started/requirements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Raspberry Pi.
99
_Electron_, the app wrapper around MagicMirror², only supports the Raspberry Pi
1010
2, 3, 4 & 5. The Raspberry Pi 0/1 is currently **not** supported. If you want to
1111
run this on a Raspberry Pi 1, use the
12-
[server only](/getting-started/installation.md#server-only) feature and setup a
12+
[server only](/getting-started/installation#server-only) feature and setup a
1313
fullscreen browser yourself. (Yes, people have managed to run MM² also on a Pi0,
1414
so if you insist, search in the forums.)
1515

@@ -20,7 +20,7 @@ You will need to install the latest full version of
2020
Raspbian).
2121

2222
If you want to run the software on other Operating Systems, take a look at
23-
[this section](/getting-started/installation.md#alternative-installation-methods)
23+
[this section](/getting-started/installation#alternative-installation-methods)
2424

2525
::: warning NOTE You **do** need a desktop environment to run Electron!
2626

module-development/core-module-file.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ system calls the getDom method. This method should therefore return a dom
206206
object.
207207

208208
Read more about Rendering Components
209-
[in the Rendering Component documentation](/module-development/rendering.md).
209+
[in the Rendering Component documentation](/module-development/rendering).
210210

211211
**Example:**
212212

@@ -232,7 +232,7 @@ An example of a default module that uses this method is
232232
[newsfeed](https://github.com/MagicMirrorOrg/MagicMirror/blob/master/defaultmodules/newsfeed/newsfeed.js).
233233

234234
Read more about Rendering Components
235-
[in the Rendering Component documentation](/module-development/rendering.md).
235+
[in the Rendering Component documentation](/module-development/rendering).
236236

237237
**Example:**
238238

@@ -283,8 +283,8 @@ getTemplateData: function() {
283283
Whenever the MagicMirror needs to update the information on screen (because it
284284
starts, or because your module asked a refresh using `this.updateDom()`), the
285285
system calls the getHeader method to retrieve the module's header. This method
286-
should therefor return a string. If this method is not subclassed, this function
287-
will return the user's configured header.
286+
should therefore return a string. If this method is not subclassed, this
287+
function will return the user's configured header.
288288

289289
If you want to use the original user's configured header, reference
290290
`this.data.header`.
@@ -394,9 +394,9 @@ the content update will be animated, but only if the content will really change.
394394

395395
Note that the rendering of the updated dom on the screen will happen
396396
asynchronously. You can listen for the
397-
[`DOM_OBJECTS_UPDATED` notification](/module-development/notifications.md) to
398-
know when the rendering is complete and the new dom is safe to interact with.
399-
This notification only fires if the content will really change.
397+
[`DOM_OBJECTS_UPDATED` notification](/module-development/notifications) to know
398+
when the rendering is complete and the new dom is safe to interact with. This
399+
notification only fires if the content will really change.
400400

401401
**Example:**
402402

@@ -422,10 +422,10 @@ module needs to be updated
422422

423423
**animate Object**
424424

425-
| animate | type | description |
426-
| ------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
427-
| in | String | Animate name when module will be shown (after dom update), it will use an `animateIn` type name (see [Animation Guide](/modules/animate.md#animatein)) |
428-
| out | String | Animate name when module will be hidden (before dom update), it will use an `animateOut` type name (see [Animation Guide](/modules/animate.md#animateout)) |
425+
| animate | type | description |
426+
| ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
427+
| in | String | Animate name when module will be shown (after dom update), it will use an `animateIn` type name (see [Animation Guide](/modules/animate#animatein)) |
428+
| out | String | Animate name when module will be hidden (before dom update), it will use an `animateOut` type name (see [Animation Guide](/modules/animate#animateout)) |
429429

430430
**Example:**
431431

@@ -499,7 +499,7 @@ Possible configurable options:
499499

500500
- `animate` - String - (_Introduced in version: 2.25.0._) Hide the module with a
501501
special animate. It will use an `animateOut` type name. All animations name
502-
are available in [Animation Guide](/modules/animate.md#animateout)
502+
are available in [Animation Guide](/modules/animate#animateout)
503503

504504
::: warning Notes:
505505

@@ -542,7 +542,7 @@ Possible configurable options:
542542
object, if specified in the options (_Introduced in version: 2.15.0_).
543543
- `animate` - String - (_Introduced in version: 2.25.0._) Show the module with a
544544
special animation. It will use an `animateIn` type name. All animations name
545-
are available in [Animation Guide](/modules/animate.md#animatein)
545+
are available in [Animation Guide](/modules/animate#animatein)
546546

547547
::: warning Notes:
548548

0 commit comments

Comments
 (0)