home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 18821 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.3 KB

  1. Path: sparky!uunet!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
  2. From: anthony@kurango.cit.gu.edu.au (Anthony Thyssen)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: X client that just sits and waits?
  5. Message-ID: <1992Dec22.040929.6025@sm.sony.co.jp>
  6. Date: 22 Dec 92 04:09:29 GMT
  7. Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
  8. Distribution: fj
  9. Organization: Griffith University.
  10. Lines: 48
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: Tue, 22 Dec 1992 01:58:05 GMT
  14. Message-Id: <Bzn1Gu.47t@kurango.cit.gu.edu.au>
  15. Newsgroups: comp.windows.x
  16. References: <1992Dec9.104532.24382@fwi.uva.nl>, <1992Dec12.032847.12529@aw2.fsl.ca.boeing.com>, <RJC.92Dec16042118@daiches.cogsci.ed.ac.uk>
  17. Sender: xpert-request@expo.lcs.mit.edu
  18.  
  19. rjc@cogsci.ed.ac.uk (Richard Caley) writes:
  20. | wijkstra@fwi.uva.nl (Marcel Wijkstra (AIO)) writes:
  21. | mw> I am looking for a very simple (X) program: one that just waits
  22. | mw> forever (until it gets killed). [to put at the end of .xinitrc.
  23. |
  24. | Try xlogout. It just opens a window which is a button to push, when it
  25. | is pushed xlogout exits. You can then have a logout button somewhere
  26. | on your screen.
  27.  
  28. I tried xlogout for a while but wanted a confirmation of the logout.
  29. So I rolled my own using xmessage.
  30.  
  31. --------------8<-----------CUT HERE--------------8<---------------
  32. #!/bin/sh -
  33. #
  34. #  This uses the xmessage program to create a Xlogout type button
  35. #
  36. exit=
  37. while [ ! "$exit" ]; do
  38.   xmessage -name xlogout -title xlogout "$@" \
  39.         -buttons "" -xrm '*message.borderWidth: 0' \
  40.         -xrm '*Translations: #override <BtnDown>: exit(0)' \
  41.         -xrm '*Font: -*-new cent*-bold-r-normal--24-*' \
  42.         'Logout'
  43.   [ $? -ne 0 ] && exit=true
  44.   if [ "$exit" != 'Logout' ]; then
  45.     xmessage -name xlogout -title xlogout "$@" \
  46.         -buttons 'Cancel:0,Logout:1' -xrm '*message.borderWidth: 0' \
  47.         -xrm '*Font: -*-new cent*-bold-r-normal--18-*' \
  48.         'Are You Sure?'
  49.     [ $? -ne 0 ] && exit=true
  50.   fi
  51. done
  52.  
  53. --------------8<-----------CUT HERE--------------8<---------------
  54.  
  55.  
  56.   Anthony Thyssen - (SysProg @ Griffith University)     anthony@cit.gu.edu.au
  57. ------------------------------------------------------------------------------
  58.        "[A computer is] like an Old Testament god,
  59.             with a lot of rules and no mercy."   ---  Joseph Campbell
  60. ------------------------------------------------------------------------------
  61.