Commit graph

2979 commits

Author SHA1 Message Date
Icar NS
d0bf79b27e Translated using Weblate (Catalan)
Currently translated at 100.0% (7 of 7 strings)

Added translation using Weblate (Catalan)

Co-authored-by: Icar NS <fedoraproject.relock974@passmail.net>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/ca/
Translation: plymouth/main
2025-05-07 16:26:50 +00:00
Hans de Goede
9653285f37 Merge branch 'get_device_scale_guess' into 'main'
ply-utils: Guessed device-scale improvements

See merge request plymouth/plymouth!343
2025-05-06 11:49:25 +00:00
Hans de Goede
1421a9f65f ply-utils: Increase threshold for guessed hiDPI scaling to >= 2880x1620
1440 is only 33% more then FHD, so using 2x there is a bit too much and
leads to the spinner being much too large on e.g 27" monitors.

And on e.g. Dell ultrawide 34" 3440x1440 which are only 110 DPI this effect
is even worse.

Change the threshold to >= 2880x1620 to avoid using 2x scaling on 1440p
monitors. 2880x1620 is ~240DPI when used in a 14" laptop at which point
using 2x scaling is really necessary.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-05-06 11:38:59 +00:00
Hans de Goede
2123f7b9c6 ply-utils: Use lower threshold for hiDPI scaling on 3:2 screens
3:2 screens are only used in mobile form factors, add a special case for
this with a lower threshold to enable 2x hiDPI scaling.

Also remove the HIDPI_MIN_* defines these were only used in one place
and adding a second set for the 3:2 screens just makes things harder
to read.

Instead write the actual width/height thresholds directly in the code
of the new get_device_scale_guess () helper.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-05-06 11:38:59 +00:00
Hans de Goede
0a4fd6b1d2 ply-utils: Swap width <-> height for portrait screens when guessing device-scale
Swap width <-> height for portrait screens when guessing device-scale,
this fixes the heuristics not working for portrait screens.

Also move the heuristics to a new get_device_scale_guess () helper, because
it has become a bit larger now.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-05-06 11:38:59 +00:00
Hans de Goede
655aae1e3d Merge branch 'use_simpledrm-config' into 'main'
Make simpledrm selection configurable from config file

Closes #264

See merge request plymouth/plymouth!342
2025-05-06 11:37:33 +00:00
Hans de Goede
61e471762e ply-device-manager: Update verify_drm_device () comment
The comment about why SimpleDRM devices should be skipped is no longer
accurate, the kernel does provide rotation info now; and plymouth now
has heuristics to guess the device-scale.

If SimpleDRM devices should be used or not now mostly is a user
preference.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:47:04 +01:00
Hans de Goede
f23b07e5b5 drm: Reject 800x600 and 1024x768 simpledrm drm devices
Sometimes the EFI firmware initializes the framebuffer at a very low
resolution rather then at the panel's native resolution.

In this case it is better to wait for the native GPU driver to load
rather then rendering a not-so-pretty splash at this very low resolution.

Reject these low resolutions for simpledrm devices except when
query_device () is called with force=true.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:47:04 +01:00
Hans de Goede
c1e0070d47 libply-splash-core: Add a force argument to ply_renderer_open ()
Sometimes a renderer plugin may want to refuse to open a device
because it has suboptimal settings, like e.g. an EFI framebuffer
based simpledrm when the EFI firmware has set the resolution to
800x600 instead of the native panel resolution.

In such a case it might be better to wait for another better
/dev/dri/card# device to show up.

This skipping of devices by renderer plugins needs to be configurable
in case the timeout hits, or the user wishes to override things.

Add a force argument to ply_renderer_open () to allow overriding
this behavior. User can force using simpledrm by passing
plymouth.use-simpledrm=2 on the kernel commandline or by setting
UseSimpledrm=2 in the config-file.

This flag is passed to the renderer plugin's query_device () method
as that is the best place for the renderer plugin to determine
a device's usability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:46:58 +01:00
Hans de Goede
e7fc6cb5c4 Make simpledrm selection configurable from config file
Move the handling of the "plymouth.use-simpledrm" commandline argument from
ply-device-manager to main.c, and allow specifying its default value in
the "[Daemon]" section of the config-file using a new UseSimpledrm keyword.

