我是新手python-xlib
。一年来我一直在使用gtk
, gdk
,xdotool
和. 现在我想通过.wmctrl
xprop
xlib
我有这个功能我想转换但不知道如何转换成xlib
命令。
def win_remove_above(win_hex):
""" If window 'above' (Always on Top in Ubuntu-speak) toggle it off
and return True. Otherwise return None
"""
was_above = None
all_lines = os.popen('xprop -id ' + win_hex).read().strip().splitlines()
for line in all_lines:
if "_NET_WM_STATE(ATOM)" in line:
# print('line:', line)
if "ABOVE" in line:
was_above = True
os.popen('wmctrl -ir ' + win_hex + ' -b toggle,above')
break
return was_above