Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000649.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: Removed views/documented customizing Unix environments</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000648.html" title="Fun with IT in GD" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000650.html" title="View space/Locked stream" />
17
18    <!--
19 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
20          xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
21          xmlns:dc="http://purl.org/dc/elements/1.1/">
22 <rdf:Description
23     rdf:about="http://defaria.com/blogs/Status/archives/000649.html"
24     trackback:ping="http://defaria.com/mt/mt-tb.cgi/37"
25     dc:title="Removed views/documented customizing Unix environments"
26     dc:identifier="http://defaria.com/blogs/Status/archives/000649.html"
27     dc:subject="General Dynamics"
28     dc:description=" Worked with Tom and Bryce to remove views from p57707 Wrote a document describing how to customize your Unix CDE environment..."
29     dc:creator=""
30     dc:date="2007-07-10T16:17:52-06:00" />
31 </rdf:RDF>
32 -->
33
34
35    
36
37    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
38 </head>
39 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
40    <div id="container">
41       <div id="container-inner" class="pkg">
42
43          <div id="banner">
44             <div id="banner-inner" class="pkg">
45                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
46                <h2 id="banner-description">Searchable status reports and work log</h2>
47             </div>
48          </div>
49
50          <div id="pagebody">
51             <div id="pagebody-inner" class="pkg">
52                <div id="alpha">
53                   <div id="alpha-inner" class="pkg">
54
55                      <p class="content-nav">
56                         <a href="http://defaria.com/blogs/Status/archives/000648.html">&laquo; Fun with IT in GD</a> |
57                         <a href="http://defaria.com/blogs/Status/">Main</a>
58                         | <a href="http://defaria.com/blogs/Status/archives/000650.html">View space/Locked stream &raquo;</a>
59                      </p>
60
61                      <a id="a000649"></a>
62                      <div class="entry" id="entry-649">
63                         <h3 class="entry-header">Removed views/documented customizing Unix environments</h3>
64                         <div class="entry-content">
65                            <div class="entry-body">
66                               <ul>
67   <li>Worked with Tom and Bryce to remove views from p57707</li>
68
69   <li>Wrote a document describing how to customize your Unix CDE environment</li>
70 </ul>
71                            </div>
72                            <div id="more" class="entry-more">
73                               <h3>Removing views with pending deliveries</h3>
74
75 <p>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.</p>
76
77 <h3>Tips on Personalizing your Unix/CDE environment</h3>
78
79 <p>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...</p>
80
81 <h3>Get control of your X Resources</h3>
82
83 <p>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:</p>
84
85 <div class=code><pre>
86 $ xrdb -q &gt; ~/.Xresources
87 </pre></div>
88
89 <p>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 <i>known set</i> of X Resources.</p>
90
91 <h3>To find if a resource is set</h3>
92
93 <p>You can see if a resource is set by using the following:</p>
94
95 <div class=code><pre>
96 $ xrdb -q | grep -i &lt;<i>resource string</i>&gt;
97 </pre></div>
98
99 <p>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: &lt;<i>color</i>&gt;" 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.</p>
100
101 <p>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...</p>
102
103 <h3>Using Xresource Classes</h3>
104
105 <p>Rather than start Xterms (or dtterms) with:</p>
106
107 <div class=code><pre>
108 $ xterm -fg white -bg black -sl 5000 -cr green \
109 &gt; -sb -e rsh &lt;other machine&gt;
110 $ xterm -fg yellow -bg blue -sl 5000 -sb -e rsh &lt;other machine&gt;
111 </pre></div>
112
113 <p>thus having long lists of options, classify your resources such as:</p>
114
115 <div class=code><pre>
116 XServer*background:    Black
117 XServer*foreground:    Green
118 XServer*colorBD:       Yellow
119 XServer*colorUL:       Red
120 XServer*cursorColor:   Yellow
121 </pre></div>
122
123 <p>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;</p>
124
125 <div class=code><pre>
126 XTerm*saveLines:      5000
127 XTerm*scrollbar:      True
128 </pre></div>
129
130 <h3>Setting Meta (or the Diamond key) to be Emacs mode Meta key</h3>
131
132 <p>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:</p>
133
134 <ul>
135   <li>C-p: Previous command in history stack</li>
136   <li>C-n: Next command in history stack</li>
137   <li>C-a: Go to beginning of line</li>
138   <li>C-e: Go to end of line</li>
139   <li>C-f: Go forward one character</li>
140   <li>M-f: Go forward one word</li>
141   <li>C-b: Go backward one character</li>
142   <li>M-b: Go backward one word</li>
143   <li>C-d: Delete one character</li>
144   <li>M-d: Delete one word</li>
145   <li>C-t: Transpose two characters</li>
146 </ul>
147
148 <p>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.</p>
149
150 <p>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
151 use this Diamond/Alt key as Emacs' Meta key. To do this for Xterm use the following X resource (best put into your ~/.Xresouces):</p>
152
153 <div class=code><pre>
154 Xterm*eightBitInput: True
155 </pre></div>
156
157 <p>and Dtterm:</p>
158
159 <div class=code><pre>
160 Dtterm*kshMode: True
161 </pre></div>
162
163 <p>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 =&gt; Meta. However ksh is not the only shell that this is useful for. It is also useful for tcsh and bash, for example.</p>
164
165 <h3>Taking Control of your Buttons and Keybindings</h3>
166
167 <p>The following:</p>
168
169 <div class=code><pre>
170 Dtwm*keyBindings:    MyKeys
171 Dtwm*buttonBindings: MyButtons
172 </pre></div>
173
174 <p>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.</p>
175
176 <p>You're dtwmrc can be very complicated. See dtwmrc(1) for more info. Here are MyButtons:</p>
177
178 <div class=code><pre>
179 Buttons MyButtons
180 {
181   &lt;Btn1Down&gt;        root              f.menu Terminals
182   &lt;Btn1Down&gt;        window|frame|icon f.raise
183   &lt;Btn2Click&gt;       root              f.toggle_frontpanel
184   &lt;Btn3Down&gt;        root              f.menu  DtRootMenu
185   &lt;Btn3Down&gt;        icon              f.post_wmenu
186   Shift&lt;Btn1Click&gt;  frame|icon        f.lower
187   &lt;Btn1Click&gt;       frame|icon|window f.raise
188   &lt;Btn1Click2&gt;      frame             f.maximize
189   &lt;Btn1Click2&gt;      icon              f.restore
190   &lt;Btn2Click&gt;       frame|icon        f.raise_lower
191   &lt;Btn3Down&gt;        frame|icon        f.post_wmenu
192   Alt&lt;Btn1Click&gt;    frame|icon|window f.raise
193   Alt&lt;Btn1Click2&gt;   frame|window      f.minimize
194   Alt&lt;Btn1Click2&gt;   icon              f.restore
195   Alt&lt;Btn2Click&gt;    frame|icon        f.raise_lower
196   Alt&lt;Btn1Down&gt;     frame|icon|window f.move
197   Alt&lt;Btn3Down&gt;     window            f.minimize
198 }
199 </pre></div>
200
201 <p>Many of these are taking from the defaults. Here are some of the changes I made:</p>
202
203 <ul>
204   <li>Changed Btn1Down to bring up the "Terminals" menu</li>
205   <li>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.</li>
206 </ul>
207
208 <h3>Changing your desktop background</h3>
209
210 <p>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
211 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?</p>
212
213 <p>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.</p>
214
215 <p>Oh and if you wish feel free to:</p>
216
217 <div class=code><pre>
218 $ mkdir ~/Images
219 $ cp ~p6238c/Images ~/Images
220 </pre></div>
221
222 <p>Or</p>
223
224 <div class=code><pre>
225 $ ln -s ~p6258c/Images ~/Images
226 </pre></div>
227
228 <div class=code><pre>
229 *0*ColorPalette:        SoftBlue.dp
230 *0*ColorUse:    HIGH_COLOR
231 *DtEditor*textFontList: -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
232 *DtTerm*shadowThickness:        1
233 *Font:  -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*
234 *FontList:      -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
235 *FontSet:       -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*
236 *HelpColorUse:  1
237 *XmText*FontList:       -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
238 *XmText*Translations:   #override\n\
239         Ctrl<Key>u:delete-to-start-of-line()\n\
240         Ctrl<Key>k:delete-to-end-of-line()\n\
241         Ctrl<Key>a:beginning-of-line()\n\
242         Ctrl<Key>e:end-of-line()\n\
243         Ctrl<Key>p:process-up()\n\
244         Ctrl<Key>b:backward-character()\n\
245         Ctrl<Key>n:process-down()\n\
246         Ctrl<Key>f:forward-character()
247 *XmTextField*FontList:  -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
248 *XmTextField*Translations:      #override\n\
249         Ctrl<Key>u:delete-to-start-of-line()\n\
250         Ctrl<Key>k:delete-to-end-of-line()\n\
251         Ctrl<Key>a:beginning-of-line()\n\
252         Ctrl<Key>e:end-of-line()\n\
253         Ctrl<Key>b:backward-character()\n\
254         Ctrl<Key>f:forward-character()
255 *background:    #9494D5D5DFDF
256 *buttonFontList:        -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
257 *dtEnvMapForRemote:     DTAPPSEARCHPATH:DTHELPSEARCHPATH:DTDATABASESEARCHPATH:XMICONSEARCHPATH:XMICONBMSEARCHPATH
258 *enableBtn1Transfer:    button2_transfer
259 *enableButtonTab:       True
260 *enableCDEColorFactors: True
261 *enableDefaultButton:   True
262 *enableDragIcon:        True
263 *enableEtchedInMenu:    True
264 *enableMenuInCascade:   True
265 *enableMultiKeyBindings:        True
266 *enableThinThickness:   True
267 *enableToggleColor:     True
268 *enableToggleVisual:    True
269 *enableUrlAwareness:    True
270 *fontGroup:     Courier
271 *foreground:    #000000000000
272 *labelFontList: -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
273 *loginShell:    True
274 *multiClickTime:        500
275 *promptDialog.bboard.frame.form.text.columns:   45
276 *saveLines:     500
277 *scrollBar_right:       True
278 *sessionVersion:        3.0
279 *systemFont:    -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
280 *textFontList:  -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
281 *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
282 *userFont:      -dt-interface user-medium-r-normal-s*-*-*-*-*-*-*-*-*:
283 *xineramaDefaultFramebuffer:    0
284 Dtstyle*timeoutScale:   5
285 Dtwm*0*FrontPanel*geometry:     +67-4
286 Dtwm*0*helpResources:   \n  
287 Dtwm*0*initialWorkspace:        ws0
288 Dtwm*0*workspaceCount:  4
289 Dtwm*0*workspaceList:   "ws0" "ws1" "ws2" "ws3"
290 Dtwm*0*backdrop*image:  NoBackdrop
291 Dtwm*0*ws3*title:       Four
292 Dtwm*0*ws4*title:       New
293 Dtwm*0*ws5*title:       New_1
294 Dtwm*0*ws6*title:       New_2
295 Dtwm*focusAutoRaise:    False
296 Dtwm*gwmOnFrontPanel:   False
297 twm*moveOpaque: True
298 Dtwm*showSwitchArea:    True
299 Dtwm*syncDesktopSwitch: False
300 Dtwm*useSameBackdrop:   True
301 Dtwm.keyboardFocusPolicy:       pointer
302
303 ! Dtwm
304 Dtwm*keyBindings:       MyKeys
305 Dtwm*buttonBindings:    MyButtons
306
307 ! Rxvt
308 Rxvt*font:              "Lucida Console-*-16"
309 Rxvt*font1:             "Lucida Console-*-18"
310 Rxvt*font2:             "Lucida Console-*-20"
311 Rxvt*saveLines:         5000
312 Rxvt*scrollBar_right:   True
313 Rxvt*geometry:          80x24
314 Rxvt*loginShell:        True
315 Rxvt*background:        SteelBlue
316 Rxvt*foreground:        White
317  Rxvt*colorBD:          Red
318 Rxvt*colorUL:           Red
319 Rxvt*cursorColor:       Red
320
321 ! New server
322 Jupiter*background:     MidNightBlue
323 Jupiter*foreground:     White
324 Jupiter*colorBD:        Red
325 Jupiter*colorUL:        Red
326 Jupiter*cursorColor:    Yellow
327
328 ! Danni's desktop
329 Starbase*background:    MediumVioletRed
330 Starbase*foreground:    White
331 Starbase*colorBD:       Yellow
332 Starbase*colorUL:       Red
333 Starbase*cursorColor:   Yellow
334
335 ! Hewlett Packard
336 Tiburon*background:     Black
337 Tiburon*foreground:     Magenta
338 Tiburon*colorBD:        Yellow
339 Tiburon*colorUL:        Red
340 Tiburon*cursorColor:    Green
341
342 Pacifica*background:    ForestGreen
343 Pacifica*foreground:    White
344 Pacifica*colorBD:       Red
345 Pacifica*colorUL:       Red
346 Pacifica*cursorColor:   Red
347
348 plebld01*background:    Black
349 plebld01*foreground:    Yellow
350 plebld01*colorBD:       Yellow
351 plebld01*colorUL:       Red
352 plebld01*cursorColor:   Yellow
353
354 ccase-sj1-4*background: Black
355 ccase-sj1-4*foreground: Green
356 ccase-sj1-4*colorBD:    Green
357 ccase-sj1-4*colorUL:    Red
358 ccase-sj1-4*cursorColor:Yellow
359
360 XServer*background:     Black
361 XServer*foreground:     Green
362 XServer*colorBD:        Yellow
363 XServer*colorUL:        Red
364 XServer*cursorColor:    Yellow
365
366 ! XTerm
367 XTerm*Font:             -*-Lucida Sans Typewriter-medium-r-*-*-*-*-*-*-*-*-*
368 XTerm*saveLines:        5000
369 XTerm*scrollBar_right:  True
370 XTerm*scrollBar:        True
371 XTerm*geometry:         80x24
372 XTerm*loginShell:       True
373 XTerm*background:       SteelBlue
374 XTerm*foreground:       White
375 XTerm*colorBD:          Blue
376 XTerm*colorUL:          Red
377 XTerm*cursorColor:      Yellow
378 XTerm*eightBitInput:    False
379
380 ! XEmacs
381 Emacs*Background:       Gray
382 Emacs*Font:             -*-Lucida Sans Typewriter-medium-r-*-*-*-*-*-*-*-*-*
383
384 ! Dtterm
385 Dtterm*kshMode:         True
386 </pre></div>
387
388 <div class=code><pre>
389 Menu DtRootMenu 
390 {
391   "Menu"                f.title
392   "Applications"        f.menu ApplicationsMenu
393   "Terminals"           f.menu Terminals
394   "Files"               f.menu FilesMenu
395   "Folders"             f.menu FoldersMenu
396   "Hosts"               f.menu HostsMenu
397   "Tools"               f.menu ToolsMenu
398   "Windows"             f.menu WindowsMenu
399   "Lock"                f.action LockDisplay
400   "Suspend"             f.action SDTsuspend
401 }
402
403 Menu Terminals
404 {
405   "Terminals"           f.title
406   sep                   f.separator
407   "Local X Term"        f.action Xterm
408   "Remote X Term"       f.action XtermRlogin
409   sep                   f.separator
410   "Local DT Term"       f.action Dtterm
411   "Remote DT Term"              f.action DttermRlogin
412 }
413
414 Menu WindowsMenu
415 {
416     "Windows"           f.title
417     "Refresh"           f.refresh
418     "Arrange Icons"     f.pack_icons
419     "Restart"           f.restart
420     "Update"            f.action UpdateWorkspaceMenu
421     "Kill"              f.exec /usr/openwin/bin/xkill
422 }
423
424 Menu ApplicationsMenu
425 {
426   "Applications"        f.title
427   "Application Manager" f.action Dtappmgr
428   "Audio Control"       f.action SDtAudioControl
429   "Audio and Video"     f.action SDTjmplay
430   "Calculator"          f.action Dtcalc
431   "Calendar"            f.action Dtcm
432   "Icon Editor"         f.action Dticon
433   "Image Viewer"        f.action SDTimage
434   "Snapshot"            f.action SDTsnapshot
435   "Text Editor"         f.action TextEditor
436   "Text Note"           f.action Note
437   "Voice Note"          f.action Record
438 }
439
440 Menu FilesMenu
441 {
442   "Files"               f.title
443   "File Manager"        f.action Dtfile
444   "Find File"           f.action SDtFind
445   "Properties..."       f.action FileProperties
446 }
447
448 Menu FoldersMenu
449 {
450   "Folders"             f.title
451   "Empty Trash Can"     f.action DtEmptyTrash
452   "File Manager - Home" f.action DtfileHome
453   "Open Floppy"         f.action OpenFloppy
454   "Removable Media"     f.action Dtmediamgr
455   "Trash Can"           f.action Dttrash
456 }
457
458 Menu HostsMenu
459 {
460   "Hosts"               f.title
461   "Find Host..."        f.action HOST_Find
462   "Performance Meter"   f.action SDtPerfmeter
463   "Terminal Console"    f.action DttermConsole
464   "This Host"           f.action Terminal "/usr/dt/config/C/wsmenu/Hosts/This_Host"
465   "Workstation Info"    f.action SDtWsinfo
466 }
467
468 Menu ToolsMenu
469 {
470   "Tools"                       f.title
471   "Create Action"               f.action Dtcreate
472   "Desktop Controls"            f.action DtControls
473   "Hotkey Editor"               f.action SDtHotkey
474   "Power Manager"               f.action SDTpowermgr
475   "Print Manager"               f.action DtPrintManager
476   "Printer Administrator"       f.action PrinterAdministratorDtspcd
477   "Process Manager"             f.action SDtProcess
478   "Solaris Management Console"  f.action smc
479   "Terminal"                    f.action Terminal
480   "Watch Errors"                f.action DttermErrorlog
481 }
482
483 Menu DtPanelMenu
484 {
485   "Windows"                             f.title
486   "Shuffle Up"                          f.circle_up
487   "Shuffle Down"                        f.circle_down
488   "Refresh"                             f.refresh
489   "Clean Up Icons"                      f.pack_icons
490   "Minimize/Restore Front Panel"        f.toggle_frontpanel
491   "Restart Workspace Manager..."        f.restart
492   "Update Workspace Menu"               f.action UpdateWorkspaceMenu
493   "Disable Access Control"              f.action Xhost+
494   "Enable Access Control"               f.action Xhost-
495   "Kill Window..."                      f.exec /usr/openwin/bin/xkill
496 }
497
498 Menu WindowMenu
499 {
500   "Restore"             _R                      f.normalize
501   "Move"                _M                      f.move
502   "Size"                _S                      f.resize
503   "Minimize"            _n                      f.minimize
504   "Maximize"            _x                      f.maximize
505   "Lower"               _L                      f.lower
506   "Workspace..."        _W                      f.workspace_presence
507   "All Workspaces"      _A                      f.occupy_all
508   "Remove Workspace"    _e                      f.remove
509   "Close"               _C      Alt<Key>F4      f.kill
510 }
511
512 Keys MyKeys
513 {
514   # Global
515   #Alt<Key>Menu                 root|icon|window        f.toggle_frontpanel 
516   Alt<Key>Tab                   root|icon|window        f.next_key
517   Alt Shift<Key>Tab             root|icon|window        f.prev_key
518   Alt<Key>Escape                root|icon|window        f.next_key
519   Alt Shift<Key>Escape          root|icon|window        f.prev_key
520   Alt<Key>Down                  root|icon|window        f.circle_down
521   Alt<Key>Up                    root|icon|window        f.circle_up
522   Alt<Key>Left                  root|icon|window        f.prev_workspace
523   Alt<Key>Right                 root|icon|window        f.next_workspace
524   Alt Ctrl Shift<Key>exclam     root|icon|window        f.set_behavior
525
526   # Root
527   <Key>SunAgain                 root|ifkey              f.pack_icons
528   <Key>SunProps                 root|ifkey              f.version
529   <Key>SunUndo                  root|ifkey              f.refresh
530   <Key>SunFront                 root|ifkey              f.circle_up
531   Shift<Key>SunFront            root|ifkey              f.circle_down
532   <Key>Down                     root                    f.circle_down
533   <Key>Up                       root                    f.circle_up
534   <Key>Right                    root                    f.next_workspace
535   <Key>Left                     root                    f.prev_workspace
536   #
537   <Key>SunAudioMute             root|icon|window|ifkey  f.exec /usr/dt/appconfig/sdtvolctl/muteVolume
538   <Key>SunAudioRaiseVolume      root|icon|window|ifkey  f.exec /usr/dt/appconfig/sdtvolctl/volumeUp
539   <Key>SunAudioLowerVolume      root|icon|window|ifkey  f.exec /usr/dt/appconfig/sdtvolctl/volumeDown
540   # Window/Icon
541   <Key>SunFront                 window|icon|ifkey       f.raise_lower
542   <Key>SunOpen                  window|ifkey            f.minimize
543   Shift<Key>Escape              window|icon             f.post_wmenu
544   Alt<Key>space                 window|icon             f.post_wmenu
545   Alt<Key>F6                    window                  f.next_key transient
546   Alt Shift<Key>F6              window                  f.prev_key transient
547   Alt<Key>F4                    window|icon|ifkey       f.kill
548   Alt<Key>SunProps              window|icon|ifkey       f.workspace_presence
549   Alt<Key>SunPaste              window|icon|ifkey       f.occupy_all
550   Alt<Key>SunCut                window|icon|ifkey       f.remove
551   Alt<Key>KP_Insert             window|icon             f.occupy_all
552   Alt<Key>Delete                window|icon             f.remove
553   Ctrl<Key>L2                   window|ifkey            f.next_cmap
554   Ctrl<Key>L4                   window|ifkey            f.prev_cmap
555   # Icon
556   <Key>SunOpen                  icon|ifkey              f.restore
557   Alt<Key>F4                    icon|ifkey              f.kill
558   <Key>SunProps                 icon|ifkey              f.workspace_presence
559   <Key>SunPaste                 icon|ifkey              f.occupy_all
560   <Key>SunCut                   icon|ifkey              f.remove
561   <Key>KP_Insert                icon|ifkey              f.occupy_all
562   <Key>Delete                   icon|ifkey              f.remove
563 }
564
565 Buttons MyButtons
566 {
567   <Btn1Down>            root                    f.menu Terminals
568   <Btn1Down>            window|frame|icon       f.raise
569   <Btn2Click>           root                    f.toggle_frontpanel
570   <Btn3Down>            root                    f.menu  DtRootMenu
571   <Btn3Down>            icon            f.post_wmenu
572   Shift<Btn1Click>      frame|icon              f.lower
573   <Btn1Click>           frame|icon|window       f.raise
574   <Btn1Click2>          frame                   f.maximize
575   <Btn1Click2>          icon                    f.restore
576   <Btn2Click>           frame|icon              f.raise_lower
577   <Btn3Down>            frame|icon              f.post_wmenu
578   Alt<Btn1Click>        frame|icon|window       f.raise
579   Alt<Btn1Click2>       frame|window            f.minimize
580   Alt<Btn1Click2>       icon                    f.restore
581   Alt<Btn2Click>        frame|icon              f.raise_lower
582   Alt<Btn1Down>         frame|icon|window       f.move
583   Alt<Btn3Down>         window                  f.minimize
584 }
585
586 Menu DefaultWindowMenu
587 {
588   "Restore"     _R      Alt<Key>F5      f.normalize
589   "Move"        _M      Alt<Key>F7      f.move
590   "Size"        _S      Alt<Key>F8      f.resize
591   "Minimize"    _n      Alt<Key>F9      f.minimize
592   "Maximize"    _x      Alt<Key>F10     f.maximize
593   "Lower"       _L      Alt<Key>F3      f.lower
594   "Close"       _C      Alt<Key>F4      f.kill
595 }
596 </pre></div>
597
598 <div class=code><pre>
599 #!/bin/perl
600 use strict;
601 use warnings;
602 use POSIX qw (setsid);
603
604 use FindBin;
605
606 my $sleep = 60 * 60;
607 my $home = $ENV{HOME};
608 my $xv = "/prj/Synopsis/gccsparcOS5/ccss/utils/xv/xv";
609
610 my @images = `ls $home/Images`;
611 chomp @images;
612
613 my $arch             = $^O =~ /MSWin/  ? "windows"   :
614                        $^O =~ /cygwin/ ? "cygwin"    : $^O;
615 my $null             = $^O =~ /MSWin/  ? "NUL"       : "/dev/null";
616
617 sub display_err ($;$$) {
618   my ($msg, $handle, $nolinefeed) = @_;
619
620   $handle = *STDERR if !defined $handle;
621
622   print $handle $msg;
623   print $handle "\n" if !defined $nolinefeed;
624 } # display_err
625
626 sub error ($;$$$) {
627   my ($msg, $errno, $handle, $nolinefeed) = @_;
628
629   if (!$errno) {
630     $msg = "$FindBin::Script ERROR: $msg";
631   } else {
632     $msg = "$FindBin::Script ERROR #$errno: $msg";
633   } # if
634
635   display_err $msg, $handle, $nolinefeed;
636
637   exit $errno if $errno;
638 } # error
639
640 sub EnterDaemonMode (;$$) {
641   my ($logfile, $errorlog) = @_;
642
643   if (!defined $logfile or $logfile eq '') {
644     $logfile = $null;
645   } # if
646
647   if (!defined $errorlog or $errorlog eq '') {
648     $errorlog = $null;
649   } # if
650
651   # Change the current directory to /
652   my $root = $arch eq "windows" ? "C:\\" : "/";
653   chdir $root
654     or error "Can't chdir to $root ($!), 1";
655
656   # Turn off umask
657   umask 0;
658
659   # Redirect STDIN to $null
660   open STDIN, $null
661     or error "Can't read $null ($!)", 1;
662
663   # Redirect STDOUT to logfile
664   open STDOUT, ">>$logfile"
665     or error "Can't write to $logfile ($!), 1";
666
667   # Redirect STDERR to errorlog
668   open STDERR, ">>$errorlog"
669     or error "Can't write to $errorlog ($!)", 1;
670
671   # Now fork the daemon
672   defined (my $pid = fork)
673     or error "Can't create daemon ($!)", 1;
674
675   # Now the parent exits
676   exit if $pid;
677
678   # Set process to be session leader
679   setsid ()
680     or error "Can't start a new session ($!)", 1;
681 } # EnterDaemonMode
682
683 sub SwitchWallPaper {
684   # We don't need to do anything here, just handle the interrupt and
685   # let the while loop continue.
686 } # SwitchWallPaper
687
688 $SIG{USR2} = \&SwitchWallPaper;
689  
690 EnterDaemonMode;
691
692 while () {
693   my $cmd = "$xv -root -maxpect -quit $home/Images/" . $images [int (rand $#images)];
694
695   `$cmd`;
696
697   sleep $sleep;
698 } # while
699 </pre></div>
700                            </div>
701                         </div>
702                         <p class="entry-footer">
703                            <span class="post-footers">Posted by  on July 10, 2007  4:17 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000649.html">Permalink</a>
704                         </p>
705                      </div>
706
707                      
708                      <div class="trackbacks">
709                         <h3 id="trackback" class="trackbacks-header">TrackBack</h3>
710                         <div id="trackbacks-info">
711                            <p>TrackBack URL for this entry:<br />http://defaria.com/mt/mt-tb.cgi/37</p>
712                         </div>
713                         <div class="trackbacks-content">
714                            
715                         </div>
716                      </div>
717                      
718
719                      
720                   </div>
721                </div>
722             </div>
723          </div>
724       </div>
725    </div>
726 </body>
727 </html>