Extend the "plymouth.use-simpledrm" handling to also accept a value e.g.
"plymouth.use-simpledrm=0" to allow overriding a "UseSimpledrm=1" in
the configfile.

And pass the use-simpledrm value to ply_device_manager_new () through a new
PLY_DEVICE_MANAGER_FLAGS_USE_SIMPLEDRM flag.

This also moves the kernel commandline handling to src/main.c grouping
it together with most of the other commandline handling.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:45:27 +01:00
Hans de Goede
6620904dff main: Do not override device_scale from lower-priorities config files
main () calls functions to get the theme and other config settings from
the commandline / config files in order of *descending* priority:

1. find_override_splash ()             /* Parses commandline */
2. find_system_default_splash ()       /* /etc/plymouth/plymouthd.conf */
3. find_distribution_default_splash () /* /usr/share/plymouth/plymouthd.defaults */

To avoid the later parsed config files *with lower priorities* overriding
earlier settings the code initializes the config variables to NAN and only
sets them if they are still set to NAN.

Except for the device_scale handling, where load_settings () always calls
ply_set_device_scale () overriding earlier values, the commandline
handling for "plymouth.force-scale=..." is done separately later so that
the commandline does take priority over the config files, but since
/usr/share/plymouth/plymouthd.defaults is parsed last any DeviceScale
setting there will override /etc/plymouth/plymouthd.conf settings.

Fix this by following the pattern used by start_time/splash_delay/
device_timeout, add a device_scale variable initialized to -1 and
only override that variable if it is at -1.

This also allows removing find_force_scale () moving the commandline
parsing to find_override_splash () together with the other commandline
handling.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:45:27 +01:00
Hans de Goede
443e580162 ply-utils: Add ply_kernel_command_line_get_ulong () helper
Add a ply_kernel_command_line_get_ulong () helper mirroring
ply_key_file_get_ulong ().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-10 11:45:18 +01:00
Hans de Goede
bf80db4ec3 ply-keyfile: Change ply_key_file_get_long () into ply_key_file_get_ulong ()
Change ply_key_file_get_long () into ply_key_file_get_ulong () and add
error checking.

All callers of ply_key_file_get_long () expect a positive / unsigned number.
Rename it to ply_key_file_get_ulong ().

Also add error checkig for non valid numbers and return the default value
for these instead of 0.

Note this also fixes the return value of ply_key_file_get_long () being
a double (this is now changed to an unsigned long).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-03-04 12:35:05 +01:00
Ray Strode
d42a2830bd Merge branch 'keymap-icon-fixes' into 'main'
ply-keymap-icon: Make Dvorak check case-insensitive

See merge request plymouth/plymouth!341
2025-02-10 19:52:38 +00:00
Hans de Goede
a251957882 Run keymap-render.py to update the pre-rendered keymap
Run keymap-render.py to update the pre-rendered keymap used by
ply-keymap-icon.c.

This adds 2 new console keymaps: "mod" and "nz" and 1 new xkb keymap:
"English (New Zealand)".

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-02-10 14:49:07 +01:00
Hans de Goede
f443234585 ply-keymap-icon: Make Dvorak check case-insensitive
When using evdev support the XKB keymap name (with variant) for Dvorak
users will be e.g. "US (Dvorak)". The Dvorak layouts are not described
in /usr/share/X11/xkb/rules/evdev.xml, so these are not added to
ply-keymap-metadata.h / keymap-render.png .

For the console-keymap case dvorak is handled specially in:

keymap-render.py:normalize_keymaps()
ply-keymap-icon.c:ply_keymap_normalize_keymap()

mapping all keymap-names with a lowercase dvorak in there to "dvorak",
change this special handling to be case-insensitive so that it also works
for the xkb-keymap case.

