A small tool to print images on a thermal Phomemo printer on macOS without the need of proprietary software.
Go to file
Wouter Groeneveld 8730d2c29f Only print .jpg/.png even with -file cmdarg 2023-03-18 08:49:08 +01:00
filter convert phomemo-filter.py to embed in Go 2023-02-01 16:59:23 +01:00
.gitignore convert phomemo-filter.py to embed in Go 2023-02-01 16:59:23 +01:00
LICENSE convert phomemo-filter.py to embed in Go 2023-02-01 16:59:23 +01:00
README.md Added -dir and -file options to support printing a single file or custom folder 2023-03-18 08:47:45 +01:00
com.brainbaking.PhomemoPrinter.plist create a macos launchd file, use channels to wait for BLE con 2023-02-01 21:20:35 +01:00
go.mod convert phomemo-filter.py to embed in Go 2023-02-01 16:59:23 +01:00
go.sum initial commit 2023-02-01 16:44:41 +01:00
main.go Only print .jpg/.png even with -file cmdarg 2023-03-18 08:49:08 +01:00

README.md

Phomemo-printer for macOS

Inspired by https://github.com/vivier/phomemo-tools

If you're on Linux, use the above repository which utilizes CUPS.

If you're on macOS, the Python pybluez Bluetooth drivers don't work (well) on the latest iteration of macOS (tested on Ventura 13.2). Instead, this repository uses TinyGo's Bluetooth package, which wraps Apple's CoreBluetooth to be able to communicate with a Bluetooth device.

For context and more information, please see https://brainbaking.com/post/2023/02/phomemo-thermal-printing-on-macos/.

Building & Installing

go build

The script checks a folder for files (intended to be set up as a cron job), if there are any, sends them to the printer (if detected), and deletes them.

See main.go, you'll probably want to edit some variables. I hacked everything together in a day for our specific case.

To inspect the possible command-line options, use phomemoprinter --help:

  • -dir [dir] customize the dir to scan (by default ~/Downloads/phomemo)
  • -file [file] print only that image

If -file is used, -dir will be ignored.

Launchd service

To install as a launchd service (mac's "cron"), copy the binary to /usr/local/bin and the file com.brainbaking.PhomemoPrinter.plist to ~/Library/LaunchAgents. Then, in a terminal, type launchctl load com.brainbaking.PhomemoPrinter.plist.