daily pastebin goal
20%
SHARE
TWEET

.xinitrc_jwc

s243a May 10th, 2018 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. #Adapted from .xinitrc in tahrpup
  3. #Path /root/.xinitrc_jwc
  4.  
  5. set -xv
  6. exec &> /mnt/sdc6/xinitrc_jwc.log
  7. #sleep 1
  8. export DISPLAY=${DISPLAY:-':0'};
  9. NESTDISPLAY=${NESTDISPLAY:-':13'};
  10. export HOME=${HOME:-/root}
  11. WindowManager=${WindowManager:-'jwm'}
  12. userresources=$HOME/.Xresources
  13. usermodmap=$HOME/.Xmodmap
  14. sysresources=/usr/lib/X11/xinit/Xresources
  15. sysmodmap=/usr/lib/X11/xinit/.Xmodmap
  16.  
  17. # merge in defaults and keymaps
  18. # https://wiki.archlinux.org/index.php/X_resources
  19. if [ -f $sysresources ]; then
  20.     xrdb -retain -display $NESTDISPLAY -merge -nocpp $sysresources
  21. fi
  22.  
  23. # https://linux.die.net/man/1/xmodmap
  24. if [ -f $sysmodmap ]; then
  25.     xmodmap -display $NESTDISPLAY $sysmodmap
  26. fi
  27.  
  28. if [ -f $userresources ]; then
  29.     xrdb -retain -display $NESTDISPLAY -merge -nocpp $userresources
  30. fi
  31.  
  32. if [ -f $usermodmap ]; then
  33.     xmodmap -display $NESTDISPLAY  $usermodmap
  34. fi
  35.  
  36.  
  37. #0.9.8 sync selection-buffer and clipboard. only useful for older apps
  38. #such as rxvt that use the selection-buffer...
  39. [ -f /usr/bin/autocutsel ] && /usr/bin/autocutsel &
  40. #...disadvantage of this is it creates a little square bottom-right of screen.
  41.  
  42.  
  43.  
  44. if [ -f /root/.xset.sh ];then
  45.  #this is created by /usr/bin/pupx...
  46.  eval "/root/.xset.sh"
  47. else
  48.  ##Xorg has it's own fontpath settings in /etc/X11/xorg.conf...
  49.  if [ "`readlink /usr/bin/X`" != "Xorg" ];then
  50.   #xset fp+ /usr/lib/X11/fonts/Type1/
  51.   #xset fp+ /usr/lib/X11/fonts/TTF/
  52.   xset -display $NESTDISPLAY fp+ /usr/share/fonts/default/Type1/
  53.   xset -display $NESTDISPLAY fp+ /usr/share/fonts/default/TTF/
  54.  fi
  55.  xset s 600 600 s blank
  56. fi
  57.  
  58. #v1.0.7 also see /etc/rc.d/rc.local0
  59. if [ -f /root/.fonts/fonts.dir ];then
  60.  xset -display $NESTDISPLAY fp+ /root/.fonts/
  61. fi
  62.  
  63.  
  64. # enable xorg mousekeys
  65. # they should be enabled by default somewhere in /etc/X11/xkb
  66. # but who knows
  67. #https://linux.die.net/man/1/setxkbmap
  68.  
  69. #From Line 101 of /usr/sbin/keymap-set
  70. [ -f /etc/keymap ] && OLDMAP=$(cat /etc/keymap)
  71. [ "$OLDMAP" = "" ] && OLDMAP="us"
  72. $NEWMAP=$OLDMAP #Maybe add the option to select a keyboard here
  73. #From Line 139 to 150 of /usr/sbin/keymap-set (Lines 140 to 150 commented out)
  74. [ "$NEWMAP" != "" ] || NEWMAP=$(basename "$1" .gz)
  75. #if [ "$NEWMAP" = "" ] ; then
  76. #  DIALOG="dialog --aspect 10"
  77. #  MENUOPT="--menu"
  78. #  REP=/tmp/$(basename $0).txt
  79. #  [ "$XSTATUS" = "yes" ] && DIALOG="Xdialog" && MENUOPT="--menubox"
  80. #  CHOICES=$(makelist)
  81. #  CHOICES=$(echo $CHOICES|sed -e "s/(/'(/g" -e "s/)/)'/g")
  82. #  eval "$DIALOG --title \"$(gettext 'Setting keyboard layout')\"  $MENUOPT \"$(gettext 'Choose keyboard layout for your country...')\" 0 0 0 $CHOICES" 2>$REP #111020 typo.
  83. #  NEWMAP=$(tail -n 1 $REP)
  84. #  rm -f $REP
  85. #fi
  86.  
  87. #Lines 158 to 181 of /usr/sbin/keymap-set
  88. XKEYMAP=$(basename $NEWMAP .kmap) #120627
  89. XKEYMAP=$(basename $XKEYMAP .map)
  90. MODEL="pc102"
  91. VARIANT=""
  92. if ! echo "$SYMBOLS" | grep -q "$XKEYMAP"; then
  93.   XK1=$(echo $XKEYMAP | cut -d'-' -f1)
  94.   XK2=$(echo $XKEYMAP | cut -d'-' -f2)
  95.   XK3=$(echo $XKEYMAP | cut -d'-' -f3)
  96.   XKEYMAP=$(xmap $XK1)
  97.   if [ "$XK2" != "" ]; then
  98.     for K in $XK1 $XK2 $XK3; do
  99.       case "$K" in
  100.         dvorak|qwerty|qwertz) VARIANT="$K";;
  101.       esac
  102.     done
  103.   fi
  104. fi
  105. LAYOUT=$XKEYMAP
  106. case $XKEYMAP in
  107.   br*) MODEL="abnt2"
  108.        LAYOUT="br";;
  109.   jp*) MODEL="jp106"
  110.        LAYOUT="jp";;
  111. esac
  112.  
  113. setxkbmap  -retain -display $NESTDISPLAY -option keypad:pointerkeys
  114. [ "$MODEL" ] && setxkbmap -retain -display $NESTDISPLAY -model "$MODEL"
  115. [ "$LAYOUT" ] && { setxkbmap -retain -display $NESTDISPLAY -layout "$LAYOUT" || exit 1 ; }
  116. [ "$VARIANT" ] && setxkbmap -retain -display $NESTDISPLAY -variant "$VARIANT"
  117. #which $CURRENTWM && exec $CURRENTWM
  118. #[ -x $CURRENTWM ] && exec $CURRENTWM
  119. #[ "$desktop" = "rox" ] && exec jwm
  120. eval "exec $WindowManager -display $NESTDISPLAY"
  121. ###END###
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top