.xinitrc 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. #!/bin/sh
  2. # $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $
  3. #120718 redesign for startup on slow computers. see also /sbin/pup_event_frontend_d and delayedrun.
  4. #130202 xrandr set vert freq. see also /usr/sbin/quicksetup.
  5. #130212 removed glipper code, see latest glipper pet.
  6. #130525 old pc celeron 2ghz cpu, 256mb ram, CPUSPEED=1999, 1st bootup rox failed to start. try experiment.
  7. . /etc/rc.d/PUPSTATE
  8. #v4.01 BK daemon to handle kernel uevents...
  9. /sbin/clean_desk_icons #v4.02 tidy up drive icons first.
  10. #/sbin/pup_event_frontend_d &
  11. #130525 ...start this further down.
  12. #w482 reshape background image if widescreen...
  13. #120708 need to reshape for PUPMODE=2 also...
  14. #[ $PUPMODE -eq 5 ] && /usr/sbin/background_reshape
  15. NEEDRESHAPE='yes'
  16. [ -f /usr/share/backgrounds_original/ORIGINAL-default.jpg ] && NEEDRESHAPE='no'
  17. [ -f /usr/share/backgrounds_original/ORIGINAL-default.png ] && NEEDRESHAPE='no'
  18. [ "$NEEDRESHAPE" = "yes" ] && /usr/sbin/background_reshape
  19. userresources=$HOME/.Xresources
  20. usermodmap=$HOME/.Xmodmap
  21. sysresources=/usr/lib/X11/xinit/Xresources
  22. sysmodmap=/usr/lib/X11/xinit/.Xmodmap
  23. # merge in defaults and keymaps
  24. if [ -f $sysresources ]; then
  25. xrdb -merge -nocpp $sysresources
  26. fi
  27. if [ -f $sysmodmap ]; then
  28. xmodmap $sysmodmap
  29. fi
  30. if [ -f $userresources ]; then
  31. xrdb -merge -nocpp $userresources
  32. fi
  33. if [ -f $usermodmap ]; then
  34. xmodmap $usermodmap
  35. fi
  36. CURRENTWM="`cat /etc/windowmanager`"
  37. if [ "$CURRENTWM" = "startkde" ];then
  38. /sbin/pup_event_frontend_d & #130525
  39. exec startkde
  40. fi
  41. #100501 if full nvidia pkg installed, it has a gui config app...
  42. [ -f /root/.nvidia-settings-rc ] && nvidia-settings --load-config-only
  43. [ -f $HOME/.xgamma-gamma ] && /bin/sh $HOME/.xgamma-gamma #100215 see /usr/sbin/xgamma-gui.
  44. #0.9.8 sync selection-buffer and clipboard. only useful for older apps
  45. #such as rxvt that use the selection-buffer...
  46. [ -f /usr/bin/autocutsel ] && /usr/bin/autocutsel &
  47. #...disadvantage of this is it creates a little square bottom-right of screen.
  48. if [ -e /tmp/videomode ];then #xvesa only: testing a video mode
  49. video-wizard &
  50. fi
  51. [ -f /usr/local/bin/agenda_chk ] && agenda_chk &
  52. #v1.0.7 set by xrandrshell, part of xorg wizard... v3.99...
  53. if [ -f /etc/xrandrindex ];then
  54. #v3.99 workround for dual monitors, 'head -n 1'....
  55. XRANDRDEFAULT="$(xrandr -q | grep '\*' | tr -s ' ' | grep '^ [0-9]' | cut -f 2,3 -d ' ' | cut -f 1 -d '*' | tr ' ' '@' | head -n 1)" #130202 return 1024x768@60.0
  56. XRANDRINDEX="`cat /etc/xrandrindex`" #v3.99 XRANDRINDEX now is XxY resolution. #130202 now vertxhoriz@freq (refer quicksetup).
  57. #but do not switch if default is already this resolution....
  58. if [ "$XRANDRINDEX" = "$XRANDRDEFAULT" ];then
  59. rm -f /etc/xrandrindex
  60. else
  61. echo "$XRANDRINDEX"|grep -q "@"
  62. case $? in
  63. 1)NEW_XY="$XRANDRINDEX"
  64. xrandr -s $NEW_XY #131124 (see quicksetup)
  65. ;;
  66. *)NEW_XY="$(echo -n "$XRANDRINDEX" | cut -f 1 -d '@')" #130202
  67. NEW_VFREQ="$(echo -n "$XRANDRINDEX" | cut -f 2 -d '@')" #130202
  68. xrandr -s $NEW_XY -r $NEW_VFREQ #130202
  69. ;;
  70. esac
  71. fi
  72. fi
  73. if [ -f /root/.xset.sh ];then
  74. #this is created by /usr/bin/pupx...
  75. eval "/root/.xset.sh"
  76. else
  77. ##Xorg has it's own fontpath settings in /etc/X11/xorg.conf...
  78. #if [ "`readlink /usr/bin/X`" != "Xorg" ];then
  79. # #xset fp+ /usr/lib/X11/fonts/Type1/
  80. # #xset fp+ /usr/lib/X11/fonts/TTF/
  81. # xset fp+ /usr/share/fonts/default/Type1/
  82. # xset fp+ /usr/share/fonts/default/TTF/
  83. #fi
  84. xset s 600 600 s blank
  85. fi
  86. #v1.0.7 also see /etc/rc.d/rc.local0
  87. if [ -f /root/.fonts/fonts.dir ];then
  88. xset fp+ /root/.fonts/
  89. fi
  90. [ -f /usr/bin/xsetroot ] && xsetroot -cursor_name top_left_arrow
  91. #v555 w003
  92. #[ -f /usr/bin/xfce-mcs-manager ] && xfce-mcs-manager
  93. #[ "$CURRENTWM" = "xfwm4" ] && xfce-mcs-manager
  94. #...no need to start it here, fvwm4 below will start it automatically.
  95. #relocates right-side icons to actual right-side of screen...
  96. /usr/sbin/fixPuppyPin /root/Choices/ROX-Filer/PuppyPin #v1.0.7
  97. #w468 on old PCs rox sometimes does not start, see further down...
  98. #120718 raspi sometimes need extra delay otherwise rox fails to start.
  99. CPUSPEED=`grep -m 1 -i '^cpu MHz' /proc/cpuinfo | tr -d ' ' | cut -f 2 -d ':' | cut -f 1 -d '.'` #my laptop: 933.000
  100. [ ! $CPUSPEED ] && CPUSPEED=`grep -m 1 -i '^bogomips' /proc/cpuinfo | tr -d ' ' | cut -f 2 -d ':' | cut -f 1 -d '.'` #120718 raspi: 697.95 my laptop: 4789.47
  101. [ ! $CPUSPEED ] && CPUSPEED=250
  102. [ $CPUSPEED -lt 700 ] && sleep 0.5
  103. [ $CPUSPEED -lt 400 ] && sleep 0.5
  104. if [ -f /root/Choices/ROX-Filer/PuppyPan1 ];then
  105. rox -p /root/Choices/ROX-Filer/PuppyPin -r /root/Choices/ROX-Filer/PuppyPan1
  106. else
  107. rox -p /root/Choices/ROX-Filer/PuppyPin
  108. fi
  109. /sbin/pup_event_frontend_d & #130525 moved down.
  110. #v2.0.0
  111. /usr/sbin/delayedrun &
  112. #v2.01 hide cursor when not moving... (setup in /usr/sbin/input-wizard)
  113. if [ -f /etc/mousehide ];then
  114. IDLETIME="`cat /etc/mousehide | cut -f 1 -d ','`"
  115. [ ! "$IDLETIME" = "0" ] && unclutter -idle $IDLETIME &
  116. fi
  117. ##v2.14 rarsa: update xdg menu for w.m. that do not allow includes...
  118. #which ${CURRENTWM}_menu_refresh && ${CURRENTWM}_menu_refresh
  119. #...no, now doing it differently, see /usr/sbin/fixmenus
  120. if [ "$CURRENTWM" = "xfwm4" ];then
  121. if [ "`which xfce4-panel`" != "" ];then
  122. xfwm4 --daemon #note, starts xfce-mcs-manager daemon also.
  123. exec xfce4-panel
  124. fi
  125. fi
  126. #v3.91 volume tray applet, thanks to hairywill...
  127. [ -f /usr/bin/absvolume ] && absvolume &
  128. #v3.95 support fbpanel tray/taskbar...
  129. #only launch tray for w.m. without inbuilt tray...
  130. if [ "$CURRENTWM" != "jwm" -a "$CURRENTWM" != "icewm" ];then
  131. if [ -f /usr/bin/fbpanel ];then
  132. #a bit of a hack: when 3builddistro runs fixmenus, which calls variconlinks,
  133. #which populates /var/local/icons with symlinks, /usr/local/lib/X11/pixmaps
  134. #is not yet populated (happens at first boot, from default icon theme)...
  135. [ ! -e /var/local/icons/home48.png ] && ln -fs /usr/local/lib/X11/pixmaps/* /var/local/icons/
  136. fbpanel &
  137. fi
  138. [ -f /usr/bin/lxpanel ] && lxpanel &
  139. fi
  140. ##w468 rox may not start old hardware, try again... 120517 bring this back...
  141. ##PS="`ps`"
  142. ##if [ "`echo "$PS" | grep 'ROX\-Filer'`" = "" ];then
  143. #if ! busybox pidof ROX-Filer;then
  144. # touch /tmp/roxfilerstartupproblem #see /sbin/pup_event_frontend_d
  145. # sleep 0.5
  146. # if ! busybox pidof ROX-Filer;then #check again.
  147. # rox -p /root/Choices/ROX-Filer/PuppyPin
  148. # fi
  149. #fi
  150. #exec $CURRENTWM
  151. #v2.11 GuestToo suggested this improvement...
  152. which $CURRENTWM && exec $CURRENTWM
  153. [ -x $CURRENTWM ] && exec $CURRENTWM
  154. exec jwm
  155. ###END###