├── .gitignore ├── Makefile ├── README.md ├── acmeedit.bash ├── main.scpt └── spaceglenda.icns /.gitignore: -------------------------------------------------------------------------------- 1 | *.app 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARG=Acme.app 2 | 3 | STARTUP=main.scpt 4 | EDITOR=acmeedit.bash 5 | ICON=spaceglenda.icns 6 | 7 | RES=$(TARG)/Contents/Resources 8 | PLIST=$(TARG)/Contents/Info.plist 9 | 10 | CONTENTS=\ 11 | $(RES)/Scripts/$(STARTUP)\ 12 | $(RES)/Scripts/$(EDITOR)\ 13 | $(RES)/$(ICON)\ 14 | 15 | .PHONY: all clean 16 | 17 | all: $(CONTENTS) 18 | 19 | $(RES)/Scripts/$(STARTUP): $(STARTUP) 20 | osacompile -o $(TARG) $< 21 | plutil -replace CFBundleDocumentTypes.CFBundleTypeRole -string Editor $(PLIST) 22 | 23 | $(RES)/Scripts/%: % 24 | install -m 755 $< $@ 25 | 26 | $(RES)/$(ICON): $(ICON) 27 | cp $< $@ 28 | plutil -replace CFBundleIconFile -string $< $(PLIST) 29 | rm -f $(RES)/droplet.icns 30 | 31 | clean: 32 | rm -rf $(TARG) 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # acme packager 2 | 3 | This repository contains a Makefile and several scripts for launch from Dock. 4 | 5 | To make a package just run: 6 | 7 | ``` 8 | $ make 9 | ``` 10 | 11 | This command will create *Acme.app* in current directory. 12 | 13 | ## Requirements 14 | 15 | *Acme.app* requires installed [Plan 9 from User Space](https://swtch.com/plan9port/) (a.k.a plan9port). 16 | Also if plan9port is installed in different from _/usr/local/plan9_, 17 | you should set _PLAN9_ environment variable with `launchctl`. 18 | 19 | ``` 20 | $ launchctl setenv PLAN9 ~/plan9 21 | ``` 22 | 23 | ## Options 24 | 25 | * GoFont 26 | * 9fans.net/go/acme/editinacme 27 | -------------------------------------------------------------------------------- /acmeedit.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash -l 2 | 3 | export PLAN9="${PLAN9:-/usr/local/plan9}" 4 | if ! echo :$PATH: | grep -q :$PLAN9/bin: 5 | then 6 | PATH=$PATH:$PLAN9/bin 7 | fi 8 | export LESS= 9 | export LESSCHARSET=utf-8 10 | GIT_EDITOR='sam -d' 11 | if which -s editinacme 12 | then 13 | GIT_EDITOR='editinacme' 14 | fi 15 | export GIT_EDITOR 16 | export GIT_PAGER='p' 17 | 18 | # ln -s $PLAN9/bin/rc $HOME/bin/-rc 19 | export SHELL='rc' 20 | if which -s -- -rc 21 | then 22 | SHELL='-rc' 23 | fi 24 | 25 | opts=() 26 | if 9p ls font | grep -q GoRegular 27 | then 28 | opts=("${opts[@]}" -f /mnt/font/GoRegular/14a/font) 29 | fi 30 | if 9p ls font | grep -q GoMono 31 | then 32 | opts=("${opts[@]}" -F /mnt/font/GoMono/14a/font) 33 | fi 34 | 35 | if ! pgrep -q plumber 36 | then 37 | plumber 38 | function cleanup() { 39 | pkill plumber 40 | } 41 | else 42 | function cleanup() { 43 | : 44 | } 45 | fi 46 | trap 'cleanup; exit 1' 1 2 3 15 47 | 48 | if pgrep -q acme 49 | then 50 | for i in "$@" 51 | do 52 | plumb "$i" 53 | done 54 | else 55 | acme "${opts[@]}" "$@" 56 | fi 57 | cleanup 58 | -------------------------------------------------------------------------------- /main.scpt: -------------------------------------------------------------------------------- 1 | on main(argv) 2 | set editor to path to resource "Scripts/acmeedit.bash" 3 | set text item delimiters of AppleScript to space 4 | try 5 | do shell script quoted form of POSIX path of editor & space & argv & " &>/dev/null &" 6 | end try 7 | return text item delimiters 8 | end main 9 | 10 | on open argv 11 | set v to {} 12 | repeat with i in argv 13 | set end of v to quoted form of POSIX path of i 14 | end repeat 15 | main(v) 16 | end open 17 | 18 | on run 19 | tell application "Finder" 20 | set dir to home as alias 21 | end tell 22 | main(quoted form of POSIX path of dir) 23 | end run 24 | -------------------------------------------------------------------------------- /spaceglenda.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lufia/acmeedit/2ced4693e7fc39efd01f65925b736fcd41c05474/spaceglenda.icns --------------------------------------------------------------------------------