HP COMPAQ T5125, COMPAQ T5525, COMPAQ T5515 User Manual

Customization Techniques on HP Compaq Linux Thin Clients
HP Business PC Group
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
Modifying the right-click menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Linux configuration files that control the right-click menu . . . . . . . . . . . . . . . . . . . . . . . . . . .3
Modifying the right-click menu to remove non-root access to the
Linux console . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
Modifying the global key set for XFCE to remove access to the manual Linux RUN command . . . .7
Manually adding additional keyboard layouts to the HP Linux thin client . . . . . . . . . . . . . . . . . . 8
Manually adding extra libraries for additional application support . . . . . . . . . . . . . . . . . . . . . 10
Appendix A: Partial list of vi commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
1
Introduction
The white paper provides some simple modifications that you can make on select HP Compaq Linux thin clients. Linux is a very powerful and flexible operating system that you can customize in many ways. The more you understand how the Linux operating system works, the better you can tailor the operating sys­tem to meet your needs.
This white paper covers the following specific topics related to customization:
1. Using the HP Linux thin client Altiris manageability scripts.
2. Modifying the right-click menu to remove non-root access to the Linux console.
3. Modifying the right-click menu to add a custom application command.
4. Modifying the global key set for XFCE to remove access to the manual Linux RUN command.
5. Manually adding additional keyboard layouts to the HP Linux thin client.
6. Manually adding additional Linux libraries for additional application support.
This paper assumes that the IT Professional has basic knowledge of navigating directory structures using the Linux console, editing files using the “vi” editor, and an understanding of how to set file permissions through the Linux console. A listing of some basic vi editor commands is provided in Appendix A.
Modifying the right-click menu
The right-click menu is displayed while holding down the right mouse button while the mouse pointer is on the HP Compaq Linux thin client workspace or desktop area. The information displayed on the right-click menu varies based on whether you are logged in as root user (administrator) or non-root user. By default, the right-click menu content changes depending on the user type. By default, the right-click menu for non­root user is the same for all non-root users on the same system; however, you can configure the right-menu differently for two non-root users.
2
Linux configuration files that control the right-click menu
The files that control the content of the right-click menu are located in the /etc/xfce4 subdirectory. The file directory is shown below:
drwxrwxr-x 4 root root 1024 Mar 8 18:08 .
drwxrwxr-x 20 root root 1024 Mar 14 02:04 ..
drwxrwxr-x 2 root root 1024 Jan 4 23:50 applets
-rw-rw-rw- 1 root root 41 Apr 15 2005 blank.menu.xml
-rw-rw-rw- 1 root root 53 Apr 15 2005 ff.menu.xml
-rw-rw-rw- 1 root root 2014 Mar 14 01:04 menu.xml
-rw-rw-rw- 1 root root 1747 Mar 7 19:04 menu.xml.cma
-rw-rw-rw- 1 root root 2012 Mar 14 01:06 menu.xml.cman.root
-rw-rw-rw- 1 root root 2390 Apr 15 2005 menu.xml.pna
-rw-rw-rw- 1 root root 2089 Apr 15 2005 menu.xml.pna.root
-rw-rw-rw- 1 root root 2079 Apr 15 2005 menu.xml.XXXXXXX
-rw-rw-rw- 1 root root 2079 Apr 15 2005
-rw-rw-rw- 1 root root 52 Apr 15 2005 po.menu.xml
-rw-r--r-- 1 root root 52 Jan 31 17:08 poweroff.menu.xml
-rw-rw-rw- 1 root root 47 Apr 15 2005 rb.menu.xml
-rw-r--r-- 1 root root 47 Jan 31 17:08 reboot.menu.xml
-rw-rw-rw- 1 root root 65 Apr 15 2005 vnc.menu.xml
-rw-r--r-- 1 root root 53 Mar 14 01:04 webbrowser.menu.xml
-rw-r--r-- 1 root root 1098 Jul 21 2004 xfce4rc
drwxrwxr-x 3 root root 1024 Jan 4 23:50 xfwm4
-rw-r--r-- 1 root root 5298 Apr 21 2005 xinitrc
The specific files that control the right-click menu are listed in the following table:
HP Desktop Startup Mode Root account Non-root account*
HP Connection Administrator menu.xml.cman.root menu.xml.cman
Citrix ICA Client menu.xml.pna.root menu.xml.pna
XFCE (model specific) menu.xml.XXXXXXXX.root menu.xml.XXXXXXX
Note that the non-root files control all non-root users for that system. You can customize non-root files per user by appending the system defined user name to the end of the file. For example, a custom non-root user file for user “Bob” can be created by creating and modifying the file “menu.xml.cman.Bob”.
3
The basic structure of each of these files is similar but varies depending on the current startup shell (XFCE, HP Connection Administrator, Citrix ICA Client) and the current logged in user. A partial display of the menu.xml.cman file is shown below.
========================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xfdesktop-menu [
<!ENTITY webbrowser SYSTEM "webbrowser.menu.xml">
<!ENTITY VNC SYSTEM "vnc.menu.xml">
]>
<!--
Explanantion of XFce 4 menu file:
=================================
Here we will try to explain the format of the menu file. Look at the
actual menu below for the real examples.
-->
<!-- Obviously, this is how you make a comment ;-) -->
<!--
+ Everything is between exactly one pair of
<xfdesktop-menu></xfdesktop-menu> tags.
+ Applications:
<app name="Name in menu" cmd="Command to run" term="no" visible="yes" />
'term' determines if the program needs a terminal to run
Only 'name' and 'cmd' are required.
+ Separators:
<separator/>
+ Submenus:
<menu name="Name in menu" visible="yes"></menu>
Only 'name' is required.
Between the menu tags you can define more applications, separators and
menus.
+ Titles
<title name="Name in menu" />
Creates an insensitive menu title
+ Including other files:
Other files can be included by using an xml trick. This is a little bit
complicated.
First you have to define a so called entity in the file header. See above,
where we define a 'menu2' entity to point to a "menu2.xml" file.
Then you can use '&entityname;' anywhere in the menu file and it will be
replaced with the contents of the file the entity points to.
4
This can be useful for example if you make a script that generates a gnome
menu and put it in a separate file.
-->
<xfdesktop-menu>
<title name="HP Connection Administrator Desktop Menu" visible="yes" />
<separator/>
<app name="Console" cmd="xfterm4 -bg black -fg white -rightbar" />
<separator/>
<app name="Vncviewer" cmd="vncviewer" />
<separator/>
<app name="Settings" cmd="xfce-setting-show"/>
<separator/>
</xfdesktop-menu>
========================================================================
The menu.xml.cman file controls the right-click menu for all non-root users.
To modify the menu for the standard user, edit the menu.xml.cman file. The focus of this section is based on the following portion of the file:
<xfdesktop-menu>
<title name="HP Connection Administrator Desktop Menu" visible="yes" />
<separator/>
<app name="Console" cmd="xfterm4 -bg black -fg white -rightbar" />
<separator/>
<app name="Vncviewer" cmd="vncviewer" />
<separator/>
<app name="Settings" cmd="xfce-setting-show"/>
<separator/>
</xfdesktop-menu>
The previous syntax results in the following menu:
5
Modifying the right-click menu to remove non-root access to the Linux console
To remove console access for all non-root users:
1. While logged in as a root user, edit the menu.xml.cman file to contain the following lines:
<xfdesktop-menu>
<title name="HP Connection Administrator Desktop Menu" visible="yes" />
<separator/>
<app name="Vncviewer" cmd="vncviewer" />
<separator/>
<app name="Settings" cmd="xfce-setting-show"/>
<separator/>
</xfdesktop-menu>
Note the following lines have been removed:
<app name="Console" cmd="xfterm4 -bg black -fg white -rightbar" />
<separator/>
2. From a console, change the file permissions on the menu.xml file located in the /etc/xfce4 subdirec-
tory by typing chmod 666 menu.xml.
3. Reboot the system or restart X-Windows for the change to take affect. To restart X-Windows, press the
Control-Alt-Backspace keys simultaneously.
The following image illustrates the new menu:
Modifying the right-click menu to add a custom command
Modifying the menu.xml.cman file allows you to add additional custom commands to the menu. In the fol­lowing procedure, adding the lines in bold demonstrates this technique.
To modify the right-click menu to add a custom command:
1. Modify the menu.xml.cman file.
<xfdesktop-menu>
<title name="HP Connection Administrator Desktop Menu" visible="yes" />
<separator/>
<app name="Custom Rdesktop"cmd="rdesktop 111.111.11.1" />
<separator/>
<app name="Vncviewer" cmd="vncviewer" />
<separator/>
<app name="Settings" cmd="xfce-setting-show"/>
<separator/>
</xfdesktop-menu>
6
Note: Command “rdesktop IP address” syntax
2. From a console, change the file permissions on the menu.xml file located in the /etc/xfce4 subdirec-
tory by typing chmod 666 menu.xml.
3. Reboot the system or restart X-Windows for the change to take affect. To restart X-Windows, press the
Control-Alt-Backspace keys simultaneously.
The following image shows the new menu:
Modifying the global key set for XFCE to remove access to the manual Linux RUN command
You can also modify a Linux configuration file to remove the capability to use the ALT-F2 keyboard sequence within the Linux shell. The ALT-F2 key sequence window is similar to the Start > Run com- mand in Windows, which displays the RUN command input dialog, as displayed below.
Making this modification requires changes to the XFCE Global key settings.
To remove access to the manual Linux RUN command:
1. Log in as the root user.
2. Before making changes, use the Linux copy command cp keythemerc keythermerc_backup
to backup the following file: /usr/share/xfwm4/themes/default.keys/keythemerc
7
3. Disable the ALT-F2 key sequence by editing the keythemerc Linux configuration file. This file controls
keyboard shortcut behavior on the Linux desktop. To edit the file:
Using the vi editor, scroll down to the following two lines:
shortcut_2_key=Alt+F2 (Note: Binds the command “xfrun” from the “shortcut_2_exec=” line to ALT+F2 key sequence)
shortcut_2_exec=xfrun4 (Note: “xfrun4” command causes the dialog to display upon ALT+F2 key)
4. Edit the second line, “shortcut_2_exec” line to read as follows: shortcut_2_exec=
5. Reboot the system or restart X-Windows for the change to take affect. To restart X-Windows, press the
Control-Alt-Backspace keys simultaneously.
6. Test the ALT+F2 key sequence to ensure that the “run program” dialog does not function.
Manually adding additional keyboard layouts to the HP Linux thin client
The HP Linux thin client supports the use of additional local keyboard mappings, which align to language­specific keyboard hardware used throughout the world. HP Linux thin clients ship with several keyboard mappings installed in the image; however, user requests indicate a need to manually add keyboard maps.
You can add additional mappings by installing the appropriate keyboard map files onto the HP Linux thin client and modifying the Linux configuration file that controls the keyboard maps within the desktop envi­ronment. You must compile the keyboard mapping you want to install in “xkm” format, which is used in many other Linux distributions.
To manually add additional keyboard layouts:
1. Log in as the root user.
2. Copy the keyboard map to the HP Linux thin client and place it into the /etc/X11/xkb subdirectory.
The file name of the new keyboard map must be two characters plus the .xkm file extension.
8
A following is a sample listing of the /etc/X11/xkb directory:
/usr/X11/xkb # ls
drwxrwxr-x 2 root root 1024 Jan 4 23:50 .
drwxr-xr-x 11 root root 1024 Mar 20 22:52 ..
-rw-r--r- 1 root root 7940 Apr 20 2005 ar.xkm
-rw-r--r- 1 root root 8024 Apr 20 2005 be.xkm
-rw-r--r- 1 root root 7820 Apr 20 2005 br.xkm
-rw-r--r- 1 root root 9884 Apr 20 2005 cz.xkm
-rw-rw-r-- 1 root root 8340 Apr 20 2005 de_CH.xkm
-rw-r--r- 1 root root 8024 Apr 20 2005 de.xkm
-rw-rw-r-- 1 root root 8344 Apr 20 2005 dk.xkm
-rw-r--r- 1 root root 8024 Apr 20 2005 es.xkm
-rw-r--r- 1 root root 9176 Apr 20 2005 fi.xkm
-rw-r--r- 1 root root 8340 Apr 20 2005 fr_CH.xkm
-rw-r--r- 1 root root 8020 Apr 20 2005 fr.xkm
-rw-r--r- 1 root root 9132 Apr 20 2005 gr.xkm
-rw-r--r- 1 root root 8024 Apr 20 2005 hu.xkm
-rw-r--r- 1 root root 9156 Apr 20 2005 il.xkm
Each file listed in the previous directory corresponds to a local Linux keyboard mapping on the HP Linux thin client. You must compile the new keyboard mappings in “xkm” format and copy them into the /etc/X11/xkb directory.
3. Update a Linux configuration file to make the new mapping available to the window manager. To
make the keyboard map available, complete the following steps:
In the Linux console, navigate to the /etc/xfce4/applets subdirectory.
Using the vi editor, open the keyboard.conf text file.
Add the new keyboard mapping using the conventions in the file. The text inserted into the first column represents the file name of the keyboard map without the file extension, followed by the name to be displayed in the operating system. A few lines from the keyboard.conf file are shown below. Note that Mongolian has been added to the file using the mo.xkm key­board file.
ar “Arabic”
be “Belgian-French” #is there Bel-Eng
br “Brazilian”
mo “Mongolian” (Note: This line added to support the new key mapping)
4. Save the file and exit the vi editor.
9
Manually adding extra libraries for additional application support
While not supported by HP, Linux-proficient IT professionals may install additional Linux applications and/ or drivers onto HP Linux thin clients. Keep in mind that you must compile additional applications and driv­ers on full Linux clients prior to installation, as thin clients have limited flash memory space and operating system tools. A few additional considerations include:
Flash size - Is there enough free space on the flash to support the application and/or driver plus the
required support files?
Linux kernel versions - Many applications and drivers are sensitive to the kernel version they were
compiled under. The HP Linux thin client kernel version is 2.4.25.
Compiler and C library compatibility issues - Many applications and drivers are sensitive to the com-
piler and C libraries they were compiled under. The HP Linux thin client image is compiled with ver­sion gcc 3.3.2 using glibc version 2.3.2.
When adding libraries or other files required for supporting additional applications or drivers, HP recom­mends installing the additional files into a separate and unique file directory and configuring the LD_LIBRARY_PATH variable to expose the files to the applications and/or drivers.
HP recommends using the following steps to install the files and edit the path variable:
Add libraries and other support files to the /opt/lib Linux sub-directory. Note that you must create the
lib directory.
Using the vi editor, modify the /etc/profile file and append the text /opt/lib to the end of the
LD_LIBRARY_PATH variable to make the new library path available to the newly-installed application or driver known to the operating system.
10
Appendix A: Partial list of vi commands
Starting an Editing Session Text Insertion Commands
vi filename, where filename is name of file to be edited. a
Appends text after cursor. Terminated by ESC key. Undo Command A u Appends text at end of the line. Terminated the ESC key.
undo the last command. i
Cursor Positioning Commands
jl
Moves cursor down one line, same column. Inserts text at beginning of line. Terminated by ESC key.
ko
Moves cursor up one line, same column. Opens new line below current line for text insertion. Termi-
hO
Moves cursor back one character. Opens new line above the current line for text insertion. Termi-
lDEL
Moves cursor forward one character. Overwrites last character during text insertion.
RET ESC
Moves cursor to beginning of next line. Stops text insertion. The ESC key on the DECstations is F11.
O
Moves cursor to start of current line. x
$ Deletes current character.
Moves cursor to end of current line. dd
SPACE Deletes current line.
Moves cursor forward one character. dw
nG Deletes the current word.
Moves cursor to beginning of line n. Default is last line of file.
O Deletes the rest of the current sentence.
Moves cursor to 1st char. of line. D, d$
:n Deletes from cursor to end of line.
Moves cursor to beg. of line n.P
b Puts back text from the previous delete.
Moves cursor backward to beginning of previous word.
eyy
Moves the cursor backward to the end of the previous word.
wp
Moves cursor forward to next word. Places line in the buffer after the current position of the cursor.
n
Repeats last / or ? pattern search. ZZ
Changing Commands
cw :wq
Changes characters of current word until stopped with ESC. Writes changes to current file and quits edit session.
Inserts text before cursor. Terminated by the ESC key.
nated by ESC key.
nated by the ESC key.
Text Deletion Commands
d)
Cut and Paste Commands
Puts current line in a buffer. Does not delete line from current position.
Exiting vi
Exits vi and saves changes.
:q!
Quits edit session (no changes) made).
11
© Copyright 2005 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.
This document contains proprietary information that is protected by copyright. No part of this document may be photocopied, reproduced, or translated to another language without the prior written consent of Hewlett-Packard Company.
405022-001, 08/2005
12
Loading...