From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: fn key to bring emacs forward / focus it as if c-tab were used Date: Sun, 17 Apr 2022 02:06:58 +0200 Message-ID: <87h76so9nh.fsf@zoho.eu> References: <0c9372e3fbded8caac89e5c33ffc0d7f@isnotmyreal.name> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21802"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:cWDgzUSXDnns+zDMHYrcBR/9mEA= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 17 19:19:19 2022 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 1ng8YR-0005Ut-85 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 17 Apr 2022 19:19:19 +0200 Original-Received: from localhost ([::1]:47722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ng8YP-0002Yq-U6 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 17 Apr 2022 13:19:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55400) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfsRZ-0004Et-KI for help-gnu-emacs@gnu.org; Sat, 16 Apr 2022 20:07:09 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:50894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfsRX-0001c3-Rx for help-gnu-emacs@gnu.org; Sat, 16 Apr 2022 20:07:09 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nfsRV-0002Hs-RR for help-gnu-emacs@gnu.org; Sun, 17 Apr 2022 02:07:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 17 Apr 2022 13:18:26 -0400 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" Xref: news.gmane.io gmane.emacs.help:136936 Archived-At: Samuel Wales wrote: > is there bring to front functionality in elisp/emacsclient? This is something you do in your WW, normally and easily. >From Emacs - from Emacs and _with_ Emacs I should add - you can also do it, of course, either by using e.g. EXWM which is the Emacs X Window Manager, or simply by having Elisp execute shell commands. I include a bunch of commands to get you started/inspired with that if so ... #! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/wm alias {wins,wl}='wmctrl -l' win-id () { case $# in (0) xprop -id $(xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}') \ WM_CLIENT_LEADER | awk '{print $5}' ;; (1) wins | awk "/$1/{print \$1}" ;; (*) echo "error: $0 accepts 0 or 1 argument (got $#)" >&2 ;; esac } show-win () { local win=$1 wmctrl -a $win } hide-win () { local win=$1 wmctrl -r $win -b toggle,hidden } hide-all-wins () { DISPLAY=":0" wmctrl -k on } alias hide=hide-all-wins max-win () { local win case $# in (0) win=$(win-id) wmctrl -i -r $win -b toggle,fullscreen ;; (1) win=$1 wmctrl -r $win -b toggle,fullscreen ;; (*) echo "error: $0 accepts 0 or 1 argument (got $#)" >&2 esac } alias fullscreen=max-win half-win () { local win=$1 wmctrl -r $win -b remove,fullscreen wmctrl -r $win -e 0,0,358,1024,381 } max-wait () { local prog=$1 while (( ! $(wmctrl -l | grep $prog | wc -l) )) {} max-win $prog } fullscreen-exec () { local prog=$1 $prog &; max-wait $prog } -- underground experts united https://dataswamp.org/~incal