使用 pygtk 确定当前壁纸的路径(也许是 X11?) [英] Determining path to current wallpaper with pygtk (maybe X11?)

查看:62
本文介绍了使用 pygtk 确定当前壁纸的路径(也许是 X11?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 PyGTK 确定用户的壁纸路径.

I would like to determine a user's wallpaper path with PyGTK.

如果可能,我希望依赖桌面环境的功能来实现这一点 - 这是因为一些用户(比如我自己)不使用 DE.因此,我想知道您是否可以使用X11或其他东西来确定当前正在使用的壁纸.

If possible, I would like to not rely on a Desktop Environment's function to do this - this is because some users(like myself) do not use a DE. Because of this, I am wondering if you can use X11 or something else to determine the current wallpaper being used.

推荐答案

你必须依赖桌面环境,否则不可能,因为 X11 不应该处理壁纸之类的东西.当您设置背景图像时,外部程序会加载该图像并将其设置为根窗口的背景像素图.因此,除非特定的加载机制将图像路径存储在某处,否则 X11 本身永远不会知道图像文件在磁盘上的位置.

You MUST rely on a desktop environment, otherwise it is not possible, since X11 isn't supposed to handle such things as wallpapers. When you set a background image, an external program loads the image and sets it as the background pixmap of the root window. Therefore, unless the specific loading mechanism stores the image path somewhere, X11 itself will never know where the image file is located on the disk.

这篇关于使用 pygtk 确定当前壁纸的路径(也许是 X11?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