-
-
Save faraoman/92a8196270aae1cc5be311f3075105ad to your computer and use it in GitHub Desktop.
Install a printer on Arch Linux with cups using command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################ | |
# Install a printer on Arch Linux with cups using command line # | |
# Used for a HP PSC 1510 with default driver # | |
################################################################ | |
sudo pacman -S cups | |
sudo systemctl start org.cups.cupsd | |
sudo systemctl status -l org.cups.cupsd | |
# If errors are shown add yourself to 'lp' group | |
sudo gpasswd -a ${USER} lp | |
sudo systemctl restart org.cups.cupsd | |
sudo systemctl status -l org.cups.cupsd | |
# If errors are shown again add yourself to 'lpadmin' group | |
sudo gpasswd -a ${USER} lpadmin | |
sudo systemctl restart org.cups.cupsd | |
# Find if your device is connected and found by the system | |
lsusb | |
# Find the URI | |
sudo lpinfo -v # | |
# Find if a driver for your device is installed | |
lpinfo -m | |
# Create a print queue with URI and driver | |
sudo lpadmin -p HP_PSC_1510 -E -v "usb://HP/PSC%201500%20series?serial=MY61DD31P90498&interface=1" -m drv:///sample.drv/deskjet.ppd | |
# Set as default | |
lpoptions -d HP_PSC_1510 | |
# Set A4 Page | |
lpoptions -p HP_PSC_1510 -o PageSize=A4 | |
# Enable printing | |
sudo cupsenable HP_PSC_1510 | |
sudo cupsaccept HP_PSC_1510 | |
# Restart!! | |
sudo systemctl restart org.cups.cupsd | |
# Test printer | |
lpr test.txt | |
# List other options | |
lpoptions -p HP_PSC_1510 -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment