You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+95-1
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ To display the module insert it in the config.js file. Here is an example:
56
56
57
57
## Alternative commands
58
58
59
-
In default the module uses `vcgencmd` to control the screen. There might be situations where `vcgencmd` fails (for example with newer Raspberry Bullseye versions) and you need to find an alterative way to control the screen.
59
+
In default the module uses `vcgencmd` to control the screen. There might be situations where `vcgencmd` fails (for example with newer Raspberry Bullseye or Bookworm versions) and you need to find an alterative way to control the screen.
60
60
61
61
You can provide your own scripts and set the paths to them with the configuration options `screenStatusCommand`, `screenOnCommand` and `screenOffCommand`.
62
62
@@ -68,6 +68,16 @@ The module already provides alternative scripts in the controlScripts directory
68
68
69
69
This solution will work even with Raspberry OS Bullseye which uses the new "vc4-kms-v3d" graphics driver.
70
70
71
+
If you use Raspberry OS Bookworm you can either change your default graphics stack back to X11 instead of Wayland or you can use the `wlr-randr_control` wrapper in the next section (preferred way).
72
+
73
+
If you want to change back to X11 you can do it with the following steps:
74
+
75
+
```bash
76
+
sudo raspi-config
77
+
```
78
+
79
+
Select Option "6 - advanced options" then "A6-Wayland" and switch back to X11 (thanks to [https://forums.raspberrypi.com/viewtopic.php?t=360281#p2161288](https://forums.raspberrypi.com/viewtopic.php?t=360281#p2161288))
80
+
71
81
The first option of the script is the action you want the second option is optional and the port you want to use.
72
82
My Raspberry 4 provides two HDMI ports which are called "HDMI-1" and "HDMI-2".
73
83
@@ -130,6 +140,90 @@ In the following example the output is shut off and on but it is rotatet left:
130
140
131
141
Other possible rotations are "normal", "inverted", "right".
132
142
143
+
### wlr-randr_control
144
+
145
+
This solution will work even with Raspberry OS Bookworm.
146
+
147
+
The first option of the script is the action you want the second option is optional and the port you want to use. The third option is optional, too and can be used to set the `WAYLAND_DISPLAY` ("wayland-1" usually).
148
+
149
+
My Raspberry 4 provides two HDMI ports which are called "HDMI-A-1" and "HDMI-A-2".
150
+
151
+
You can check which port is used with the command:
152
+
153
+
```bash
154
+
WAYLAND_DISPLAY=wayland-1 wlr-randr
155
+
```
156
+
157
+
The output will look something like:
158
+
159
+
```bash
160
+
HDMI-A-1 "HCD PJ402D-2 LTM12 (HDMI-A-1)"
161
+
Enabled: yes
162
+
Modes:
163
+
640x480 px, 59.939999 Hz
164
+
640x480 px, 60.000000 Hz
165
+
640x480 px, 72.808998 Hz
166
+
640x480 px, 75.000000 Hz
167
+
720x480 px, 59.939999 Hz
168
+
720x480 px, 59.939999 Hz
169
+
720x480 px, 59.939999 Hz
170
+
720x480 px, 60.000000 Hz
171
+
720x480 px, 60.000000 Hz
172
+
720x576 px, 50.000000 Hz
173
+
800x600 px, 56.250000 Hz
174
+
800x600 px, 60.317001 Hz
175
+
800x600 px, 72.188004 Hz
176
+
800x600 px, 75.000000 Hz
177
+
1024x768 px, 60.004002 Hz
178
+
1024x768 px, 70.069000 Hz
179
+
1024x768 px, 75.028999 Hz
180
+
1280x720 px, 59.939999 Hz
181
+
1280x720 px, 60.000000 Hz
182
+
1152x864 px, 75.000000 Hz
183
+
1280x800 px, 59.995998 Hz
184
+
1280x960 px, 60.000000 Hz
185
+
1280x1024 px, 60.020000 Hz
186
+
1920x1080 px, 59.939999 Hz
187
+
1920x1080 px, 60.000000 Hz
188
+
1920x1080 px, 60.000000 Hz
189
+
1280x800 px, 59.910000 Hz (preferred, current)
190
+
Position: 0,0
191
+
Transform: normal
192
+
Scale: 1.000000
193
+
```
194
+
195
+
The first line in the output above shows that HDMI-A-1 is connected. Depending of your output you need to change the second option in the command configurtions which are following.
196
+
197
+
In the following example the output is simply shut off or on and no rotation is provided:
198
+
199
+
```json5
200
+
{
201
+
module:'MMM-Screen-Powersave-Notification',
202
+
config: {
203
+
delay:60,
204
+
screenStatusCommand:"./modules/MMM-Screen-Powersave-Notification/controlScripts/wlr-randr_control status HDMI-A-1",
205
+
screenOnCommand:"./modules/MMM-Screen-Powersave-Notification/controlScripts/wlr-randr_control on HDMI-A-1",
206
+
screenOffCommand:"./modules/MMM-Screen-Powersave-Notification/controlScripts/wlr-randr_control off HDMI-A-1"
207
+
}
208
+
}
209
+
```
210
+
211
+
In the following example the output is shut off and on but it is turned up-side down:
212
+
213
+
```json5
214
+
{
215
+
module:'MMM-Screen-Powersave-Notification',
216
+
config: {
217
+
delay:60,
218
+
screenStatusCommand:"./modules/MMM-Screen-Powersave-Notification/controlScripts/wlr-randr_control status HDMI-A-1",
Copy file name to clipboardexpand all lines: package.json
+1-1
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "MMM-Screen-Powersave-Notification",
3
-
"version": "0.0.9",
3
+
"version": "0.0.10",
4
4
"description": "A MagicMirror² module which controls the state of a screen and can call scripts after the screen got enabled or disabled. This module needs a other module like MMM-GPIO-Notifications which sends notifications on USER_PRESENCE.",
0 commit comments