Annotation of /mcore-src/trunk/mcore-tools/daemon/client/include/plymouth.client.class
Parent Directory | Revision Log
Revision 2079 -
(hide annotations)
(download)
Fri May 10 11:37:38 2013 UTC (11 years ago) by niro
File size: 1403 byte(s)
Fri May 10 11:37:38 2013 UTC (11 years ago) by niro
File size: 1403 byte(s)
-split systemd, sysvinit, fbsplash and plymouth functions in single classes so no runtime checks are required and the correct version get installed right away
1 | niro | 2079 | # $Id$ |
2 | |||
3 | provide basic-splash plymouthd | ||
4 | require basic-boot | ||
5 | |||
6 | get_boot_splash() | ||
7 | { | ||
8 | if grep "^export GRUB_CMDLINE_BOOTSPLASH=.*splash" ${MROOT}/etc/conf.d/grub | ||
9 | then | ||
10 | mecho "bootsplash currently enabled" | ||
11 | rvecho "1" | ||
12 | else | ||
13 | mecho "bootsplash currently disabled" | ||
14 | rvecho "0" | ||
15 | fi | ||
16 | } | ||
17 | |||
18 | set_boot_splash() | ||
19 | { | ||
20 | local action="$1" | ||
21 | [[ -z ${action} ]] && help_boot_splash && return 1 | ||
22 | |||
23 | case "${action}" in | ||
24 | enable) | ||
25 | sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash\":" ${MROOT}/etc/conf.d/grub | ||
26 | helper_boot_rebuild_bootconfig | ||
27 | mecho "bootsplash enabled" | ||
28 | ;; | ||
29 | disable) | ||
30 | sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"rd.plymouth=0\":" ${MROOT}/etc/conf.d/grub | ||
31 | helper_boot_rebuild_bootconfig | ||
32 | mecho "bootsplash disabled" | ||
33 | ;; | ||
34 | *) help_system_autologon && return 1 ;; | ||
35 | esac | ||
36 | } | ||
37 | |||
38 | get_boot_theme() | ||
39 | { | ||
40 | local action="$1" | ||
41 | local i | ||
42 | |||
43 | case "${action}" in | ||
44 | current) rvecho "$(plymouth-set-default-theme)" ;; | ||
45 | system) | ||
46 | for i in $(plymouth-set-default-theme --list) | ||
47 | do | ||
48 | rvecho "${i}" | ||
49 | done | ||
50 | ;; | ||
51 | *) | ||
52 | help_boot_theme | ||
53 | return 1 | ||
54 | ;; | ||
55 | esac | ||
56 | } | ||
57 | |||
58 | set_boot_theme() | ||
59 | { | ||
60 | local theme="$1" | ||
61 | local themedir="${MROOT}/usr/share/plymouth/themes" | ||
62 | [[ -z ${theme} ]] && help_boot_theme && return 1 | ||
63 | |||
64 | if [[ -d ${themedir}/${theme} ]] | ||
65 | then | ||
66 | plymouth-set-default-theme ${theme} | ||
67 | mecho "Selected theme '${theme}'." | ||
68 | else | ||
69 | eecho "Theme '${theme}' not available on this system. Aborted!" | ||
70 | fi | ||
71 | } |