s243a

init_scripts.sh (Phoenix - Draft#1)

Mar 14th, 2021 (edited)
585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.05 KB | None | 0 0
  1. if [ -z "$CHROOT_FOLDER" ]; then
  2.   if [ ! -z "$CONT_NAME_DEST" ]; then
  3.     CHROOT_FOLDER="/${CONT_NAME_DEST}"
  4.   else
  5.     CHROOT_FOLDER=top
  6.   fi
  7. fi
  8.  
  9. echo '
  10. #!/bin/sh
  11. source /etc/profile
  12. export PATH="$PATH:/usr/local/bin/"
  13. ldconfig
  14. #gdk-pixbuf-query-loaders --update-cache
  15. /usr/bin/gtk-update-icon-cache -f /usr/share/icons/hicolor/
  16. DEFAULT_DESK_ICONS="JQ8flat"
  17. #[ $NEWPVERSION -ge 500 ] && DEFAULT_DESK_ICONS="JQ8flat"
  18. [ ! -d /usr/local/lib/X11/themes/JQ8flat ] && DEFAULT_DESK_ICONS="Stardust"
  19. [ -f /etc/desktop_icon_theme ] && DEFAULT_DESK_ICONS="`cat /etc/desktop_icon_theme`" #w477
  20. /usr/sbin/icon_switcher_cli $DEFAULT_DESK_ICONS
  21. fixmenus #probably not necessary'"
  22. DISPLAY=$XephyrDISPLAY rox -n &
  23. /strip_jwm.sh
  24. DISPLAY=$XephyrDISPLAY jwm &"'
  25. PID=$!
  26. '"$(if [ ! -z "$CHROOT_CMD2" ]; then
  27.  echo "DISPLAY=$XephyrDISPLAY $CHROOT_CMD2 &"
  28.   fi )"'
  29. wait "$PID"
  30. ' >"$CHROOT_FOLDER"/init_basic
  31.  
  32. chmod +x "$CHROOT_FOLDER"/init_basic
  33.  
  34. cat <<"EOF">"$CHROOT_FOLDER"/strip_tray.sed
  35. #!/bin/sed -nrf
  36. {H;}
  37. /^.*<\/Swallow>.*$/ {x;
  38.                                     s#(.*)(.*<Swallow[^<]*.*asapmshell.*$)#\1#g;tp
  39.                                     s#(.*)(.*<Swallow[^<]*.*freememappletshell.*$)#\1#g;tp
  40.                                     s#(.*)(.*<Swallow[^<]*.*xload.*$)#\1#g;tp
  41.                                    }
  42. /^.*<\/Swallow>.*$/ {bp}
  43. $ {x;p}
  44. /.*/! {:p #Print than cleanup
  45.        #s/([[:blank:]]*)//g #This doesn't seem to do anything
  46.         p
  47.         s/.*//g;x;d}
  48. EOF
  49. chmod +x "$CHROOT_FOLDER"/strip_tray.sed
  50.  
  51. cat << "EOF" >"$CHROOT_FOLDER"/strip_jwm.sh
  52. #!bin/sh
  53. cat /root/.jwmrc | sed -nr '$! {H};$ {H;x;s#(<StartupCommand>)(.*)(</StartupCommand>)##g;p}' > /root/.jwmrc-new
  54. mv /root/.jwmrc-new /root/.jwmrc
  55.  
  56. cat /root/.jwmrc-tray | /strip_tray.sed > /root/.jwmrc-tray-new
  57. mv /root/.jwmrc-tray-new /root/.jwmrc-tray
  58. EOF
  59. chmod +x "$CHROOT_FOLDER"/strip_jwm.sh
  60.  
  61.  
  62. # Xephyr parameters
  63. #   XP="-fullscreen -title container -name Xephyr2 -dpi 144 -nolisten tcp"
  64. #XEPHYR="-fullscreen -name Xephyr2 -dpi 144 -nolisten tcp"  
  65. #XEPHYR="$XP"
  66.  
  67.  
Add Comment
Please, Sign In to add comment