YaST/Tips

From openSUSE


Contents

Branding the installation

For testing your style, use Wizard2.ycp file.

The style consist of a cascade style sheet (css) file ( with .qss extension ), and artwork & images you use in the stylesheet.

By default, YaST uses style.qss located in /usr/share/YaST2/theme/current/wizard . However for the installation the file installation.qss is used.

You can modify on runtime which style YaST uses.

Y2STYLE=installation.qss /usr/lib/YaST2/bin/y2base ./Wizard2.ycp qt

Note: branding only works with the Qt user interface backend. Currently the Gtk toolkit does not provide such capabilities. However, on the installation, Qt is always used.


Look at the installation.qss file, and you will figure out which sections of the installation screen are defined as classes and ids in the stylesheet.

To give each widget a theme, look at this tutorial or refer to the documentation.


YaST Hotkeys

The following hotkeys are enabled in the Qt/X11 GUI

Ctrl-Shift-X 
open a terminal window (xterm), useful for VNC installs
Shift-F7 
Debug level
Ctrl-Shift-D 
Debug module write
Print key 
Screenshot
Shift-F8 
Save logs to
Shift-M 
Start/Stop macro recorder
Shift-F4 
Accesibility, Switch to vision impaired palette.

Invoking terminal from YaST

Sometimes it is useful, or even necessary, to get a text console in the middle of the installation.

There are three ways to do this

non-remote text mode 
consoles can be normally switched with Ctrl+F1, Ctrl+F2, etc.
non-remote graphical mode 
use Ctrl+Alt+F1, Ctrl+Alt+F2 etc., and Ctrl+Alt+F7 to return to the graphical installer.
remote graphical installation 
where hardware console switching is not available, use Ctrl+Alt+Shift+X to open a text-mode terminal within the graphical installer

There is a root shell open on the consoles (except those that show system messages), and basic shell commands are available.

Color theme for textmode YaST

Set your favorite color theme

The default setting of the YaST ncurses UI is that the init routine detects the terminal type and automatically chooses the appropriate color theme.

Since openSUSE 10.3 it's possible to set the color theme manually in /etc/sysconfig/yast2. E.g. if you want a black/white YaST set Y2NCURSES_COLOR_THEME to "mono".

## Type: string(linux,xterm,rxvt,mono,braille)
## Default: ""
# Color theme for YaST ncurses UI
# xterm: blue-white-red
# linux: blue-white-yellow
# rxvt: black-yellow-red
# mono: white-black
# braille: for visually impaired
Y2NCURSES_COLOR_THEME = "mono"

Additionally the braille style can be enabled by setting the environment variable Y2_BRAILLE.

Create a customized color theme

If you want to change an existing color theme there is the possibility to get a style edit popup. With it you are able to configure the color settings for a certain terminal type. After creating the new style (a new header file NCstyle.<style>.h), yast2-ncurses has to be recompiled. How to get and compile the YaST sources see YaST/Development/Build.

First set the environment:

 export Y2NCDBG=1

Then set the color theme in /etc/sysconfig/yast2 accordingly to what you want to change (or use the appropriate terminal) and start YaST ncurses UI or a YaST module.

 yast			or
 yast <module>

Press keys:

 Ctrl d S    

The style edit popup will appear. Use keys below to configure your own textmode style:

 F1/F2    toggle styles    (default, info, warning, popup style)
 F3/F4    select widget
 F5         move pad mode    (move with cursor keys)
 F6         example dialog
 F7
 F8         restore style from /tmp/...
 F9         save style to /tmp/...
 F10       quit
 KEY_HOME/KEY_END         set foreground
 KEY_PPAGE/KEY_NPAGE   set background
 a ASCII chars
 b toggle bold
 n normal
 l blink
 s standout
 u underline
 r reverse
 d dim
 i invis
Save the style settings with F9

The header file is written to /tmp (e.g. NCstyle.xterm.h). Quit the edit dialog with F10.

Copy this file to your source directory and recompile yast2-ncurses with the new header file.

Articles

Links