From 0a4af205b76f92e7685e38faf5e4a839270f1a11 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sun, 8 Mar 2015 19:21:49 -0600 Subject: [PATCH] flesh out plan9 thing --- papers/index.mdwn | 2 +- papers/{gui.mdwn => plan9.mdwn} | 72 +++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) rename papers/{gui.mdwn => plan9.mdwn} (53%) diff --git a/papers/index.mdwn b/papers/index.mdwn index 787a271..df98046 100644 --- a/papers/index.mdwn +++ b/papers/index.mdwn @@ -20,7 +20,7 @@ Computer Nerd Stuff * [The Setup](setup.html): the hardware and software I use * [Writing formal letters with roff](roff-letters.html) -* [Plan9 GUI stuff in Unix](gui.html): How to make your X11 stuff feel more like Plan9 +* [Plan9 GUI stuff in Unix](plan9.html): How to make your X11 stuff feel more like Plan9 * [Runit as Init](runit-as-init.html): My experience using runit as PID 1 for two years * [Reply-To Munging Still Considered Harmful](reply-to-still-harmful.html) * [Runnning PHP as a CGI](php-cgi.html) in anything other than Apache diff --git a/papers/gui.mdwn b/papers/plan9.mdwn similarity index 53% rename from papers/gui.mdwn rename to papers/plan9.mdwn index d4524e5..918bdf9 100644 --- a/papers/gui.mdwn +++ b/papers/plan9.mdwn @@ -61,3 +61,75 @@ there are some differences you might prefer. http://woozle.org/neale/g.cgi/x11/9wm/ +sshfs +----- + +As a non-root user, +you can mount remote file systems locally with `sshfs`. +It's probably as close as Unix is going to get for a while, +and it's not awful. + + +lm +-- + +The plan9 `lm` command is great: +it's like `apropos` or `man -k` but it outputs lines you can +copy and paste into a prompt to pull up the page. +Here's a script to do the same thing with Unix: + + #! /bin/sh + apropos -l "$@" | sed 's/\(.*\) (\(.*\)) * - /man \2 \1 # /' + + +xdg-open +-------- + +This is the current Linux notion of how to do things like the plumber. +Just about every modern program calls out to it to open files, +and it uses whichever one is first in your path, +so you can make a little script to do what you want and +avoid having to configure all the weirdo files in ~/.config + + #! /bin/sh + case "$1" in + *://*) + exec web "$1" + ;; + *.pdf) + exec my-pdf-viewer "$1" + ;; + esac + + +mon +--- + +Russ Cox uses a program called `mon` +to watch files and run them whenever they change. +This is pretty handy for iterative debugging, +you don't have to keep re-running your program every time you +save/compile. + +Here's a start at one. +It can be improved. + + #! /bin/sh + while true; do + gonow= + stat=$(stat --format=%Y.%Z.%s $1) + if [ "$stat" != "${laststat:-$stat}" ]; then + laststat=$stat + gonow=yes + fi + + if [ -n "$gonow" ]; then + echo "[[=== start ===]]" + $@ + echo "[[=== done ===]]" + fi + laststat=$stat + sleep 1 + done + +