Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland support #3582

Open
goldyfruit opened this issue Oct 8, 2024 · 10 comments
Open

Wayland support #3582

goldyfruit opened this issue Oct 8, 2024 · 10 comments

Comments

@goldyfruit
Copy link

goldyfruit commented Oct 8, 2024

Hi,

Raspberry Pi OS Bookworm is now defaulting to Wayland and Wayfire and because of this change MagicMirror is not able to start via the standard npm run start as its looking for DISPLAY to be set which doesn't exist anymore on Wayland.

Maybe adding a start-wayland option to package.json will be a requirement in order to allow users running on modern distributions to use MagicMirror.

This is how I'm running it and its working very well so far:

WAYLAND_DISPLAY="${WAYLAND_DISPLAY:=wayland-1}" ./node_modules/.bin/electron js/electron.js --enable-features=UseOzonePlatform --ozone-platform=wayland

Related to https://gitlab.com/khassel/magicmirror/-/issues/74

@KristjanESPERANTO
Copy link
Contributor

I'm running Debian 11 with Wayland but without Wayfire and I have no problems with npm run start. So maybe Wayfire is the "problem" and not Wayland?

@goldyfruit
Copy link
Author

I'm running "pure" Wayland (not xwayland), same issue happens with Sway.

@KristjanESPERANTO
Copy link
Contributor

Oh okay, I just checked: Electron is running under xwayland on my system.

I'm just thinking out loud: Would it be possible to put a check into "npm run start" to see if Wayland or X is running and call the right command? This way we could also check if Windows is running (they also need another command).

@bugsounet
Copy link
Contributor

hmm, interesting :)

I just write a test script for test it


pi@raspberrypi:~ $ ./test.sh 
Running: Wayland
pi@raspberrypi:~ $ 

pi@raspberrypi2:~ $ ./test.sh 
Running: X11
pi@raspberrypi2:~ $ 

now the question is... what language to use for code it ?
bash ? or node ?

  • if we use bash we have linux / mac compatibilities BUT not windows
  • if we use node I think we have both compatibility

Or ... just add un new start line with something like this: npm start wayland, npm start windows

@khassel
Copy link
Collaborator

khassel commented Oct 22, 2024

just add un new start line with something like this: npm start wayland, npm start windows

I think this is sufficient.

The wayland scenario is an edge case at the moment, in all raspian os images with desktop XWayland is installed which works with X11 as usual.

@bugsounet
Copy link
Contributor

@khassel ok ;)

@KristjanESPERANTO , do you want to code it ? (i'm lazy mouahah)

@sdetweil
Copy link
Collaborator

a few years ago i wrote a neutral wrapper for start, post install see #2571
https://raw.githubusercontent.com/sdetweil/MMM-Config/refs/heads/main/exec_script.js

@sdetweil
Copy link
Collaborator

so you don't need different start, and couldn't have multiple postinstall clauses

@khassel
Copy link
Collaborator

khassel commented Oct 22, 2024

I think we

  • should prevent current start commands
  • can add new start lines for windows, wayland, ...
  • can add new start line for autodetect
  • should not force users to use autodetect with every start (e.g. there is no need for it in a container)

@KristjanESPERANTO
Copy link
Contributor

KristjanESPERANTO commented Oct 23, 2024

I created a draft PR #3594 for further investigation and discussion.

It is interesting to note that npm run start:wayland seems to run more smoothly (especially ticker texts) than npm run start on my Debian system. But I haven't investigated this further, and my tired senses may be deceiving me. Since X11 development is dead, I'll try this as my new default.

khassel pushed a commit that referenced this issue Oct 23, 2024
This PR adds start options for Wayland and Windows.

This would solve issue #3582.

**To Do if this PR is merged:**

- [ ] Adjust [Windows
section](https://docs.magicmirror.builders/getting-started/installation.html#windows)
in documentation
- [ ] Add Wayland section to the documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants