Python: text overlay on top of all windows includi

2019-09-11 03:55发布

I am trying to write a simple script in python that outputs text on top of all windows and fullscreen apps.

The purpose of this script is to output load average and free memory (and other useful stats) in similar fashion that Steam FPS counter works.

So far I tried pygame but as far as I can see it can only write into its own window.

As I understand I need to write directly to frame buffer?

The target OS is Linux with Nvidia card and Xorg, but I would prefer it to be hardware agnostic.

Thanks a lot!

1条回答
放荡不羁爱自由
2楼-- · 2019-09-11 04:32

I am trying to do the same, and so far it worked - but I'm not sure about fullscreen apps - with PyOsd: http://python-osd.sourcearchive.com/documentation/0.2.14-5.1/index.html

Simplest example is

import pyosd
p=pyosd.osd()
p.display("Hello world!")
查看更多
登录 后发表回答