Zenity/Yad and scripts

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#61 Post by Geoffrey »

Yad still seems to be going ahead, the latest version is 0.23.1, the issue of text placement is fixed in " yad --text " it now can be centered, the window resizing is resolved and buttons can also be centered.

It's been very quite here in regard to Yad.

Code: Select all

#!/bin/bash

process=`ps -u $USER | yad --list --title="Kill Process" --window-icon="process-stop" --buttons-layout=center --column "Please select a process to kill:" --text="List all $USER processes:" --width 350 --height 450`

ans=`echo $?`

	if test "$ans" -eq "0" ;
	then

		select=`echo $process | cut -d" " -f1`

		kill $select
			ans1=`echo $?`
			if [ "$ans1" == "0" ] ;
			then 
			select1=`echo $process | cut -d":" -f3  | cut -d" " -f2`
 			echo | yad --fixed --timeout="5" --title="Kill Process" --window-icon="process-stop" --buttons-layout=center --button="gtk-ok:0" --text-align="center" --borders="30" \
 			--text="<big><big><b>${select1%|*}</b></big></big><big><b> was killed!</b></big>" 
			else
 			echo | yad --fixed --timeout="5" --title="Kill Process" --window-icon="process-stop" --buttons-layout=center --button="gtk-ok:0" --text-align="center" --borders="30" \
 			--text="<big><big><b>Process</b></big></big><big><b> not found!</b></big>" 
			fi
	exit 0
 	fi 
 
	if test "$ans" -eq "1" ;
	then
	exit 0
	fi
Attachments
yad-0.23.1.tar.gz
Yad version 0.23.1 compiled in Carolina
(57.3 KiB) Downloaded 499 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]

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

#62 Post by Geoffrey »

Latest Yad compiled in Carolina.
Victor Ananjevsky
Dec 6 (15 hours ago)

hi, list

new version (0.25.1) of yad is available for download
this is a bugfix release.

changes are:
- fix bug with popup menu of notification icon (http://code.google.com/p/yad/issues/detail?id=196)
- use normal hints for windows, so now window managers doesn't treats yad windows as a dialogs
Attachments
yad-0.25.1-i486.pet
(97.68 KiB) Downloaded 521 times
yad_DOC-0.25.1-i486.pet
(9.51 KiB) Downloaded 483 times
yad_NLS-0.25.1-i486.pet
(55.68 KiB) Downloaded 460 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]

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#63 Post by mikeb »

It's been very quite here in regard to Yad.
It gets quietly used here :D.
Did a redo of pburn using it recently just to try out various options.

Thanks for the update and supporting it and not being trapped in the box :)

mike
Last edited by mikeb on Sat 07 Dec 2013, 08:20, edited 1 time in total.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#64 Post by L18L »

Did work on a "redo of pmount" ymount http://www.murga-linux.com/puppy/viewto ... &start=101 long time ago

Thanks for the update.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#65 Post by mikeb »

Ah ymount...neat. ..playing with it now.

Did not know about yad when I rewrote pmount ... ended up around 3k and auto refreshing and faster but remained gtkdialog3...recently used that desktop widget thingy to make pseudo icons with it along with a revitalised mut for the backend .. was not sure if I could do it with yad but perhaps I could revisit it.

mike

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#66 Post by L18L »

mikeb wrote:Ah ymount...neat. ..playing with it now.
Ymount was started by iguleder.
My contribution and interest was mainly addition of GUI language switchable between several languages from ymount-NLS.pet.
You can play with them, no need to add or change locale IIRC.

edit
Just switch between your installed locales :cry:

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

#67 Post by Geoffrey »

Yad 0.27.0 Updated: Aug 1 2014

YAD WIKI

Compiled in Carolina.

Changelog:
- add --hidden option to notification icon
- add --tooltip-column option to list dialog
- add --gtkrc option
- fix detection of expanding columns in list dialog
- fix markup handling
- add YAD_XID variable for dialogs children
- code cleanup for remove deprecated api
Attachments
yad-0.27.0.pet
(98 KiB) Downloaded 376 times
yad_DOC-0.27.0.pet
(9.76 KiB) Downloaded 356 times
yad_NLS-0.27.0.pet
(58.33 KiB) Downloaded 314 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]

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#68 Post by WoodLark »

When using YAD to open a file search dialogue, it is possible to set the start directory for the search as follows:

--filename "/home/user/directorytostartin/"

However when using a file search button within a form, this does not work:

--form
--field:FL "/home.user/directorytostartin/"

Is there a way to set the start directory within a form?

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

#69 Post by ASRI éducation »

Geoffrey wrote:Yad 0.27.0 Updated: Aug 1 2014
Thank you Geoffrey!
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

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

#70 Post by Geoffrey »

WoodLark wrote:When using YAD to open a file search dialogue, it is possible to set the start directory for the search as follows:

--filename "/home/user/directorytostartin/"

However when using a file search button within a form, this does not work:

--form
--field:FL "/home.user/directorytostartin/"

Is there a way to set the start directory within a form?
Shouldn't that have a "="

Code: Select all

--field=":FL" "/home.user/directorytostartin/"

Code: Select all

# yad --help-form
Usage:
  yad [OPTION...] Yet another dialoging program

Form options
  --form                                         Display form dialog
  --field=LABEL[:TYPE]                           Add field to form (TYPE - H, RO, NUM, CHK, CB, CBE, FL, SFL, MFL, DIR, CDIR, MDIR, FN, DT, SCL, CLR, BTN, LBL or TXT)
  --align=TYPE                                   Set alignment of filed labels (left, center or right)
  --columns=NUMBER                               Set number of columns in form
  --separator=SEPARATOR                          Set output separator character
  --item-separator=SEPARATOR                     Set separator character for combobox or scale data
  --date-format=PATTERN                          Set the format for the returned date
  --scroll                                       Make form scrollable
  --quoted-output                                Quote dialogs output
