Operating System - HP-UX
1829553 Members
2007 Online
109992 Solutions
New Discussion

Embedding xload into the CDE panel

 
SOLVED
Go to solution
Simon Galton
Frequent Advisor

Embedding xload into the CDE panel

Once upon a time we migrated from HP-VUE to CDE and many of our users missed the embedded xload application in the panel.

One of our adminstrators discovered how to do this under CDE and made it happen. They even prepared a nice little depot package of all of our CDE customizations.

Well, this administrator is no longer with us and when we applied the customizations to an 11i box we discovered that all the customiztions stayed but the embedded xload.

Can anyone point us towards a tutorial/howto/article on doing this?

Thanks!
Simon
2 REPLIES 2
Alex Glennie
Honored Contributor
Solution

Re: Embedding xload into the CDE panel


To add the xload control to the CDE front panel without changing the existing front panel :


Create a unique *.fp file (for example, Xload.fp) and *.dt file (for example, Xload.dt) in the user's $HOME/.dt/types directory:

Xload.fp

CONTROL Xload
{
TYPE client
CONTAINER_NAME Top
CONTAINER_TYPE BOX
POSITION_HINTS 1
LABEL Xload
PUSH_ACTION StartXload
PUSH_RECALL True
CLIENT_NAME xload
CLIENT_GEOMETRY 85x40
}


Xload.dt

ACTION StartXload
{
WINDOW_TYPE NO_STDIO
EXEC_STRING /usr/contrib/bin/X11/xload -geometry 85x40 -nolabel
}

Reload the actions: dtaction ReloadActions

Restart the workspace manager by right-clicking (button 3) in the background of the desktop workspace and selecting "Restart Workspace Manager..." in the root window menu.

As when replacing the analog clock control with a digital clock control, a blank space may appear on the front panel where you'd expect to see the xload utility. However, when the blank space is clicked, the PUSH_ACTION field in the control definition invokes the xload action.
Implement one of the following three options to automate the startup of the xload utility at subsequent logins:


If you are running a "current" session type, xload should restart automatically as part of the current state saved at the previous logout.

If you are running a "home" session, you will need to reset your "home" session, which saves the current state of your desktop applications as your home state and restores it at the next login.
To reset your home session, invoke the Style Manager, click on Startup and select the push-button labeled 'Set Home Session...'.


For system-wide modifications, to start xload without forcing each user to save their sessions:

Create an executable file (for example, 0020.xload) in the /etc/dt/config/Xsession.d directory, with the following contents:

#!/usr/bin/ksh

if [ -d $HOME/.dt/sessions/home ]; then
grep xload $HOME/.dt/sessions/home/dt.session
GrepRC=$?
else
grep xload $HOME/.dt/sessions/current/dt.session
GrepRC=$?
fi

if [ ${GrepRC} -eq 0 ]; then
continue
else
/usr/contrib/bin/X11/xload -geometry 85x40 -nolabel&
fi

Note: These commands determine whether each user is running xload.
If any user is not running xload, it will be started for them.



Change the permissions on this file: chmod 755 0020.xload
Simon Galton
Frequent Advisor

Re: Embedding xload into the CDE panel

Wow! That was detailed and *fast* :)

Much of this appears to be already configured, but I suspect the xload process is not starting properly.

I will investigate.