v1cont / yad

Yet Another Dialog
GNU General Public License v3.0
654 stars 58 forks source link

yad seems to execute the link in addition to sending it to the linkhandler I wrote. #178

Closed manoflinux closed 2 years ago

manoflinux commented 2 years ago

This is how I am running yad. yad --html --browser --width=1526 --height=974 --uri-handler=/usr/local/bin/linkhandler --title='Click on something' --uri=file:///tmp/test.html

And it works in that yad passes the url to the linkhandler, but it also has started going to page itself inside of yad. So I click on a link in yad, it sends it to the linkhandler and then it starts loading it. I swore it used to not work like this but I may have been closing yad before it got a chance to fully load the page.

manoflinux commented 2 years ago

sorry forgot to include version info. I compiled yad. yad --version 12.0 (GTK+ 3.24.5)

kernel 4.19

v1cont commented 2 years ago

use appropriate exit code (1 in your case). possible values of exit codes mentioned in man page

manoflinux commented 2 years ago

oh so I have to have the link handler have an exit status of 1? Nice will try that now. Thanks!

manoflinux commented 2 years ago

Worked perfectly. Found it, I had read it but didn't fully wrap my head around it the first time. " 0 for keep working, 1 for ignoring uri and 2 for downloading uri." So 0 tells yad to follow the uri because it got a signal to keep working from the uri handler. 1 tells it to ignore the uri 2 tells yad to download the uri itself. That's very useful, thanks!