Note the keymap-render.py change really is a no-op since keymap-render.py
only calls normalize_keymaps() on console-keymaps which are always
lower-case. normalize_keymaps() should still be updated though to keep
the 2 functions in sync.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2341810
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2025-02-10 14:23:58 +01:00
Ray Strode
a0e8b6cf50 Merge branch 'freetype-monospace-bold' into 'main'
label-freetype: implement bold font handling

See merge request plymouth/plymouth!338
2024-12-15 18:40:14 +00:00
Ferdinand Bachmann
42430bcdf8 label-freetype: implement bold font handling
Bold monospace fonts are prominently used in the console output printed
by systemd. Without them, the output looks incorrect compared to pango.
This still is far from a complete implementation of rich text, but
brings label-freetype much closer to what label-pango does for the
default theme.

This commit introduces a glyph_face variable in load_glyphs() that holds
the correct face for the current glyph (label->face or
label->bold_face). This face is then passed on to load_glyph() and
finish_measuring_line() to ensure correct font measurements.
2024-10-30 10:50:22 +01:00
Ray Strode
8bc9364cac Merge branch 'fix-freetype-monospace-fallback' into 'main'
label-freetype: fix monospace font fallback

See merge request plymouth/plymouth!337
2024-10-27 15:30:07 +00:00
Ferdinand Bachmann
90ae4ab42e label-freetype: fix monospace font fallback
fix find_default_monospace_font_path() accidently returning the
non-monospace fallback font in some cases.
2024-10-27 13:05:36 +01:00
Ray Strode
ea83580a6d Merge branch 'fixterminal' into 'main'
main: Go back to text mode when quitting (if appropriate)

See merge request plymouth/plymouth!334
2024-08-28 04:10:37 +00:00
nerdopolis
1e206268df main: Correctly switch back to text mode if the splash is requested, but never shown
Co-authored-by: filip-hejsek
Suggested-by: filip-hejsek
2024-08-20 18:53:33 -04:00
Ray Strode
d2ab367e12 main: Go back to text mode when quitting (if appropriate)
Since commit 48881ba2ef plymouth
goes into GRAPHICS mode early on. Unfortunately, there are cases
where it neglects to go back to TEXT mode when quitting. That can
happen if boot finishes before the splash screen is created.

This commit fixes that.
2024-08-20 18:18:18 -04:00
Ray Strode
c08a22599f Merge branch 'wip/jimmac/libadwaita-spinner' into 'main'
spinner: update design

See merge request plymouth/plymouth!324
2024-08-12 11:02:44 +00:00
Jakub Steiner
1a01883fa2 spinner: update design 2024-08-12 11:02:44 +00:00
Ray Strode
59c0e30e8f Merge branch 'correctalphavalue' into 'main'
two-step: Don't try to set use_black_background based on the ConsoleLogTextColor

See merge request plymouth/plymouth!332
2024-08-09 12:51:42 +00:00
nerdopolis
380e601889 two-step: Don't try to set use_black_background based on the ConsoleLogTextColor
The correct value is 0x000000ff, for full opacity
2024-08-09 07:59:03 -04:00
Ray Strode
d7937e77da Merge branch 'consoleviewerbackground' into 'main'
Replace ConsoleViewerPreserveBackground with ConsoleLogBackgroundColor

See merge request plymouth/plymouth!330
2024-08-08 23:38:50 +00:00
nerdopolis
872ecf75a2 script: Replace ConsoleViewerPreserveBackground with ConsoleLogBackgroundColor 2024-08-07 16:43:42 -04:00
nerdopolis
5ef8b3170d space-flares: Replace ConsoleViewerPreserveBackground with ConsoleLogBackgroundColor 2024-08-07 16:43:42 -04:00
nerdopolis
1297059357 fade-throbber: Replace ConsoleViewerPreserveBackground with ConsoleLogBackgroundColor 2024-08-07 16:43:38 -04:00
nerdopolis
f5f7b7c60f two-step: Replace ConsoleViewerPreserveBackground with ConsoleLogBackgroundColor 2024-08-07 16:21:24 -04:00
Ray Strode
956df66dc6 Merge branch 'twostepconsoleviewerbackground' into 'main'
Support ConsoleViewerPreserveBackground option to keep the background when the console viewer is active

