Programming :: How To Get Zenity Progress Bar Working Properly
Apr 14, 2011
I am busy writing this script to get a pixel count of a large batch of images in a directory for a research project. To do this I'm using a loop to get all the images in the directory. To make the whole procedure more user friendly for some colleagues I decided to use zenity, something I haven't yet really worked with. As not to make sure that the users don't have to watch to this blank screen during the actual processing of the images I'm trying to get the zenity progress bar working. So far the progress bar comes up but instead of changing over time it stays "empty" till all the images are processed and then becomes 100% when all images are done. What servers my needs for now, but since I am trying to learn more about zenity I was wondering how I could change the script to get the progress bar properly working? Below is the piece of script I am talking about.
Code:
cd $input #goto path of image directory
(for a in *jpg *JPG *jpeg *JPEG; do
if [ -f "$a" ]; then #was it a image file
b="$a" #set b to $a
convert -resize 1000x1000! ${b} -depth 1 -format %c histogram:info:$b.txt #get pixelcount and write to .txt file
fi
done) | zenity --progress
I'm trying to use zenity and at to make a little reminder script. The problem is that while zenity --info works fine from bash (or sh), running echo "zenity --info" | at now + 1 min does nothing. The job shows up in my atq and then runs, but no zenity pop-up. What's going on?
I have a webpage in html that uses <frameset> tag. One of the frames is a Table of Contents (toc.htm) that lists a series of images. The other frame is called 'canvas.htm'. My framset is laid out as follows:
The frameset is created properly and I can load the images manually (i.e. I can access the images from my browser and/or image editing tool). The problem comes when I attempt to access the images from the toc.htm frame. Instead of opening the image in the canvas.htm frame, a new window is displayed in my browser, instead of the image being displayed in the target window (canvas.htm). This happens on all of my browsers (firefox, safari, IE7/8 and Opera) on Windows, debian-linux and OS X 10.5/10.6.
If I change my src attribute (in the canvas frame) to toc.htm, I see the Table of Contents (toc.htm) displayed side-by-side until I click on the first drawing in the list. At this point, the frame 'behaves' half-arsed the way I want it to. I have searched on google till I am blue(er) in the face with no luck.
I am creating a simple program using C# to print the contents of the todo.txt file once it has run. Problem is when I run the program, I get this warning.
basically in the child process iam just calling the ptrace(PTRACE_TRACEME, 0, NULL, NULL) system call but if add this stsyem call rest of the code not working properly. i found the reason basically what happening is when we have ptrace() system call its printing the same variable 3 times i.e its not executing it 3 times but just it is printing 3 times .iam just wondering how it could be possible.
I'm trying to use zenity in a bash script to display a .csv file using '--list' to allow the user to edit some of the values.I can display it fine but i'm unsure how to edit the data? all i can get is whichever line is highlited when hitting ok on the zenity dialog to print.the data in the csv is arranged:
I'm using zenity 2.28.0 in a bash script (under kde4) to select multiple files in a directory. It works fine, but always defaults to showing hidden files. How can I get it to hide hidden files by default?
I know about toggling them on and off with Ctrl-H, but I would prefer not to have to use that. I have my options set so that dolphin and konqueror do not show hidden files by default. I even tried adding shopt -u dotglob to my script. zenity invocation (extracted from a more complex statement): zenity --title "Select Print Files to Delete" --file-selection --multiple
After searching I cant find script that can deal with directories. All the found scripts work file to file and not directory to directory. Someone know script that can deal with all this situation?
I would really like to capture the output of scp and my file's progress. Scp updates the transfer rate every 1 second, and I will like to save the transfer rate at every update. So for example, if the file transfer takes 30 seconds, I would like 30 reports of the transfer rate.
The output looks like: Code: file.dat 1% 3664KB 938.5KB/s 05:48
Whenever I try a simple redirect like: Code: scp file.dat 192.168.1.100:~/ &> output ... it does not save the rate at every update, it only shows the final rate.
If I try using typescript by starting "script" ... it's the same deal.
I've got a loop which is able to echo out how complete a process is after each loop (e.g says 25% if the loop has 4 elements and has run once through). Is there any way I can print characters, perhaps a progress bar? I was thinking of using the percentage as a count or something and using.
Code: I got told off for including code from work here.
I'm writing a script to automate rsync backups which so far is working great. I prefer to send output to a text file instead of watching it fly by but the blank output is slightly boring? I would love to use a progress bar. Not for each file but for overall progress. Something like
syncing /home directory 50% [++++++++]
I already know it's way over my head and maybe bash isn't even the right tool for the job.
I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html
I am attempting to "export" the progress bar from wget display using sed. Basically, we have an app that starts wget to download a large file and we want to show a progress bar. Our application has a dbus interface to receive the download progress.
So we were think of a command like: wget [] | sed [] | dbus-send[] The problem at the moment is, how do you get the matched string out of sed and into dbus-send? I can get the progress string by: sed -u 's/[0-9]*%/&/'
This populated '&' with the correct percentage, but I cannot seem to get this out of sed.
i have written a bash script to convert flv files (e.g. videos) to xvid to be played on my dvd player. the conversion is not really the issue, as it works. what i am dealing with now are 2 problems i have not found a good workarouond: 1. surpressing the shell output of mencoder completely ( i do not want to see all the mencoder messages). this i have only solved to a certain extend. 2. i want to create a progress bar. this one i have not yet cracked.
#start the script main_menu 1. mencoder output: using /dev/null works more or less. for example: if mencoder detects a double frame while converting, a message is still printed on the bash screen 2. progressbar: i have no clue yet on how to do this. any link or tip is welcome. my goal is something like this: [56%] [time in progress] [timeleft]
I had a problem with apache2 and getting .htaccess working. I have done some things and i believe its working the ErrorDocument command is anyway. I believe there may be some problems with the rewrites though.Im trying to take a urlhttp://localhost/showthread/123and make it display whats on http://localhost/index.php?showthread=123The rewrite rule is Quote:
Options +FollowSymLinks RewriteEngine on RewriteRule ^showthread/([^/.]+)/?$ index.php?showthread=$1 [L]
Does anyone know why vi text editor would not work. I'm running Ubuntu server with SIP service and apache and when i try to edit config files with vi it gets messy.On the bottom of the screen it would not indicate if I'm in backup mode or not. I won't same changes, and it messes up the layout when you use arrow keys to move between the lines. Also sometimes when I use arrow keys it will insert capital A, B, C or D.
I have a Lenovo W500 ThinkPad. It is running XP on first partition, then Ubuntu. I've tried both 10.10, 11.04 beta 2, and now 11.04 release.With the release I just installed, it seemed OK till reboot-after-install, at which point nothing came up. I rebooted several times and just got errors and kernel panics in the ATI video driver. I also saw a lot of these messages:"udevd[80]: worker [XXX] did not accept message -1 (Connection refused), kill it" URL...
I had download updates on, I'm trying again with a clean install without updates. (Although, I said don't download while installing, and it says it is downloading language packs...?)Now, I also had issues with 10.10, where it would intermittently boot and fail to get video, I'd just be at a tty, and have to reboot and try again. I found it usually got video if I had just booted Windows (XP Pro SP3) beforehand, and not otherwise So what's going on there? Something up with the actual video card? I want to run Gnome anyways, is there a way I can specify that during the install?At any rate, if I can't get 11.04 working properly, I'll have to run 10.10, which I didn't want to do. I'm starting from scratch and wish to start from 11.04 if at all possible.
So yesterday I upgraded to 11.04 from 10.10 and now when I enter Ubuntu only my background image appears. No files, programs, or anything. It worked right after it rebooted to finish the upgrade but when I turned my computer on this morning I got nothing but background.
My computer has been running well for a couple of years with Ubuntu and the Gnome desktop. I use a very cheap webcam from PCWorld PC Line 1.3 Mega Pixels with Cheese and Skype which worked on Ubuntu. The new Ubuntu Unity desktop seems most unintuitive and reading that Ubuntu may not include Gnome for the next release is my reason to make the change to Debian. I am aware Ubuntu is a Debian derivative.
I have installed Debian Squeeze and everything is working properly apart from the webcam. When I open Cheese the webcam works but very slowly although it will not capture video. When I open Cheese > Preferences, I see the Device listed as USB 2.0 Camera (/dev/video0) but greyed out. When I open Skype > Options > Video I see the same greyed out listing but no image appears in the test area.
lsusb Bus 001 Device 002: ID 0c45:62e0 Microdia MSI Starcam Racer Computer: Gigabyte motherboard with onboard video and sound.
When I delete things from my home directory, or from my desktop,my trash can on the desktop stays empty, and the Empty Trash in the right-click menu stays disabled.The files disappear from view, but the disk space remains labeled as used.The only way I can empty my trash is through the trash on the panel. Weird
I was just trying to install some packages at the gpk-application 2.27.2, but they are not compatible. For some reason I can't install anyting. I have Fedora Leonidas. In another forum they told me that my package installer is not the proper for this version
I'm running fedora 12 64-bit with XFCE desktop. Updated to firefox 3.5.9 yesterday and that hasn't solved my issue... Just recently it is SO slow. I would even say its on ie standards I sometimes sit with pages "loading" only to find that the url soon changes to "search history and bookmarks" and the bottom left corner message says "stopped" - its most unreliable. at first i thought it was my sometimes dodgy internet connection but i have done several speed tests and after waiting ages for the page to load, the speed test comes up with about 2Mbps. This speed is not translated to the speed firefox is loading pages - several times i've had to stop all tabs loading and then reload them just because firefox seems to have forgotten its meant to be looking on the internet and "thinks" putting a message "loading" in the tab will do
The navigation buttons in firefox are not working and I can not access File, Edit, View, and History pull down menus. This just started today i think. I have 3.5.pre8 and 3.7 installed. both are affected.
Edit: Actually it is a problem with all apps when window is maximized. I cannot access the first 3 or 4 pull down menus or buttons on the tool bar unless the window is not maximized. This happens with konqueror, firefox and Banshee. Have not tested other apps yet.
Edit2: Upper left corner of desktop is also affected. The icons in this part of the screen are not accessible. seems that anything in that region of the screen is dead. just switched from compiz window manager to metacity and there is a black square in the upper left corner of my screen about 2.5"x 2.5".
I can't install software in Karmic - just installed the OS and hooked up to the network, but whenever I 'sudo apt-get install <program>' I get: Couldn't find package <program>I've looked at sources.list and can't find any problems. Is there something else I should look at?
upon the upgrade from 10.04 to 10.10, all upgraded nicely, except for my touchpad, which can't right click anymore, I can use the scroll on the side, and the button-trackpad just functions as a left click.I have an HP Pavilion dv6, with a touchpad like that of the HP Envy, click touchpad, with depressing ends on the bottom and middle respectively for left, middle, and right click.
I submitted a bug report on this when it was in beta, is there a solution to this issue? I use my laptop for work, so I would appreciate a fix... or something I could do aside from uninstalling my Operating System and reinstalling the previous version, which would seem to be a hassle.
I can't get java applications to run properly in a lot of cases. I've tried completely removing Java and reinstalling it. I've tried removing Iced Tea and OpenJDK and installing Sun Java instead. I've done a complete, clean reinstall of Ubuntu. The symptoms of my problem never seem to change. Minecraft is the best example I can give you. As soon as the game loads (in the web or on the desktop alike) it closes abruptly. This is what's in the log file.
Code:
I'm thinking "C [+0x416] __kernel_vsyscall+0x2" is important somehow. I can't seem to figure out what it means. I've tested this on a friend's laptop using the same (Ubuntu 10.10) and it works fine, no errors. I know other people are running their java fine.