Magellan Linux

Annotation of /mcore-src/trunk/mcore-tools/src/modules/fbsplash/fbsplash.client.class.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2162 - (hide annotations) (download)
Fri Jan 10 13:56:52 2014 UTC (10 years, 4 months ago) by niro
File size: 1705 byte(s)
-use variable pathes
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     *) eecho "unkown state" ;;
15     esac
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 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     local action="$1"
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     local theme="$1"
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     }