Skip to main content

A Linux command-line wrapper to print from the command-line without cups

Project description

cupless

@readwithai - X - blog - machine-aided reading - 📖⚡️🖋️

Printing on Linux without CUPS.

[This is a first-cut - but I'm throwing it live because... I'm done with printers for today]. I might add more features when i need to rpint more stuff.

Motivation

I don't like CUPS. It's this hidden daemon that hides in the background and gets in the way of printing can go wrong and is then difficult to debug. We live in the future with standard file formats (.pwg) and standardized printer protocols (ipp) - we should be able to print directly on the command-line immediately and just see the errors right there.

Installation

This tool depends on mutool, ipptool, and pdfjam. Importantly, all of these can be installed with apt on ubuntu with sudo apt install mupdf-tools texlive cups-ipp-utils (texlive supplies pdfjam)

Once you have installed these you can install this with pipx.

pipx install cupless

## Usage
`cupless file` will print a file with ipptools. Images will be scaled and printed.

At the moment only single page files are supported.

## Some technical details
`ipp` is an HTTP-based standard that most printers support that allows files to be sent to the printer and printed. Unfortunately, likely to make printers simpler, standard formats such as PDF or PNG are not supported - rather than either niche (PWF, URF) or proprietary or lossy (JPEG) formats.

This tool is a wrapper around `mutool` and `ipp` which takes a PDF converts it into a niche format and sends it to a printe.

## Alternatives and prior work
Obviously there has been a bunch of work on standardizing printers. This tool makes use of [mutool](https://www.mankier.com/1/mutool) for converting PDF. Attah wrote a tool called [ippclient](https://github.com/attah/ppm2pwg) (and an alternative to mutool) which I think performs a similar role to this tool - but there is no automatic installation process for this tool.

## Caveats
I didn't want to depend upon `ipptools` as this is maintained by cups (though it is a separate package). However, I had difficulty getting the print command to work so gave up and used iptools. If I feel inspired (of if you do and feel like submitting patches) I might remove this. `pdfjam` depends on latex and texlive - which is quite big - however it is quite good at resizing images.

This only works with printers that have a default resolution of 300dpi.

## About me
I am **@readwithai**. I create tools for reading, research and agency sometimes using the markdown editor [Obsidian](https://readwithai.substack.com/p/what-exactly-is-obsidian).

I also create a [stream of tools](https://readwithai.substack.com/p/my-productivity-tools) that are related to carrying out my work.

I write about lots of things - including tools like this - on [X](https://x.com/readwithai).
My [blog](https://readwithai.substack.com/) is more about reading and research and agency.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cupless-1.0.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cupless-1.0.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file cupless-1.0.0.tar.gz.

File metadata

  • Download URL: cupless-1.0.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cupless-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6ccd691d20d6e4599486c0529d6727bb9936c6ff992f22d8e01a1b746defc212
MD5 6033b18ffb49e46f135536764344f919
BLAKE2b-256 6839d8bd2c4fafd5679fa52e383c2a2f2dee8f53e59b8ba7b7d16ab0d60de7be

See more details on using hashes here.

File details

Details for the file cupless-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: cupless-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cupless-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec1f28b458c1f8e577734d345256392b56df11ca225bbfe7c32cce7a9f4580c3
MD5 389619c32d17b948234648254cf95405
BLAKE2b-256 3d7dfaba1f2acfe0609e420ff30d2f890cbdda0f61bc09e69f46e2614b6bbe9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page