Python: text overlay on top of all windows including fullscreen in Linux

别等时光非礼了梦想. 提交于 2019-12-12 02:28:26

问题


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:


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!")


来源:https://stackoverflow.com/questions/41998489/python-text-overlay-on-top-of-all-windows-including-fullscreen-in-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!