Skip to content

Commit 9fc2664

Browse files
committed
plymouthcfg: Use simpledrm by default to show splash screen
Signed-off-by: Vasiliy Stelmachenok <ventureo@cachyos.org>
1 parent 08de6b3 commit 9fc2664

3 files changed

Lines changed: 29 additions & 10 deletions

File tree

src/modules/plymouthcfg/main.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
# Calamares is Free Software: see the License-Identifier above.
1313
#
1414

15+
import os
16+
import fileinput
1517
import libcalamares
1618

17-
from libcalamares.utils import debug, target_env_call
19+
from libcalamares.utils import debug, warning, target_env_call
1820

1921
import gettext
2022
_ = gettext.translation("calamares-python",
@@ -50,11 +52,28 @@ def setTheme(self):
5052
plymouth_theme = libcalamares.job.configuration["plymouth_theme"]
5153
target_env_call(["plymouth-set-default-theme", plymouth_theme])
5254

55+
def setUseSimpledrm(self):
56+
conf_path = os.path.join(self.__root, "etc", "plymouth", "plymouthd.conf")
57+
58+
try:
59+
with fileinput.input(conf_path, inplace=True) as config:
60+
for line in config:
61+
if line.startswith("#[Daemon]") or line.startswith("[Daemon]"):
62+
line = line.lstrip("#")
63+
line = line + "UseSimpledrm=1\n"
64+
65+
print(line, end='')
66+
except Exception as e:
67+
warning("Failed to set UseSimpledrm=1: {!s}".format(e))
68+
5369
def run(self):
5470
if detect_plymouth():
5571
if (("plymouth_theme" in libcalamares.job.configuration) and
5672
(libcalamares.job.configuration["plymouth_theme"] is not None)):
5773
self.setTheme()
74+
75+
if libcalamares.job.configuration.get("plymouth_simpledrm", False):
76+
self.setUseSimpledrm()
5877
return None
5978

6079

src/modules/plymouthcfg/plymouthcfg.conf

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
#
44
# Plymouth Configuration Module
55
#
6-
# This module can be used to setup the default plymouth theme to
6+
# This module can be used to setup the default plymouth theme to
77
# be used with your distribution
88
#
9-
# You should only use this module if the plymouth package is installed
10-
# on the build configurations of your distribution & the plymouth
9+
# You should only use this module if the plymouth package is installed
10+
# on the build configurations of your distribution & the plymouth
1111
# theme you want to configure is installed as well. If the unpacked
1212
# filesystem configures a plymouth theme already, there is no need
1313
# to change it here.
1414
---
1515

1616

17-
# Leave this commented if you want to use the default theme
18-
# shipped with your distribution configurations. Make sure that
19-
# the theme exists in the themes directory of plymouth path.
17+
# Leave this commented if you want to use the default theme
18+
# shipped with your distribution configurations. Make sure that
19+
# the theme exists in the themes directory of plymouth path.
2020
# Debian / Ubuntu comes with themes "joy", "script", "softwaves",
2121
# possibly others. Look in /usr/share/plymouth/themes for more.
2222
#
@@ -26,6 +26,5 @@
2626

2727
plymouth_theme: cachyos-bootanimation
2828

29-
30-
31-
29+
# Use simpledrm driver to show splash screen
30+
plymouth_simpledrm: true

src/modules/plymouthcfg/plymouthcfg.schema.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ additionalProperties: false
77
type: object
88
properties:
99
plymouth_theme: { type: string }
10+
plymouth_simpledrm: { type: boolean }

0 commit comments

Comments
 (0)