How do I send a message to a window? (Linux)

Just starting out? Need help? Post your questions and find answers here.
AZJIO
Addict
Addict
Posts: 1316
Joined: Sun May 14, 2017 1:48 am

How do I send a message to a window? (Linux)

Post by AZJIO »

I want to show the tray menu using a hotkey. I have registered a hotkey to start the first program. The window is hidden, maybe this is the problem. See "Extended clipboard (?) Linux"

Code: Select all

EnableExplicit

Procedure Execute(comstr$)
	Protected Pos, Command$
	comstr$ = LTrim(comstr$)
	If comstr$ = ""
		ProcedureReturn
	EndIf
	Pos = FindString(comstr$ , " ")
	If Pos
		Command$ = Mid(comstr$, 1, Pos-1)
		If Not RunProgram(Command$, Mid(comstr$, Pos+1), "", #PB_Program_Hide | #PB_Program_Wait)
			MessageRequester("Error", " The command could not be executed:" + Command$ + ". Make sure that this program is installed.")
			; 		MessageRequester("|" +Mid(comstr$, 1, Pos-1) + "|", "|" +Mid(comstr$, Pos+1) + "|")
		EndIf
	EndIf
EndProcedure

If RunProgram("bash", "-c " + Chr(34) + "xdotool search --name '-CL-' windowactivate %@" + Chr(34), "", #PB_Program_Open | #PB_Program_Read)
	Delay(40)
	Execute("xdotool key alt+m")
EndIf

Code: Select all

If OpenWindow(#Win_Main, 0, 0, 99, 99, "-CL-", #PB_Window_SystemMenu | #PB_Window_Invisible)
	CatchImage(0, ?Tray24_png)
	AddSysTrayIcon(#SysTrayIcon, WindowID(#Win_Main), ImageID(0))
	.......
	AddKeyboardShortcut(#Win_Main,  #PB_Shortcut_Alt |  #PB_Shortcut_M , 0)
	.......