; Module/File: Desktop_GetWindowManager.pb ; Function: Get the name of the window manager (needs wmctrl) - Linux ; Author: Omi ; Date: Mar. 31, 2015 ; Version: 0.1 ; Target Compiler: PureBasic 5.22/5.31 ; Target OS: Linux: (X/K/L)ubuntu, Mint, 32/64, Ascii/Uni ;-------------------------------------------------------------- ; wmctrl must be installed !!! ; install: sudo apt-get install wmctrl EnableExplicit Global.i ProgrammId, I Global.s Output= "", DesktopData ProgrammId = RunProgram("wmctrl", "-m", "", #PB_Program_Open | #PB_Program_Read) If ProgrammId While ProgramRunning(ProgrammId) If AvailableProgramOutput(ProgrammId) Output + ReadProgramString(ProgrammId) + #LF$ EndIf Wend CloseProgram(ProgrammId) EndIf For I= 1 To CountString(Output, #LF$)+ 1 DesktopData= StringField(Output, I, #LF$) If Left(DesktopData, 6) = "Name: " Debug "Window manager: " + Mid(DesktopData, 7) EndIf Next I ; IDE Options = PureBasic 5.40 LTS Beta 9 (Linux - x86) ; CursorPosition = 18 ; EnableUnicode ; EnableXP