2006年 1月 23日 月曜日
|
|
Messages in cipher reflected in the looking glass [ Yasuhiro Fujitsuki's Weblog ] |
(EN) Customizing of the screen of dtlogin of Solaris 10 and later
Dtlogin theme has changed on Solaris 10 and later, but I cannot found the way to customize on docs.sun.com.
So, I wrote about it on my blog.
Overview of customizing of dtlogin is as follows.
- Preparation
- Make background images
- Make theme file
- Regist theme
Default configuration files of dtlogin are in under /usr/dt/config. But, when configuration files are in /etc/dt/config, dtlogin use these files instead of files in /usr/dt/config.
Therefore, at first, make /etc/dt/config directory, and copy all configuration files in /usr/dt/config to /etc/dt/config like a following.
# mkdir /etc/dt/config # cp -r /usr/dt/config/* /etc/dt/config/.
The next step is to make image files used for the background.
Dtlogin requires background image of each screen resolution.
Default resolution are 800x600(SVGA), 1028x768(XGA), 1280x1024(SXGA), and 1400x1050(SXGA+). Dtlogin also can use 1600x1200(UXGA) and 1280x800 and so on, but if you want to use these resolution, you have to enhance theme file.
Dtlogin requires xpm files as background image, you can make xpm files with gimp and so on.
After making image files, it is necessary to compress the image files by gzip as follows.
# mkdir /etc/dt/config # gzip styleExpress-1028x768.pm
It is preferable to make image files as follows.
- It is good that gzipped image file size is 400KB or less. (Under 300KB is better.)
- make one color part in the picture.
The following picture is a example (1024x768). Original image is gdmtheme by chandan. Thanks.
Default theme file of dtlogin of Solaris 10 and later is /etc/dt/config/C/styleModern . If this file is re-writed directly, dtlogin of all language environment are changed.
The login screen can be changed responding to the linguistic environment by preparing another file. In this case, [4. Regist theme] is required.
In this content, make new theme file, /etc/dt/config/ja_JP.UTF-8/styleExpress, as copy of styleModern. And re-write it to fit new background image.
To change in the following elements is needed.
- Define a background image files
- Text color and backgound color
- Coordinates of items
- Messages
- Input field of user name and password
- [OK],[Reset],[Option],[Help] buttons.
It is necessary to set up information in each resolution.
The following configuration file is changed 1024x768 settings as sample theme file.
Settings in the first part, Dtlogin*foreground and so on, are default settings of colors. These settings are used by all resolutions. In this configuration, another color settings are made in the 1024x768 part, because settings for 1024x768 only has changed in this configuration.
Dtlogin*foreground: white Dtlogin*background: #416d89 Dtlogin*XmTextField*background: #8e8e8e Dtlogin*highlightColor: #9dca12 Dtlogin*table.background: black Dtlogin*button_matte*background: #2a4456 #if (WIDTH >= 1400) && (HEIGHT >= 1050) ... #elif (WIDTH >= 1024) && (HEIGHT >= 768) Dtlogin*foreground: white Dtlogin*background: black Dtlogin*XmTextField*background: #8e8e8e Dtlogin*highlightColor: #9dca12 Dtlogin*table.background: black Dtlogin*button_matte*background: black Dtlogin*matte1.backgroundPixmap: styleExpress-1028x768.pm-1024.pm.gz Dtlogin*matte.width: 1024 Dtlogin*matte.height: 768 Dtlogin*matteFrame.width: 1024 Dtlogin*matteFrame.height: 768 !! "Welcome to _____" message Dtlogin*greeting.leftOffset: 540 Dtlogin*greeting.rightOffset: 80 Dtlogin*greeting.height: 48 Dtlogin*greeting.topOffset: 30 !! Session type message !! offset from bottom of welcome message Dtlogin*dt_label.topOffset: 410 Dtlogin*dt_label.height: 32 Dtlogin*dt_label.leftOffset: 540 Dtlogin*dt_label.rightOffset: 40 !! Login area !! offset from bottom of welcome message Dtlogin*login_form.topOffset: 450 Dtlogin*login_form.leftOffset: 540 Dtlogin*login_form.rightOffset: 40 Dtlogin*login_text.bottomPosition: 90 Dtlogin*login_text.leftPosition: 8 Dtlogin*passwd_text.bottomPosition: 90 Dtlogin*passwd_text.leftPosition: 8 !! Buttons below login area Dtlogin*ok_button.bottomPosition: 99 Dtlogin*clear_button.bottomPosition: 99 Dtlogin*options_button.bottomPosition: 99 Dtlogin*help_button.bottomPosition: 99 Dtlogin*button_matte.leftOffset: 510 Dtlogin*button_matte.rightOffset: 10 #else ...
Offset settings are as following picture.
If you make an another theme file, you have to change [Xresources] file of the locale that you want to regist theme.
The way to change is as follows.
!!###################################################################### !! !! LOGIN SCREEN STYLE !! !! Allows customization of login screen look for different displays/types !! If no style is given, the "classic" CDE login screen look is used !! File is simply a Xresources format file found in the search path of !! /etc/dt/config/%L:/etc/dt/config/C:/usr/dt/config/%L:/usr/dt/config/C !! !! #include "styleModern" #include "styleExpress"
Posted at 09:03午後 1 23, 2006 by Yasuhiro Fujitsuki in Linux & Solaris(EN) |
(JA) Customizing of the screen of the dtlogin of Solaris 10 and later
Solaris 10 以降の dtlogin ではテーマの設定方法が従来から変わりましたが、
docs.sun.comには現在書かれてないです。(私が見つけられないだけかも)
ということで、Solaris 10 のログイン画面の変更方法の解説したいと思います。
ちょっとばかり長くなります。
方法を大まかに言うと、
- 下準備 (カスタマイズ用の環境の用意)
- 背景画像の作成
- テーマファイルの作成
- テーマの登録
という手順になります。
dtlogin のデフォルト設定は /usr/dt/config ディレクトリ以下になりますが、 /etc/dt/configが存在する場合、こちらの設定が優先されます。
まず、このディレクトリを用意し、/usr/dt/config以下のファイルを/etc/dt/configにコピーします。
# mkdir /etc/dt/config # cp -r /usr/dt/config/* /etc/dt/config/.
次に背景画像を用意します。 背景画像は画面解像度毎に用意する必要があります。 基本は 800x600, 1028x768, 1280x1024, 1400x1050 です。 1600x1200や1280x800など特殊な画像にも対応することが出来ます。 ただ、その場合はテーマファイルを独自に拡張する必要があります。
作成する画像は、xpm形式になります。作成は gimp などが利用できます。 作成後、gzipで圧縮します。
# mkdir /etc/dt/config # gzip styleExpress-1028x768.pm
背景はxpm形式であれば何でも良いのですが、以下のような感じで作成するのが望ましいです。
- gzip圧縮を行った後のファイルサイズが 400KB 以下。 (出来れば 300KB 以下)
- 画像の1部分に単色の部分を作成する。 (サンプル画像では上下の黒の部分)
サンプルとして、次のような 1024x768 の画像を作成してみました。
Solaris 10/Express の dtlogin の標準テーマは、 /etc/dt/config/C/styleModern で定義されています。このファイルを直接変更することで、全言語環境のログイン画面を一括で変更することができます。 また、別のファイルを用意することで、言語環境に応じてログイン画面を変えるというようなことも行えます。(この場合、「4.テーマの登録」の作業が必要になります。)
ここでは、とりあえず styleModern を /etc/dt/config/ja_JP.UTF-8/styleExpress にコピーして、変更したとします。
- 背景画像
- 文字やボタンなどの色など
- アイテムの座標
- メッセージ
- ユーザー名・パスワード入力フィールド
- 「了解」「やり直し」「オプション」「ヘルプ」ボタン
設定情報は各解像度ごとに行う必要があります。
以下は変更例で今回作成してみたものです。 最初の Dtlogin*foreground 等は先頭に共通項目として定義してあるのですが、今回は1024x768しか変更していないので、1024x768の項目で設定を上書きしています。
Dtlogin*foreground: white Dtlogin*background: #416d89 Dtlogin*XmTextField*background: #8e8e8e Dtlogin*highlightColor: #9dca12 Dtlogin*table.background: black Dtlogin*button_matte*background: #2a4456 #if (WIDTH >= 1400) && (HEIGHT >= 1050) ...(省略)... #elif (WIDTH >= 1024) && (HEIGHT >= 768) Dtlogin*foreground: white Dtlogin*background: black Dtlogin*XmTextField*background: #8e8e8e Dtlogin*highlightColor: #9dca12 Dtlogin*table.background: black Dtlogin*button_matte*background: black Dtlogin*matte1.backgroundPixmap: styleExpress-1028x768.pm-1024.pm.gz Dtlogin*matte.width: 1024 Dtlogin*matte.height: 768 Dtlogin*matteFrame.width: 1024 Dtlogin*matteFrame.height: 768 !! "Welcome to _____" message Dtlogin*greeting.leftOffset: 540 Dtlogin*greeting.rightOffset: 80 Dtlogin*greeting.height: 48 Dtlogin*greeting.topOffset: 30 !! Session type message !! offset from bottom of welcome message Dtlogin*dt_label.topOffset: 410 Dtlogin*dt_label.height: 32 Dtlogin*dt_label.leftOffset: 540 Dtlogin*dt_label.rightOffset: 40 !! Login area !! offset from bottom of welcome message Dtlogin*login_form.topOffset: 450 Dtlogin*login_form.leftOffset: 540 Dtlogin*login_form.rightOffset: 40 Dtlogin*login_text.bottomPosition: 90 Dtlogin*login_text.leftPosition: 8 Dtlogin*passwd_text.bottomPosition: 90 Dtlogin*passwd_text.leftPosition: 8 !! Buttons below login area Dtlogin*ok_button.bottomPosition: 99 Dtlogin*clear_button.bottomPosition: 99 Dtlogin*options_button.bottomPosition: 99 Dtlogin*help_button.bottomPosition: 99 Dtlogin*button_matte.leftOffset: 510 Dtlogin*button_matte.rightOffset: 10 #else ...(省略) ...
基本的に編集は試行錯誤という感じでしょうか。 とりあえず、Offset変数は下記のような感じです。 後は、幅とかなので名前から想像したり、試しながらで…。
#中途半端で申し訳ない。
テーマファイルを別途作成した場合は、テーマを登録する必要があります。
利用するテーマファイルは、各ロケールのディレクトリの [Xresources] ファイルで宣言されています。
このファイルの include 行を変更します。
!!###################################################################### !! !! LOGIN SCREEN STYLE !! !! Allows customization of login screen look for different displays/types !! If no style is given, the "classic" CDE login screen look is used !! File is simply a Xresources format file found in the search path of !! /etc/dt/config/%L:/etc/dt/config/C:/usr/dt/config/%L:/usr/dt/config/C !! !! #include "styleModern" #include "styleExpress"
Posted at 01:20午後 1 23, 2006 by Yasuhiro Fujitsuki in Linux & Solaris |