Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: ACRizona on December 18, 2010, 11:30:59 PM

Title: Xdialog scripting question - progress bar
Post by: ACRizona on December 18, 2010, 11:30:59 PM
...not beer or gold bar.  This a thermometer, speedometer bar showing the progress of something.   Keeps one entertained while BigSlowProgram loads.

How do I make it the "front-end" while BigSlowProgram loads ?
There is no RUN command in BASH.   I tried the background ampersand ruse, but Opera (as example) will not run (pun) in background 'mode'.

Any Guroo solutions ? :)        ( Please - only TinyCore capable.  No PHP etc. )
Title: Re: Xdialog scripting question - progress bar
Post by: gerald_clark on December 19, 2010, 01:06:49 AM
opera &
absolutely works.
Title: Re: Xdialog scripting question - progress bar
Post by: tinypoodle on December 19, 2010, 08:22:55 AM
There is no RUN command in BASH.

There is 'exec', but don't use it indiscriminately.
Title: Re: Xdialog scripting question - progress bar - CLARIFICATION
Post by: ACRizona on December 19, 2010, 12:27:37 PM
BASH:
Xdialog --progressbar.....10...9...8...7....6...5
exec BigSlowProgram :(

Results: 
Xdialog completes countdown from 10 to zero.
BigSlowProgram loads ( you are watching a blank screen) and runs. :P

Desired:
BigSlowProgram loads WHILE you watch Xdialog count down.
Title: Re: Xdialog scripting question - progress bar
Post by: curaga on December 19, 2010, 01:12:07 PM
Bigslowapp &
Xdialog --progressbar...
Title: Re: Xdialog scripting question - progress bar
Post by: ^thehatsrule^ on December 19, 2010, 02:48:56 PM
exec is not exactly a "run in background command" but is for replacing the current process with another.
Title: Re: Xdialog scripting question - progress bar
Post by: ACRizona on December 19, 2010, 02:59:08 PM
hmmmm...  I guess I'm in deep water.  I hoped for something simple that could be added to the wbar exec command line.  

Using Opera as my BigSlowExample, It seems I need another script to SET all values in background (matching user TC's foreground) so that Opera will run.  
Opera attempts it's first-time-run processes ( like a new user ).

Thanks for your help.

Title: Re: Xdialog scripting question - progress bar
Post by: gerald_clark on December 19, 2010, 03:07:26 PM
Opera is an X client, and cannot run outside of a logged-in X server with proper authentication..
Any logged in X user should be able to 'opera &'.
Title: Re: Xdialog scripting question - progress bar
Post by: tinypoodle on December 19, 2010, 06:41:29 PM
Opera attempts it's first-time-run processes ( like a new user ).

One reason why this could happen is when no preexisting profile dir is used.
Title: Re: Xdialog scripting question - progress bar
Post by: ACRizona on December 20, 2010, 01:50:48 AM
Got it ! :)

script1 appears:
/usr/local/bin/opera -nomail -nolirc -personaldir /home/tc/.opera/
exit
# tinypoodle was right-on to -personaldir
# Opera documentation  ::)   no comment!

script2 appears:
script1 &       #launch Opera
xdialog progress bar... 10.. 9... 8...
exit

wbar
Changed Opera entry to read exec /user/tc/script2

Later I'll add a 'single-instance' check to allow only 1 Opera.
Title: Re: Xdialog scripting question - progress bar
Post by: tinypoodle on December 20, 2010, 05:29:31 AM
Not sure if '-personaldir' would work, but '-pd' certainly does   ;)