Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 26 Apr 2018, 15:52
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
YAD - Tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 22 of 28 [417 Posts]   Goto page: Previous 1, 2, 3, ..., 20, 21, 22, 23, 24, 25, 26, 27, 28 Next
Author Message
misko_2083


Joined: 08 Nov 2016
Posts: 30

PostPosted: Sun 06 Aug 2017, 20:46    Post subject: yad internet radio player  

Not so much stations in this little internet radio player, but at least got it working. Requres: mpv and yad

The radio stations are in a separate file, and should be in the same folder.
Otherwise, it can be this line in the script:
Code:
export pmrp_stations="stations"
pmrp.tar
Description 
tar

 Download 
Filename  pmrp.tar 
Filesize  20 KB 
Downloaded  92 Time(s) 
pmrp.png
 Description   
 Filesize   80.58 KB
 Viewed   813 Time(s)

pmrp.png

Back to top
View user's profile Send private message 
drxspace

Joined: 28 Jul 2017
Posts: 3

PostPosted: Tue 08 Aug 2017, 06:09    Post subject:  

Hello everyone,

as I've post here: https://groups.google.com/d/msg/yad-common/d4YLAE_3-5o/W0owMLv_FwAJ, I'm facing the same issue. Take for example the next code:
Code:
yad --form --width=320 --height=240 --borders=5 --fixed --center \
       --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" \
       --image="system-software-install" --image-on-top \
       --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n\
These are packages from all enabled \nrepositories except for base and base-devel \nones. Also, you\'ll find packages that \nare locally installed such as AUR packages." \
       --buttons-layout="center" \
       --button=$"Κλείσιμο!window-close!Κλείνει το παράθυρο:0"


I would like to ask: Why the dialog window/form doesn't obey the --height=N rules?

Thanks for your prompt response to this matter.
Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2682
Location: South Australia

PostPosted: Tue 08 Aug 2017, 06:29    Post subject:  

drxspace wrote:
Hello everyone,

as I've post here: https://groups.google.com/d/msg/yad-common/d4YLAE_3-5o/W0owMLv_FwAJ, I'm facing the same issue. Take for example the next code:
Code:
yad --form --width=320 --height=240 --borders=5 --fixed --center \
       --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" \
       --image="system-software-install" --image-on-top \
       --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n\
These are packages from all enabled \nrepositories except for base and base-devel \nones. Also, you\'ll find packages that \nare locally installed such as AUR packages." \
       --buttons-layout="center" \
       --button=$"Κλείσιμο!window-close!Κλείνει το παράθυρο:0"


I would like to ask: Why the dialog window/form doesn't obey the --height=N rules?

Thanks for your prompt response to this matter.


It seems work to here: I changed the width and height and put the "N" in brackets, not that should make a difference.

My code:
Code:
yad --form --width="350" --height="130" --borders=5 --fixed --center \
       --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" \
       --image="system-software-install" --image-on-top \
       --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n\
These are packages from all enabled \nrepositories except for base and base-devel \nones. Also, you\'ll find packages that \nare locally installed such as AUR packages." \
       --buttons-layout="center" \
       --button=$"Κλείσιμο!window-close!Κλείνει το παράθυρο:0"


What version of Yad are you using? yad --version
example.png
 Description   
 Filesize   13.32 KB
 Viewed   746 Time(s)

example.png


_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
drxspace

Joined: 28 Jul 2017
Posts: 3

PostPosted: Wed 09 Aug 2017, 06:32    Post subject:  

Hello,
thank you for your response.
smokey01 wrote:
What version of Yad are you using? yad --version

I'm running YAD 0.39.0 (GTK+ 3.22.18)

To be honest I've never thought that I could use string type values in these fields.

Anyway in order to address my problem I have to insist with with a different version of the same example.
In this version I removed some of the \n characters because I want my text, if possible, to be dynamically wrapped in the dialog window, also I removed the --fixed option...

Code:
yad --form --width="350" --height="130" --borders=5 --center --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" --image="system-software-install" --image-on-top --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\nThese are packages from all enabled repositories except for base and base-devel ones. Also, you\'ll find packages that are locally installed such as AUR packages." --buttons-layout="center" --button='Κλείσιμο!window-close!Κλείνει το παράθυρο:0'


...and the result was as shown below.

Why this behavior?

