unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* fn key to bring emacs forward / focus it as if c-tab were used
@ 2022-03-10  5:41 Samuel Wales
  2022-04-05 21:19 ` TRS-80
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Wales @ 2022-03-10  5:41 UTC (permalink / raw)
  To: help-gnu-emacs

i want to assign a function key to bring emacs to the top of the
windows and focus it as if c-tab were used to get to emacs.

i figured perhaps i could assign, in fluxbox keys file, some
emacsclient call that raises emacs.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fn key to bring emacs forward / focus it as if c-tab were used
  2022-03-10  5:41 fn key to bring emacs forward / focus it as if c-tab were used Samuel Wales
@ 2022-04-05 21:19 ` TRS-80
  2022-04-16 23:29   ` Samuel Wales
  0 siblings, 1 reply; 5+ messages in thread
From: TRS-80 @ 2022-04-05 21:19 UTC (permalink / raw)
  To: help-gnu-emacs

On 2022-03-10 00:41, Samuel Wales wrote:
> i want to assign a function key to bring emacs to the top of the
> windows and focus it as if c-tab were used to get to emacs.
> 
> i figured perhaps i could assign, in fluxbox keys file, some
> emacsclient call that raises emacs.

Yes this is window manager functionality (IMO).

In my case, I bind all my Super (Win) keys to stuff like this, as those 
have no conflicts with Emacs.  For me, =s-S-e= will launch a new 
Emacs(client) frame.

Cheers,
TRS-80



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fn key to bring emacs forward / focus it as if c-tab were used
  2022-04-05 21:19 ` TRS-80
@ 2022-04-16 23:29   ` Samuel Wales
  2022-04-17  0:06     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-04-17 14:16     ` Robert Pluim
  0 siblings, 2 replies; 5+ messages in thread
From: Samuel Wales @ 2022-04-16 23:29 UTC (permalink / raw)
  To: TRS-80; +Cc: help-gnu-emacs

is there bring to front functionality in elisp/emacsclient?

On 4/5/22, TRS-80 <lists.trs-80@isnotmyreal.name> wrote:
> On 2022-03-10 00:41, Samuel Wales wrote:
>> i want to assign a function key to bring emacs to the top of the
>> windows and focus it as if c-tab were used to get to emacs.
>>
>> i figured perhaps i could assign, in fluxbox keys file, some
>> emacsclient call that raises emacs.
>
> Yes this is window manager functionality (IMO).
>
> In my case, I bind all my Super (Win) keys to stuff like this, as those
> have no conflicts with Emacs.  For me, =s-S-e= will launch a new
> Emacs(client) frame.
>
> Cheers,
> TRS-80
>
>


-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fn key to bring emacs forward / focus it as if c-tab were used
  2022-04-16 23:29   ` Samuel Wales
@ 2022-04-17  0:06     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2022-04-17 14:16     ` Robert Pluim
  1 sibling, 0 replies; 5+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2022-04-17  0:06 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: fn key to bring emacs forward / focus it as if c-tab were used
  2022-04-16 23:29   ` Samuel Wales
  2022-04-17  0:06     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2022-04-17 14:16     ` Robert Pluim
  1 sibling, 0 replies; 5+ messages in thread
From: Robert Pluim @ 2022-04-17 14:16 UTC (permalink / raw)
  To: Samuel Wales; +Cc: help-gnu-emacs

>>>>> On Sat, 16 Apr 2022 16:29:44 -0700, Samuel Wales <samologist@gmail.com> said:

    Samuel> is there bring to front functionality in elisp/emacsclient?

Thereʼs `raise-frame', but it might not work with your window manager.

Robert
-- 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-17 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10  5:41 fn key to bring emacs forward / focus it as if c-tab were used Samuel Wales
2022-04-05 21:19 ` TRS-80
2022-04-16 23:29   ` Samuel Wales
2022-04-17  0:06     ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-04-17 14:16     ` Robert Pluim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).