[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]

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#71 Post by WoodLark »

Geoffrey wrote:
WoodLark wrote:When using YAD to open a file search dialogue, it is possible to set the start directory for the search as follows:

--filename "/home/user/directorytostartin/"

However when using a file search button within a form, this does not work:

--form
--field:FL "/home.user/directorytostartin/"

Is there a way to set the start directory within a form?
Shouldn't that have a "="

Code: Select all

--field=":FL" "/home.user/directorytostartin/"

Code: Select all

# yad --help-form
Usage:
  yad [OPTION...] Yet another dialoging program

Form options
  --form                                         Display form dialog
  --field=LABEL[:TYPE]                           Add field to form (TYPE - H, RO, NUM, CHK, CB, CBE, FL, SFL, MFL, DIR, CDIR, MDIR, FN, DT, SCL, CLR, BTN, LBL or TXT)
  --align=TYPE                                   Set alignment of filed labels (left, center or right)
  --columns=NUMBER                               Set number of columns in form
  --separator=SEPARATOR                          Set output separator character
  --item-separator=SEPARATOR                     Set separator character for combobox or scale data
  --date-format=PATTERN                          Set the format for the returned date
  --scroll                                       Make form scrollable
  --quoted-output                                Quote dialogs output
You are correct. I left out the equals sign in my post. However, I had not left it out in my actual code, so I still have the problem.

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#72 Post by WoodLark »

I believe I have solved this problem, but I am not really sure why my solution works. Here is my actual form code:

Code: Select all

	response=$(yad --width=500 --title="SRRPC Club Mail" \
		--form \
		--button="NEXT" \
		--field="Distribution":CB \
			'Members!Officers' \
		--field="Subject" \
		--field="Message":FL '' '/root/SRRPC/Messages/*' \
		--field="Address":FL '/root/SRRPC/AddressLists/*' \
		) ; echo $response
Note that I had to put an extra pair of single quotes in the "Message" field parameters, but not in the "Address" field parameters.

Without the extra quotes, the expression "/root/SRRPC/Messages/*" appeared as default text in the "Subject" field.

I am curious as to why this is so!

OK, I may have answered my own question. If I move the single quotes to the parameters of the "subject" field, it works the same way. This is probably where they belong anyway.

Code: Select all

	response=$(yad --width=500 --title="SRRPC Club Mail" \
		--form \
		--button="NEXT" \
		--field="Distribution":CB \
			'Members!Officers' \
		--field="Subject" '' \
		--field="Message":FL '/root/SRRPC/Messages/*' \
		--field="Address":FL '/root/SRRPC/AddressLists/*' \
		) ; echo $response

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

#73 Post by rg66 »

Code: Select all

response=$(yad --width=500 --title="SRRPC Club Mail" \
      --form \
      --button="NEXT" \
      --field="Distribution:CB" \
         "Members!Officers" \
      --field="Subject" "" \
      --field="Message:FL" "/root/SRRPC/Messages/*" \
      --field="Address:FL" "/root/SRRPC/AddressLists/*" \
      ) ; echo $response 
You should also be quoting the :CB part and I've found that when using --form and you have a default for one field you need one for all of them so "" will work as a blank default.

Check out this page on yad which has better explanations than yad --help-all

http://rpm.pbone.net/index.php3/stat/45 ... /nazwa/yad
X-slacko-5b1 - X-tahr-2.0 - X-precise-2.4
[url=http://smokey01.com/rg66/]X-series repo[/url]

User avatar
WoodLark
Posts: 142
Joined: Tue 17 Apr 2007, 15:15
Location: South Carolina, USA

#74 Post by WoodLark »

rg66 wrote:

Code: Select all

response=$(yad --width=500 --title="SRRPC Club Mail" \
      --form \
      --button="NEXT" \
      --field="Distribution:CB" \
         "Members!Officers" \
      --field="Subject" "" \
      --field="Message:FL" "/root/SRRPC/Messages/*" \
      --field="Address:FL" "/root/SRRPC/AddressLists/*" \
      ) ; echo $response 
You should also be quoting the :CB part and I've found that when using --form and you have a default for one field you need one for all of them so "" will work as a blank default.

Check out this page on yad which has better explanations than yad --help-all

http://rpm.pbone.net/index.php3/stat/45 ... /nazwa/yad
Thank you, the documentation I had been able to find about YAD was not clear on where quote marks needed to be. In fact it seems to work whether you use the quotes or not (but I imagine there are cases where it would matter a great deal).

I'll just have to remember "default for one, default for all".

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

#75 Post by slavvo67 »

Can someone create new pets for YAD? It's still a very live project and I noticed there were March 2015 changes.

Thank you,

Slavvo67

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#76 Post by smokey01 »

Yad is a single binary and very easy to compile.
Download the source, unpack it.
In the unpacked directory where you see the configure script open a terminal and type ./configure --prefix=/usr then press enter.
Once it has finished type make.
You should now see the yad binary. Copy it to /usr/bin
Job done.

You do need the devx loaded before you can compile.

Cheers.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#77 Post by greengeek »

Thanks for the tips smokey. That enabled me to compile the latest yad for my Slacko 5.6 derivative.

If anyone wants a copy it's here:
http://www.mediafire.com/download/wr7gs ... -slk56.pet

Post Reply