#!/bin/bash
yad --form --field="Select jpg files:":FL 'sf.jpg' --field="Select text files:":SFL 'sf.txt' \
--file-filter="Image Files (*.jpg *.jpeg)| *.jpg *.JPG *.jpeg *.JPEG" --file-filter="Text Files (*.txt)| *.txt *.TXT" \
--file-filter="All Files | *.*"#!/bin/bash
yad --plug=12345 --tabnum=1 --text="first tab" --form --field="Select jpg files:":FL 'sf.jpg' \
--file-filter="Image Files (*.jpg *.jpeg)| *.jpg *.JPG *.jpeg *.JPEG" &> res1 &
yad --plug=12345 --tabnum=2 --text="second tab" --form --field="Select text files:":SFL 'sf.txt' \
--file-filter="Text Files (*.txt)| *.txt *.TXT!" &> res2 &
yad --notebook --key=12345 --tab="Tab 1" --tab="Tab 2"
cat res1 res2 | tr "|" " "
rm -f res1 res2$ yad --file-selection --mime-filter text/plain \
--mime-filter text/html
$ yad --file-selection --file-filter \*.txt \
--file-filter \*.htm\*
========================================
$ man yad
File filters options
--file-filter=NAME | PATTERN1 PATTERN2 ...
Add a filename filter. NAME is a displayed filter name, PATTERN is a shell-style filename pattern (for example *.txt). This option may be used mul‐
tiply times.
--mime-filter=NAME | MIME1 MIME2 ...
Add a mime-type filter. NAME is a displayed filter name, PATTERN is a name of mime type (for example text/plain). This option may be used multiply
times.
--image-filter=[NAME]
Add filter for images supported by gdk-pixbuf library. NAME in as optional name for this filter.
--add-preview
Add preview widget. Preview images loads from large or normal thumbnails according to XDG Thumbnails specification v0.8.0 (http://stan‐
dards.freedesktop.org/thumbnail-spec/latest/) or creates by yad for image files and saves as large thumbnails.
This options applies to all of yad's file chooser dialogs.
|
Mime |
Extensões |
Mime |
Extensões |
|
application/mac-binhex40 |
hqx |
application/octet-stream |
bin,exe |
|
application/oda |
oda |
application/pdf |
|
|
application/postscript |
ai,eps,ps |
application/rtf |
rtf |
|
application/x-gtar |
gtar |
application/x-mif |
mif,fm |
|
application/x-shar |
shar |
application/x-tar |
tar |
|
audio/basic |
au,snd |
audio/x-aiff |
aif,aiff,aifc |
|
audio/x-wav |
wav |
image/gif |
gif |
|
image/ief |
ief |
image/jpeg |
jpeg,jpg,jpe |
|
image/tiff |
tiff,tif |
image/x-rgb |
rgb |
|
image/x-xbitmap |
xbm |
image/x-xpixmap |
xpm |
|
image/x-xwindowdump |
xwd |
magnus-internal/cgi |
cgi,exe,bat |
|
magnus-internal/imagemap |
map |
magnus-internal/jsp |
jsp |
|
magnus-internal/parsed-html |
shtml |
text/html |
htm,html |
|
text/plain |
txt |
text/richtext |
rtx |
|
text/tab-separated-values |
tsv |
text/x-setext |
etx |
|
video/mpeg |
mpeg,mpg,mpe |
video/quicktime |
qt,mov |
|
video/x-msvideo |
avi |
|
|
Shell básico e Programação em Shell Julio Neves
Bacula Heitor Medrado
Zabbix Adail Host
Produção Gráfica e Videografismo Cadunico
--
You received this message because you are subscribed to the Google Groups "yad-common" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Shell básico e Programação em Shell Julio Neves
Bacula Heitor Medrado
Zabbix Adail Host
Produção Gráfica e Videografismo Cadunico
--
Shell básico e Programação em Shell Julio Neves
Bacula Heitor Medrado
Zabbix Adail Host
Produção Gráfica e Videografismo Cadunico
--
#!/bin/bash
function IMAGE
{
while : ; do
FILE="$(yad --file-selection --width=500 --height=400 \
--title="Select an Image" --file-filter='Image Files (*.jpg *.jpeg)| *.jpg *.JPG *.jpeg *.JPEG' \
|| echo 'sf.jpg'
)"
if [[ "$FILE" == "sf.jpg" ]] || [[ -f "$FILE" ]]; then
break
fi
done
printf "%s" "1:$FILE"
}
export -f IMAGE
function TEXT
{
while : ; do
FILE="$(yad yad --file-selection --width=500 --height=400 \
--title="Select a Text File" --file-filter='Text Files *.txt | *.txt *.TXT' \
|| echo 'sf.txt'
)"
if [[ "$FILE" == "sf.txt" ]] || [[ -f "$FILE" ]]; then
break
fi
done
printf "%s\n" "2:$FILE"
}
export -f TEXT
# Main dialog
yad --form --width=550 --height=400 \
--field="Image:":RO "sf.jpg" \
--field="Text:":RO "sf.txt" \
--field="Select Image":fbtn '@bash -c "IMAGE %1"' \
--field="Select Text":fbtn '@bash -c "TEXT %1"'
#!/bin/bash
function IMAGE
{
while : ; do
FILE="$(yad --file-selection --width=800 --height=600 --add-preview \
--title="Select an Image" --file-filter='Image Files (*.jpg *.jpeg *.png)| *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG' \
|| echo 'sf.jpg'
)"
if [[ "$FILE" == "sf.jpg" ]] || [[ -f "$FILE" ]]; then
break
fi
done
printf "%s\n" "1:$FILE"
printf "%s" "1:@disabled@"
}
export -f IMAGE
function TEXT
{
while : ; do
FILE="$(yad yad --file-selection --width=600 --height=400 \
--title="Select a Text File" --file-filter='Text Files *.txt | *.txt *.TXT' \
|| echo 'sf.txt'
)"
if [[ "$FILE" == "sf.txt" ]] || [[ -f "$FILE" ]]; then
break
fi
done
printf "%s\n" "2:$FILE"
printf "%s" "2:@disabled@"
}
export -f TEXT
# Main dialog
yad --form --width=550 --height=400 \
--field="Image:":FL "@disabled@" \
--field="Text:":FL "@disabled@" \
--field="Select Image":fbtn '@bash -c "IMAGE %1"' \
--field="Select Text":fbtn '@bash -c "TEXT %1"'