[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get X Window id from within Emacs?
From: |
Po Lu |
Subject: |
Re: How to get X Window id from within Emacs? |
Date: |
Mon, 16 Dec 2024 08:39:31 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii <eliz@gnu.org> writes:
>> Date: Sun, 15 Dec 2024 20:52:13 +0300
>> From: Jean Louis <bugs@gnu.support>
>>
>> The standard shell commend `xwininfo' gives me the Window id, such as
>> 0x2e000ac and then I can run shell command like `xdotool' to activate
>> the Emacs window:
>>
>> $ xwininfo
>>
>> xwininfo: Please select the window about which you
>> would like information by clicking the
>> mouse in that window.
>>
>> xwininfo: Window id: 0x2e000ac "*shell* - GNU Emacs at lco2"
>>
>> after switching to other workspace, then I can still do:
>>
>> $ xdotool windowactivate 0x2e000ac
>>
>> and I would return to Emacs X Window.
>>
>> Is there a way to get the Window ID from within Emacs?
>
> There's the window-id frame parameter, although I'm not sure it is
> universally available. Try
>
> M-: (frame-parameter nil 'window-id) RET
This is the ID of Emacs's "inner window", where it displays buffer text
and decorations. The `outer-window-id' frame parameter supplies a
window ID that is suitable for external programs such as xdotool.