Files
david 448c8b43f1
shellcheck / shellcheck (push) Failing after 17s
fix agent networking
2026-11-02 08:57:45 -07:00

26 lines
722 B
Bash

#!/bin/bash
# configure reads TITLE and DESCRIPTION
# shellcheck disable=SC2034
TITLE="Printers"
# shellcheck disable=SC2034
DESCRIPTION="Add your network's printers to every print dialog"
# Exists once you've run this, even if you added none, so this isn't "to do"
# on machines without a printer
PRINTERS_CONF="$HOME/.config/coredesktop/printers"
is_installed() {
command -v lpadmin
}
# Set up here, or a network printer was already added some other way
is_configured() {
[ -f "$PRINTERS_CONF" ] || LC_ALL=C lpstat -v 2> /dev/null | grep -qE ': (ipps?|dnssd)://'
}
run_configure() {
bash "$COREDESKTOP/system/setup-printers.sh" || return 1
mkdir -p "$(dirname "$PRINTERS_CONF")" && touch "$PRINTERS_CONF"
}