3 # This script creates a KSplashX theme from KSplashML's theme using the Default engine.
4 # Just run in the theme's directory with theme name as argument and it'll create a new subdirectory "theme".
5 # Note that the positions in the icon bar may be a bit off, as KSplashML itself has them off;
6 # if it doesn't work for you, fiddle with the positions below (two places, also the description.txt file)
7 # You should also afterwards check Theme.rc (only Engine= and descriptive fields like Name= should matter)
9 # the -depth 8 is there to produce smaller png's (it doesn't seem to affect anything else *shrug*)
11 if test $# -ne 1; then
12 echo Theme name missing.
18 grep "Engine = Default" Theme.rc
>/dev
/null
2>&1 ||
( echo "No Theme.rc or Engine is not Default"; exit 1 )
21 rm -r "$theme" 2>/dev
/null
23 mkdir
"$theme"/1600x1200
25 # create background image from top, bar and bottom
26 montage splash_top.png splash_inactive_bar.png splash_bottom.png
-geometry +0+0 -tile 1x3
-depth 8 "$theme"/1600x1200
/background.png
28 # cut the icons from the icon bar
29 # numbers are x position, width and icon number
30 for i
in 0-58-1 58-58-2 116-58-3 174-58-4 232-58-5 290-50-6 340-60-7; do
31 x
=`echo $i | sed 's/\(.*\)-.*-.*/\1/'`
32 w
=`echo $i | sed 's/.*-\(.*\)-.*/\1/'`
33 n
=`echo $i | sed 's/.*-.*-\(.*\)/\1/'`
34 convert splash_inactive_bar.png
-crop ${w}x58
+${x}+0 -depth 8 iconin.png
35 convert splash_active_bar.png
-crop ${w}x58
+${x}+0 -depth 8 iconac.png
36 montage iconac.png iconin.png
-tile 2x1
-geometry +0+0 -depth 8 "$theme"/1600x1200
/icon
${n}_anim.png
37 cp iconac.png
"$theme"/1600x1200
/icon
${n}.png
38 rm iconin.png iconac.png
42 cp Preview.png
"$theme"/Preview.png
46 |
sed 's/Engine = Default/Engine = KSplashX/' \
47 |
sed "s/\[KSplash Theme: .*\]/\[KSplash Theme: $theme\]/" \
52 cat >"$theme"/CMakeLists.txt
<<EOF
53 install( FILES Preview.png Theme.rc DESTINATION \${DATA_INSTALL_DIR}/ksplash/Themes/$theme )
54 install( FILES 1600x1200/description.txt 1600x1200/background.png
55 1600x1200/icon1.png 1600x1200/icon2.png 1600x1200/icon3.png
56 1600x1200/icon4.png 1600x1200/icon5.png 1600x1200/icon6.png 1600x1200/icon7.png
57 1600x1200/icon1_anim.png 1600x1200/icon2_anim.png 1600x1200/icon3_anim.png
58 1600x1200/icon4_anim.png 1600x1200/icon5_anim.png 1600x1200/icon6_anim.png 1600x1200/icon7_anim.png
59 DESTINATION \${DATA_INSTALL_DIR}/ksplash/Themes/${theme}/1600x1200 )
62 # now the description file
64 cat >"$theme"/1600x1200
/description.txt
<<EOF
66 GEOMETRY_REL CC 0 0 CC 400 270
67 IMAGE 0 0 background.png
68 ANIM 1 0 190 2 icon1_anim.png 400
73 ANIM 2 58 190 2 icon2_anim.png 400
77 IMAGE 58 190 icon2.png
78 ANIM 3 116 190 2 icon3_anim.png 400
82 IMAGE 116 190 icon3.png
83 ANIM 4 174 190 2 icon4_anim.png 400
87 IMAGE 174 190 icon4.png
88 ANIM 5 232 190 2 icon5_anim.png 400
92 IMAGE 232 190 icon5.png
93 ANIM 6 290 190 2 icon6_anim.png 400
97 IMAGE 290 190 icon6.png
98 ANIM 7 340 190 2 icon7_anim.png 400
102 IMAGE 340 190 icon7.png