Determining path to current wallpaper with pygtk (maybe X11?)

余生颓废 提交于 2019-12-25 05:33:10

问题


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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/8774388/determining-path-to-current-wallpaper-with-pygtk-maybe-x11

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