techmik

x-gdm

Jun 30th, 2011
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Copyright (C) 2004-2007 Centro de Computacao Cientifica e Software Livre
  4. # Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License
  8. # as published by the Free Software Foundation; either version 2
  9. # of the License, or (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  19. # USA.
  20.  
  21. # This is my attempted file for the mdm mode x-gdm
  22.  
  23. function display_manager_init () {
  24. # This function should stop running processes, remove logs, links, locks, or
  25. # anything your display manager might need.
  26. # Consider calling display_manager_stop here if you don't need anything
  27. # else.
  28.  
  29. # No problem if it's already running...
  30. display_manager_stop
  31.  
  32. }
  33.  
  34. function display_manager_start_monoseat () {
  35. # This function is called when the computer has only 1 video card.
  36. # You should open only 1 xserver and that's it: normal usage, not multiseat
  37. # Do NOT configure devices or stuff like that
  38. # We assume $DISPLAY is already set here.
  39.  
  40. $GDMDYNAMIC -a 0=XHandled
  41. $GDMDYNAMIC -r 0
  42.  
  43. echo "Exiting (gdm will handle the X server for us)."
  44. return 0
  45. }
  46.  
  47. function display_manager_start_underneath_xserver () {
  48. # In case we're using nested xservers (like Xephyr), we'll need to start an
  49. # xserver to run the nested servers on top of it
  50. # Don't put login screen on this server!
  51. # We assume $DISPLAY is already set here.
  52.  
  53. $GDMDYNAMIC -a 0=XNotHandled
  54. $GDMDYNAMIC -r 0
  55. # XXX: find a better way to wait for X to start
  56. sleep 5
  57.  
  58. return 0
  59. }
  60.  
  61. function display_manager_start_seat () {
  62. # This is where we start the xserver that will have a login screen
  63. # In case of multiseat with Xephyr, this function starts the Xephyrs and
  64. # puts the login screens on them.
  65. # We assume $DISPLAY is already set here.
  66. # This function is called by mdm-start-seat, which gives you variables:
  67. # - $KEYBOARD and $MOUSE, which point to evdev device nodes.
  68. # - $SEAT_DISPLAY variable corresponds to the number that the user will
  69. # have to press on the keyboard. Might be useful here.
  70. # - $MY_SCREEN_SIZE for the size of screen (needed when running nested
  71. # xservers)
  72. # - $MY_XKB_LAYOUT and $MY_XKB_MODEL, for the keyboard associated with the
  73. # seat
  74. }
  75.  
  76. function display_manager_stop () {
  77. # This function should kill everything it has to kill, so that we REALLY
  78. # stop all the seats, kill all the Xephyrs, remove locks, links and stuff
  79. # like that.
  80.  
  81. if [ -e "$GDM_SOCKET" ]; then
  82. SERVERS=($(gdmdynamic -l | tr ';' '\n'| cut -d':' -f2 | cut -d',' -f1))
  83. for i in ${SERVERS[@]}; do
  84. $GDMDYNAMIC -d $i
  85. done
  86. fi
  87. }
Advertisement
Add Comment
Please, Sign In to add comment