From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to get X Window id from within Emacs? Date: Sun, 15 Dec 2024 20:25:53 +0200 Message-ID: <86ed28refi.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6460"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 15 19:27:10 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 1tMtKg-0001TS-2j for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 15 Dec 2024 19:27:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMtKC-0001X6-3k; Sun, 15 Dec 2024 13:26:40 -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 1tMtJw-0001WF-ON for help-gnu-emacs@gnu.org; Sun, 15 Dec 2024 13:26:25 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tMtJw-0004Jj-GJ for help-gnu-emacs@gnu.org; Sun, 15 Dec 2024 13:26:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hprGIMP/G7atk/Y7geska/pryoJfmSqM/ah9/S9u/Qc=; b=YhFjgqBBHJOb 37APZbGL0nELVQo+mG0GdWchg0M6mcTgHaG/2mHDQCJfNFZy/kg7vIE3WUpBu/ch7fq6fq4I8YYMZ F/LhpvrC6eItxZ1VgFWYICdK8smeX04bc+HVDx1ZESp1rl/yWN9lQ1tm8IHjKhaVP/v1gt4JKEPnW YELz9vZGEIX7KK3UuVjFhDxEwIEHfSMUkvsBeJyqRSlM8n56bjlCRo8E2LbwBD8uzoppXDGA0gN6v wI/5L/BWQLtfi4YW5ZxulalkNNl3WU/WIm6A7Jlr+1UPKwxsHS1DJKtOz2Sztx/1vHnQQCqsPgpV1 Imfhd/6tRrxOfumuoeU98g==; In-Reply-To: (message from Jean Louis on Sun, 15 Dec 2024 20:52:13 +0300) 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:148813 Archived-At: > 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