Thanks and again
About ArchLinux Packages Viewer.png
 Description   
 Filesize   15.23 KB
 Viewed   704 Time(s)

About ArchLinux Packages Viewer.png

Back to top
View user's profile Send private message 
smokey01


Joined: 30 Dec 2006
Posts: 2682
Location: South Australia

PostPosted: Thu 10 Aug 2017, 08:29    Post subject:  

@drxspace I am currently using yad 0.36.3 (GTK+ 2.24.31)

It may have something to do with gtk+3 or ArchLinux (assuming you are running Arch) as it's working fine here.

_________________
Software <-> Distros <-> Tips <-> Newsletters
Back to top
View user's profile Send private message Visit poster's website 
drxspace

Joined: 28 Jul 2017
Posts: 3

PostPosted: Thu 10 Aug 2017, 12:06    Post subject:  

Hi,
@smokey01 Yes, I'll agree with you it's probably a matter of GTK+ 3
Anyway, if I do not tire you, please have a look at the code below:
Code:
isitTheBlank=$(sed 's/[[:blank:]]*/·/g' <<<$"These are packages from all enabled repositories, except for base and base-devel ones. Also, you\'ll find packages that are locally installed, such as AUR packages.")

yad --form --width="350" --height="130" --borders=5 --center --window-icon="system-software-install" --title="About ArchLinux Packages Viewer" --image="system-software-install" --image-on-top --text="<span font_size='medium' font_weight='bold'>View Lists of Installed Packages</span>\n${isitTheBlank}" --buttons-layout="center" --button='Κλείσιμο!window-close!Κλείνει το παράθυρο:0'


Thank you for the remarks.
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2140
Location: In The Way

PostPosted: Fri 12 Jan 2018, 10:24    Post subject:  

How to make yad update instead of accumulate when piping data!

Code:
PATTERN='s/^.*Address: ([0-9A-Z:]*)/\n\1/p
s/^.*Quality=([^ ]*).*Signal level=(.*)/\1 \2/p
s/^.*key:([onf]*)/~\1~/p
s/^.*ESSID://p'
mkfifo /tmp/pipe
exec 4<>/tmp/pipe
while true; do echo "`iwlist wlan0 scan | sed -rn "$PATTERN" | tac`" >&4; sleep 5; done &
yad --list --item-separator=';' --columns=5 --column=wlan0 --column=security --column=signal --column=mac --column=save:CHK <&4 &
Back to top
View user's profile Send private message MSN Messenger 
slavvo67

Joined: 12 Oct 2012
Posts: 1513
Location: The other Mr. 305

PostPosted: Fri 12 Jan 2018, 17:54    Post subject:  

Still love YAD.

Guys, maybe you can provide guidance on something....

Take a look at Misko's post, specifically at the bottom buttons. How can I create a list of buttons going vertical and horizontal. Currently, I just get a long line of them going across AND it stretches past my screen width; not pretty. So like the generic OK and Cancel buttons but enhanced to list maybe 5 across and 10 vertical lines.

Thanks for any insight.

Slavvo67
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2140
Location: In The Way

PostPosted: Sat 13 Jan 2018, 05:43    Post subject:  

specify columns then if you have 16 buttons they will divide into 4x4 etc
Code:
yad --columns=4
Back to top
View user's profile Send private message MSN Messenger 
slavvo67

Joined: 12 Oct 2012
Posts: 1513
Location: The other Mr. 305

PostPosted: Fri 26 Jan 2018, 17:22    Post subject:  

Stemsee:

Thanks but that didn't work. I guess I should attach my code:

#!/bin/bash

