Messages in cipher reflected in the looking glass

http://blogs.sun.com/thaniwa/date/20060123 2006年 1月 23日 月曜日

(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.

  1. Preparation
  2. Make background images
  3. Make theme file
  4. Regist theme


1. Preparation

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/.

2. Make background images

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.



3. Make a theme file

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.

4. Regist theme

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"

投稿されたコメント:

コメント
コメントは無効になっています。