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

Question: How to set a persistant resolution? #304

Open
PWM-Master opened this issue Jan 15, 2024 · 4 comments
Open

Question: How to set a persistant resolution? #304

PWM-Master opened this issue Jan 15, 2024 · 4 comments

Comments

@PWM-Master
Copy link

PWM-Master commented Jan 15, 2024

I am able to set the desired resolution with wlr-randr after Cage is started.
I understand, that changing the resolution is not possible before Cage is started.
To provide some form of resolution persistance: what could be a method to call wlr-randr while starting Cage?
I experimented with some old-school X11 start configurations, like ~/.xinitrc, but none worked.

In the Cage wiki/issues there was only a daemon named kanshi mentioned on a related topic.
Is there any additional start configuration or xinit-comparable script-hook for cage/wayland?

@PWM-Master PWM-Master changed the title Question: How to set a persitant resolution? Question: How to set a persistant resolution? Jan 15, 2024
@emersion
Copy link
Contributor

Ideally Cage would support a mode where it completely delegates output configuration to kanshi, instead of making decisions on its own.

@PWM-Master
Copy link
Author

So there are no startup -options or -scripts that can be used now - and kanshi is the way to go for setting a resolution. Thanks for the info/clarification.

@emersion
Copy link
Contributor

You can use wlr-randr instead of kanshi if you don't need hotplug. However cage will still perform its own modeset before wlr-randr has the chance to change it to something else.

@embdur
Copy link

embdur commented Jul 23, 2024

What I ended up doing was calling wlr-randr before starting my (Java) app. Here is the ExecStart line from my systemd service file:

ExecStart=/usr/bin/cage -- sh -c 'wlr-randr --output HDMI-A-2 --mode 1920x1080@60 && java -jar /home/cage/PiKiosk-linux-arm64-1.0.0.jar'

More on this here: https://github.com/SergeySn/PiKiosk/?tab=readme-ov-file#run-the-sample-compose-app-with-cage -> 8. Optional: Force cage to use a specific resolution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants