yad icon indicating copy to clipboard operation
yad copied to clipboard

Cant get output from --print-uri

Open amunhoz opened this issue 3 years ago • 4 comments

I'm trying to get stdout from a html uri with this command:

yad --width=400 --height=250 --html --uri=dialog.html --print-uri

The html is from this example: https://gist.github.com/Misko-2083/227b53efa059f888f27bf6135b03b86b

But i did not understand how to get the information.

Thanks in advance

amunhoz avatar Jul 19 '21 18:07 amunhoz

so what the problem? every time you clicked on link you get the value of href attribute on stdout

v1cont avatar Jul 21 '21 07:07 v1cont

The option --print-uri supose to give some feedback about links clicked in the html inside the dialog, correct? In my test, there was no feedback in stdout, only the execution of the url with the system browser (default behaviour without the option 'print-uri').

Version: 10.90 (GTK+ 3.22.30)

amunhoz avatar Jul 27 '21 20:07 amunhoz

@amunhoz Example is working in Debian 11 libwebkit2gtk-4.0-dev: 2.32.3-1 yad: 10.90 (GTK+ 3.24.24)

Have you tried to do apply line buffering? stdbuf -oL -eL yad --width=400 --height=250 --html --uri=dialog.html --print-uri

Misko-2083 avatar Aug 28 '21 15:08 Misko-2083

@amunhoz He's a simple example save dialog.html

<!DOCTYPE html>
<html>
<head>
<body class="body">
<a href="one">One</a>
<a href="two">Two</a>
<a href="three">Three</a>
</body>
</html>

Then run

 stdbuf -oL -eL yad --width=400 --height=250 --html --uri=dialog.html --print-uri | while read -r line;
do
     case ${line##*/} in
                one)     yad --text="one" ;;
                two)     yad --text="two"  ;; 
              three)    yad --text="three" ;;
                  *)    : ;;
     esac
done

Misko-2083 avatar Aug 28 '21 15:08 Misko-2083