[SOLVED] Using cupsenable to resume the default printer
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know that we can use this command to resume a printer from terminal :
Code:
cupsenable printer_name
I need to create a launcher with that command as an easy way to resume my default printer. There are 3 printers in my room and I often switch my default printer from one to another.
Is there a way to resume the default printer without manually typing it's name?
So I don't need to edit the command every time I switch my default printer or create a launcher for each of those printers.
Write a script for each printer than give the script shorter names. You could even link them to your bin.
Well, that could work for me.
But I'll still need to copy this launcher to all computers in my workplace (about 50 computers 30 printers in total). It will take much time to edit the command to each of them.
Is there a way to get the default printer name? I've tried lpq and the output is
Code:
Epson_L120 is ready
no entries
Maybe there is something we can do with grep to get only the first block of that line (since space is not allowed in printer name). So I can copy the Epson_L120 and do something to run cupsenable using that copied text.
I've actually programmed my own front-end to lpadmin, lpinfo, etc(usb only so far), I found the cups help page a great resource https://www.cups.org/documentation.html
lpstat -d should show the current default.
I've actually programmed my own front-end to lpadmin, lpinfo, etc(usb only so far), I found the cups help page a great resource https://www.cups.org/documentation.html
lpstat -d should show the current default.
I use system-config-printer for that.
But resuming printer using system-config-printer or cups via web browser is quite complicated for most users. I need to create a one-click launcher to resume my printer. I've made many launchers to run specific commands that often be used by users such as setting display resolution using xrandr. Now I need to create this one.
I've read the cups documentation too but there is no command to resume a default printer. We can only resume a printer using cupsenable by specifying the printer name.
Put the file in /home/user/Desktop/ and it should appear on the desktop. But why not just leave the printer as it is in the active state?
I knew about it. What I need to do is this :
Assume that I need to resume my default printer without knowing the printer name. It will be like cupsenable default-printer, but there is no such command available.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.