YAD - Tips
Did that work at all? I use code like this:
charlis=$(yad --center --title='Website Search' --form --columns=2 --form --field='Google Search' --form --field='Gigablast Search' --form --field='Bing Search' --form --field='Tumbler Search' 'Football' 'Horse Racing' 'Camping' 'Investing' )
Note: The columns=2 only works with newer versions of YAD.
charlis=$(yad --center --title='Website Search' --form --columns=2 --form --field='Google Search' --form --field='Gigablast Search' --form --field='Bing Search' --form --field='Tumbler Search' 'Football' 'Horse Racing' 'Camping' 'Investing' )
Note: The columns=2 only works with newer versions of YAD.
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
About yad Font selector
Bonjour,
Latest releases of YAD let the font selector return an output of this form:
name|style|size
But, in some cases:
Italique instead of Italic for French speaking users. The problem is that when running this command:
the selector does not recognize the input font and displays the default "Sans" font instead of the expected "Brush Script MT".
As a test and workaround I tried to run YAD this way:kursiv...
This time I get the real English name of the font and obviously
works...
Now, my question is what could be the effects of this variable LANG on the rest of my script if I only use it running my font function? Is it something to avoid?
Thank you.
Cordialement.
Latest releases of YAD let the font selector return an output of this form:
name|style|size
Example:# yad --help-font
Usage:
yad [OPTION...] - Yet another dialoging program
Font selection options
--font Display font selection dialog
--font-selection Alias for --font
--preview=TEXT Set text string for preview
--separate-output Separate output of font description
Code: Select all
yad --font --separate-output
Sans|Bold Italic|10
Code: Select all
# yad --font --separate-output
Brush Script MT|Italique|10
Code: Select all
yad --font --separate-output --fontname="Brush Script MT Italique 10"
As a test and workaround I tried to run YAD this way:
Code: Select all
# LC_MESSAGES=C yad --window-icon gtk-select-font --font --separate-output
Brush Script MT|Italique|10
# LC_CTYPE=C yad --window-icon gtk-select-font --font --separate-output
Brush Script MT|kursiv|10
Code: Select all
LANG=en_US.UTF-8 yad --window-icon gtk-select-font --font --separate-output
Code: Select all
LANG=en_US.UTF-8 yad --window-icon gtk-select-font --font --separate-output="Brush Script MT Italic 10"
Now, my question is what could be the effects of this variable LANG on the rest of my script if I only use it running my font function? Is it something to avoid?
Thank you.
Cordialement.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: About yad Font selector
You should post this to Yad's bug tracker.Argolance wrote:...the selector does not recognize the input font and displays the default "Sans" font instead of the expected "Brush Script MT".
Don't be shocked. It is German language.Argolance wrote:kursiv...
No. Effect is in that single line only.Argolance wrote:Now, my question is what could be the effects of this variable LANG on the rest of my script if I only use it running my font function? Is it something to avoid?
I think LANG=C better than LANG=en_US.UTF-8 because it is defined in every system.
Cordialement
- Argolance
- Posts: 3767
- Joined: Sun 06 Jan 2008, 22:57
- Location: PORT-BRILLET (Mayenne - France)
- Contact:
Bonjour,
Thanks.
Onlyworks properly.
It only concerns some fonts and it is not very important, though (from my layman's point of view), I find it rather strange that it seems to be so complicated to get the same style result as got without the option "--separate-output".
Cordialement.
Thanks.
I reported this "issue" to Victor Ananjevsky who replied:L18L wrote:You should post this to Yad's bug tracker.
...Victor wrote:so bug (if this is a bug) must be digged somewhere under yad
Not "shocked" strictly speaking but just surprised! (I thought it was russian!)Don't be shocked. It is German language.
Good thing to know.L18L wrote:No. Effect is in that single line only.
This unfortunately (as well as LC_MESSAGES=C or LC_CTYPE=C, as reported above) doesn't work.I think LANG=C better than LANG=en_US.UTF-8 because it is defined in every system.
Only
Code: Select all
LANG=en_US.UTF-8
It only concerns some fonts and it is not very important, though (from my layman's point of view), I find it rather strange that it seems to be so complicated to get the same style result as got without the option "--separate-output".
Code: Select all
# yad --font
Brush Script MT Italic 10
Code: Select all
# yad --font --separate-output
Brush Script MT|Italique|10
So to hide password text without using --hide-text is to use :H
Code: Select all
yad --title "Eduroam University WiFi Connection Tool:" \
--form --field="Your University id:" -text "abc123" -entry \
--field=Password:H -text "aBcD3210" -entry --field="Interface:" -text "wlan0" -entry
I am working on a yad gui for a simpler wifi connection tool
- Attachments
-
- capture25227.png
- (26.15 KiB) Downloaded 1305 times
-
- capture5335.png
- (39.11 KiB) Downloaded 1308 times
-
- capture18480.png
- (19.87 KiB) Downloaded 1349 times
Last edited by stemsee on Sat 26 Mar 2016, 16:16, edited 2 times in total.
Here's an example of using tabs. The yad key gives permission to use shared memory.
Code: Select all
#!/bin/sh
yad --plug=123456 --tabnum=1 --text="first tab with text" &> res1 &
yad --plug=123456 --tabnum=2 --text="second tab" --entry &> res2 &
yad --plug=123456 --tabnum=3 --text="second tab" --entry &> res3 &
yad --plug=123456 --tabnum=4 --text="second tab" --entry &> res4 &
yad --notebook --key=123456 --tab="Tab 1" --tab="Tab 2" --tab="Tab 3" --tab="Tab 4
- Attachments
-
- capture26884.png
- (9.1 KiB) Downloaded 1371 times
adding combobox and entry to tabs and image!
- Attachments
-
- capture32294.png
- (43.33 KiB) Downloaded 1293 times
-
- capture731.png
- (34.65 KiB) Downloaded 1288 times
yad notification
Make fifo pipe first
Menu is '|' separated items. text '!' command.
Code: Select all
# run yad and tell it to read its stdin from the file descriptor
yad --notification --kill-parent --listen --image=/usr/share/pixmaps/wifi.png --text="$netsel `ifconfig | grep "inet addr" | tail -1`" --command="yaf-splash -text '`ifconfig $int`'" <&3 &
Code: Select all
PIPE=$(mktemp -u )
mkfifo -m MODE $PIPE
# attach a filedescriptor to this pipe
exec 3<> $PIPE
Code: Select all
# (d) write stuff to the file descriptor
scanres=`iwlist $int scan | grep 'ESSID' | rev | cut -f1 -d ':' | rev | tr '\n' '|'`
MENU="$scanres! wifi-connectn|Disconnect! ifconfig '$int' down|Reconnect! ifconfig '$int' up|Ethernet 1! ifconfig eth0 up|Ethernet 1 disconnect! ifconfig eth0 down"
echo "menu:$MENU" >&3
- Attachments
-
- capture28494.png
- (14.43 KiB) Downloaded 1271 times
-
- capture137.png
- (227.73 KiB) Downloaded 1277 times
Hi stemsee,stemsee wrote:But how to show icons/images in the yad -notification MENU?
Here's how I did it for pWget's tray icon:
Code: Select all
yad --notification --image="$WORKDIR/header.png" --command="$WORKDIR/pWget" --text=" pWget $(gettext 'download manager') " --menu="$(gettext 'About')!$WORKDIR/about-pwget!$WORKDIR/star.png|$(gettext 'Forum')!xdg-open http://www.murga-linux.com/puppy/viewtopic.php?t=90541!$WORKDIR/group.png|$(gettext 'webpage')!xdg-open http://bert2.be/pWget-0.9.4.html!$WORKDIR/house.png|wget-$(gettext 'help')!urxvt --geometry 80x20+2+0 -hold -e wget -h!$WORKDIR/help.png|wget manual!xdg-open http://www.gnu.org/software/wget/manual/wget.html!$WORKDIR/book_open.png"
- Attachments
-
- scrot.png
- (12.31 KiB) Downloaded 1239 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]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
Stemsee, yes, I should have given some more explanation.stemsee wrote:@Bert
I can only get a jad.png to display. Is there a size for the icon? Where is your Workdir?
It's simple: My "WORKDIR" here is part of my little pWget script. So, those icons are not available to you.
Just choose your own icons and enter their path.
The yad.png you see is just because your system cannot find my examples.
The icons in my menu are typically around 500 to 600 bytes (and roughly 4KB on disk).
I tried to minimize the "weight" of the icons, but I don't think bigger icons would pose a problem.
If you need more details, please ask.
[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]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
Stemsee, I think I now better understand your question. Just checked with a 48x48 icon. It works. But for a menu a 12x12 (or maybe 24x24) is better, depending on the length of the menu. The top icon is the 48x48: (see what happens..?)
- Attachments
-
- 2016-03-30-220106_2_scrot.png
- (15.2 KiB) Downloaded 1163 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]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
here is the format I am using, but nothing I have tried shows any other icon than standard yad green bottle! And when it does show it disables the following command!!
Which version of yad do you use Bert?
Code: Select all
yad --notification --kill-parent --listen \
--image=/usr/share/pixmaps/wifi.png --text="`iwconfig $int`"\
--command="yad --undecorated --center --no-buttons --image /usr/share/pixmaps/wifi.png --text '$mytext31'" <&3 &
pid=$!
pics=/usr/share/icons/hicolor/16x16/wifi.png
scanres2=`iwlist $int scan | grep 'ESSID' | rev | cut -f1 -d ':' | rev | tr '\n' '|'`
scanres=`iwconfig $int | tr '\n' '|'`
MENU="$scanres2 $mytext4! wifi-connect2|$mytext30! defaultbrowser|$mytext10! ifconfig '$int' down|$mytext11! ifconfig '$int' up|Wlan1! ifconfig wlan1 up| wlan1 $mytext10! ifconfig wlan1 down|Ethernet 1! ifconfig eth0 up|Ethernet 1 $mytext10! ifconfig eth0 down|Ethernet 2! ifconfig eth1 up|Ethernet 2 $mytext10! ifconfig eth1 down|$mytext12! ifconfig usb0 up|$mytext13! ifconfig usb0 down|$mytext19! hotspot|$mytext9! kill $pid"
echo "menu:$MENU" >&3 &
Hi stemsee,
I'm using yad-version 0.35.0
For the menu thingie,Yad has a strict logic:
You cannot deviate from that.
Just try it at your leisure with a very simple example.
Also, you have a space after every "!". Not sure if that is possible.
Good luck and keep us posted,
Bert
I'm using yad-version 0.35.0
For the menu thingie,Yad has a strict logic:
Code: Select all
|text!command!image|
Just try it at your leisure with a very simple example.
Also, you have a space after every "!". Not sure if that is possible.
Good luck and keep us posted,
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]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]
I have what should be an easy problem to solve but I've had no luck so far.
I want to be able to set the spin box with a min of 0.0 and the max of 1.0 with steps of 0.1 or maybe even 0.001.
Does anyone know how to do this with the code below?
#!/bin/sh
yad --form \
--field="Number:NUM" \
"5" | while read line; do
NUMBER=`echo $line | awk -F',' '{print $1}'`
echo $NUMBER
done
TIA
I want to be able to set the spin box with a min of 0.0 and the max of 1.0 with steps of 0.1 or maybe even 0.001.
Does anyone know how to do this with the code below?
#!/bin/sh
yad --form \
--field="Number:NUM" \
"5" | while read line; do
NUMBER=`echo $line | awk -F',' '{print $1}'`
echo $NUMBER
done
TIA
- rg66
- Posts: 1158
- Joined: Mon 23 Jul 2012, 05:53
- Location: Vancouver, BC Canada / Entebbe, Uganda Africa!?!
From script:smokey01 wrote:I have what should be an easy problem to solve but I've had no luck so far.
I want to be able to set the spin box with a min of 0.0 and the max of 1.0 with steps of 0.1 or maybe even 0.001.
Does anyone know how to do this with the code below?
#!/bin/sh
yad --form \
--field="Number:NUM" \
"5" | while read line; do
NUMBER=`echo $line | awk -F',' '{print $1}'`
echo $NUMBER
done
TIA
Code: Select all
yad --form --field="Number:NUM" 0!0..1!0.1!1
yad --form --field="Number:NUM" 0!0..1!0.01!2
yad --form --field="Number:NUM" 0!0..1!0.001!3
yad --form --field="Number:NUM" 0!0..1!0.05!2 (increments of 0.05)
Code: Select all
yad --form --field="Number:NUM" 0\!0..1\!0.1\!1
etc.....
- Attachments
-
- Screenshot(2).jpg
- (7.42 KiB) Downloaded 1121 times
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]
[url=http://smokey01.com/rg66/]X-series repo[/url]