From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.help Subject: Re: How to get X Window id from within Emacs? Date: Mon, 16 Dec 2024 08:39:31 +0800 Message-ID: <87h674qx4s.fsf@yahoo.com> References: <86ed28refi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20657"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 01:40:39 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMzA7-0005Ef-0V for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 01:40:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMz9M-00007O-Bx; Sun, 15 Dec 2024 19:39:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMz9J-00006X-NO for help-gnu-emacs@gnu.org; Sun, 15 Dec 2024 19:39:49 -0500 Original-Received: from sonic303-22.consmr.mail.ne1.yahoo.com ([66.163.188.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMz9F-000618-1E for help-gnu-emacs@gnu.org; Sun, 15 Dec 2024 19:39:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1734309580; bh=YXHX7PAPIOUoPx9B6wA0aMUHO5E4QQRmJ+XJLNRdLTA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=uVZadlkuExuD8GgvCA/CRocZRD2VWSpLSNDfA1BKkuDmzTdWKPQl0U9AunRd8Z/ybsKwkbYqExlLVrBjrPOu5rQac4ysF3qkafZbdicsq6qnkp4PYUmO104dnNU2/q6Xyhkc/MkNQgcJHwPwdF/p+2T2wuVO68TknCd+GFcvwC+aEx+x51xeM5AG6o0bTNPxl49T0R9bsJenTkP56GSlH7x+JrKJ/RJLufGlau57Bgg7jMMVXpkpdAqbLYogSz6pJrEyOOuurEyOnhqHXvjzgphqTmBd2Mt4geegsAYuv9Mt2jX2R6krZ7mtYnKKFheavEgoWe6bC2uV2FKEmBj2Qw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1734309580; bh=8GcHaPZisx7pvK2vgchvewMlp+3UetIYouNU0uTB3uO=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=qOT7dDT3ozVqueaOrz9LccUOpaANnnSxvJohh2wN+W/u+883v4SArAOZFmXYNQKsC0EEQTLXx9e10F02Sgz7e8A+eBHnsxayQ7h1CEOfsZdngL6uO9HuQI4KvSa+SGm9S0Gwctif3C9b4L9dnptSX92xuhpwsmPvzxs1gKcAnZHFM+dLTi4aRRgNhV8aVgbxJJo9ueFsaBHKoZt4vrTUpYz931EuSpR7dnoLgFJSVp25LK7NRcP3wVnnL3ikb98Alx+SrIEc7ZIzQyTNDFvY59HbHBLs/RgoKzp1Jjhtm2hQz+Tl+DGyIAVcpIIU1wV86bD5lLOJRf0HDNszj/hzgQ== X-YMail-OSG: c1.0uI0VM1m2CZn2h7ulwrD9jAkObY6AFqMgyDo9YUwbKV5Syh9Qm7uTJIq4Jii X4eDXf7vePJSkbaGxYtQMeZr91z79oUPx3aqJ7SNRK6sXAPT1Fn7XAxzXoVT_v_GZcZTxuyewGrE _Mw35SaBxHuOlzTmRHNHJZpQx_Zv6k2stBd_QRzzS1HXlswSzpR0NUxYrnWctUt_67Jy_h1C.8OS KpJDWklCXVy2UrMAjBCp0cOYGj_zf8gX1nxxeiwCncyeWCqKnQ0KUSdC2hv2GIowSl4KnjDvR2ls ApihlzEnjHbBvLUMwTtdKi1eJ0TuKduI51TOPD7oT_Q4Rre9wNeW_16cGLEtJ_3gUANaPuYKjyCv 300WbNp5HwZD0RwdRi.x7_C7BLJvqSAnJ4FKiKhsrEO7XMSEgBwcuNi06L6.2wdiqi35.nu_AM6l xIljtY_ceb70lBpDgVfit32pw73awJOVVea1ou2xG9EizJbPscay39H_.veM3aS5VrsxRxvbOG0L whSjdl6D7Kc3eDblaWKm_gvZ9IUShboB7eJsam6EQ1qG318az1f_H0rjRYEahvuNfXoaH7VhKlZE DCJysUj8d1gDPmeobNyw8E1I7VEliJjxrPmVS6fjiLi3Vqd7v_Xj4DTV.1W4.cwllB8.YTlvI.a_ 1Cg0GjEa43Mcg3aj8B5OgBEjF_.dtMYgXqkEi.oFJ5h1Bdm_CRza1jc1ETPn.LptEcFKMLt8v4nH MFioCG_7Rxs8fUblSLHQGeuelwKwaqclKcMglWSrzy1GPX4LYYkaw1fJn8Api9vtFNvP7VO_7gY4 qi_IpVJ8SamQWWJWO4VTNQ7s6n6x4z2t8ES7nWMMN3 X-Sonic-MF: X-Sonic-ID: 5f940b58-0a60-48e0-a2bb-606446778ef8 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.ne1.yahoo.com with HTTP; Mon, 16 Dec 2024 00:39:40 +0000 Original-Received: by hermes--production-sg3-5b7954b588-5j5q2 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f88ffc75d9a23b65733caa1395ef3c1c; Mon, 16 Dec 2024 00:39:35 +0000 (UTC) In-Reply-To: <86ed28refi.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 15 Dec 2024 20:25:53 +0200") X-Mailer: WebService/1.1.23040 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.188.148; envelope-from=luangruo@yahoo.com; helo=sonic303-22.consmr.mail.ne1.yahoo.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1.168, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148819 Archived-At: Eli Zaretskii writes: >> Date: Sun, 15 Dec 2024 20:52:13 +0300 >> From: Jean Louis >> >> 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.