Annotation of /mcore-src/trunk/mcore-tools/src/modules/fbsplash/fbsplash.client.class.in
Parent Directory | Revision Log
Revision 2269 -
(hide annotations)
(download)
Tue Jan 14 10:34:57 2014 UTC (10 years, 4 months ago) by niro
File size: 1748 byte(s)
Tue Jan 14 10:34:57 2014 UTC (10 years, 4 months ago) by niro
File size: 1748 byte(s)
-use global argv arrays GLOBAL_ARGV and CLASS_ARGV to fix whitespace issues with the read cmd. escaping works with this now. every class must use the CLASS_ARGV array for arguments
1 | niro | 2079 | # $Id$ |
2 | |||
3 | provide basic-splash fbsplash | ||
4 | require basic-boot | ||
5 | |||
6 | get_boot_splash() | ||
7 | { | ||
8 | local var | ||
9 | niro | 2162 | var=$(grep "^export GRUB_CMDLINE_BOOTSPLASH=" ${MROOT}@@CONFDDIR@@/grub | sed "s:.*splash=\(.*\),.*:\1:") |
10 | niro | 2079 | |
11 | case "${var}" in | ||
12 | silent|"") mecho "bootsplash currently enabled"; rvecho "1" ;; | ||
13 | verbose) mecho "bootsplash currently disabled"; rvecho "0" ;; | ||
14 | niro | 2243 | *) eecho "unknown state" ;; |
15 | niro | 2079 | esac |
16 | } | ||
17 | |||
18 | set_boot_splash() | ||
19 | { | ||
20 | niro | 2269 | local action="${CLASS_ARGV[0]}" |
21 | niro | 2079 | [[ -z ${action} ]] && help_boot_splash && return 1 |
22 | |||
23 | case "${action}" in | ||
24 | enable) | ||
25 | niro | 2162 | sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash=silent,theme=default\":" ${MROOT}@@CONFDDIR@@/grub |
26 | niro | 2079 | helper_boot_rebuild_bootconfig |
27 | mecho "bootsplash enabled" | ||
28 | ;; | ||
29 | disable) | ||
30 | niro | 2162 | sed -i "s:^\(export GRUB_CMDLINE_BOOTSPLASH=\).*:\1\"splash=verbose,theme=default\":" ${MROOT}@@CONFDDIR@@/grub |
31 | niro | 2079 | 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 | niro | 2269 | local action="${CLASS_ARGV[0]}" |
41 | niro | 2162 | local themedir="${MROOT}@@SYSCONFDIR@@/splash/themes" |
42 | niro | 2079 | local theme |
43 | local i | ||
44 | |||
45 | case "${action}" in | ||
46 | current) | ||
47 | if [[ -L ${themedir}/default ]] | ||
48 | then | ||
49 | theme=$(readlink ${themedir}/default) | ||
50 | rvecho "${theme}" | ||
51 | else | ||
52 | rvecho "none" | ||
53 | fi | ||
54 | ;; | ||
55 | system) | ||
56 | list_files_in_directory -type d -mindepth 1 -maxdepth 1 ${themedir} | ||
57 | ;; | ||
58 | *) | ||
59 | help_boot_theme | ||
60 | return 1 | ||
61 | ;; | ||
62 | esac | ||
63 | } | ||
64 | |||
65 | set_boot_theme() | ||
66 | { | ||
67 | niro | 2269 | local theme="${CLASS_ARGV[0]}" |
68 | niro | 2162 | local themedir="${MROOT}@@SYSCONFDIR@@/splash/themes" |
69 | niro | 2079 | [[ -z ${theme} ]] && help_boot_theme && return 1 |
70 | |||
71 | if [[ -d ${themedir}/${theme} ]] | ||
72 | then | ||
73 | ln -snf ${theme} ${themedir}/default | ||
74 | mecho "Selected theme '${theme}'." | ||
75 | else | ||
76 | eecho "Theme '${theme}' not available on this system. Aborted!" | ||
77 | fi | ||
78 | } |