YAD - Tips

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#101 Post by Bert »

My impression is most people in this thread are experienced yad-coders, to whom my examples are probably boring. My apologies to you, I'm only sharing my learning process for other yad-beginners and to possibly help build a small examples library for smokey01. (Victor's examples are often way above beginners level)

Form-field-buttons:

Last night I was reading this in the Mankier Yad Manual, under "Form options":
Initial value is a command which is running when button is clicked. A special sympols %N in command are replaced by value of field N.
A bit cryptic, but I could smell a solution in there...
>>Does anyone understand his %N method?<< Hours after bedtime, I gave up and almost accidentally found my own solution. So today, I tried to build something useful...a yad-panel:

Code: Select all

#!/bin/sh

yad --form --undecorated --no-buttons --geometry="+0+0" \
       --columns="1" \
       --field="!./icons/file-manager.png! Rox :fbtn" "rox $HOME" \
       --field="!./icons/terminal-icon.png! lxterminal :fbtn" lxterminal \
       --field="!./icons/mozicon64.png! Palemoon :fbtn" /mnt/home/palemoon/palemoon \
       --field="!./icons/Apps-geany-icon.png! Geany :fbtn" geany \
       --field="!./icons/Paint.png! mtPaint :fbtn"  /usr/bin/mtpaint \
       --field="!./icons/seamonkey.png! Composer :fbtn" mozedit \
Happy Bert :)
It's fun to just play with the value in --columns:
One column:
Image

Three columns:
Image

Six columns:
Image

Here's my desktop with yad-panel:
Image
It works really well. I like it and think it's worth developing further.

If anyone wants to play with this script, I've attached it here. Download and unpack it anywhere. It's a very small script, the weight comes from the quality icons. Most of the icons come from iconarchive.com and I've compressed them without quality loss with the help of TinyPNG.

Have a nice weekend!
Attachments
yad-panel.tar.gz
(16.21 KiB) Downloaded 425 times
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

stemsee

#102 Post by stemsee »

yad-0.31.2 --enable-html
Attachments
yad-0.31.2-i686.pet
(210.75 KiB) Downloaded 336 times

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#103 Post by Bert »

Thank you stemsee!

It's working great in both Precise 5.7.2 and Librepup. 8)
The html --browser function opens without errors, but does not open the url.
But that's not your problem: I still have to find out how to add webkit to both Precise and Librepup.
Thanks again,
Bert
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

stemsee

#104 Post by stemsee »

popcorntime has nw.pak webkit archive, but I do not know how to open the binary to see the code to call/use this archive format. It is node-webkit.

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#105 Post by Bert »

--image-on-top

I'm struggling with this one:

Code: Select all

#!/bin/sh
yad  --image="/root/Johannes_Itten_die-Begegnung_1916.jpg"  \
		--text="\"Die Begegnung\" (\"The encounter\") is a painting by Johannes Itten, 1916"
gives this result:
Image
If I add "--image-on-top" to the script:

Code: Select all

#!/bin/sh
yad  --image="/root/Johannes_Itten_die-Begegnung_1916.jpg" --image-on-top \
		--text="\"Die Begegnung\" (\"The encounter\") is a painting by Johannes Itten, 1916"
the result is:
Image
Hmm, image not really on top..

If I add more text, this is the result:
Image
So we're back to --image-NOT-on-top :wink:

Has anybody mastered --image-on-top?
Thanks.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

image-on-top

#106 Post by seaside »

Bert,

It seems that "image-on-top" isn't what it appears to be. :D

https://code.google.com/p/yad/issues/detail?id=113

Cheers,
s

User avatar
rg66
Posts: 1158
Joined: Mon 23 Jul 2012, 05:53
Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!

#107 Post by rg66 »

Can't get the image centered but can trick it to show the text underneath by adding blank lines.
yad --text="\n\n\n\nThis is a test" --image="/usr/share/pixmaps/firefox48.png"
More tricks:

Code: Select all

