Get list of connected printers
So, I understand that I can list all printers with
$ lpstat -p -d
printer DYMO-LabelWriter-450-Turbo is idle. enabled since Tue 06 Jun 2017 12:12:48 PM SGT
Waiting for printer to become available.
printer DYMO-LabelWriter-450-Turbo-2 is idle. enabled since Tue 06 Jun 2017 12:12:31 PM SGT
Ready to print.
printer Epson-Stylus-NX420 is idle. enabled since Mon 18 May 2015 05:23:36 AM SGT
printer Photosmart-C4200-series is idle. enabled since Thu 11 May 2017 07:17:13 PM SGT
system default destination: Photosmart-C4200-series
DYMO-LabelWriter-450-Turbo is installed but disconnected and DYMO-LabelWriter-450-Turbo-2 is both installed and connected.
What is the cleanest way to get the list of connected printers? Parsing the output of lpstat for "Ready to print."? Or is there some clean approach using lsusb?
14.04 usb printing
add a comment |
So, I understand that I can list all printers with
$ lpstat -p -d
printer DYMO-LabelWriter-450-Turbo is idle. enabled since Tue 06 Jun 2017 12:12:48 PM SGT
Waiting for printer to become available.
printer DYMO-LabelWriter-450-Turbo-2 is idle. enabled since Tue 06 Jun 2017 12:12:31 PM SGT
Ready to print.
printer Epson-Stylus-NX420 is idle. enabled since Mon 18 May 2015 05:23:36 AM SGT
printer Photosmart-C4200-series is idle. enabled since Thu 11 May 2017 07:17:13 PM SGT
system default destination: Photosmart-C4200-series
DYMO-LabelWriter-450-Turbo is installed but disconnected and DYMO-LabelWriter-450-Turbo-2 is both installed and connected.
What is the cleanest way to get the list of connected printers? Parsing the output of lpstat for "Ready to print."? Or is there some clean approach using lsusb?
14.04 usb printing
Would a command likelpstat -p -d | grep "Ready to print"
work?
– ThatGuy
Jun 6 '17 at 4:45
@ThatGuy: "Ready to print" is on a newline so that might not work if others want the printer names. But what you're saying is essentially the same idea as my current solution (your idea but in python to grab the printer names more easily). I guess I thought there was some mechanism where lpstat (or some other command) would report connected printers without any grep-ing.
– rith87
Jun 6 '17 at 5:57
add a comment |
So, I understand that I can list all printers with
$ lpstat -p -d
printer DYMO-LabelWriter-450-Turbo is idle. enabled since Tue 06 Jun 2017 12:12:48 PM SGT
Waiting for printer to become available.
printer DYMO-LabelWriter-450-Turbo-2 is idle. enabled since Tue 06 Jun 2017 12:12:31 PM SGT
Ready to print.
printer Epson-Stylus-NX420 is idle. enabled since Mon 18 May 2015 05:23:36 AM SGT
printer Photosmart-C4200-series is idle. enabled since Thu 11 May 2017 07:17:13 PM SGT
system default destination: Photosmart-C4200-series
DYMO-LabelWriter-450-Turbo is installed but disconnected and DYMO-LabelWriter-450-Turbo-2 is both installed and connected.
What is the cleanest way to get the list of connected printers? Parsing the output of lpstat for "Ready to print."? Or is there some clean approach using lsusb?
14.04 usb printing
So, I understand that I can list all printers with
$ lpstat -p -d
printer DYMO-LabelWriter-450-Turbo is idle. enabled since Tue 06 Jun 2017 12:12:48 PM SGT
Waiting for printer to become available.
printer DYMO-LabelWriter-450-Turbo-2 is idle. enabled since Tue 06 Jun 2017 12:12:31 PM SGT
Ready to print.
printer Epson-Stylus-NX420 is idle. enabled since Mon 18 May 2015 05:23:36 AM SGT
printer Photosmart-C4200-series is idle. enabled since Thu 11 May 2017 07:17:13 PM SGT
system default destination: Photosmart-C4200-series
DYMO-LabelWriter-450-Turbo is installed but disconnected and DYMO-LabelWriter-450-Turbo-2 is both installed and connected.
What is the cleanest way to get the list of connected printers? Parsing the output of lpstat for "Ready to print."? Or is there some clean approach using lsusb?
14.04 usb printing
14.04 usb printing
asked Jun 6 '17 at 4:39
rith87rith87
262
262
Would a command likelpstat -p -d | grep "Ready to print"
work?
– ThatGuy
Jun 6 '17 at 4:45
@ThatGuy: "Ready to print" is on a newline so that might not work if others want the printer names. But what you're saying is essentially the same idea as my current solution (your idea but in python to grab the printer names more easily). I guess I thought there was some mechanism where lpstat (or some other command) would report connected printers without any grep-ing.
– rith87
Jun 6 '17 at 5:57
add a comment |
Would a command likelpstat -p -d | grep "Ready to print"
work?
– ThatGuy
Jun 6 '17 at 4:45
@ThatGuy: "Ready to print" is on a newline so that might not work if others want the printer names. But what you're saying is essentially the same idea as my current solution (your idea but in python to grab the printer names more easily). I guess I thought there was some mechanism where lpstat (or some other command) would report connected printers without any grep-ing.
– rith87
Jun 6 '17 at 5:57
Would a command like
lpstat -p -d | grep "Ready to print"
work?– ThatGuy
Jun 6 '17 at 4:45
Would a command like
lpstat -p -d | grep "Ready to print"
work?– ThatGuy
Jun 6 '17 at 4:45
@ThatGuy: "Ready to print" is on a newline so that might not work if others want the printer names. But what you're saying is essentially the same idea as my current solution (your idea but in python to grab the printer names more easily). I guess I thought there was some mechanism where lpstat (or some other command) would report connected printers without any grep-ing.
– rith87
Jun 6 '17 at 5:57
@ThatGuy: "Ready to print" is on a newline so that might not work if others want the printer names. But what you're saying is essentially the same idea as my current solution (your idea but in python to grab the printer names more easily). I guess I thought there was some mechanism where lpstat (or some other command) would report connected printers without any grep-ing.
– rith87
Jun 6 '17 at 5:57
add a comment |
1 Answer
1
active
oldest
votes
lpstat
will list printers that are being serviced by cups. I see that you have an HP Photosmart which I believe does not use cups.
Since you will most often be printing from a GUI app such as Libre or Firefox, I've found that clicking on *System Settings > Printers** provides the most useful information.
For cups printers, lpstat -t
should give you the maximum amount of current information about all the relevant printers your machine knows about.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f922546%2fget-list-of-connected-printers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
lpstat
will list printers that are being serviced by cups. I see that you have an HP Photosmart which I believe does not use cups.
Since you will most often be printing from a GUI app such as Libre or Firefox, I've found that clicking on *System Settings > Printers** provides the most useful information.
For cups printers, lpstat -t
should give you the maximum amount of current information about all the relevant printers your machine knows about.
add a comment |
lpstat
will list printers that are being serviced by cups. I see that you have an HP Photosmart which I believe does not use cups.
Since you will most often be printing from a GUI app such as Libre or Firefox, I've found that clicking on *System Settings > Printers** provides the most useful information.
For cups printers, lpstat -t
should give you the maximum amount of current information about all the relevant printers your machine knows about.
add a comment |
lpstat
will list printers that are being serviced by cups. I see that you have an HP Photosmart which I believe does not use cups.
Since you will most often be printing from a GUI app such as Libre or Firefox, I've found that clicking on *System Settings > Printers** provides the most useful information.
For cups printers, lpstat -t
should give you the maximum amount of current information about all the relevant printers your machine knows about.
lpstat
will list printers that are being serviced by cups. I see that you have an HP Photosmart which I believe does not use cups.
Since you will most often be printing from a GUI app such as Libre or Firefox, I've found that clicking on *System Settings > Printers** provides the most useful information.
For cups printers, lpstat -t
should give you the maximum amount of current information about all the relevant printers your machine knows about.
edited Jan 2 at 21:12
Pablo Bianchi
2,4451530
2,4451530
answered Jun 6 '17 at 4:51
jones0610jones0610
1,3281321
1,3281321
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f922546%2fget-list-of-connected-printers%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Would a command like
lpstat -p -d | grep "Ready to print"
work?– ThatGuy
Jun 6 '17 at 4:45
@ThatGuy: "Ready to print" is on a newline so that might not work if others want the printer names. But what you're saying is essentially the same idea as my current solution (your idea but in python to grab the printer names more easily). I guess I thought there was some mechanism where lpstat (or some other command) would report connected printers without any grep-ing.
– rith87
Jun 6 '17 at 5:57