How to create a theme:zh TW

From GeeXboX wiki

Jump to: navigation, search

作者 : LoR@KoRn (Laurent Peltier)




這份教學是給 GNU-Linux 使用者,它描述如何一步一步建立完整的 GeeXboX 外觀

Contents

軟體需求

Splash-isolinux

使用 The Gimp 產生你自己的圖檔,解析度為 640x320,並將之存成 splash-isolinux.png:

- 選擇選單: image > mode > indexed > maximum number of colors > 設成 16 > ok - 選擇選單: file > save as > file type > PNG image > save (splash-isolinux.png)

在命令視窗中:

 #convert splash-isolinux.png splash-isolinux.ppm
 #ppmtolss16 <splash-isolinux.ppm >splash-isolinux.rle 

Grub-splash

使用 The Gimp, 產生你自己的圖檔,解析度為 640x480, 並存成 grub-splash.xpm:

- 選擇選單: image > mode > indexed > maximum number of colors > set to 14 > ok - 選擇選單: file > save as > file type > Pixmap X image > save (grub-splash.xpm)

在命令視窗中:

 #gzip grub-splash.xpm 

Bootsplash

Using The Gimp, create your picture at 800x600 resolution and save it as bootsplash-800x600.jpeg.

- Click menu: file > save as > file type > JPEG image > save (bootsplash-800x600.jpeg)


Create a file named bootsplash-800x600.cfg with the following lines :

 # This is the configuration file for the 800x600 bootsplash picture.
 # This file is necessary to specify the coordinates of the text box on
 # the splash screen.
 # config file version
 version=3
 # should the picture be displayed?
 state=1
 # fgcolor is the text forground color.
 # bgcolor is the text background (i.e. transparent) color.
 fgcolor=7
 bgcolor=5
 # (tx, ty) are the (x, y) coordinates of the text window in pixels.
 # tw/th is the width/height of the text window in pixels.
 tx=20
 ty=20
 tw=760
 th=560
 # name of the picture file (full path recommended)
 jpeg=bootsplash-800x600.jpeg
 progress_enable=1
 percent=6000
 # progress bar
 box silent inter 224 393 224 404 #fd8100
 box silent       224 393 601 404 #fd8100
 box        inter 224 393 224 404 #fd8100
 box              224 393 601 404 #fd8100
 box noover        15  17 785 583 #333333E0
 overpaintok=1

Where 393 corresponds to the top of the progress bar, 404 to the bottom, 224 to the left, 601 to the right and #fd8100 to the color. Modify these values according to your realization.

In a console :

 #cd /where_the_files_are/
 #splash -s -f bootsplash-800x600.cfg > bootsplash.dat 

Patch for bootsplash-3.1 (useful for the progressbar on GeeXboX) :

--- bootsplash-3.1.orig/Utilities/splash.c   2004-09-20 20:54:42.832461640 +0200
+++ bootsplash-3.1/Utilities/splash.c   2004-09-20 23:49:27.094611528 +0200
@@ -517,13 +517,13 @@
             exit(1);
          }
          fclose(sfp);
-         if (sboxcount)
-            memmove(pic + 47 + l + boxcount * 12,
-               sboxes, sboxcount * 12);
-         silentl += sboxcount * 12;
-         l += silentl;
       }
       fclose(fp);
+      if (sboxcount)
+         memmove(pic + 47 + l + boxcount * 12,
+            sboxes, sboxcount * 12);
+      silentl += sboxcount * 12;
+      l += silentl;
    } else {
       l = 0;
       pic = calloc(47, 1);

背景

使用 The Gimp, 產生你自己的圖檔,解析度為 640x480,存成 150.jpg:

- 選擇選單: file > save as > file type > JPEG image > save (150.jpg)

在命令視窗中 :

#cd /where_the_file_is/
#for ((i=0;i<149;i++)); do ln -s 150.jpg $i.jpg; done
#mencoder -ffourcc divx mf://*.jpg -mf w=640:h=480:fps=25:type=jpg -ovc lavc
-lavcopts vcodec=mpeg4:vbitrate=4 -oac copy -o background.avi

要編輯自己的圖或許有困難,這邊另外指明一個從電影檔截圖的語法,可用的電影檔只要 mplayer 相容即可:

 mplayer -nosound -frames 1 -vo jpeg -msglevel all=-1 MyMovie.avi

選單字型

挑選一個 Truetype 字型,名為 font.ttf,並產生一個檔叫 config, 其內容如下:

 FONT_SIZE=3 

你也可以使用 OMC theme 裡的字型

最後

建立一個名為 theme-你的 theme 的目錄,例如 theme-wade,並放下面你產生的六個檔進去:

 splash-isolinux.rle
 grub-splash.xpm.gz
 bootsplash-800x600.dat
 background.avi
 font.ttf
 config

最後, 複製此目錄到FLTK generator的 themes 目錄下。

手動修改 USB 隨身碟

若你是安裝到隨身碟(硬碟也類似),上面六個檔分別放在隨身碟不同地方,

檔案隨身碟相對檔案
splash-isolinux.rle /splash.rle
grub-splash.xpm.gz /boot/grub/grub-splash.xpm.gz, 另外在 /usr/share 也有,那個是給開機時 install 用的,可以刪除
bootsplash-800x600.dat 這比較麻煩,基本上是附加在 initrd.gz 後面,見後面詳述
background.avi /GEEXBOX/usr/share/mplayer/background.avi
font.ttf /GEEXBOX/usr/share/fonts/themefont.ttf 若已有可以不必更新
config /media/sdb1/GEEXBOX/etc/theme.conf, 內容只有一行,可以自行編譯
  • bootsplash-800x600.dat 後面的解析度請見 /GEEXBOX/etc/tvout,或參考 FLTK Generator:zh_TW,或自行修改 generator.sh 裡的 RESOLUTION=
  • bootsplash-800x600.dat 是附加在 initrd.gz 後面,檔案在 /boot/initrd.gz,但是這個檔已附加了一個,因此得將之拿掉,方法如下:
    1. zcat initrd.gz | gzip -c > initrd.gz.org 可將 bootsplash-800x600.dat 截掉
    2. cat initrd.gz.org bootsplash-800x600.dat > initrd.gz 這樣就會覆蓋掉舊的 initrd.gz
    3. rm -f initrd.gz.org
Personal tools