source: src-sh/pc-firstgui/pc-firstgui @ 1620346

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 16 months ago

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100644
File size: 1.9 KB
Line 
1#!/bin/sh
2# Script to startup the first run setup gui
3
4# Check if we need to save an existing .xinitrc file
5if [ -e "/root/.xinitrc" ] ; then
6 mv /root/.xinitrc /root/.xinitrc.xbak
7fi
8
9# Check if we need to move the .fluxbox profile
10if [ -e "/root/.fluxbox" ] ; then
11  rm -rf /root/.fluxbox.xbak 2>/dev/null
12  mv /root/.fluxbox /root/.fluxbox.xbak 2>/dev/null
13fi
14
15# Copy the default fluxbox init files
16cp -R /usr/local/share/pcbsd/fluxboxinit /root/.fluxbox
17
18# Make sure we use files in /root
19HOME="/root"
20export HOME
21
22# Create the .xinitrc file
23echo '# Set all our path variables
24PATH="/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/bin:/usr/local/sbin"
25HOME="/root"
26export PATH HOME
27
28# Unset the PROGDIR variable
29PROGDIR=""
30export PROGDIR
31
32if [ -e "/root/.xprofile" ] ; then . /root/.xprofile ; fi
33
34# Figure out which intro video to play
35res=`xdpyinfo | grep dimensions: | awk "{print $2}"`
36h=`echo $res | cut -d "x" -f 1`
37w=`echo $res | cut -d "x" -f 2`
38h=`expr 100 \* $h`
39ratio=`expr $h \/ $w | cut -c 1-2`
40case $ratio in
41   13) mov="PCBSD9_4-3_UXGA.flv";;
42   16) mov="PCBSD9_16-10_WUXGA.flv";;
43   17) mov="PCBSD9_16-9_1080p.flv";;
44    *) mov="PCBSD9_4-3_UXGA.flv";;
45esac
46
47# Play the video now
48mplayer -fs -nomouseinput -zoom /usr/local/share/pcbsd/movies/$mov
49
50# Setting a language
51if [ -e "/etc/pcbsd-lang" ] ; then
52   LANG=`cat /etc/pcbsd-lang`
53   export LANG
54fi
55
56# Start fluxbox
57/usr/local/bin/startfluxbox &
58PID=$!
59
60# Start first-boot wizard
61/usr/local/bin/pc-firstboot
62if [ $? -eq 0 ] ; then
63  rm /var/.pcbsd-firstgui
64fi
65kill -9 ${PID}' > /root/.xinitrc
66chmod 755 /root/.xinitrc
67startx
68
69
70# Put back our saved files
71rm /root/.xinitrc >/dev/null 2>/dev/null
72# Check if we need to save an existing .xinitrc file
73if [ -e "/root/.xinitrc.xbak" ] ; then
74   mv /root/.xinitrc.xbak /etc/.xinitrc
75fi
76
77# Check if we need to move the .fluxbox profile
78if [ -e "/root/.fluxbox.xbak" ] ; then
79  rm -rf /root/.fluxbox >/dev/null 2>/dev/null
80  mv /root/.fluxbox.xbak /root/.fluxbox
81fi
Note: See TracBrowser for help on using the repository browser.