-
-
Notifications
You must be signed in to change notification settings - Fork 28
Add HiDPI support for Plymouth boot #330
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi, thanks for running the CI. I've been able to build with meson locally and install the generated 'elementary-default-settings' deb package in my machine. The meson script needed a change so the service is effectively installed and enabled during the post install of the primary deb package. Please check commit #02cd7bd Regards |
|
Hi, I've done further testing and noticed that sometimes the 'xrdb' command doesn't work as expected. To address this, I've applied a fix: the script now waits for Gala to start, not just the X11 session. Additionally, I've simplified the script to only create the configuration file at '/etc/plymouth/plymouthd.conf', assuming it doesn't already exist. Regards |
plymouth/meson.build
Outdated
| # Configure Plymouth for HiDPI screens | ||
| install_data( | ||
| 'plymouth-hidpi.sh', | ||
| install_dir: '/usr/local/bin', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be nice if this can respect get_option('bindir'). To substitute path to the script in plymouth-hidpi.service you can use meson's configure_file().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Thanks for the guidance. Please check the latest commit
meson.build
Outdated
| subdir('gtk') | ||
|
|
||
| # Plymouth HiDPI support | ||
| subdir('plymouth') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will probably be nice if there is a meson option to disable this (because I package this on NixOS and we don't enable plymouth by default and don't configure plymouth this way in a immutable system... 😂 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure no probs. It's added. Please check the latest commit
Plymouth HiDPI support can be disabled by running Meson with a command like:
meson setup builddir -Denable-plymouth-hidpi=false
eebb6bb to
d9bde3d
Compare
…tors.xml file. Also respect get_option('bindir') for improved configuration handling.
cf43a4e to
1e4d00f
Compare
1e4d00f to
0701853
Compare
plymouth/plymouth-hidpi.service.in
Outdated
| [Service] | ||
| Type=oneshot | ||
| ExecStart="@BINDIR@/plymouth-hidpi.sh" | ||
| ExecStartPost=/bin/bash -c 'if [ $? -eq 0 ]; then systemctl disable plymouth-hidpi.service; rm -f /etc/systemd/system/plymouth-hidpi.service @BINDIR@/plymouth-hidpi.sh; fi' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if user upgrades their monitor? I guess we should update plymouth config in this case. What if we just run this session every boot, not just the first one? Will that give us any issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that'd be a good improvement.
Hence, the following changes were added:
- The script now runs on every boot. It doesn't wait for 'Gala' to be running anymore, it just wait until the user logs in (max waiting time is 5 mins, otherwise it tries again on next boot).
- The Plymouth config file is created or updated based on needs, and when updated, the scaling setting is edited or removed based on the scaling factor detected.
Could you please review the latest commit?
plymouth/plymouth-hidpi.sh
Outdated
| TIMEOUT_SECONDS=300 # Maximum wait time in seconds | ||
| ELAPSED=0 | ||
|
|
||
| # Wait until Gala is running or timeout occurs | ||
| while ! pgrep -x "gala" > /dev/null && [ $ELAPSED -lt $TIMEOUT_SECONDS ]; do | ||
| sleep 5 | ||
| ((ELAPSED += 5)) | ||
| done | ||
|
|
||
| if [ $ELAPSED -ge $TIMEOUT_SECONDS ]; then | ||
| echo "Timeout reached while waiting for Gala to start" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed since this script no longer relies on gala
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks. The script was waiting for 'Gala' to be ready so there was certainty there's a logged in user, but it wasn't really necessary anymore.
I've pushed an update with the last commit to just check if there's an user logged in (5 mins timeout).
Also, I assume the '~.../monitors.xml' file might not be available immediately after installing elementary OS, at least not until the user logs in for the first time. This is the only reason the script waits for an active user session. Otherwise, I’d remove the session check as well. If you know when the file is created or how to confirm this assumption, that would be very helpful.
|
I'm not sure about this solution, but there is a plymouth repo that this PR should be made against instead: https://github.com/elementary/plymouth-theme |
Configure Plymouth to display at 1x scaling on HiDPI screens, such as the MacBook Pro 15" Mid 2015, which has a 192 DPI display. Currently, Plymouth appears too large (2x the expected size) during boot, but displays correctly at 1x during shutdown, likely due to the window manager’s HiDPI settings only available after booting up.
Approach:
Testing: