Page 2 of 2
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 4:38 pm
by fredx181
Hi stemsee,
I think it is not necesssary to spawn a new instance of yad ... just send to pipe!
Yes, better.
Also when stopping the test and clearing the data info then I feel that I normally like to scrutinize the data. So now I must watch the test as it happens and process it in real time. Personally I prefer to review it after stopping and clear manually. Maybe the quit button could do the clearing first, before actually quitting, instead of stop test. Maybe a trap function also to clear /tmp/clear.sh ...
I too am not really liking the clear data when stopping, indeed letting the quit button to do the clearing is better, I don't know how yet.
Fred
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 6:03 pm
by stemsee
I think the problem is with the pipe somehow being blocked up with the suspended dd command, maybe the pipe needs flushin/releasing first.
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 6:17 pm
by fredx181
Found solution!
The kill dd command needs to be: kill -SIGINT, this way it quits okay without needing to clear data with the stop button.
Also implemented your suggestion about writing the message "please mount .." to the pipe
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 6:23 pm
by stemsee
I tried signum and sigspec, kill `pgrep -n dd` etc etc ...
Good job
EDIT: func_stop didn't do anything to stop the test. I had to change the command to
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 6:37 pm
by fredx181
stemsee wrote: ↑Fri May 07, 2021 6:23 pm
I tried signum and sigspec, kill `pgrep -n dd` etc etc ...
Good job
EDIT: func_stop didn't do anything to stop the test. I had to change the command to
Strange, stop works for me, is ps different on your system perhaps, I never like "killall" (as you had previously in your v4) is `pgrep -n dd` similar i.e. does it kill all possibly existing dd processes ?
EDIT: I tested on FatDog (which I think you use) and stop worked for me.
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 9:39 pm
by stemsee
Maybe i need to reboot system and test.
pgrep -n "command" gets pid of the newest instance, not all, so the last started instance is identified.
I also use fossadog cinnamon!.
EDIT: yeah its working!
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 10:24 pm
by mikewalsh
@fredx181 :-
I've had a quick squizz at the newest re-write of the v4 script, Fred; appears to work fine now. I'll probably re-pack it tomorrow; haven't got time tonight.
I'm intending to leave the v4 .pet & portable attached to the first post, along with a 'tidied-up' release of v2-portable....which a few others, including me, seem to prefer! So; the older version for those who like it, and the current version, for those who like all the bells & whistles.....which should, I think, cater for everyone.
One small point; I notice you now can't drag the bottom of the window down to 'expose' more of the progress display; was this intentional, or a 'side-effect' of summat else?
Mike.
Re: Capture YAD combobox output as variable..?
Posted: Fri May 07, 2021 11:47 pm
by bigpup
DriveSpeed-v4-fixed.tar.gz
Are you sure the clr buffers is working?
After I make a test file, clr buffers, and try to read.
It seems to me it is reading what is in the buffers.
Re: Capture YAD combobox output as variable..?
Posted: Sat May 08, 2021 7:34 am
by fredx181
bigpup wrote: ↑Fri May 07, 2021 11:47 pm
DriveSpeed-v4-fixed.tar.gz
Are you sure the clr buffers is working?
After I make a test file, clr buffers, and try to read.
It seems to me it is reading what is in the buffers.
Maybe you are running it as standalone ?, clear buffers depends on the DATA/clear_cache script from Mike's setup, so you need to run 'DriveSpeed' from "DriveSpeed_v4-portable" folder.
@mikewalsh
One more thing and then I stop my obsessive behaviour with this
To stop the test I had a bit of a struggle to make it kill exclusively the dd command ran by the program (e.g. "killall dd" will kill all existing dd processes, so not an option).
func_stop improved: (how it was it could kill any command running at the same time with "/testfile" in it, small chance, I know, but still...):
Code: Select all
func_stop () {
# kill -SIGINT "$(ps -eo pid,cmd | grep '/testfile' | grep -v grep | awk '{ print $1 }')"
# kill dd pid (read or write)
kill -SIGINT "$(ps -eo pid,cmd | grep 'dd if=/dev/zero of=.*/testfile\|dd if=.*/testfile of=/dev/null' | grep -v grep | awk '{ print $1 }')"
}; export -f func_stop
One small point; I notice you now can't drag the bottom of the window down to 'expose' more of the progress display; was this intentional, or a 'side-effect' of summat else?
Mmm.. works ok for me, maybe behavior is a bit different because I've set width and height, needed for displaying properly when using yad gtk3.
Fred