ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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've run into similar problems with yad, namely you have a yad button calling an executable with an argument like:
Code:
yad --button=Test:dolphin /etc
and in the above dolphin will open to the users home directory ignoring the argument to open dolphin at /etc. I think that's the same problem you're having and trying to solve with a creative use of quotes. I've never been able to find such a solution that will work but I haven't looked really hard. The workaround I use is to simply create a separate bash script and call that from the button. In your case, create a bash script called, eg do-print:
The line "Printer" not work. I think could be the colon
No, it's not about the colon. You cannot specify arguments to the command like this. In your example, yad takes firefox "localhost:631" as the command verb. There is no such command: the command is firefox.
You'll have to supply return codes instead of commands, then evaluate them (e.g. in a case statement).
You'll have to supply return codes instead of commands, then evaluate them (e.g. in a case statement).
I didn't explain myself very clearly. What I gave him will work; I've run it myself successfully. Here's the problem as I see it.
The simplest syntax for a yad button to trigger the running of an executable, say firefox, is:
Code:
$ yad --button="Firefox":firefox
This will give you a yad box with one button entitled "Firefox" which, when pressed launches firefox. The original poster wanted to access the cups configuration page by opening firefox at localhost:631. If you run the following in a terminal:
Code:
$ firefox localhost:631
firefox launches and opens at the cups configuration page. However, if you create a yad box to do the same with:
Code:
$ yad --button="Printer":firefox localhost:631
This will give you a yad box with a single button entitled "Printer" which, when pressed launches firefox which opens at the configured home page instead of the desired cups configuration page at localhost:631. In short, the argument following firefox is ignored and firefox opens as usual at its home page. I believe all the fooling around with quotes by the OP on the relevant line was an attempt to force firefox to open at localhost:631 instead of the home page. I doesn't work and I've never gotten it to work with yad buttons on similar problems in the past. Making a separate bash script to call the executable with the desired argument was my workaround.
Sorry if there was a bad explanation. The intention is not to print. It is to open the configuration of CUPS in port 631
And nobody has answered point 2
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.