yad --text="\n      <b>Title</b>\n\n\n\nThis is a test" --image="/usr/share/pixmaps/firefox48.png"
Attachments
Screenshot.jpg
(8.75 KiB) Downloaded 1298 times
Screenshot(1).jpg
(9.12 KiB) Downloaded 1296 times
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

Re: image-on-top

#108 Post by Bert »

seaside wrote:Bert,

It seems that "image-on-top" isn't what it appears to be. :D

https://code.google.com/p/yad/issues/detail?id=113

Cheers,
s
Ah OK, thanks!
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#109 Post by Bert »

rg66 wrote:Can't get the image centered but can trick it to show the text underneath by adding blank lines.
yad --text="\n\n\n\nThis is a test" --image="/usr/share/pixmaps/firefox48.png"
More tricks:

Code: Select all

yad --text="\n      <b>Title</b>\n\n\n\nThis is a test" --image="/usr/share/pixmaps/firefox48.png"
Thanks for the tricks rg66.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

YAD 32.0

#110 Post by slavvo67 »

YAD 32.0 compiled in Quirky Unicorn.

https://copy.com/1TiI9bckdABFUJNa

The changes are listed in the following post. Just don't ask me how to use them. :lol:
Last edited by slavvo67 on Wed 25 Nov 2015, 03:31, edited 1 time in total.

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

Follow YAD fixes

#111 Post by slavvo67 »

Victor's Updates for 32.0 per Google Forum :

YAD 0.32.0 released

Changes in this release:
- enable rules-hint for icons list in icon browser
- add --splash options (thanks to Konstantin Baierer)
- add --no-focus option
- fix timeout progressbar layout for gtk3 builds
- add --num-output option for output index of active element in combo-boxes

YAD 31.3 Changes

New 0.31.3 bugfix release of YAD available for download

This release fixes setting default value for completion entry in form
dialog

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#112 Post by Geoffrey »

Yad html browser to run flash swf games, needs flash and webkit installed to work.

Code: Select all

yad --title="Pacman" --window-icon="/usr/share/pixmaps/pacman.png" --html --browser --uri="./pacman.swf" --no-buttons --geometry="800x600"
Attachments
pacman.pet
(62.03 KiB) Downloaded 213 times
pacman.png
(63.19 KiB) Downloaded 1178 times
[b]Carolina:[/b] [url=http://smokey01.com/carolina/pages/recent-repo.html]Recent Repository Additions[/url]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#113 Post by slavvo67 »

Dang Webkit! Why do you mock me so!! :roll:

stemsee

#114 Post by stemsee »

Me too!

stemsee

#115 Post by stemsee »

Me too!

stemsee

#116 Post by stemsee »

Me too!

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#117 Post by slavvo67 »

YAD 33.0 Pet. Now, I'm putting a YAD changes text file in root so all can see what's been added.

https://copy.com/JJZAd0afRdX7el8P

Best,

Slavvo67

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#118 Post by slavvo67 »

YAD 33.1 tested for Vivid and Upup Precise. Should work for most. I created the others posted in this thread in Quirky Unicorn and noticed they didn't work in some other Puppies.

https://copy.com/a9YhztWGAVlJF2jU

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#119 Post by step »

I got word from a fried that (untested by me):

the recent update to yad - 0.33.1 (GTK+ 2.24.10) breaks all dialogs with time outs in them.

The fix is to delete the yad config file.

It is at one or two places:

rm $XDG_CONFIG_HOME/yad.conf

and/or

rm $HOME/.config/yad.conf
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

stemsee

#120 Post by stemsee »

I don't know if anyone found this, but if you want a yad form with entry box showing 'default' values it works like this.

Code: Select all

yad --title "Eduroam University WiFi Connection Tool:" \
--form --field="Your University id:" -text "abc123" -entry \
--field="Your University password" -text "aBcD3210" -entry --field="Interface:" -text "wlan0" -entry
for the password field I wanted to used --hide-text eg

Code: Select all

yad --title "Life" --form --field="love" --entry --hide-text
That works but only as a single line occurrence, in among several fields it doesn't work ... for me! Anyone?
Attachments
capture1240.png
(18.44 KiB) Downloaded 856 times

Post Reply