I want to check which window manager is active using python? I used subprocess.run but it's giving me string type output like below :
name: xfwm4
class: xfwm4
pid: 6981
I just want xfwm4 from name.Is there any alternative of subprocess and wmctrl for showing window manager? This is my code so far,
def getWM():
try:
output = subprocess.run(['wmctrl', '-m'], text=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if output.stdout:
s = (output.stdout) + ' '
return s
except:
return None