Advertisement
Guest User

Untitled

a guest
Feb 5th, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. # /etc/X11/xinit/xinitrc.common
  2. #
  3. # Common code used in X session and X init scripts.
  4. # File shall be sourced but not executed by the scripts.
  5. #
  6.  
  7. #
  8. # Source this file only once
  9. #
  10. test "$XSESSION_IS_UP" != "yes" || return
  11. XSESSION_IS_UP=yes
  12. export XSESSION_IS_UP
  13.  
  14. #
  15. # Some common user and system files,
  16. #
  17. XETCDIR=/etc/X11
  18. xdefaults=$HOME/.Xdefaults
  19. xresources=$HOME/.Xresources
  20. xmodmap=$HOME/.Xmodmap
  21. xkbmap=$HOME/.Xkbmap
  22.  
  23. #
  24. # This should be the default
  25. #
  26. TERM=xterm
  27. export TERM
  28.  
  29. #
  30. # Check for X11R6 in execution path
  31. #
  32. case ":${PATH}:" in
  33. *:/usr/X11R6/bin:*) ;;
  34. *) PATH="${PATH}:/usr/X11R6/bin"
  35. esac
  36.  
  37. #
  38. # Choose a window manager
  39. #
  40. test -n "$WINDOWMANAGER" && WINDOWMANAGER="$(type -p $WINDOWMANAGER 2>/dev/null)"
  41. if test -z "$WINDOWMANAGER" ; then
  42. if test -x /usr/X11R6/bin/kde -o -x /usr/bin/kde; then
  43. WINDOWMANAGER=$(type -p kde)
  44. elif test -x /usr/X11R6/bin/startkde -o -x /usr/bin/startkde; then
  45. WINDOWMANAGER=$(type -p startkde)
  46. elif test -x /usr/X11R6/bin/fvwm2 -o -x /usr/bin/fvwm2; then
  47. WINDOWMANAGER=$(type -p fvwm2)
  48. elif test -x /usr/X11R6/bin/wmlist -o -x /usr/bin/wmlist ; then
  49. for i in $($(type -p wmlist)) ; do
  50. WINDOWMANAGER="$(type -p $i 2>/dev/null)"
  51. test -n "$WINDOWMANAGER" && break
  52. done
  53. fi
  54. fi
  55.  
  56. #
  57. # Error, no Window Manager found. Normally the exit
  58. # raise the fallback trap of the sourcing script.
  59. #
  60. if test -z "$WINDOWMANAGER" ; then
  61. if test -t 1 ; then
  62. echo "Error: Unable to find a window manager. Please make sure you installed one!"
  63. echo "Exiting..."
  64. fi
  65. xmessage -timeout 10 -default okay -center -file - <<-EOF
  66. Error: Unable to find a window manager. Please make sure you installed one!
  67. Exiting...
  68. EOF
  69. exit 1
  70. fi
  71.  
  72. #
  73. # Foreign X session scripts may use an other variable name
  74. #
  75. WINDOW_MANAGER=$WINDOWMANAGER
  76. STARTUP=$WINDOWMANAGER
  77. export WINDOWMANAGER WINDOW_MANAGER STARTUP
  78.  
  79. #
  80. # Start the XIM server
  81. #
  82. XIMFILE=/etc/X11/xim
  83. test -r $HOME/.xim && XIMFILE=$HOME/.xim
  84. test -r $XIMFILE && source $XIMFILE
  85.  
  86. #
  87. # Enable Numlock if set
  88. #
  89. if test -r /var/run/numlock-on && type -p numlockx > /dev/null ; then
  90. numlockx
  91. fi
  92.  
  93. #
  94. # Load nvidia settings
  95. #
  96. if test -r $HOME/.nvidia-settings-rc && type -p nvidia-settings > /dev/null ; then
  97. nvidia-settings --load-config-only > /dev/null 2>&1 &
  98. fi
  99.  
  100. #
  101. # Handle the the users Xmodmap or Xkbmap.
  102. # Note that xkb and xmodmap should not be mixed.
  103. #
  104. if test -s $XETCDIR/Xkbmap ; then
  105. test -r "$xkbmap" && cat "$xkbmap" | setxkbmap
  106. else
  107. test -r "$xmodmap" && xmodmap "$xmodmap"
  108. fi
  109.  
  110. #
  111. # Handle the system and the users Xresources
  112. #
  113. if test -r "$xdefaults" ; then
  114. if test -r $XETCDIR/Xresources ; then
  115. xrdb -nocpp -load -retain $XETCDIR/Xresources
  116. xrdb -I$HOME -merge "$xdefaults"
  117. else
  118. xrdb -I$HOME -load -retain "$xdefaults"
  119. fi
  120. if test -r "$xresources" ; then
  121. xrdb -I$HOME -merge "$xresources"
  122. fi
  123. elif test -r "$xresources" ; then
  124. if test -r $XETCDIR/Xresources ; then
  125. xrdb -nocpp -load -retain $XETCDIR/Xresources
  126. xrdb -I$HOME -merge "$xresources"
  127. else
  128. xrdb -I$HOME -load -retain "$xresources"
  129. fi
  130. elif test -r $XETCDIR/Xresources ; then
  131. xrdb -nocpp -load -retain $XETCDIR/Xresources
  132. fi
  133.  
  134. #
  135. # Disable new Xcursor themes if none is specified resp. located
  136. # in $HOME (use "unset XCURSOR_CORE" to enable them again later)
  137. #
  138. #if test -z "$XCURSOR_THEME" -a ! -d $HOME/.icons ; then
  139. # XCURSOR_CORE=true
  140. # export XCURSOR_CORE
  141. #else
  142. # unset XCURSOR_CORE
  143. #fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement