- Worked with Tom and Bryce to remove views from p57707
- Wrote a document describing how to customize your Unix CDE environment
Removing views with pending deliveries
Had an issue where a user (p57707) had left the company but still had UCM related views. In attempting to remove those views to free up space I was told that there was a delivery in progress. Yet if I set to that view and did ct deliver -cancel it would say that there was no delivery in progress. The best thing to do here is to do a ct lsact -cact which should be the deliver activity. Then find which view these was delivered from. IOW this view was the destination view for the delivery and we needed to find where the delivery was initiated from. Then ct deliver -cancel|-resume from that stream/view.
Tips on Personalizing your Unix/CDE environment
Way back in the day I used to alpha test HP's VUE which latter became the basis for CDE. Oh yes it's brought back memories for sure, and a couple of head scratches as I strive to remember how to configure, customize and personalize things. Perhaps you too have wished to make the environment a little better. Well here's some tips...
Get control of your X Resources
A lot of CDE and X can be controlled via X Resources. But how do you manage your X resources in a CDE environment? In general, xrdb(1) is your friend. CDE saves your "session" using X resource files that are loaded via xrdb(1) at session start up. Additionally (I believe) that X loads any and all resources in ~/.Xresources at start. So the trick is to get all your X resources into ~/.Xresources and to start actively managing them. You can do this as follows:
$ xrdb -q > ~/.Xresources
Now you can add and/or adjust resources in to your liking then do xrdb -l ~/.Xresources. Remember, xrdb -l ~/.Xresources will always get you back to your known set of X Resources.
To find if a resource is set
You can see if a resource is set by using the following:
$ xrdb -q | grep -i <resource string>
I've attached my ~/.Xresources. Let me bring a few to your attention. Note that resources that start with "*" are global in nature. Thus "*background: <color>" will serve as the background for any X application that doesn't explicitly set a background color. "*"'s between resource names are more general than "."'s. Just think "*" expands to anything where "." expands to one character.
The "Dtwm*0*backdrop*image: NoBackdrop" says not to set a CDE "Backdrop" on any of the workspaces. Instead I use xv to randomly change my backdrops from jpg images. More on that later...
Using Xresource Classes
Rather than start Xterms (or dtterms) with:
$ xterm -fg white -bg black -sl 5000 -cr green \
> -sb -e rsh <other machine>
$ xterm -fg yellow -bg blue -sl 5000 -sb -e rsh <other machine>
thus having long lists of options, classify your resources such as:
XServer*background: Black
XServer*foreground: Green
XServer*colorBD: Yellow
XServer*colorUL: Red
XServer*cursorColor: Yellow
Then use xterm -name XServer and all of those X Resources that start with, in this case, XServer will be used. You can set generic or global resources such as;
XTerm*saveLines: 5000
XTerm*scrollbar: True
Setting Meta (or the Diamond key) to be Emacs mode Meta key
Did you know that (even in tcsh) generally Emacs key bindings are in effect at the command line. This while arrow up gets you the previous command in the command history stack so does Cntl-P also go to the previous command. Other Emacs bindings that work:
- C-p: Previous command in history stack
- C-n: Next command in history stack
- C-a: Go to beginning of line
- C-e: Go to end of line
- C-f: Go forward one character
- M-f: Go forward one word
- C-b: Go backward one character
- M-b: Go backward one word
- C-d: Delete one character
- M-d: Delete one word
- C-t: Transpose two characters
Additionally, in bash, C-r stands for search backward in the history stack. tcsh does not support this. Using such keybindings keeps your hands on the keyboard and improves your productivity.
M-f listed above means "hold the meta key down and type f". The meta key is defined as Escape, which, unfortunately will repeat if held down. Most people map this to the "Alt" key. The Sun keyboard has both an Alt key and two "Diamond" keys that are normally labeled Alt on PC keyboards. Therefore it's good to configure your terminal emulator to
use this Diamond/Alt key as Emacs' Meta key. To do this for Xterm use the following X resource (best put into your ~/.Xresouces):
Xterm*eightBitInput: True
and Dtterm:
Side note about "kshMode". This is a misnomer really. True, ksh does support Emacs style keybindings (set -o emacs or set -o vi for you vi guys) and it is useful to have Alt => Meta. However ksh is not the only shell that this is useful for. It is also useful for tcsh and bash, for example.
Taking Control of your Buttons and Keybindings
The following:
Dtwm*keyBindings: MyKeys
Dtwm*buttonBindings: MyButtons
Tell the window manager (Dtwm) not to use the default keyBindings and buttonBindings but instead to use MyKeys and MyButtons instead. These are defined in your dtwmrc, which is under ~/.dt/en_US.ISO8859-1/dtwmrc (which I've also attached). I started by copying the system dtwmrc (cp /usr/dt/config/C/sys.dtwmrc ~/.dt/en_US.ISO8859-1) and then modified it.
You're dtwmrc can be very complicated. See dtwmrc(1) for more info. Here are MyButtons:
Buttons MyButtons
{
<Btn1Down> root f.menu Terminals
<Btn1Down> window|frame|icon f.raise
<Btn2Click> root f.toggle_frontpanel
<Btn3Down> root f.menu DtRootMenu
<Btn3Down> icon f.post_wmenu
Shift<Btn1Click> frame|icon f.lower
<Btn1Click> frame|icon|window f.raise
<Btn1Click2> frame f.maximize
<Btn1Click2> icon f.restore
<Btn2Click> frame|icon f.raise_lower
<Btn3Down> frame|icon f.post_wmenu
Alt<Btn1Click> frame|icon|window f.raise
Alt<Btn1Click2> frame|window f.minimize
Alt<Btn1Click2> icon f.restore
Alt<Btn2Click> frame|icon f.raise_lower
Alt<Btn1Down> frame|icon|window f.move
Alt<Btn3Down> window f.minimize
}
Many of these are taking from the defaults. Here are some of the changes I made:
- Changed Btn1Down to bring up the "Terminals" menu
- Added "window" to the places where a Btn1Down would do a raise. This allows me to click on the window itself to raise it instead of having to find the window border.
Changing your desktop background
I have a series of images that I like to constantly refresh on my background. I put them in ~/Images. CDE has terrible desktop background support (like circa 1990) and only supports xpm (which is a horrible image file format!). xv is an image viewer than handles more modern image file formats such as .gif, .jpg, and .png. It also has options
for setting the backdrop (provided CDE is not putting up a .xpm backdrop image, hence the "Dtwm*0*backdrop*image: NoBackdrop" setting). Now how do we get this to do this periodically?
The answer? Perl. I've attached a Perl script that sets your backdrop by choosing a random image from all of those under ~/Images every hour or whenever it receives a SIGUSR2.
Oh and if you wish feel free to:
$ mkdir ~/Images
$ cp ~p6238c/Images ~/Images
Or
$ ln -s ~p6258c/Images ~/Images
*0*ColorPalette: SoftBlue.dp
*0*ColorUse: HIGH_COLOR
*DtEditor*textFontList: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*DtTerm*shadowThickness: 1
*Font: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*
*FontList: -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*FontSet: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*
*HelpColorUse: 1
*XmText*FontList: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*XmText*Translations: #override\n\
Ctrlu:delete-to-start-of-line()\n\
Ctrlk:delete-to-end-of-line()\n\
Ctrla:beginning-of-line()\n\
Ctrle:end-of-line()\n\
Ctrlp:process-up()\n\
Ctrlb:backward-character()\n\
Ctrln:process-down()\n\
Ctrlf:forward-character()
*XmTextField*FontList: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*XmTextField*Translations: #override\n\
Ctrlu:delete-to-start-of-line()\n\
Ctrlk:delete-to-end-of-line()\n\
Ctrla:beginning-of-line()\n\
Ctrle:end-of-line()\n\
Ctrlb:backward-character()\n\
Ctrlf:forward-character()
*background: #9494D5D5DFDF
*buttonFontList: -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*dtEnvMapForRemote: DTAPPSEARCHPATH:DTHELPSEARCHPATH:DTDATABASESEARCHPATH:XMICONSEARCHPATH:XMICONBMSEARCHPATH
*enableBtn1Transfer: button2_transfer
*enableButtonTab: True
*enableCDEColorFactors: True
*enableDefaultButton: True
*enableDragIcon: True
*enableEtchedInMenu: True
*enableMenuInCascade: True
*enableMultiKeyBindings: True
*enableThinThickness: True
*enableToggleColor: True
*enableToggleVisual: True
*enableUrlAwareness: True
*fontGroup: Courier
*foreground: #000000000000
*labelFontList: -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*loginShell: True
*multiClickTime: 500
*promptDialog.bboard.frame.form.text.columns: 45
*saveLines: 500
*scrollBar_right: True
*sessionVersion: 3.0
*systemFont: -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*textFontList: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*ttyModes: intr ^c quit ^\\ erase ^h kill ^u eof ^d start ^q stop ^s susp ^z dsusp ^y rprnt ^r flush ^o weras ^w lnext ^v
*userFont: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
*xineramaDefaultFramebuffer: 0
Dtstyle*timeoutScale: 5
Dtwm*0*FrontPanel*geometry: +67-4
Dtwm*0*helpResources: \n
Dtwm*0*initialWorkspace: ws0
Dtwm*0*workspaceCount: 4
Dtwm*0*workspaceList: "ws0" "ws1" "ws2" "ws3"
Dtwm*0*backdrop*image: NoBackdrop
Dtwm*0*ws3*title: Four
Dtwm*0*ws4*title: New
Dtwm*0*ws5*title: New_1
Dtwm*0*ws6*title: New_2
Dtwm*focusAutoRaise: False
Dtwm*gwmOnFrontPanel: False
twm*moveOpaque: True
Dtwm*showSwitchArea: True
Dtwm*syncDesktopSwitch: False
Dtwm*useSameBackdrop: True
Dtwm.keyboardFocusPolicy: pointer
! Dtwm
Dtwm*keyBindings: MyKeys
Dtwm*buttonBindings: MyButtons
! Rxvt
Rxvt*font: "Lucida Console-*-16"
Rxvt*font1: "Lucida Console-*-18"
Rxvt*font2: "Lucida Console-*-20"
Rxvt*saveLines: 5000
Rxvt*scrollBar_right: True
Rxvt*geometry: 80x24
Rxvt*loginShell: True
Rxvt*background: SteelBlue
Rxvt*foreground: White
Rxvt*colorBD: Red
Rxvt*colorUL: Red
Rxvt*cursorColor: Red
! New server
Jupiter*background: MidNightBlue
Jupiter*foreground: White
Jupiter*colorBD: Red
Jupiter*colorUL: Red
Jupiter*cursorColor: Yellow
! Danni's desktop
Starbase*background: MediumVioletRed
Starbase*foreground: White
Starbase*colorBD: Yellow
Starbase*colorUL: Red
Starbase*cursorColor: Yellow
! Hewlett Packard
Tiburon*background: Black
Tiburon*foreground: Magenta
Tiburon*colorBD: Yellow
Tiburon*colorUL: Red
Tiburon*cursorColor: Green
Pacifica*background: ForestGreen
Pacifica*foreground: White
Pacifica*colorBD: Red
Pacifica*colorUL: Red
Pacifica*cursorColor: Red
plebld01*background: Black
plebld01*foreground: Yellow
plebld01*colorBD: Yellow
plebld01*colorUL: Red
plebld01*cursorColor: Yellow
ccase-sj1-4*background: Black
ccase-sj1-4*foreground: Green
ccase-sj1-4*colorBD: Green
ccase-sj1-4*colorUL: Red
ccase-sj1-4*cursorColor:Yellow
XServer*background: Black
XServer*foreground: Green
XServer*colorBD: Yellow
XServer*colorUL: Red
XServer*cursorColor: Yellow
! XTerm
XTerm*Font: -*-Lucida Sans Typewriter-medium-r-*-*-*-*-*-*-*-*-*
XTerm*saveLines: 5000
XTerm*scrollBar_right: True
XTerm*scrollBar: True
XTerm*geometry: 80x24
XTerm*loginShell: True
XTerm*background: SteelBlue
XTerm*foreground: White
XTerm*colorBD: Blue
XTerm*colorUL: Red
XTerm*cursorColor: Yellow
XTerm*eightBitInput: False
! XEmacs
Emacs*Background: Gray
Emacs*Font: -*-Lucida Sans Typewriter-medium-r-*-*-*-*-*-*-*-*-*
! Dtterm
Dtterm*kshMode: True
Menu DtRootMenu
{
"Menu" f.title
"Applications" f.menu ApplicationsMenu
"Terminals" f.menu Terminals
"Files" f.menu FilesMenu
"Folders" f.menu FoldersMenu
"Hosts" f.menu HostsMenu
"Tools" f.menu ToolsMenu
"Windows" f.menu WindowsMenu
"Lock" f.action LockDisplay
"Suspend" f.action SDTsuspend
}
Menu Terminals
{
"Terminals" f.title
sep f.separator
"Local X Term" f.action Xterm
"Remote X Term" f.action XtermRlogin
sep f.separator
"Local DT Term" f.action Dtterm
"Remote DT Term" f.action DttermRlogin
}
Menu WindowsMenu
{
"Windows" f.title
"Refresh" f.refresh
"Arrange Icons" f.pack_icons
"Restart" f.restart
"Update" f.action UpdateWorkspaceMenu
"Kill" f.exec /usr/openwin/bin/xkill
}
Menu ApplicationsMenu
{
"Applications" f.title
"Application Manager" f.action Dtappmgr
"Audio Control" f.action SDtAudioControl
"Audio and Video" f.action SDTjmplay
"Calculator" f.action Dtcalc
"Calendar" f.action Dtcm
"Icon Editor" f.action Dticon
"Image Viewer" f.action SDTimage
"Snapshot" f.action SDTsnapshot
"Text Editor" f.action TextEditor
"Text Note" f.action Note
"Voice Note" f.action Record
}
Menu FilesMenu
{
"Files" f.title
"File Manager" f.action Dtfile
"Find File" f.action SDtFind
"Properties..." f.action FileProperties
}
Menu FoldersMenu
{
"Folders" f.title
"Empty Trash Can" f.action DtEmptyTrash
"File Manager - Home" f.action DtfileHome
"Open Floppy" f.action OpenFloppy
"Removable Media" f.action Dtmediamgr
"Trash Can" f.action Dttrash
}
Menu HostsMenu
{
"Hosts" f.title
"Find Host..." f.action HOST_Find
"Performance Meter" f.action SDtPerfmeter
"Terminal Console" f.action DttermConsole
"This Host" f.action Terminal "/usr/dt/config/C/wsmenu/Hosts/This_Host"
"Workstation Info" f.action SDtWsinfo
}
Menu ToolsMenu
{
"Tools" f.title
"Create Action" f.action Dtcreate
"Desktop Controls" f.action DtControls
"Hotkey Editor" f.action SDtHotkey
"Power Manager" f.action SDTpowermgr
"Print Manager" f.action DtPrintManager
"Printer Administrator" f.action PrinterAdministratorDtspcd
"Process Manager" f.action SDtProcess
"Solaris Management Console" f.action smc
"Terminal" f.action Terminal
"Watch Errors" f.action DttermErrorlog
}
Menu DtPanelMenu
{
"Windows" f.title
"Shuffle Up" f.circle_up
"Shuffle Down" f.circle_down
"Refresh" f.refresh
"Clean Up Icons" f.pack_icons
"Minimize/Restore Front Panel" f.toggle_frontpanel
"Restart Workspace Manager..." f.restart
"Update Workspace Menu" f.action UpdateWorkspaceMenu
"Disable Access Control" f.action Xhost+
"Enable Access Control" f.action Xhost-
"Kill Window..." f.exec /usr/openwin/bin/xkill
}
Menu WindowMenu
{
"Restore" _R f.normalize
"Move" _M f.move
"Size" _S f.resize
"Minimize" _n f.minimize
"Maximize" _x f.maximize
"Lower" _L f.lower
"Workspace..." _W f.workspace_presence
"All Workspaces" _A f.occupy_all
"Remove Workspace" _e f.remove
"Close" _C AltF4 f.kill
}
Keys MyKeys
{
# Global
#AltMenu root|icon|window f.toggle_frontpanel
AltTab root|icon|window f.next_key
Alt ShiftTab root|icon|window f.prev_key
AltEscape root|icon|window f.next_key
Alt ShiftEscape root|icon|window f.prev_key
AltDown root|icon|window f.circle_down
AltUp root|icon|window f.circle_up
AltLeft root|icon|window f.prev_workspace
AltRight root|icon|window f.next_workspace
Alt Ctrl Shiftexclam root|icon|window f.set_behavior
# Root
SunAgain root|ifkey f.pack_icons
SunProps root|ifkey f.version
SunUndo root|ifkey f.refresh
SunFront root|ifkey f.circle_up
ShiftSunFront root|ifkey f.circle_down
Down root f.circle_down
Up root f.circle_up
Right root f.next_workspace
Left root f.prev_workspace
#
SunAudioMute root|icon|window|ifkey f.exec /usr/dt/appconfig/sdtvolctl/muteVolume
SunAudioRaiseVolume root|icon|window|ifkey f.exec /usr/dt/appconfig/sdtvolctl/volumeUp
SunAudioLowerVolume root|icon|window|ifkey f.exec /usr/dt/appconfig/sdtvolctl/volumeDown
# Window/Icon
SunFront window|icon|ifkey f.raise_lower
SunOpen window|ifkey f.minimize
ShiftEscape window|icon f.post_wmenu
Altspace window|icon f.post_wmenu
AltF6 window f.next_key transient
Alt ShiftF6 window f.prev_key transient
AltF4 window|icon|ifkey f.kill
AltSunProps window|icon|ifkey f.workspace_presence
AltSunPaste window|icon|ifkey f.occupy_all
AltSunCut window|icon|ifkey f.remove
AltKP_Insert window|icon f.occupy_all
AltDelete window|icon f.remove
CtrlL2 window|ifkey f.next_cmap
CtrlL4 window|ifkey f.prev_cmap
# Icon
SunOpen icon|ifkey f.restore
AltF4 icon|ifkey f.kill
SunProps icon|ifkey f.workspace_presence
SunPaste icon|ifkey f.occupy_all
SunCut icon|ifkey f.remove
KP_Insert icon|ifkey f.occupy_all
Delete icon|ifkey f.remove
}
Buttons MyButtons
{
root f.menu Terminals
window|frame|icon f.raise
root f.toggle_frontpanel
root f.menu DtRootMenu
icon f.post_wmenu
Shift frame|icon f.lower
frame|icon|window f.raise
frame f.maximize
icon f.restore
frame|icon f.raise_lower
frame|icon f.post_wmenu
Alt frame|icon|window f.raise
Alt frame|window f.minimize
Alt icon f.restore
Alt frame|icon f.raise_lower
Alt frame|icon|window f.move
Alt window f.minimize
}
Menu DefaultWindowMenu
{
"Restore" _R AltF5 f.normalize
"Move" _M AltF7 f.move
"Size" _S AltF8 f.resize
"Minimize" _n AltF9 f.minimize
"Maximize" _x AltF10 f.maximize
"Lower" _L AltF3 f.lower
"Close" _C AltF4 f.kill
}
#!/bin/perl
use strict;
use warnings;
use POSIX qw (setsid);
use FindBin;
my $sleep = 60 * 60;
my $home = $ENV{HOME};
my $xv = "/prj/Synopsis/gccsparcOS5/ccss/utils/xv/xv";
my @images = `ls $home/Images`;
chomp @images;
my $arch = $^O =~ /MSWin/ ? "windows" :
$^O =~ /cygwin/ ? "cygwin" : $^O;
my $null = $^O =~ /MSWin/ ? "NUL" : "/dev/null";
sub display_err ($;$$) {
my ($msg, $handle, $nolinefeed) = @_;
$handle = *STDERR if !defined $handle;
print $handle $msg;
print $handle "\n" if !defined $nolinefeed;
} # display_err
sub error ($;$$$) {
my ($msg, $errno, $handle, $nolinefeed) = @_;
if (!$errno) {
$msg = "$FindBin::Script ERROR: $msg";
} else {
$msg = "$FindBin::Script ERROR #$errno: $msg";
} # if
display_err $msg, $handle, $nolinefeed;
exit $errno if $errno;
} # error
sub EnterDaemonMode (;$$) {
my ($logfile, $errorlog) = @_;
if (!defined $logfile or $logfile eq '') {
$logfile = $null;
} # if
if (!defined $errorlog or $errorlog eq '') {
$errorlog = $null;
} # if
# Change the current directory to /
my $root = $arch eq "windows" ? "C:\\" : "/";
chdir $root
or error "Can't chdir to $root ($!), 1";
# Turn off umask
umask 0;
# Redirect STDIN to $null
open STDIN, $null
or error "Can't read $null ($!)", 1;
# Redirect STDOUT to logfile
open STDOUT, ">>$logfile"
or error "Can't write to $logfile ($!), 1";
# Redirect STDERR to errorlog
open STDERR, ">>$errorlog"
or error "Can't write to $errorlog ($!)", 1;
# Now fork the daemon
defined (my $pid = fork)
or error "Can't create daemon ($!)", 1;
# Now the parent exits
exit if $pid;
# Set process to be session leader
setsid ()
or error "Can't start a new session ($!)", 1;
} # EnterDaemonMode
sub SwitchWallPaper {
# We don't need to do anything here, just handle the interrupt and
# let the while loop continue.
} # SwitchWallPaper
$SIG{USR2} = \&SwitchWallPaper;
EnterDaemonMode;
while () {
my $cmd = "$xv -root -maxpect -quit $home/Images/" . $images [int (rand $#images)];
`$cmd`;
sleep $sleep;
} # while