2011-03-16 151 views
0

我該如何編程關閉在Ubuntu的彈出窗口?programmaticaly在ubuntu中關閉彈出窗口

我可以在OSX使用AppleScript做到這一點:

tell application "System Events" 
    tell process "SketchUp" 

     set frontmost to true 
     keystroke return 

    end tell 
end tell 

現在我正在尋找在Ubuntu當量(10.10版)。

回答

0

您想安裝wmctrl包,然後man wmctrl查看如何使用它來選擇窗口並要求它們關閉。 (我會提供更多的細節,但我的Ubuntu VM在升級到納蒂的進步。)


好了,用我的VM備份,因爲納蒂和Parallels工具不會互相交談(還):

jinx:1458 Z$ wmctrl -l 
0x03e00037 0 jinx jinx {allbery} [~//lib] 
0x03e00027 0 jinx jinx {allbery} [~] 
0x03e00042 0 jinx jinx {allbery} [////xkb] 
jinx:1459 Z$ wmctrl -c -i 0x03e00042 
jinx:1460 Z$ _ 

默認情況下(不含-i)它與窗口標題匹配。

+0

運行那個Natty安裝?謹慎發佈更多細節? – dsg 2011-03-16 17:50:17

+0

停止等待我整理Parallels Tools。我確實先複製了虛擬機,然後現在把虛擬機複製回來,決定納蒂安裝在短時間內不可用。 – geekosaur 2011-03-16 17:54:28