Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am looking at displaying a counter or display a variable number as a desktop icon for GNOME in Ubuntu 12.10. I have a computer program that is running through a bunch of files and will likely take a few weeks to complete. As it is doing this I want some kind of indication on the desktop to see how many files have been processed. I was hoping to use a count-badge over an icon but haven't found anything online if it is possible. Is there way of somehow displaying a variable number on the GNOME desktop that updates everytime a script runs?

I have tried the command <> but I am looking for something less intrusive that I have don't have to click every 10 minutes.

Thanks in advance.

share|improve this question
    
You might be able to use conky.. –  Seth Jan 2 at 20:13
add comment

1 Answer 1

up vote 0 down vote accepted

Greeting Jeremy, based on your requirement I'm going to suggest this solution, and I hope it will help you or give you another way to look at your problem in turn. In my suggestion you need :

1) shell-script file "bash programming".
2) for-loop counter, as you said "to see how many files have been processed" .
3) notification every X time (seconds / minutes / hours), here you need "libnotify bin".
4) keep the script running.

Now let's make the script

create a file "counter.sh"

#!/bin/bash
for f in $( ls /usr/lib ); #just change the path with yours, it was just an example
do 
notify-send -u critical "How many files" $f
done
sleep (1000*60) # get notification every 1 hour
counter.sh
sleep (1000*60) # get notification every 1 hour
#you can make infinite for loop here 
#and put counter.sh inside it, 
#just look that up on the internet (infinite loop using shell script)


Finally, to make your file running you can just run it in the terminal and let it running. Or you can add it in auto-start.

P.S : open terminal login to root 'sudo su' then "chmod 777 counter.sh" to be able to run your script.

share|improve this answer
    
Thanks for the answer. I'm trying to be less intrusive so do not really want a pop-up window to display. The reason is that let's say I leave it running for a long time then I need to delete quite a few of the popups. I was hoping there is something like a unread email notification icon or something along those lines. Have you ever seen that with the GNOME or Unity desktops? –  jeremy Jan 3 at 0:00
    
its not a pop-up window nor intrusive and you don't have to delete anything. Its a notification which comes once every 1 hour and remains ON 1-3 seconds JUST to notify you THEN IT GOES away, and so forth. You can make it once every 2 hours if you wish. Have you ever tried/worked with notify-send before? –  ggalaxy Jan 3 at 1:30
    
I have tried working with notify-send before and it works well; I was hoping there would be a way to have a counter in an icon. Looks like there is no easy way of doing it though. Anyways thanks for the response. –  jeremy Jan 4 at 23:39
    
you are very welcome Jeremy. Well, I don't know any way of doing it in icon, if I had known, I would have told you or at least have guided you. –  ggalaxy Jan 5 at 11:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.