ref: 5b2d0dd966ad8a955fee75d5462e53f7b96c2f13
parent: 0d46e6409c185f796f96cb2fdeb4eaa1cb84f5ef
author: glenda <glenda@9pi4>
date: Tue Sep 3 23:18:40 EDT 2024
Add documentation articles on theming the system and installing go.
--- /dev/null
+++ b/go.ms
@@ -1,0 +1,69 @@
+.HTML Installing Go on 9
+.TL
+Installing Go on Plan 9
+.SH
+amd64
+.PP
+.P1
+mkdir -p /sys/lib/go
+cd /sys/lib/go
+hget https://go.dev/dl/go1.23.0.plan9-amd64.tar.gz | tar xz
+mv go amd64-1.23.0
+.P2
+
+Add this to the beginning of your user's lib/profile:
+.P1
+GOROOT=/sys/lib/go/amd64-1.23.0
+bind -b $GOROOT/bin /bin
+.P2
+
+After restarting, your Go installation should be commplete.
+
+.SH
+arm64
+.PP
+Installing go on arm64 plan 9 is unsupported by the go language and team but a fork of golang is avaliable which supports it. You will need a non-arm64 system with go running on it to cross-compile for plan9 arm64. These instructions will assume you are on a linux machine with a Go toolchain already installed.
+
+On linux:
+.P1
+git clone https://github.com/psilva261/go-arm64.plan9.git
+cd go-arm64.plan9/src
+export GOOS=plan9
+export GOARCH=arm64
+export GOROOT_FINAL=/sys/lib/go/arm64.plan9
+bash ./make.bash
+cd ../bin
+mv plan9_arm64/* .
+cd ../..
+tar xzvf go9.tgz go-arm64.plan9/**/*
+.P2
+
+.PP
+Now you need to transfer the go9.tgz archive to your Plan 9 machine. You can do this with 9P.
+
+On Plan 9:
+.P1
+mkdir share
+aux/listen1 -tv tcp!*!9999 /bin/exportfs -r share
+.P2
+
+On Linux with Plan 9 from User Space where 9serverip is the IP address of your Plan 9 system:
+.P1
+mkdir ~/share
+9pfuse tcp!9serverip!9999 ~/share
+cp go9.tgz ~/share/
+.P2
+
+On Plan 9:
+.P1
+mkdir -p /sys/lib/go
+cd /sys/lib/go
+tar xvf /usr/glenda/share/go9.tgz
+mv go-arm64.plan9 arm64.plan9
+.P2
+
+Add the following to your user's lib/profile;
+.P1
+GOROOT=/sys/lib/go/arm64.plan9
+bind -b $GOROOT/bin /bin
+.P2
--- /dev/null
+++ b/theming.ms
@@ -1,0 +1,93 @@
+.HTML Theming Rio and acme
+.TL
+Theming Rio and acme
+
+.SH
+rio
+.PP
+Install Sigrid's Rio theming patch:
+.P1
+bind -ac /dist/plan9front /
+cd /sys/src/cmd/rio
+hget https://ftrv.se/_/9/patches/rio-themes.patch | patch -p5
+mk install
+.P2
+
+Themes can be installed by writing to the /mnt/wsys/theme file while a patched rio install is running.
+
+An example theme file:
+.P1
+back 1e1e2e
+high f38ba8
+border 313234
+text cdd6f4
+htext 1e1e2e
+title f38ba8
+ltitle 6c7086
+hold ffffff
+lhold 3399ff
+palehold 4d9bff
+paletext a5adce
+size f38ba8
+menubar 1e1e2e
+menuback 1e1e2e
+menuhigh f38ba8
+menuboard f38ba8
+menutext cdd6f4
+menuhtext 1e1e2e
+.P2
+
+The https://git.sr.ht/~ft/picker color picker utility can be used for live editing of the Rio theme with a GUI.
+.P1
+picker </mnt/wsys/theme >/mnt/wsys/theme
+.P2
+
+To persist the theme, you can write it to a file and add a line like this into your bin/rc/riostart:
+.P1
+cat lib/theme/rio.theme >/mnt/wsys/theme
+.P2
+
+.SH
+acme
+.PP
+Acme does not include built in theming support so you will need to edit the C source code. Don't worry as its as you will mostly just be changing the colors around.
+
+.PP
+To start, run the following commands.
+
+.P1
+bind -ac /dist/plan9front /
+cd /sys/src/cmd/acme
+acme acme.c
+.P2
+
+.PP
+You will want to edit the iconinit function to contain different definitions for the colors. Put the following CLR macro outside of the iconinit function to simplify the code:
+.P1
+#define CLR(c) (allocimage(display, Rect(0,0,1,1), screen->chan, 1, (c)))
+.P2
+
+.PP
+Now, edit the beginning of the iconinit function to define your own colors.
+
+.P1
+void
+iconinit(void)
+{
+ Rectangle r;
+ Image *tmp;
+
+ /* Blue */
+ tagcols[BACK] = CLR(0xYOURHEXCOLOR);
+ tagcols[HIGH] = CLR(0xYOURHEXCOLOR);
+ tagcols[BORD] = CLR(0xYOURHEXCOLOR);
+ tagcols[TEXT] = CLR(0xYOURHEXCOLOR);
+ tagcols[HTEXT] = CLR(0xYOURHEXCOLOR);
+
+ /* Yellow */
+ textcols[BACK] = CLR(0xYOURHEXCOLOR);
+ textcols[HIGH] = CLR(0xYOURHEXCOLOR);
+ textcols[BORD] = CLR(0xYOURHEXCOLOR);
+ textcols[TEXT] = CLR(0xYOURHEXCOLOR);
+ textcols[HTEXT] = CLR(0xYOURHEXCOLOR);
+.P2