]> git.lizzy.rs Git - plan9front.git/blob - sys/lib/newuser
profile: use vga/unicode.font in default lib/profile
[plan9front.git] / sys / lib / newuser
1 #!/bin/rc
2
3 user=`{cat /dev/user}
4 home=/usr/$user
5 if(test -f $home/lib/profile){
6         echo user directories already made
7         exit no
8 }
9 cd $home
10 x='$'
11 mkdir bin bin/rc bin/mips bin/386 bin/power bin/arm
12 mkdir lib tmp
13 touch lib/webcookies
14 chmod 600 lib/webcookies
15 chmod +t tmp
16 bind -qc /n/other/usr/$user/tmp $home/tmp
17 bind -c $home/tmp /tmp
18 mail -c
19 auth/cron -c
20
21 cat > lib/profile <<!
22 bind -a $x^home/bin/rc /bin
23 bind -a $x^home/bin/$x^cputype /bin
24 mount -qC /srv/cwfs /n/other other
25 bind -qc /n/other/usr/$x^user/tmp $x^home/tmp
26 bind -c $x^home/tmp /tmp
27 font=/lib/font/bit/vga/unicode.font
28 switch($x^service){
29 case terminal
30         webcookies
31         webfs
32         plumber
33         startupasfs
34         echo -n accelerated > '#m/mousectl'
35         echo -n 'res 3' > '#m/mousectl'
36         prompt=('term% ' '      ')
37         fn term%{ $x^* }
38         exec rio
39 case cpu
40         if (test -e /mnt/term/mnt/wsys) {
41                 # rio already running
42                 wsys = /mnt/term^`{cat /mnt/term/env/wsys}
43                 bind -a /mnt/term/mnt/wsys /dev
44                 echo -n $x^sysname > /dev/label
45         }
46         bind /mnt/term/dev/cons /dev/cons
47         bind /mnt/term/dev/consctl /dev/consctl
48         bind -a /mnt/term/dev /dev
49         prompt=('cpu% ' '       ')
50         fn cpu%{ $x^* }
51         startupasfs
52         if (! test -e /mnt/term/mnt/wsys) {
53                 # cpu call from drawterm
54                 font=/lib/font/bit/vga/unicode.font
55                 plumber
56                 auth/factotum
57                 exec rio
58         }
59 case con
60         prompt=('cpu% ' '       ')
61         startupasfs
62 }
63 !
64 cat > lib/plumbing <<!
65 # to update: cp /usr/$user/lib/plumbing /mnt/plumb/rules
66
67 editor = sam
68 browser = mothra
69
70 include basic
71
72 !
73
74 . lib/profile