YAD - Tips
Dear Misko,
Very nice, and nicely coded. I just added a bit of eye candy.
With kind regards,
vovchik
Very nice, and nicely coded. I just added a bit of eye candy.
With kind regards,
vovchik
- Attachments
-
- yt-get.tar.gz
- (5.5 KiB) Downloaded 163 times
Dear all,
Here is a little YAD-based task killer. I found most of the code somewhere and modded it a bit. It's not too bad, but it is not the fastest thing in the world. It seems to work.
With kind regards,
vovchik
Here is a little YAD-based task killer. I found most of the code somewhere and modded it a bit. It's not too bad, but it is not the fastest thing in the world. It seems to work.
With kind regards,
vovchik
- Attachments
-
- ypid.tar.gz
- (1.37 KiB) Downloaded 157 times
- misko_2083
- Posts: 114
- Joined: Tue 08 Nov 2016, 13:42
Vovchik, it looks great.vovchik wrote:Dear Misko,
Very nice, and nicely coded. I just added a bit of eye candy.
With kind regards,
vovchik
Just found this for the .bashrc
similar to this http://worldwidemann.com/a-gui-file-pic ... s-of-code/
Code: Select all
# Yad gui file selector
# put in .bashrc and call with ctrl+g from terminal
select_files() {
local file files i IFS=' '
local -n l=READLINE_LINE p=READLINE_POINT
while IFS= read -rd '' file; do printf -v 'files[i++]' %q "$file"
done < <(yad --file --multiple --width=600 --height=600 --center | tr '|\n' '\0\0')
files="${files[*]}" l=${l:0:p}$files${l:p} p=$((p+${#files}));
}
bind -x '"\C-g":select_files'
My bash shell returns an error when parsing Misko's script - but I can't find a syntax error anywhere in it. Anyone with the same problem?
That's the "<" before "<("
Code: Select all
sh: syntax error near unexpected token `<'
Code: Select all
# bash --version
GNU bash, version 4.3.42(1)-release (x86_64-unknown-linux-gnu)
[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]
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Even without looking into the script the error message is obvious: "<(" would be a bash process substitution which is not available when you invoke bash in POSIX mode. i.e. with a #!/bin/sh shebang.step wrote:My bash shell returns an error when parsing Misko's script - but I can't find a syntax error anywhere in it. Anyone with the same problem?That's the "<" before "<("Code: Select all
sh: syntax error near unexpected token `<'
Use #!/bin/bash instead.
Thanks MochiMoppel. Actually, I was pasting the code directly into terminal, so there was no shebang involved. But I'm pretty sure you hit the nail on its head. There are other ways to enable POSIX mode, so I'll check my setup to ensure that POSIX is disabled.MochiMoppel wrote:pocess substitution which is not available when you invoke bash in POSIX mode. i.e. with a #!/bin/sh shebang.
Use #!/bin/bash instead.
[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]
I have one I want to get going but don't know how .
I'm after a form that comes up with say 8 fields on one line and then the next line down is the same but a different background colour.
Multiple lines , say 1000 and scrolling . Ability to work through each field in order and enter takes it to the next line.
Now it is needed to look exactly like a bank statement and have the same data fields as date number details code debit credit balance and presented(T/F).
If anyone knows Quickbooks I want it to look just like one of their bank entry forms
Anyone ever done similar?
I'm after a form that comes up with say 8 fields on one line and then the next line down is the same but a different background colour.
Multiple lines , say 1000 and scrolling . Ability to work through each field in order and enter takes it to the next line.
Now it is needed to look exactly like a bank statement and have the same data fields as date number details code debit credit balance and presented(T/F).
If anyone knows Quickbooks I want it to look just like one of their bank entry forms
Anyone ever done similar?
I've just discovered yad and I'm trying to use it for a little project I'm working on,
but I have a problem.
I'm using the following code to select a directory:It all seems to work fine except when I use the "Create Folder" button. After typing in the name of the new folder I hit the "Enter" key, and nothing happens. I expect it to cause the new folder name to be accepted.
I'm doing this on puppy_xenial_7.0.4 using(I downloaded and compiled it.)
Has anyone had a similar problem?
Is it likely to be a bug in this particular version?
Note1: All my other yad dialogs seem to work as expected.
Note2: Before "discovering" yad, I wrote a gtk C program to do the same thing, calling the builtin gtk_file_chooser_dialog. It looks rather similar, except that the "Enter" key works after naming a new folder.
gyro
but I have a problem.
I'm using the following code to select a directory:
Code: Select all
INIT_DIR="$(pwd)"
RET_DIR=$(yad --center --borders=6 --title "dircrypt - Select encrypted directory" \
--file --directory --width=600 --height=400 --filename="$INIT_DIR/")
I'm doing this on puppy_xenial_7.0.4 using
Code: Select all
yad --version
0.38.1 (GTK+ 2.24.30)
Has anyone had a similar problem?
Is it likely to be a bug in this particular version?
Note1: All my other yad dialogs seem to work as expected.
Note2: Before "discovering" yad, I wrote a gtk C program to do the same thing, calling the builtin gtk_file_chooser_dialog. It looks rather similar, except that the "Enter" key works after naming a new folder.
gyro
gyro, works ok for me with yad
yeah the new folder is created by either a mouse click or enter key, the button's do nothing, they need to be give an action
Code: Select all
yad --version
0.36.3 (GTK+ 2.24.23)
Code: Select all
INIT_DIR="$(pwd)"
RET_DIR=$(yad --center --borders=6 --title "dircrypt - Select encrypted directory" \
--button="gtk-ok:0" --button="gtk-cancel:1" --file --directory --width=600 --height=400 --filename="$INIT_DIR/")
[[ $? -eq 0 ]] && SOME_ACTION
[[ $? -eq 1 ]] && SOME_OTHER_ACTION
[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]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
I have the same version-
After "create folder" is clicked and a name entered, a "tab" writes the new folder and returns the dialog to a "no selected directory" mode.
Or you could click on the dark section to the right of the entry.
The path of the new directory is returned in both cases.
Cheers,
s
(Not exactly my idea of intuitive )
Code: Select all
yad --version
0.38.1 (GTK+ 2.24.30)
Or you could click on the dark section to the right of the entry.
The path of the new directory is returned in both cases.
Cheers,
s
(Not exactly my idea of intuitive )
@Geoffrey and seaside,
The "Enter" key does what I expect. It causes the new directory to be accepted and it gets opened.
So the remaining question is, do any of the versions between 0.36.3 and 0.38.1 function "correctly"?
gyro
Usinggyro wrote:It all seems to work fine except when I use the "Create Folder" button. After typing in the name of the new folder I hit the "Enter" key, and nothing happens.
Code: Select all
yad --version
0.36.3 (GTK+ 2.24.30)
So the remaining question is, do any of the versions between 0.36.3 and 0.38.1 function "correctly"?
gyro
I'm most likely getting it wrong on what you want to do.gyro wrote:@Geoffrey and seaside,Usinggyro wrote:It all seems to work fine except when I use the "Create Folder" button. After typing in the name of the new folder I hit the "Enter" key, and nothing happens.The "Enter" key does what I expect. It causes the new directory to be accepted and it gets opened.Code: Select all
yad --version 0.36.3 (GTK+ 2.24.30)
So the remaining question is, do any of the versions between 0.36.3 and 0.38.1 function "correctly"?
gyro
Code: Select all
INIT_DIR="$(pwd)"
RET_DIR=$(yad --center --borders=6 --title "dircrypt - Select encrypted directory" \
--file --directory --width=600 --height=400 --filename="$INIT_DIR/")
echo $RET_DIR
OK button to confirm selected directory and continue to next script action, or Cancel button to abort.
[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]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
Unfortunately, sort of yes.Geoffrey wrote:I'm most likely getting it wrong on what you want to do.
I'm happy with the script code, as the rest of my script makes use of $RET_DIR.
My problem was with yad version 0.38.1, where the "Enter" key failed to do what I expected when using the "Create Folder" button in the select directory dialog.
Problem solved:
The "Enter" key works as expected in both yad version 0.36.3 and the recent 0.38.2.
@seaside,
Upgrade to yad 0.38.2 and the problem is fixed.
So the YAD tip is: avoid version 0.38.1
gyro
Yes, https://groups.google.com/forum/#!forum/yad-commongyro wrote:So the YAD tip is: avoid version 0.38.1
YAD 0.38.2 released
This is a bugfix release. One serious bug was fixed, update is highly recommended
Changes in this release:
- fix enter behavior
[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]
[img]https://dl.dropboxusercontent.com/s/ahfade8q4def1lq/signbot.gif[/img]
Thanks for this example, I find such a column of buttons quite useful as a kind of menu with each button executing a corresponding script.Geoffrey wrote:Buttons in --form --field are the width of the windowCode: Select all
yad --form --field="test1:FBTN" "yad --text='test1'" \ --field="test2:FBTN" "yad --text='test2'" \ --field="test3:FBTN" "yad --text='test3'"
gyro
I see that some people are using YAD 0.38.2. I have upgraded too, from 0.36.3, but I think 0.38.2 bombs X11. Twice already I clicked a yad --entry dialog button and X11 crashed. The first time I found myself back at the console prompt, and had to restart X manually. The second time X restarted automatically. All this happened on Fatdog64-710.
My script involves closing the yad dialog with "kill -USR2 $YAD_PID", but I'm not positive this is connected to X11 crashing.
edited after vovchik's post below: X11 restarted again with yad 0.36.3, so this issue isn't version dependent. On to more investigation...
My script involves closing the yad dialog with "kill -USR2 $YAD_PID", but I'm not positive this is connected to X11 crashing.
edited after vovchik's post below: X11 restarted again with yad 0.36.3, so this issue isn't version dependent. On to more investigation...
Last edited by step on Sun 05 Feb 2017, 12:37, edited 1 time in total.
[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]
Dear step,
I am using the same version (0.38.2) and have not experienced your problem in Tahr, so I don't really think it is a "version" problem. I compiled YAD myself for Inetl and for my Raspberry PI. This runs fine on my various machines:
With kind regards,
vovchik
I am using the same version (0.38.2) and have not experienced your problem in Tahr, so I don't really think it is a "version" problem. I compiled YAD myself for Inetl and for my Raspberry PI. This runs fine on my various machines:
Code: Select all
#!/bin/bash
function CLOSE_EXIT()
{
echo "Close and exit..."
kill -s SIGUSR1 $YAD_PID
} ; export -f CLOSE_EXIT
yad --text "<b>Simple Dialog</b>" --button="OK:bash -c CLOSE_EXIT"
vovchik
Dear vovchik,
thank you. I'm using kill -USR1 in a similar fashion. I also don't think anymore that it's a "version" problem, because the X11 restart just happened again, this time with yad 0.36.3. I need to investigate further what's going on.
thank you. I'm using kill -USR1 in a similar fashion. I also don't think anymore that it's a "version" problem, because the X11 restart just happened again, this time with yad 0.36.3. I need to investigate further what's going on.
[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]