p.mon 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/sh
  2. #%Module
  3. #% description: To establish and control use of a graphics display monitor.
  4. #% keywords: display
  5. #%End
  6. #%Flag
  7. #% key: l
  8. #% description: List all monitors
  9. #%End
  10. #%Flag
  11. #% key: L
  12. #% description: List all monitors (with current status)
  13. #%End
  14. #%Flag
  15. #% key: p
  16. #% description: Print name of currently selected monitor
  17. #%End
  18. #%Flag
  19. #% key: r
  20. #% description: Release currently selected monitor
  21. #%End
  22. #%Flag
  23. #% key: s
  24. #% description: Do not automatically select when starting
  25. #%End
  26. #%Option
  27. #% key: start
  28. #% type: string
  29. #% required: no
  30. #% multiple: no
  31. #% description: Name of graphics monitor to start (p0-p9)
  32. #%End
  33. #%Option
  34. #% key: stop
  35. #% type: string
  36. #% required: no
  37. #% multiple: no
  38. #% description: Name of graphics monitor to stop
  39. #%End
  40. #%Option
  41. #% key: select
  42. #% type: string
  43. #% required: no
  44. #% multiple: no
  45. #% description: Name of graphics monitor to select
  46. #%End
  47. #%Option
  48. #% key: unlock
  49. #% type: string
  50. #% required: no
  51. #% multiple: no
  52. #% description: Name of graphics monitor to unlock
  53. #%End
  54. if [ -z "$GISBASE" ] ; then
  55. echo "You must be in GRASS GIS to run this program." 1>&2
  56. exit 1
  57. fi
  58. if [ "$1" != "@ARGS_PARSED@" ] ; then
  59. exec g.parser "$0" "$@"
  60. fi
  61. # CODE GOES HERE
  62. if [ -z "$PYTHONPATH" ] ; then
  63. PYTHONPATH="$GISBASE/etc/wxpython"
  64. else
  65. PYTHONPATH="$GISBASE/etc/wxpython:$PYTHONPATH"
  66. fi
  67. export PYTHONPATH
  68. start="$GIS_OPT_START"
  69. select="$GIS_OPT_SELECT"
  70. stop="$GIS_OPT_STOP"
  71. unlock="$GIS_OPT_UNLOCK"
  72. # create the command file
  73. command_file="`g.tempfile pid=$$`"
  74. g.gisenv set="GRASS_PYCMDFILE=${command_file}"
  75. if [ -n "$start" ] ; then
  76. "$GRASS_PYTHON" "$GISBASE/etc/wxpython/gui_modules/mapdisp.py" "$start" "${command_file}" &
  77. fi
  78. if [[ -n "$stop" || -n "$select" || -n "$unlock" ]] ; then
  79. g.message -w "Not implemented yet"
  80. fi
  81. exit 0