Firefox lpr workaround

For some reason unknown to mankind, Firefox doesn’t allow you to print via lpr any more.

It used to be that if you had lpr enabled on the line gtk-print-backends= in your ~/.config/gtk-3.0/settings.ini, you would be able to print directly to lpr.

But recently (I’m using Firefox 60 at the moment) this doesn’t work.

After this workaround I only kept ”file” in my settings.ini.



My workaround was to create a simple script that watches a folder, if it finds a PDF, print it using lpr and then remove the file.

Then a simple systemd user script to get it running in the background.

The ”printy” script

Most beautiful bash script ever.

#!/usr/bin/env bash


mkdir -p "$PRINTDIR"

while true; do 
  sleep 2

  for file in "$PRINTDIR"/*.pdf; do
    if [ -f "$file" ]; then
      cat "$file" | lpr -l && rm "$file"

Change PRINTDIR to where you’ll print PDF:s to from Firefox.

systemd unit script

Description=Fucked up Firefox printing workaround script



Save file in ~/.config/systemd/user/printy.service.

To keep the script running after you login/logout and reboot. Enable ”lingering” in systemd.

As root, run: systemctl enable-linger ogg

Then enable and start the script:

systemctl --user enable printy


systemctl --user start printy


If you do the above, whenever you need to print anything from Firefox, use ”Print to file” and place the PDF in /tmp/printy (if you use my script above).

Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *