; Module/File: Desktops_GetNumOf.pb ; Function: Get number of desktops (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 Global.s Output= "", DesktopData ProgrammId = RunProgram("wmctrl", "-d", "", #PB_Program_Open | #PB_Program_Read) If ProgrammId While ProgramRunning(ProgrammId) If AvailableProgramOutput(ProgrammId) Output + ReadProgramString(ProgrammId) + #LF$ EndIf Wend CloseProgram(ProgrammId) EndIf Debug "Desktops: " + Str(CountString(Output, #LF$)) ; IDE Options = PureBasic 5.40 LTS Beta 9 (Linux - x86) ; CursorPosition = 14 ; EnableUnicode ; EnableXP