LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 07-25-2011, 05:12 PM   #1
debianD
Member
 
Registered: Jul 2009
Posts: 37

Rep: Reputation: 16
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.
 
Old 07-25-2011, 05:37 PM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to refresh a graphical display through bash script debianD Programming 5 07-27-2011 09:49 PM
Bash script to find available display sever ralfbutler Linux - Software 1 09-18-2010 05:15 AM
How to display remainder in Bash script packets Linux - Newbie 6 12-01-2007 01:30 AM
xset is unable to open display from within bash script copolii Linux - General 3 10-22-2005 06:26 PM
change refresh rate during graphical startup mmail75 Fedora 1 12-11-2003 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration