Reply
Thread Tools
BLIZZARD's Avatar
Posts: 194 | Thanked: 266 times | Joined on May 2010
#1
Hello guys i am modding Jay-C's auto-installer and adding a gui using zenity, you can find the installer at http://downloads.nitdroid.com/BLIZZA...installer-gui/. The latest version works fine and updates progress bar many times except at downloading which is what am currently working on: i managed to make a progress bar that updates during download and works fine on my pc, but i have a problem with busybox on n900. Here i what works on my pc: wget url 2>&1 | sed -u 's/.* \([0-9]\+%\)\ \+\([0-9.]\+.\) \(.*\)/\1\n# Downloading at \2\/s, ETA \3/' | zenity --progress --title="Downloading file $count/10" --auto-close , and here is what i made for n900: wget -P /home/user/MyDocs/.documents url 2>&1 | sed 's/.*\ \([0-9]\+%\)\ \+\([0-9.]\+\ [KMB\/s]\+\)$/\1\n# Downloading \2/' | zenity --progress . Sed outputs the data fine but zenity does nothing, however if i save the output of sed in a file which is like:
18%
# Downloading at 81.2K/s, ETA 3s
36%
# Downloading at 129K/s, ETA 2s
55%
# Downloading at 148K/s, ETA 1s
73%
# Downloading at 155K/s, ETA 1s
92%
# Downloading at 169K/s, ETA 0s
and pipe it to zenity as a script program:
(
echo 18%
echo "# Downloading at 81.2K/s, ETA 3s"
echo 36%
echo "# Downloading at 129K/s, ETA 2s"
echo 55%
echo "# Downloading at 148K/s, ETA 1s"
echo 73%
echo "# Downloading at 155K/s, ETA 1s"
echo 92%
echo "# Downloading at 169K/s, ETA 0s"
) | zenity --progress
works fine . Anyone knows why? What i do wrong? I think the hole problem is sed -u. Is there an alternative way to "emulate" sed -u in busybox or something? Waiting for your replies/ideas/suggestions . NOTE THAT YOU SHOULD RUN THE SCRIPT AFTER YOU TYPE "ROOT" NOT "SUDO GAINROOT". For some reason the ui gets ugly when you type "sudo gainroot".
__________________
I LOVE THESE GAMES: STARCRAFT/STARCRAFT2
I LOVE N900 I LOVE C++ I LOVE UBUNTU
E.F.F, (QT) E.F.F EMPTY FREQUENCIES FINDER, CRAPS, T-CONTROL

Last edited by BLIZZARD; 2010-09-10 at 19:18.
 

The Following 4 Users Say Thank You to BLIZZARD For This Useful Post:
Banned | Posts: 778 | Thanked: 337 times | Joined on Jun 2010
#2
gets ugly?
lol
here i'll post
this will get active and someone might help u out
*sorry, im a noob*
 
BLIZZARD's Avatar
Posts: 194 | Thanked: 266 times | Joined on May 2010
#3
it really gets ugly, try this out, type on the command line:
zenity --info --text="hello world" hit enter
"sudo gainroot" hit enter
zenity --info --text="hello world" hit enter

you will definately notice a difference!
__________________
I LOVE THESE GAMES: STARCRAFT/STARCRAFT2
I LOVE N900 I LOVE C++ I LOVE UBUNTU
E.F.F, (QT) E.F.F EMPTY FREQUENCIES FINDER, CRAPS, T-CONTROL
 
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#4
Originally Posted by BLIZZARD View Post
it really gets ugly, try this out, type on the command line:
zenity --info --text="hello world" hit enter
"sudo gainroot" hit enter
zenity --info --text="hello world" hit enter

you will definately notice a difference!
Prefix it with run-standalone.sh
 

The Following User Says Thank You to MohammadAG For This Useful Post:
BLIZZARD's Avatar
Posts: 194 | Thanked: 266 times | Joined on May 2010
#5
Originally Posted by MohammadAG View Post
Prefix it with run-standalone.sh
Thanks. Why this is happening only for sudo gainroot and not also with root? Also, i have to prefix zenity everytime i use it, or there is something like #include <run-standalone.sh> ?
__________________
I LOVE THESE GAMES: STARCRAFT/STARCRAFT2
I LOVE N900 I LOVE C++ I LOVE UBUNTU
E.F.F, (QT) E.F.F EMPTY FREQUENCIES FINDER, CRAPS, T-CONTROL

Last edited by BLIZZARD; 2010-09-10 at 18:42.
 
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#6
Originally Posted by BLIZZARD View Post
Thanks. Why this is happening only for sudo gainroot and not also with root? Also, i have to prefix zenity everytime i use it, or there is something like #include <run-standalone.sh> ?
I'm not sure tbh, could be environment variables, but I'm looking for the same answer, you'll have to prefix it everytime, sadly (see phone control, it has all dbus commands prefixed, as they too fail when using sudo but not when using root)
 

The Following User Says Thank You to MohammadAG For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 03:09.