LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to refresh a graphical display through bash script (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-refresh-a-graphical-display-through-bash-script-893715/)

debianD 07-25-2011 05:12 PM

How to refresh a graphical display through bash script
 
Hi friends ,

Firstly I am not sure if this is the right place to ask this question.
My problem is -->

I need to display a message graphically using a messagebox or textbox through bash script. However the message should be keep changing every 4 secs . I input the message from a file and use "gxmessage" to display it .

Code:

gxmessage -nofocus -center -title "Welcome screen" -geometry "600,600" -wrap -file $random
Where "$random" is some random data from a file.
But the problem is , how should I refresh the same gxmessage message box,putting different message each time .

I thought of
Code:

while :
do
        sleep 4
        if ps | grep "gxmessage"
        then
                killall -9 "gxmessage"
        fi
        gxmessage -nofocus -center -title "Welcome screen" -geometry "600,600" -wrap -file $random &
 done &

I do not like this solution and it looks ugly too , because it is visible that the message box is getting killed and forked every time .

Can't I use the same gxmessage message box for all the messages just by putting new messages and hence refreshing the same box.
Any idea , anything other than gxmessage will do , if a solution is somewhere else.


Thanks.
D.

colucix 07-25-2011 05:37 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 04:25 AM.