Drop uri into "yad dnd" then open uri in NEW WINDOW "yad --html --browser --uri="%s"

102 views
Skip to first unread message

Robert Cooper

unread,
Aug 17, 2022, 4:31:22 PM8/17/22
to yad-common
Since "yad --html ---browser" does not open "new window" hyperlinks, I modified this little script (based on Victor's text version) so a hyperlink (from either a yad window or other browser window) can be Drag & Dropped where the hyperlink is opened in an additional Yad window.

The hyperlink can be an image or a uri address. If its an image the image appears in its native sizing.  (still more testing of other hyperlink results). 
--------------------------------------------------------------------
#!/bin/bash

function uri_hndl  {
      yad --width=1300 --height=800 --center --button="Close" --html --browser --uri="${1:7}"
}
export -f uri_hndl
yad --width=250 --height=100 --text="Drop Hyperlink Here" --dnd --use-interp --command='uri_hndl "%s"  '
----------------------------------------------------------------------
Special Thanks (and many thoughts) go out to Victor for all that he does to help others. 

Robert Cooper

unread,
Aug 19, 2022, 5:02:30 PM8/19/22
to yad-common
Reply all
Reply to author
Forward
0 new messages