ezkur / yad

Automatically exported from code.google.com/p/yad
GNU General Public License v3.0
0 stars 0 forks source link

--list --dclick-action behavior #149

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. yad --title='Testing' --dclick-action='/usr/bin/chromium-browser' 
--width=1000 --height=500 --list --column='Site' --column='Description' 
'http://code.google.com/p/yad/' 'Yad info page'

What is the expected output? What do you see instead?
In the browser i see the opening of a tab http://code.google.com/p/yad/ AND the 
opening of a tab http://yad%20info%20page/
I only want the opening of the first Tab in the browser.

What version of the product are you using? 
yad 0.17.1.1

On what operating system?
Bodhi Linux

Please provide any additional information below.
Did i miss something or can i somewhere adjust Yad to output only the first 
column to a browser?
BTW: I appreciate your work on Yad, Thank you.

Original issue reported on code.google.com by rensvans...@gmail.com on 15 Oct 2012 at 7:36

GoogleCodeExporter commented 8 years ago
yad pass data from all columns to double-click action as an arguments. if you 
wish to use only some of them, make an action as a shell function

#! /bin/bash

function call_browser () {
    /usr/bin/chromium-browser "$1"
}
export -f call_browser

yad --title='Testing' --dclick-action='bash -c "call_browser %s"' --width=1000 
--height=500 --list --column='Site' --column='Description' 
'http://code.google.com/p/yad/' 'Yad info page'

Original comment by ananasik on 16 Oct 2012 at 9:46

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I can use this!

I 'forgot' to mention that i use yad in Freebasic. That's why i use ' instead 
of "
and was trying to call yad in my code with: 

code to extract bookmarksdata from html file to bookmarks.txt
shell "yad --list --title='...' ... "
...

I now made a script file with your code, let my program make a file: 
bookmarks.txt and changed the following line in the script file:

yad --title='Testing' --dclick-action='bash -c "call_browser %s"' --width=1000 
--height=500 --list --column='Site' --column='Description' 
'http://code.google.com/p/yad/' 'Yad info page'

to:

bookmarks.txt|yad --title='Testing' --dclick-action='bash -c "call_browser %s"' 
--width=1000 --height=500 --list --column='Site' --column='Date' 
--column='Description'

Made the script file executable and use it as follows:

test.bas
code to extract bookmarksdata from html file to bookmarks.txt
shell "./bookmark.sh"
...

It would be easier if one could choose which column to 'execute', but i am 
happy with this.

Thanks.

Original comment by rensvans...@gmail.com on 16 Oct 2012 at 8:40