See merge request plymouth/plymouth!328
2024-08-07 11:50:44 +00:00
nerdopolis
1be72c0eab label-pango: Don't draw a black box around rich text when the background is default 2024-08-07 00:12:13 -04:00
nerdopolis
4d9e442a6c Add ConsoleViewerPreserveBackground hint to themes to make the option visible for theme creators 2024-08-06 08:30:23 -04:00
nerdopolis
759f883301 script: Support ConsoleViewerPreserveBackground option to keep the background when the console viewer is active 2024-08-06 11:33:26 +00:00
nerdopolis
22fd5bfde4 space-flares: Support ConsoleViewerPreserveBackground option to keep the background when the console viewer is active 2024-08-06 11:33:26 +00:00
nerdopolis
e1bc057723 fade-throbber: Support ConsoleViewerPreserveBackground option to keep the background when the console viewer is active 2024-08-06 11:33:26 +00:00
nerdopolis
ab96ffa373 two-step: Support ConsoleViewerPreserveBackground option to keep the background when the console viewer is active 2024-08-06 11:33:26 +00:00
Ray Strode
32bf3a81f2 Merge branch 'devttynullsplash' into 'main'
main: Assume graphical splash when the active kernel console is /dev/ttynull.

See merge request plymouth/plymouth!327
2024-08-06 09:37:55 +00:00
nerdopolis
f2d0f87b99 main: Assume graphical splash when the active kernel console is /dev/ttynull. 2024-08-05 22:21:06 -04:00
nerdopolis
7847f49ec8 ply-utils: Add ply_get_primary_kernel_console_type () 2024-08-05 21:09:42 -04:00
nerdopolis
2dc6aa9e44 ply-device-manager: Don't log an error when /sys/class/tty/console/active is empty
This is possible on some kernels that were built with CONFIG_NULL_TTY enabled, and were booted with console=ttynull
/sys/class/tty/console/active is empty in this case, so the file being empty is not always an error worth logging
2024-08-02 07:56:28 -04:00
Ray Strode
6976081d6a Merge branch 'fixscriptdraw' into 'main'
script: Partially revert 8fb0e1f334 and move...

See merge request plymouth/plymouth!326
2024-07-31 10:05:35 +00:00
nerdopolis
f0195a129a script: Add script_lib_update_displays () and call it on state changes 2024-07-30 06:55:28 -04:00
nerdopolis
5489ddd65c script: Partially revert 8fb0e1f334 and move needs_redraw handling back to script_lib_sprite_refresh 2024-07-29 22:25:10 -04:00
Marge Bot
3738dfd8b5 Merge branch 'weblate-plymouth-master' into 'main'
Translations update from Fedora Weblate

See merge request plymouth/plymouth!315
2024-07-27 17:34:31 +00:00
Giannis Antypas
fc35eb3762 Translated using Weblate (Greek)
Currently translated at 100.0% (7 of 7 strings)

Added translation using Weblate (Greek)

Co-authored-by: Giannis Antypas <gianni.antypas@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/el/
Translation: plymouth/main
Part-of: <https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/315>
2024-07-27 17:33:31 +00:00
Scrambled 777
b161cd1c7b Translated using Weblate (Hindi)
Currently translated at 100.0% (7 of 7 strings)

Co-authored-by: Scrambled 777 <weblate.scrambled777@simplelogin.com>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/hi/
Translation: plymouth/main
Part-of: <https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/315>
2024-07-27 17:33:31 +00:00
Martin Srebotnjak
fb0e280747 Translated using Weblate (Slovenian)
Currently translated at 100.0% (7 of 7 strings)

Translated using Weblate (Slovenian)

Currently translated at 85.7% (6 of 7 strings)

Added translation using Weblate (Slovenian)

Co-authored-by: Martin Srebotnjak <miles@filmsi.net>
Translate-URL: https://translate.fedoraproject.org/projects/plymouth/master/sl/
Translation: plymouth/main
Part-of: <https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/315>
2024-07-27 17:33:31 +00:00