logout_gui 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/sh
  2. export TEXTDOMAIN=logout_gui
  3. JWM=`ps -A|grep jwm`
  4. if [ "$JWM" ];then
  5. WM_IS_JWM='
  6. <hbox spacing="10" homogeneous="true" space-expand="true" space-fill="true">
  7. <button image-position="2">
  8. <label>'$(gettext 'Restart window manager')'</label>
  9. '"`/usr/lib/gtkdialog/xml_button-icon wm_restart.svg huge`"'
  10. <action>exit:restartjwm</action>
  11. </button>
  12. <button image-position="2">
  13. <label>'$(gettext 'Rebuild Menu')'</label>
  14. '"`/usr/lib/gtkdialog/xml_button-icon menu.svg huge`"'
  15. <action>exit:refreshjwm</action>
  16. </button>
  17. </hbox>'
  18. MSG_JWM="$(gettext "Active window manager"): <b>JWM</b>"
  19. fi
  20. X_SERVER=`type X|awk '{print $3}'`
  21. X=`readlink $X_SERVER`
  22. MSG_X="$(gettext "Active graphical server"): <b>$X</b>"
  23. export logout='
  24. <window title="'$(gettext 'Puppy Log Out')'" icon-name="gtk-preferences" window-position="1">
  25. <vbox space-expand="true" space-fill="true">
  26. '"`/usr/lib/gtkdialog/xml_info fixed puppy_config.svg 60 "$MSG_JWM" "$MSG_X"`"'
  27. <vbox spacing="10" space-expand="true" space-fill="true">
  28. <frame>
  29. <hbox spacing="10" homogeneous="true" space-expand="true" space-fill="true">
  30. <button image-position="2">
  31. <label>'$(gettext 'Reboot')'</label>
  32. '"`/usr/lib/gtkdialog/xml_button-icon reboot.svg huge`"'
  33. <action>exit:reboot</action>
  34. </button>
  35. <button image-position="2">
  36. <label>'$(gettext 'Shut Down')'</label>
  37. '"`/usr/lib/gtkdialog/xml_button-icon shutdown.svg huge`"'
  38. <action>exit:poweroff</action>
  39. </button>
  40. </hbox>
  41. <hbox spacing="10" homogeneous="true" space-expand="true" space-fill="true">
  42. <button image-position="2">
  43. <label>'$(gettext 'Restart graphical server')'</label>
  44. '"`/usr/lib/gtkdialog/xml_button-icon graphics_restart.svg huge`"'
  45. <action>exit:restartx</action>
  46. </button>
  47. <button image-position="2">
  48. <label>'$(gettext 'Exit to Prompt')'</label>
  49. '"`/usr/lib/gtkdialog/xml_button-icon terminal.svg huge`"'
  50. <action>exit:logout</action>
  51. </button>
  52. </hbox>
  53. '"$WM_IS_JWM"'
  54. </frame>
  55. </vbox>
  56. </vbox>
  57. </window>'
  58. . /usr/lib/gtkdialog/xml_info gtk > /dev/null #build bg_pixmap for gtk-theme
  59. eval `gtkdialog -p logout`
  60. case $EXIT in
  61. logout)exec wmexit ;;
  62. reboot)exec wmreboot ;;
  63. poweroff)exec wmpoweroff ;;
  64. restartx)restartwm ;;
  65. restartjwm)jwm -restart ;;
  66. refreshjwm)fixmenus; jwm -reload ;;
  67. *)exit ;;
  68. esac