#Slavvo67 MMPlay Version 5.0
#This is a GUI on top of M-Player
#You can create up to 3 Playlists or choose a folder to play.
#Good idea to know the keyboard commands...
# < > go back and forward in playlist (use shift)
# Arrow keys are rewind and fast forward type buttons
# f key is for full screen or default view. You can hit it twice to see the difference.
# 9 to decrease volume and 0 to increase volume.
# Enter or Return Key goes to next video in playlist.
# Esc or Q will either quit completely or go to the next video, depending.
# If you hold down the Esc button, it will eventually end the program...
# Spacebar is pause and start.
#
if [ -f "/root/.title1.play" ]; then
tab1=$(</root/.title1.play)
else
tab1="No Playlist-1"
fi
if [ -f "/root/.title2.play" ]; then
tab2=$(</root/.title2.play)
else
tab2="No Playlist-2"
fi
if [ -f "/root/.title3.play" ]; then
tab3=$(</root/.title3.play)
else
tab3="No Playlist-3"
fi
if [ -f "/root/.title4.play" ]; then
tab4=$(</root/.title4.play)
else
tab4="No Playlist-4"
fi
if [ -f "/root/.title9.play" ]; then
tab5=$(</root/.title9.play)
else
tab5="No Dir by Mod Date"
fi
cd /
subs555=$(yad --columns=4 --center --title="Choose if you want subtitles" --button="Subtitles:0" --button="No Subtitles:1" --button="Exit:2" )
subs1=$?
if [[ $subs1 -eq 2 ]]; then
exit 0
fi
if [[ -a /root/.Playlist.play || -a /root/.Playlist2.play || -a /root/.Playlist3.play || -a /root/.Playlist4.play ]]; then
usepl1=$(yad --center --title "Use current playlist or new?" --button="$tab1:0" --button="$tab2:4" --button="$tab3:8" --button="$tab4:9" --button="$tab5:3" --button="Other Options:2")
usepl2=$?
if [[ $usepl2 -eq 0 ]]; then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist.play
fi
exit
elif [[ $usepl2 -eq 1 ]]; then
rm /root/.Playlist.play
elif [[ $usepl2 -eq 4 ]]; then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist2.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist2.play
fi
exit
elif [[ $usepl2 -eq 8 ]]; then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist3.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist3.play
fi
exit
elif [[ $usepl2 -eq 9 ]]; then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist4.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist4.play
fi
exit
elif [[ $usepl2 -eq 3 ]]; then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist9.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist9.play
fi
exit
fi
fi
#yad --columns=4
### next line modifies the previously saved directories. So if changing...
file222=$(yad --width=120 --center --form --separator=" " --title="CREATE NEW PLAYLISTS" --button="Create Playlist 1:5" --button="Create Playlist 2:1" --button="Create Playlist 3:8" --button="Create Playlist 4:9" --button="Folder by Mod Date:0" --button="Folder of Vids:7" --button="Exit:2" )
ret=$?
if [[ $ret -eq 2 ]]; then
exit 0
fi
## CHOOSE FOLDER TO PLAY ###
if [[ $ret -eq 7 ]]; then
folder1=$(yad --columns=4 --center --title="Choose folder to play..." --file --directory --width=600 --height=400 --button="Exit:1" --button="OK:0")
ret8=$?
if [[ $ret8 -eq 1 ]]; then
exit 0
fi
cd "$folder1"
#mplayer -af volnorm=2:0.75 FooVideo.flv NOTE: This normalizes the volume across all played
if [[ *.[Mm][Pp][4]* ]]; then
for i in *.[Mm][Pp][4]*; do urxvt -e mplayer -af volnorm=2:0.75 -nosub -fs "$i" ; done
fi
if [[ *.[Mm][Pp][3] ]]; then
for i2 in *.[Mm][Pp][3]; do urxvt -e mplayer -af volnorm=2:0.75 -nosub -fs "$i2" ; done
fi
if [[ *.[Ww][Aa][Vv] ]]; then
for i2 in *.[Ww][Aa][Vv]; do urxvt -e mplayer -af volnorm=2:0.75 -nosub -fs "$i2" ; done
fi
if [[ *.[Mm][4][Aa] ]]; then
for i4 in *.[Mm][4][Aa]; do urxvt -e mplayer -af volnorm=2:0.75 -nosub -fs "$i4"; done
fi
if [[ *.wmv ]]; then
for i3 in *.wmv; do ffplay -fs -b:v 1000k "$i3" -volume 90; done
fi
exit
fi
##### PLAYLIST 1 ###
if [[ $ret -eq 3 ]]; then
#echo "Choose number of files in playlist:"
#read amount22
file112=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.mp4 *.mp4 *.wmv *.m4v *.m3v *.mpg *mpeg *.wav" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" )
ret22=$?
if [[ $ret22 -eq 1 ]];
then
exit
fi
echo "$file112">>/root/.Playlist.play
file113=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.mp4 *.mp4 *.wmv *.m4v *.m3v *.mpg *mpeg *.wav" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" )
ret22=$?
if [[ $ret22 -eq 1 ]];
then
exit
fi
echo "$file113">>/root/.Playlist.play
file114=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.mp4 *.mp4 *.wmv *.m4v *.m3v *.mpg *mpeg *.wav" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" )
ret22=$?
if [[ $ret22 -eq 1 ]];
then
exit
fi
echo "$file114">>/root/.Playlist.play
file115=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.mp4 *.mp4 *.wmv *.m4v *.m3v *.mpg *mpeg *.wav" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" )
ret22=$?
if [[ $ret22 -eq 1 ]];
then
exit
fi
echo "$file115">>/root/.Playlist.play
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist.play
fi
fi
############################################
if [[ $ret -eq 0 ]]; then
rm /root/.Playlist9.play # remove prior playlist
folder1=$(yad --center --title="Choose folder to play..." --file --directory --width=600 --height=400 --button="Exit:1" --button="OK:0")
ret8=$?
if [[ $ret8 -eq 1 ]]; then
exit 0
fi
cd "$folder1"
for f in *\ *; do mv "$f" "${f// /_}"; done
title9a=$(yad --center --title="Title For Playlist Folder" --form --field 'Playlist 9 Title' 'Folder by Mod Date')
title9=$(echo $title9a | awk 'BEGIN {FS="|" }{print $1}')
echo "$title9-folder" >/root/.title9.play
#while true; do
#file112=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.[Mm][Pp][4]* *.[Mm][Pp][3]* *.[Ww][Mm][Vv]* *.[Mm\[4][Vv]* *.[Mm][4][Aa]* .m3v *.mpg *mpeg" --file --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" )
#ret22=$?
#if [[ $ret22 -eq 1 ]];
#then
#ls -d -1 -t $PWD/*.* >/root/.Playlist4.play
#find . -type f -print0 | xargs -0 ls -ltr | head -n 1 >/root/.Playlist4a.play
##
ls -d -l -t $PWD/*.* >/root/.Playlist9a.play
tac /root/.Playlist9a.play|awk 'BEGIN {FS=" " }{print $9}'>/root/.Playlist9.play #TAC is reverse cat very nice
#tail /root/.Playlist4.play
#awk '{a[i++]=$0} END {for (j=i-1; j>=0Wink print a[j--] }' /root/.Playlist4.play
#rm /root/.Playlist4a.play
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist9.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist9.play
fi
exit
#fi
#echo "$file112">>/root/.Playlist4.play
#done
fi
################################################
# CREATE PLAYLIST 2 ### note: playlist 1 is two sections above
if [[ $ret -eq 1 ]]; then
#echo "Choose number of files in playlist:"
#read amount22
rm /root/.Playlist2.play # remove prior playlist
title2a=$(yad --center --title="Title For Playlist 2" --form --field 'Playlist 2 Title' 'Playlist2')
title2=$(echo $title2a | awk 'BEGIN {FS="|" }{print $1}')
while true; do
file112=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.[Mm][Pp][4]* *.[Mm][Pp][3]* *.[Ww][Aa][Vv]* *.wmv *.[Mm][4][Vv]* *.[Mm][4][Aa]* *.m3v *.mpg *mpeg" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" --button="Clear All:2" )
ret22=$?
if [[ $ret22 -eq 2 ]];
then
tab2="No Playlist-2"
echo "$tab2" >/root/.title2.play
exit
fi
if [[ $ret22 -eq 1 ]];
then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist2.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist2.play
fi
exit
fi
file112a=$(echo $file112 | awk 'BEGIN {FS="|" }{print $1}')
file112b=$(echo $file112 | awk 'BEGIN {FS="|" }{print $2}')
file112c=$(echo $file112 | awk 'BEGIN {FS="|" }{print $3}')
file112d=$(echo $file112 | awk 'BEGIN {FS="|" }{print $4}')
file112e=$(echo $file112 | awk 'BEGIN {FS="|" }{print $5}')
file112f=$(echo $file112 | awk 'BEGIN {FS="|" }{print $6}')
file112g=$(echo $file112 | awk 'BEGIN {FS="|" }{print $7}')
file112h=$(echo $file112 | awk 'BEGIN {FS="|" }{print $8}')
file112i=$(echo $file112 | awk 'BEGIN {FS="|" }{print $9}')
file112j=$(echo $file112 | awk 'BEGIN {FS="|" }{print $10}')
file112k=$(echo $file112 | awk 'BEGIN {FS="|" }{print $11}')
file112l=$(echo $file112 | awk 'BEGIN {FS="|" }{print $12}')
file112m=$(echo $file112 | awk 'BEGIN {FS="|" }{print $13}')
file112n=$(echo $file112 | awk 'BEGIN {FS="|" }{print $14}')
file112o=$(echo $file112 | awk 'BEGIN {FS="|" }{print $15}')
echo "$file112a">>/root/.Playlist2.play
echo "$file112b">>/root/.Playlist2.play
echo "$file112c">>/root/.Playlist2.play
echo "$file112d">>/root/.Playlist2.play
echo "$file112e">>/root/.Playlist2.play
echo "$file112f">>/root/.Playlist2.play
echo "$file112g">>/root/.Playlist2.play
echo "$file112h">>/root/.Playlist2.play
echo "$file112i">>/root/.Playlist2.play
echo "$file112j">>/root/.Playlist2.play
echo "$file112k">>/root/.Playlist2.play
echo "$file112l">>/root/.Playlist2.play
echo "$file112m">>/root/.Playlist2.play
echo "$file112n">>/root/.Playlist2.play
echo "$file112o">>/root/.Playlist2.play
echo $title2 >/root/.title2.play # Note the .title2.play is a hidden file
done
fi
## CREATE PLAYLIST 3 ##
if [[ $ret -eq 8 ]]; then
#echo "Choose number of files in playlist:"
#read amount22
rm /root/.Playlist3.play # remove prior playlist
title3a=$(yad --center --title="Title For Playlist 3" --form --field 'Playlist 3 Title' 'Playlist3')
title3=$(echo $title3a | awk 'BEGIN {FS="|" }{print $1}')
while true; do
file112=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.[Mm][Pp][4]* *.[Ww][Aa][Vv]* *.[Mm][Pp][3]* *.wmv *.[Mm][4][Vv]* *.m3v *.mpg *mpeg" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" --button="Clear:2" )
ret22=$?
if [[ $ret22 -eq 2 ]];
then
tab3="No Playlist-3"
echo "$tab3" >/root/.title3.play
exit
fi
if [[ $ret22 -eq 1 ]];
then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist3.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist3.play
fi
exit
fi
file112a=$(echo $file112 | awk 'BEGIN {FS="|" }{print $1}')
file112b=$(echo $file112 | awk 'BEGIN {FS="|" }{print $2}')
file112c=$(echo $file112 | awk 'BEGIN {FS="|" }{print $3}')
file112d=$(echo $file112 | awk 'BEGIN {FS="|" }{print $4}')
file112e=$(echo $file112 | awk 'BEGIN {FS="|" }{print $5}')
file112f=$(echo $file112 | awk 'BEGIN {FS="|" }{print $6}')
file112g=$(echo $file112 | awk 'BEGIN {FS="|" }{print $7}')
file112h=$(echo $file112 | awk 'BEGIN {FS="|" }{print $8}')
file112i=$(echo $file112 | awk 'BEGIN {FS="|" }{print $9}')
file112j=$(echo $file112 | awk 'BEGIN {FS="|" }{print $10}')
file112k=$(echo $file112 | awk 'BEGIN {FS="|" }{print $11}')
file112l=$(echo $file112 | awk 'BEGIN {FS="|" }{print $12}')
file112m=$(echo $file112 | awk 'BEGIN {FS="|" }{print $13}')
file112n=$(echo $file112 | awk 'BEGIN {FS="|" }{print $14}')
file112o=$(echo $file112 | awk 'BEGIN {FS="|" }{print $15}')
echo "$file112a">>/root/.Playlist3.play
echo "$file112b">>/root/.Playlist3.play
echo "$file112c">>/root/.Playlist3.play
echo "$file112d">>/root/.Playlist3.play
echo "$file112e">>/root/.Playlist3.play
echo "$file112f">>/root/.Playlist3.play
echo "$file112g">>/root/.Playlist3.play
echo "$file112h">>/root/.Playlist3.play
echo "$file112i">>/root/.Playlist3.play
echo "$file112j">>/root/.Playlist3.play
echo "$file112k">>/root/.Playlist3.play
echo "$file112l">>/root/.Playlist3.play
echo "$file112m">>/root/.Playlist3.play
echo "$file112n">>/root/.Playlist3.play
echo "$file112o">>/root/.Playlist3.play
echo $title3 >/root/.title3.play
done
fi
### CREATE PLAYLIST 1 ### PLAYLIST 1
if [[ $ret -eq 5 ]]; then
rm /root/.Playlist.play # remove prior playlist
title1a=$(yad --center --title="Title For Playlist 1" --form --field 'Playlist 1 Title' 'Playlist1')
title1=$(echo $title1a | awk 'BEGIN {FS="|" }{print $1}')
while true; do
file112=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.[Mm][Pp][4]* *.[Ww][Aa][Vv]* *.[Mm][Pp][3] *.wmv *.m4v *.m3v *.mpg *mpeg" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" --button="Clear:2" )
ret22=$?
if [[ $ret22 -eq 2 ]];
then
tab1="No Playlist-1"
echo "$tab1" >/root/.title1.play
exit
fi
if [[ $ret22 -eq 1 ]];
then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist.play
fi
exit
fi
file112a=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $1}')
file112b=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $2}')
file112c=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $3}')
file112d=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $4}')
file112e=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $5}')
file112f=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $6}')
file112g=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $7}')
file112h=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $8}')
file112i=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $9}')
file112j=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $10}')
file112k=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $11}')
file112l=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $12}')
file112m=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $13}')
file112n=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $14}')
file112o=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $15}')
file112p=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $16}')
file112q=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $17}')
file112r=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $18}')
file112s=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $19}')
file112t=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $20}')
file112u=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $21}')
file112v=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $22}')
file112w=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $23}')
file112x=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $24}')
file112y=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $25}')
file112z=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $26}')
file112A=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $27}')
file112B=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $28}')
file112C=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $29}')
file112D=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $30}')
file112E=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $31}')
file112F=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $32}')
file112G=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $33}')
file112H=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $34}')
file112I=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $35}')
file112J=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $36}')
file112K=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $37}')
file112L=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $38}')
file112M=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $39}')
file112N=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $40}')
file112O=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $41}')
file112P=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $42}')
file112Q=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $43}')
file112R=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $44}')
file112S=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $45}')
file112T=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $46}')
file112U=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $47}')
file112V=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $48}')
file112W=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $49}')
file112X=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $50}')
file112Y=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $51}')
file112Z=$(echo "$file112" | awk 'BEGIN {FS="|" }{print $52}')
echo "$file112a">>/root/.Playlist.play
echo "$file112b">>/root/.Playlist.play
echo "$file112c">>/root/.Playlist.play
echo "$file112d">>/root/.Playlist.play
echo "$file112e">>/root/.Playlist.play
echo "$file112f">>/root/.Playlist.play
echo "$file112g">>/root/.Playlist.play
echo "$file112h">>/root/.Playlist.play
echo "$file112i">>/root/.Playlist.play
echo "$file112j">>/root/.Playlist.play
echo "$file112k">>/root/.Playlist.play
echo "$file112l">>/root/.Playlist.play
echo "$file112m">>/root/.Playlist.play
echo "$file112n">>/root/.Playlist.play
echo "$file112o">>/root/.Playlist.play
echo "$file112p">>/root/.Playlist.play
echo "$file112q">>/root/.Playlist.play
echo "$file112r">>/root/.Playlist.play
echo "$file112s">>/root/.Playlist.play
echo "$file112t">>/root/.Playlist.play
echo "$file112u">>/root/.Playlist.play
echo "$file112v">>/root/.Playlist.play
echo "$file112w">>/root/.Playlist.play
echo "$file112x">>/root/.Playlist.play
echo "$file112y">>/root/.Playlist.play
echo "$file112z">>/root/.Playlist.play
echo "$file112A">>/root/.Playlist.play
echo "$file112B">>/root/.Playlist.play
echo "$file112C">>/root/.Playlist.play
echo "$file112D">>/root/.Playlist.play
echo "$file112E">>/root/.Playlist.play
echo "$file112F">>/root/.Playlist.play
echo "$file112G">>/root/.Playlist.play
echo "$file112H">>/root/.Playlist.play
echo "$file112I">>/root/.Playlist.play
echo "$file112J">>/root/.Playlist.play
echo "$file112K">>/root/.Playlist.play
echo "$file112L">>/root/.Playlist.play
echo "$file112M">>/root/.Playlist.play
echo "$file112N">>/root/.Playlist.play
echo "$file112O">>/root/.Playlist.play
echo "$file112P">>/root/.Playlist.play
echo "$file112Q">>/root/.Playlist.play
echo "$file112R">>/root/.Playlist.play
echo "$file112S">>/root/.Playlist.play
echo "$file112T">>/root/.Playlist.play
echo "$file112U">>/root/.Playlist.play
echo "$file112V">>/root/.Playlist.play
echo "$file112W">>/root/.Playlist.play
echo "$file112X">>/root/.Playlist.play
echo "$file112Y">>/root/.Playlist.play
echo "$file112Z">>/root/.Playlist.play
echo $title1 >/root/.title1.play
done
fi
# Playlist 4
if [[ $ret -eq 9 ]]; then
rm /root/.Playlist4.play # remove prior playlist
title4a=$(yad --center --title="Title For Playlist 4" --form --field 'Playlist 4 Title' 'Playlist4')
title4=$(echo $title4a | awk 'BEGIN {FS="|" }{print $1}')
while true; do
file112=$(yad --center --title='Choose Video File' --width=600 --height=400 --file-filter="Vid & Audio|*.[Mm][Pp][4]* *.[Mm][Pp][3]* *.[Ww][Mm][Vv]* *.[Mm\[4][Vv]* *.[Mm][4][Aa]* .m3v *.mpg *mpeg" --file --multiple --filename="/mnt/" --button="OK:0" --button="Exit and Play:1" --button="Clear:2" )
ret22=$?
if [[ $ret22 -eq 2 ]];
then
tab4="No Playlist-4"
echo "$tab4" >/root/.title4.play
exit
fi
if [[ $ret22 -eq 1 ]];
then
if [[ $subs1 -eq 1 ]]; then
urxvt -e mplayer -nosub -fs -vo xv -playlist /root/.Playlist4.play
elif [[ $subs1 -eq 0 ]]; then
urxvt -e mplayer -fs -vo xv -playlist /root/.Playlist4.play
fi
exit
fi
file112a=$(echo $file112 | awk 'BEGIN {FS="|" }{print $1}')
file112b=$(echo $file112 | awk 'BEGIN {FS="|" }{print $2}')
file112c=$(echo $file112 | awk 'BEGIN {FS="|" }{print $3}')
file112d=$(echo $file112 | awk 'BEGIN {FS="|" }{print $4}')
file112e=$(echo $file112 | awk 'BEGIN {FS="|" }{print $5}')
file112f=$(echo $file112 | awk 'BEGIN {FS="|" }{print $6}')
file112g=$(echo $file112 | awk 'BEGIN {FS="|" }{print $7}')
file112h=$(echo $file112 | awk 'BEGIN {FS="|" }{print $8}')
file112i=$(echo $file112 | awk 'BEGIN {FS="|" }{print $9}')
file112j=$(echo $file112 | awk 'BEGIN {FS="|" }{print $10}')
file112k=$(echo $file112 | awk 'BEGIN {FS="|" }{print $11}')
file112l=$(echo $file112 | awk 'BEGIN {FS="|" }{print $12}')
file112m=$(echo $file112 | awk 'BEGIN {FS="|" }{print $13}')
file112n=$(echo $file112 | awk 'BEGIN {FS="|" }{print $14}')
file112o=$(echo $file112 | awk 'BEGIN {FS="|" }{print $15}')
echo "$file112a">>/root/.Playlist4.play
echo "$file112b">>/root/.Playlist4.play
echo "$file112c">>/root/.Playlist4.play
echo "$file112d">>/root/.Playlist4.play
echo "$file112e">>/root/.Playlist4.play
echo "$file112f">>/root/.Playlist4.play
echo "$file112g">>/root/.Playlist4.play
echo "$file112h">>/root/.Playlist4.play
echo "$file112i">>/root/.Playlist4.play
echo "$file112j">>/root/.Playlist4.play
echo "$file112k">>/root/.Playlist4.play
echo "$file112l">>/root/.Playlist4.play
echo "$file112m">>/root/.Playlist4.play
echo "$file112n">>/root/.Playlist4.play
echo "$file112o">>/root/.Playlist4.play
#echo "$file112">>/root/.Playlist4.play
echo $title4 >/root/.title4.play
done
fi
Back to top
View user's profile Send private message 
some1

Joined: 17 Jan 2013
Posts: 81

PostPosted: Fri 26 Jan 2018, 23:42    Post subject:  

....meanwhile..slightly off-topic
slavvo67:
Consider this:
Code:
#extract leftmost 15-items
awk -v RS="[|\n]" 'NR<=15' <<<"$file112" >Playlist2.play
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 2140
Location: In The Way

PostPosted: Sat 27 Jan 2018, 11:14    Post subject:  

Here is an idea I would like to get working.
Code:
mkfifo -m 755 /tmp/PIPE9 2>/dev/null
exec 9<> /tmp/PIPE9

function scan (){
PATTERN='
s/^.*ESSID://p'
MENU=`iwlist wlan2 scan | sed -rn "$PATTERN" | tac | tr '\n'  '|'`
list=`echo $MENU >/tmp/scan`
echo "menu:$MENU" >&9 &
}
export -f scan

yad --notification --icon=/usr/share/pixmaps/wireless.png --listen --text="Scanner" --command="geany /tmp/scan" <&9 &
while true
do
bash -c scan
sleep 4
done


This uses yad --notification --listen to change menu items. In this usage the menu items are the APs found from iwlist scan. The APs are one per line, "AP1"|"AP2"|"AP3" how to interpolate
Code:
!bash -c connect1!/usr/share/pixmaps/wireless.png|
"AP1"|bash -c connect1|/usr/share/pixmaps/wireless.png|"AP2"!bash -c connect2!/usr/share/pixmaps/wireless.png|


The problems I need to help to solve are 1) only scan on click.
2) click on menu item to select AP to connect with
3) show an icon next to each AP entry
Back to top
View user's profile Send private message MSN Messenger 
slavvo67

Joined: 12 Oct 2012
Posts: 1513
Location: The other Mr. 305

PostPosted: Sat 27 Jan 2018, 11:55    Post subject:  

Hi Some1:

Keeping in mind that each of the below are separate user inputs (which can be grabbed in bulk with the shift or ctrl buttons in the YAD window), I'm not sure your script would work. I could and should consolidate the script with a for / do loop but it's been working as is so I haven't really attacked my code; yet... Very Happy

file112a=$(echo $file112 | awk 'BEGIN {FS="|" }{print $1}')
file112b=$(echo $file112 | awk 'BEGIN {FS="|" }{print $2}')
file112c=$(echo $file112 | awk 'BEGIN {FS="|" }{print $3}')
file112d=$(echo $file112 | awk 'BEGIN {FS="|" }{print $4}')

I find your script interesting, however. Thanks for that!
Back to top
View user's profile Send private message 
step

Joined: 04 May 2012
Posts: 1030

PostPosted: Sat 27 Jan 2018, 17:42    Post subject:  

@slavvo67 --columns applies to --form buttons only. AFAIK there is no way to layout --button's in a grid. I will gladly stand corrected. Yad lays out all --buttons in a single horizontal row (default) or a single vertical column (by means of a style file). Tested with yad 0.36.3.

1x4 because --columns=2 is rightly ignored
Code:

# yad --columns=2 --button=gtk-ok --button=gtk-cancel --button=gtk-yes --button=gtk-no &

2x2 because --columns=2 applies to --form
Code:

# yad --columns=2 --no-buttons --form --field=gtk-ok:FBTN '' --field=gtk-cancel:FBTN '' --field=gtk-yes:FBTN '' --field=gtk-no:FBTN '' &
1x4.png
 Description   
 Filesize   3.75 KB
 Viewed   179 Time(s)

1x4.png

2x2.png
 Description   
 Filesize   3.72 KB
 Viewed   179 Time(s)

2x2.png


_________________
Fatdog64-721|+Packages|Kodi|Findnrun|+forum|gtkmenuplus
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 1513
Location: The other Mr. 305

PostPosted: Sat 27 Jan 2018, 20:10    Post subject:  

Thanks, Step. So I gather passing the button values in your example would require an awk command? We're not numbering the buttons like in my YAD example.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 22 of 28 [417 Posts]   Goto page: Previous 1, 2, 3, ..., 20, 21, 22, 23, 24, 25, 26, 27, 28 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1030s ][ Queries: 15 (0.0049s) ][ GZIP on ]