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">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Movable Type 5.2.3" />
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" />
12 <title>Status for Andrew DeFaria: Removed views/documented customizing Unix environments</title>
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" />
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/">
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..."
30 dc:date="2007-07-10T16:17:52-06:00" />
37 <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
39 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
41 <div id="container-inner" class="pkg">
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>
51 <div id="pagebody-inner" class="pkg">
53 <div id="alpha-inner" class="pkg">
55 <p class="content-nav">
56 <a href="http://defaria.com/blogs/Status/archives/000648.html">« 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 »</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">
67 <li>Worked with Tom and Bryce to remove views from p57707</li>
69 <li>Wrote a document describing how to customize your Unix CDE environment</li>
72 <div id="more" class="entry-more">
73 <h3>Removing views with pending deliveries</h3>
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>
77 <h3>Tips on Personalizing your Unix/CDE environment</h3>
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>
81 <h3>Get control of your X Resources</h3>
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>
86 $ xrdb -q > ~/.Xresources
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>
91 <h3>To find if a resource is set</h3>
93 <p>You can see if a resource is set by using the following:</p>
96 $ xrdb -q | grep -i <<i>resource string</i>>
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: <<i>color</i>>" 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>
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>
103 <h3>Using Xresource Classes</h3>
105 <p>Rather than start Xterms (or dtterms) with:</p>
107 <div class=code><pre>
108 $ xterm -fg white -bg black -sl 5000 -cr green \
109 > -sb -e rsh <other machine>
110 $ xterm -fg yellow -bg blue -sl 5000 -sb -e rsh <other machine>
113 <p>thus having long lists of options, classify your resources such as:</p>
115 <div class=code><pre>
116 XServer*background: Black
117 XServer*foreground: Green
118 XServer*colorBD: Yellow
120 XServer*cursorColor: Yellow
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>
125 <div class=code><pre>
126 XTerm*saveLines: 5000
127 XTerm*scrollbar: True
130 <h3>Setting Meta (or the Diamond key) to be Emacs mode Meta key</h3>
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>
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>
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>
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>
153 <div class=code><pre>
154 Xterm*eightBitInput: True
159 <div class=code><pre>
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 => Meta. However ksh is not the only shell that this is useful for. It is also useful for tcsh and bash, for example.</p>
165 <h3>Taking Control of your Buttons and Keybindings</h3>
167 <p>The following:</p>
169 <div class=code><pre>
170 Dtwm*keyBindings: MyKeys
171 Dtwm*buttonBindings: MyButtons
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>
176 <p>You're dtwmrc can be very complicated. See dtwmrc(1) for more info. Here are MyButtons:</p>
178 <div class=code><pre>
181 <Btn1Down> root f.menu Terminals
182 <Btn1Down> window|frame|icon f.raise
183 <Btn2Click> root f.toggle_frontpanel
184 <Btn3Down> root f.menu DtRootMenu
185 <Btn3Down> icon f.post_wmenu
186 Shift<Btn1Click> frame|icon f.lower
187 <Btn1Click> frame|icon|window f.raise
188 <Btn1Click2> frame f.maximize
189 <Btn1Click2> icon f.restore
190 <Btn2Click> frame|icon f.raise_lower
191 <Btn3Down> frame|icon f.post_wmenu
192 Alt<Btn1Click> frame|icon|window f.raise
193 Alt<Btn1Click2> frame|window f.minimize
194 Alt<Btn1Click2> icon f.restore
195 Alt<Btn2Click> frame|icon f.raise_lower
196 Alt<Btn1Down> frame|icon|window f.move
197 Alt<Btn3Down> window f.minimize
201 <p>Many of these are taking from the defaults. Here are some of the changes I made:</p>
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>
208 <h3>Changing your desktop background</h3>
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>
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>
215 <p>Oh and if you wish feel free to:</p>
217 <div class=code><pre>
219 $ cp ~p6238c/Images ~/Images
224 <div class=code><pre>
225 $ ln -s ~p6258c/Images ~/Images
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*-*-*-*-*-*-*-*-*
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
271 *foreground: #000000000000
272 *labelFontList: -dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-*-*:
275 *promptDialog.bboard.frame.form.text.columns: 45
277 *scrollBar_right: True
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
298 Dtwm*showSwitchArea: True
299 Dtwm*syncDesktopSwitch: False
300 Dtwm*useSameBackdrop: True
301 Dtwm.keyboardFocusPolicy: pointer
304 Dtwm*keyBindings: MyKeys
305 Dtwm*buttonBindings: MyButtons
308 Rxvt*font: "Lucida Console-*-16"
309 Rxvt*font1: "Lucida Console-*-18"
310 Rxvt*font2: "Lucida Console-*-20"
312 Rxvt*scrollBar_right: True
314 Rxvt*loginShell: True
315 Rxvt*background: SteelBlue
316 Rxvt*foreground: White
319 Rxvt*cursorColor: Red
322 Jupiter*background: MidNightBlue
323 Jupiter*foreground: White
326 Jupiter*cursorColor: Yellow
329 Starbase*background: MediumVioletRed
330 Starbase*foreground: White
331 Starbase*colorBD: Yellow
332 Starbase*colorUL: Red
333 Starbase*cursorColor: Yellow
336 Tiburon*background: Black
337 Tiburon*foreground: Magenta
338 Tiburon*colorBD: Yellow
340 Tiburon*cursorColor: Green
342 Pacifica*background: ForestGreen
343 Pacifica*foreground: White
344 Pacifica*colorBD: Red
345 Pacifica*colorUL: Red
346 Pacifica*cursorColor: Red
348 plebld01*background: Black
349 plebld01*foreground: Yellow
350 plebld01*colorBD: Yellow
351 plebld01*colorUL: Red
352 plebld01*cursorColor: Yellow
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
360 XServer*background: Black
361 XServer*foreground: Green
362 XServer*colorBD: Yellow
364 XServer*cursorColor: Yellow
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
377 XTerm*cursorColor: Yellow
378 XTerm*eightBitInput: False
381 Emacs*Background: Gray
382 Emacs*Font: -*-Lucida Sans Typewriter-medium-r-*-*-*-*-*-*-*-*-*
388 <div class=code><pre>
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
407 "Local X Term" f.action Xterm
408 "Remote X Term" f.action XtermRlogin
410 "Local DT Term" f.action Dtterm
411 "Remote DT Term" f.action DttermRlogin
418 "Arrange Icons" f.pack_icons
420 "Update" f.action UpdateWorkspaceMenu
421 "Kill" f.exec /usr/openwin/bin/xkill
424 Menu ApplicationsMenu
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
443 "File Manager" f.action Dtfile
444 "Find File" f.action SDtFind
445 "Properties..." f.action FileProperties
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
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
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
486 "Shuffle Up" f.circle_up
487 "Shuffle Down" f.circle_down
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
500 "Restore" _R f.normalize
503 "Minimize" _n f.minimize
504 "Maximize" _x f.maximize
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
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
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
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
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
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
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
586 Menu DefaultWindowMenu
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
598 <div class=code><pre>
602 use POSIX qw (setsid);
607 my $home = $ENV{HOME};
608 my $xv = "/prj/Synopsis/gccsparcOS5/ccss/utils/xv/xv";
610 my @images = `ls $home/Images`;
613 my $arch = $^O =~ /MSWin/ ? "windows" :
614 $^O =~ /cygwin/ ? "cygwin" : $^O;
615 my $null = $^O =~ /MSWin/ ? "NUL" : "/dev/null";
617 sub display_err ($;$$) {
618 my ($msg, $handle, $nolinefeed) = @_;
620 $handle = *STDERR if !defined $handle;
623 print $handle "\n" if !defined $nolinefeed;
627 my ($msg, $errno, $handle, $nolinefeed) = @_;
630 $msg = "$FindBin::Script ERROR: $msg";
632 $msg = "$FindBin::Script ERROR #$errno: $msg";
635 display_err $msg, $handle, $nolinefeed;
637 exit $errno if $errno;
640 sub EnterDaemonMode (;$$) {
641 my ($logfile, $errorlog) = @_;
643 if (!defined $logfile or $logfile eq '') {
647 if (!defined $errorlog or $errorlog eq '') {
651 # Change the current directory to /
652 my $root = $arch eq "windows" ? "C:\\" : "/";
654 or error "Can't chdir to $root ($!), 1";
659 # Redirect STDIN to $null
661 or error "Can't read $null ($!)", 1;
663 # Redirect STDOUT to logfile
664 open STDOUT, ">>$logfile"
665 or error "Can't write to $logfile ($!), 1";
667 # Redirect STDERR to errorlog
668 open STDERR, ">>$errorlog"
669 or error "Can't write to $errorlog ($!)", 1;
671 # Now fork the daemon
672 defined (my $pid = fork)
673 or error "Can't create daemon ($!)", 1;
675 # Now the parent exits
678 # Set process to be session leader
680 or error "Can't start a new session ($!)", 1;
683 sub SwitchWallPaper {
684 # We don't need to do anything here, just handle the interrupt and
685 # let the while loop continue.
688 $SIG{USR2} = \&SwitchWallPaper;
693 my $cmd = "$xv -root -maxpect -quit $home/Images/" . $images [int (rand $#images)];
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>
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>
713 <div class="trackbacks-content">