home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / 3b1 / volume02 / wuser / part01 < prev    next >
Encoding:
Internet Message Format  |  1992-11-26  |  3.2 KB

  1. Path: comp-sources-3b1
  2. From: bruce%blilly@broadcast.sony.com (Bruce Lilly)
  3. Subject:  v02i031:  wuser - Set Window Manager User Line, Part01/01
  4. Newsgroups: comp.sources.3b1
  5. Approved: dave@galaxia.network23.com
  6. X-Checksum-Snefru: 5c7ffc22 5ee39e4d c22f893e c3584a8a
  7.  
  8. Submitted-by: bruce%blilly@broadcast.sony.com (Bruce Lilly)
  9. Posting-number: Volume 2, Issue 31
  10. Archive-name: wuser/part01
  11.  
  12. >
  13. >This seems like a good time to go off on a tangent:  does anybody out
  14. >there know how to set the name in the window menu to something other
  15. >than "Unknown Process"?  I've been able to set up different entries in
  16. >my main Office menu that all make shells, but I can't get them to have
  17. >different names in the window menu (which is what I really want).
  18. >Any help would be appreciated (although paging quickly through the 
  19. >windows might be better...)
  20.  
  21. Easy: (usage is wuser "some string to use", which sets the name
  22. for the window from which wuser was invoked)
  23.  
  24. #! /bin/sh
  25. # This is a shell archive.  Remove anything before this line, then unpack
  26. # it by saving it into a file and typing "sh file".  To overwrite existing
  27. # files, type "sh file -c".  You can also feed this as standard input via
  28. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  29. # will see the following message at the end:
  30. #        "End of shell archive."
  31. # Contents:  makefile wuser.c
  32. # Wrapped by bruce@blilly on Thu Nov 19 18:24:25 1992
  33. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  34. if test -f 'makefile' -a "${1}" != "-c" ; then 
  35.   echo shar: Will not clobber existing file \"'makefile'\"
  36. else
  37. echo shar: Extracting \"'makefile'\" \(217 characters\)
  38. sed "s/^X//" >'makefile' <<'END_OF_FILE'
  39. XCC = gcc -fpcc-struct-return -fstrength-reduce -fcombine-regs -Wall -g
  40. XCFLAGS = -O
  41. XLDFLAGS = -s
  42. XSTARTOFF = /lib/crt0s.o
  43. XSHAREDLIB = /lib/shlib.ifile
  44. X
  45. Xwuser:    wuser.o
  46. X    $(LD) $(LDFLAGS) -o $@ $(STARTOFF) $? $(SHAREDLIB)
  47. END_OF_FILE
  48. if test 217 -ne `wc -c <'makefile'`; then
  49.     echo shar: \"'makefile'\" unpacked with wrong size!
  50. fi
  51. # end of 'makefile'
  52. fi
  53. if test -f 'wuser.c' -a "${1}" != "-c" ; then 
  54.   echo shar: Will not clobber existing file \"'wuser.c'\"
  55. else
  56. echo shar: Extracting \"'wuser.c'\" \(526 characters\)
  57. sed "s/^X//" >'wuser.c' <<'END_OF_FILE'
  58. X/*
  59. X    @(#)wuser.c    1.2    11/19/92    18:22:43
  60. X * wuser - revise window's user line (displayed by wmgr)
  61. X*/
  62. X
  63. X#ifndef lint
  64. X    static    char    sccsid[] = "@(#)wuser.c    1.2";
  65. X#ifdef    __GNUC__
  66. X    static char compiled[] = "@(#)compiled by gcc version "__VERSION__;
  67. X#endif
  68. X#endif
  69. X
  70. X#include    <tam.h>
  71. X#undef    erase
  72. X#include    <fcntl.h>
  73. X#include    <stdio.h>
  74. X
  75. Xmain(argc, argv)
  76. Xint    argc;
  77. Xchar    **argv;
  78. X{
  79. X    if (argc != 2)
  80. X        exit(1);
  81. X    fclose(stdout);
  82. X    if (open("/dev/window", O_RDWR) == -1)
  83. X        perror("open of /dev/window");
  84. X    winit();
  85. X    wuser(0, argv[1]);
  86. X    wexit(0);
  87. X}
  88. END_OF_FILE
  89. if test 526 -ne `wc -c <'wuser.c'`; then
  90.     echo shar: \"'wuser.c'\" unpacked with wrong size!
  91. fi
  92. # end of 'wuser.c'
  93. fi
  94. echo shar: End of shell archive.
  95. exit 0
  96.  
  97. -- 
  98.     Bruce Lilly        blilly!bruce@Broadcast.Sony.COM
  99.                     ...uunet!sonyusa!sonyd1!blilly!bruce
  100.  
  101. -- 
  102. David H. Brierley
  103. Home: dave@galaxia.network23.com; Work: dhb@quahog.ssd.ray.com
  104. Send comp.sources.3b1 submissions to comp-sources-3b1@galaxia.network23.com
  105. %% Can I be excused, my brain is full. **
  106.