#!/bin/sh -e if [[ ! -x "$(command -v paru)" ]]; then sudo pacman -S --noconfirm --needed paru || exit 1 fi paru --noconfirm --needed -Sy \ cups \ cups-filters \ cups-pdf \ system-config-printer \ avahi \ nss-mdns \ splix \ foomatic-db \ foomatic-db-engine \ foomatic-db-gutenprint-ppds \ foomatic-db-nonfree \ foomatic-db-nonfree-ppds \ foomatic-db-ppds \ gutenprint if [[ -x "$(command -v systemctl)" ]]; then sudo systemctl enable --now cups.service fi # Disable multicast dns in resolved. Avahi will provide this for better network printer discovery sudo mkdir -p /etc/systemd/resolved.conf.d echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10-disable-multicast.conf if [[ -x "$(command -v systemctl)" ]]; then sudo systemctl enable --now avahi-daemon.service fi # Enable automatically adding remote printers if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf fi