LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 07-01-2012, 02:16 PM   #1
dth4h
Member
 
Registered: Mar 2009
Posts: 51

Rep: Reputation: 10
How to make overlay to display text?


I made this script that displays numbers (mouse screen coordinates). As of now they are displayed through the terminal, which is fine but it would be a lot more useful if they were displayed through an overlay on the screen.

But the problem is, I have no idea how to make something like this. I am thinking that it could be done with GTK and Python, but I don't know how to program either of those.

I would like it to be displayed on the screen on top of something that looks like the pngs that are attached to this post.


I guess what I am looking for is for it to do something like conky. It displays text on screen on top of a semi-transparent black overlay.
Where it would differ from conky is that it would be on top of all windows at all times (until the process is closed or killed of course).
Attached Images
File Type: png me3.png (1.4 KB, 7 views)
File Type: png me2.png (927 Bytes, 10 views)
 
Old 07-01-2012, 02:57 PM   #2
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 583

Rep: Reputation: 129Reputation: 129
With xmessage you can create a window with a text. Not exactly what you wanted but maybe useable.
 
Old 07-01-2012, 06:35 PM   #3
Dafydd
Member
 
Registered: Oct 2008
Posts: 315

Rep: Reputation: 23
Could you either post or point me to the code that produces those windows?
Thanks
D
 
Old 07-02-2012, 01:56 AM   #4
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 583

Rep: Reputation: 129Reputation: 129
Code:
xmessage "hello"
 
Old 07-02-2012, 06:12 AM   #5
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 252

Rep: Reputation: 40
If you want to make a custom overlay you could use conky.
 
Old 07-03-2012, 05:37 PM   #6
dth4h
Member
 
Registered: Mar 2009
Posts: 51

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by whizje View Post
Code:
xmessage "hello"
That wont work, because the number will always be changing (because it shows where the mouse is, and the mouse keeps moving). So it would make a zillion window pop-up all over.

I want something that will display a number that will always be changing.

Thanks for replying though.
 
Old 07-03-2012, 05:40 PM   #7
dth4h
Member
 
Registered: Mar 2009
Posts: 51

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by Roken View Post
If you want to make a custom overlay you could use conky.
Thanks, that is a cool idea, but if I use conky for that, then wont I not be able to use it as a system monitor anymore?
Plus I would prefer to use my own built in program for this instead of an external one.

Last edited by dth4h; 07-03-2012 at 05:43 PM.
 
Old 07-03-2012, 05:55 PM   #8
Dafydd
Member
 
Registered: Oct 2008
Posts: 315

Rep: Reputation: 23
is this to be called from inside some html code?
 
Old 07-03-2012, 05:58 PM   #9
dth4h
Member
 
Registered: Mar 2009
Posts: 51

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by Dafydd View Post
is this to be called from inside some html code?
No, it is just a bash script that can be called from the terminal with an alias I made to it (mouse-location).
 
Old 07-03-2012, 07:37 PM   #10
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 252

Rep: Reputation: 40
Theres's nothing to stop you running more than one conky, one dedicated to your required task. It's very nature is such that you would use your own bash script anyway. All conky would do is put it on the screen for you (exec ${sh your/script})
 
Old 07-03-2012, 07:44 PM   #11
dth4h
Member
 
Registered: Mar 2009
Posts: 51

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by Roken View Post
Theres's nothing to stop you running more than one conky, one dedicated to your required task. It's very nature is such that you would use your own bash script anyway. All conky would do is put it on the screen for you (exec ${sh your/script})
I didn't know you could run two of them at the same time. Thanks for the info.
If no one else comes up with another solution, then I will look into that.
 
Old 07-04-2012, 02:57 AM   #12
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 583

Rep: Reputation: 129Reputation: 129
You can run xmessage from a script with as variables the positions.
Code:
x=3
y=2
xmessage $x' '$y
xmessage.png
 
Old 07-04-2012, 03:00 AM   #13
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 583

Rep: Reputation: 129Reputation: 129
For options of xmessage run in a terminal
Code:
man xmessage
 
  


Reply

Tags
overlay, script


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Live Image mount: union FS overlay vs dmsetup overlay kostya Linux - Software 2 02-16-2012 07:38 AM
I can't see TV with my wintv express (bt878), I have error display ..no overlay ... anyon Linux - Newbie 0 06-01-2009 02:06 PM
Text Overlay OSD software pankaj_yadav Linux - Newbie 0 05-19-2009 08:43 AM
Command Line Video Text Overlay mundy Linux - Software 16 06-25-2008 10:27 PM
LaTex text/graphic overlay edgjerp Linux - Software 1 02-27-2006 05:52 AM


All times are GMT -5. The time now is 01:49 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration