Blob


1 # acmerc
3 I'm using this script to spawn acme on OpenBSD in all its glory!
5 #!/usr/bin/env rc
7 . $home/lib/profile
9 if (~ $PLAN9 '') {
10 echo '$PLAN9 is not defined!'
11 exit 1
12 }
14 Provide a sane environment for acme
16 SHELL=rc
17 PAGER=nobs
18 MANPAGER=nobs
19 EDITOR=editinacme
20 VISUAL=editinacme
22 Most of the utilities from plan9ports binds sockets in NAMESPACE, which
23 is /tmp/ns.$USER.$DISPLAY by default. I'd like to have different
24 namespaces per acme session, so I'm defining the env variable.
26 Yes, using $pid ($$ in bourne shell) is discouraged to generate "random"
27 values, but here it's done on purpose: every program spawned inside
28 *this* terminal will share the same namespace.
30 NAMESPACE=/tmp/ns.$user.$pid
31 mkdir -p $"NAMESPACE
33 Start the plumber and fontsrv
35 plumber
36 fontsrv &
37 fontsrvpid=$apid
39 I've used Go Mono for a while, but I'm falling in love with bitmaps
40 fonts these days
42 font=/usr/local/plan9/font/fixed/unicode.7x14.font
43 # font=/mnt/font/GoMono/10a/font
44 FONT=/mnt/font/InputSans-Regular/10a/font
46 Start acme for real
48 $PLAN9/bin/acme -a -f $font -F $FONT $* &
49 acmepid=$apid
51 wait a bit for acme to set up its things and start autoacme
53 {
54 sleep 1
55 winid=1
56 exec acmeeval 'autoacme '$home'/bin/acmeconfig'
57 } &
58 acmeevalpid=$apid
60 Then wait for acme to terminate
62 wait $acmepid
64 and stop acmeeval (just in case) and fontsrv
66 kill $acmeevalpid
67 kill $fontsrvpid
69 wait a little bit more
71 wait # just in case
73 and then kill the namespace before quitting
75 rm -rf $"NAMESPACE