unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Björn Bidar" <bjorn.bidar@thaodan.de>
To: David Hedlund <public@beloved.name>
Cc: emacs-devel@gnu.org
Subject: Re: Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
Date: Fri, 29 Sep 2023 02:26:44 +0300	[thread overview]
Message-ID: <874jjdx4jv.fsf@thaodan.de> (raw)
In-Reply-To: <84ec22ac-299e-4849-adaf-e604d20218a6@beloved.name> (David Hedlund's message of "Wed, 27 Sep 2023 19:29:23 +0200")

David Hedlund <public@beloved.name> writes:

> On 9/27/23 17:10, David Hedlund wrote:
>>
>>
>> On 9/27/23 17:07, David Hedlund wrote:
>>>
>>>
>>> On 9/27/23 15:25, Emanuel Berg wrote:
>>>> David Hedlund wrote:
>>>>
>>>>> sudo apt install -y emacs wmctrl # Just press Enter during the
>>>>> "Postfix Configuration"
>>>>>
>>>>> tee ~/.emacs > /dev/null << 'EOF'
>>>>>
>>>>> (defun switch-full-screen ()
>>>>>         (interactive)
>>>>>         (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))
>>>>>
>>>>> EOF
>>>> Yes, do that and then M-x switch-full-screen RET
>>>>
>>>> or just type
>>>>
>>>>    (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen")
>>>>
>>>> and do C-x C-e for `eval-last-sexp'.
>>>>
>>>> It doesn't work?
>>>>
>>>
>>> Sorry, it works, I just expected the snippet from Emacs wiki to
>>> work out-of-the-box automatically. But I had to add: (add-hook
>>> 'after-init-hook 'switch-full-screen)  . Also, "toggle" is useless
>>> for wmctrl in this situation, so I replaced it with "add", and I
>>> replaced "fullscreen" with "maximized_horz,maximized_vert"
>>>
>>> Here's the final solution for X11 (Trisquel, Ubuntu MATE), but not
>>> for Wayland (Ubuntu):
>>> (defun switch-full-screen ()
>>>         (interactive)
>>>         (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
>>
>> Sorry, I forgot to add (add-hook 'after-init-hook
>> 'switch-full-screen). Here's everything:
>>
>>
>> (defun switch-full-screen ()
>>         (interactive)
>>         (shell-command "wmctrl -r :ACTIVE: -b add,maximized_horz,maximized_vert"))
>> (add-hook 'after-init-hook 'switch-full-screen)
>>
>>
> Sorry, I just found out that even if it's added to the top of
> ~/.emacs, this will not expand the buffer quickly like `emacs -mm` for
> a typical ~/.emacs that need to load a lot of stuff. It will not
> expand the buffer faster than
>
>     (add-to-list 'default-frame-alist '(fullscreen . maximized)) -- so
> it's a useless solution since it requires wmctrl
>
> Also, the wmctrl solution requires the package to be installed
>
Same for any other external solution such as  your recommended solution devilspie2.
>
> Right now the only way to automaticall and always quickly expand the
> buffer like `emacs -mm`, regardless the size of ~/.emacs, is to use
> devilspie2 solution that I added in the first post in this thread.
Call wmctrl hook in after-make-frame-functions.



  parent reply	other threads:[~2023-09-28 23:26 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 12:11 Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux David Hedlund
2023-09-26 14:12 ` Björn Bidar
2023-09-26 14:36   ` Emanuel Berg
2023-09-26 15:57   ` David Hedlund
2023-09-26 22:24     ` Emanuel Berg
2023-09-26 22:33     ` Emanuel Berg
2023-09-27 11:21       ` David Hedlund
2023-09-27 13:16         ` David Hedlund
2023-09-27 13:25           ` Emanuel Berg
2023-09-27 15:07             ` David Hedlund
2023-09-27 15:10               ` David Hedlund
2023-09-27 17:29                 ` David Hedlund
2023-09-28 20:05                   ` chad
2023-09-28 22:39                     ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux - Improved solution by Chad: ~/.emacs.d/early-init.el David Hedlund
2023-09-29 17:18                       ` David Hedlund
2023-09-29 17:54                         ` David Hedlund
2023-09-29 19:46                           ` Emanuel Berg
2023-09-30 15:50                           ` David Hedlund
2023-10-05  4:01                             ` David Hedlund
2023-10-05  4:19                               ` Emanuel Berg
2023-10-19 13:57                                 ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux -- Lisp code for `emacs --maximize` David Hedlund
2023-10-27  2:19                     ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux David Hedlund
2023-11-10 11:04                     ` David Hedlund
2023-09-28 23:26                   ` Björn Bidar [this message]
2023-09-29 16:09                     ` Emanuel Berg
2023-09-29 17:46                       ` David Hedlund
2023-09-29 17:20                     ` David Hedlund
2023-09-27 15:21               ` Emanuel Berg
2023-09-27 13:28           ` David Hedlund
2023-09-27 14:03             ` Emanuel Berg
2023-09-27 15:18               ` David Hedlund
2023-09-27 13:21         ` Emanuel Berg
2023-09-26 16:06 ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html David Hedlund
2023-09-26 19:11   ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html Emanuel Berg
2023-09-26 20:06     ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html David Hedlund
2023-09-27  3:53       ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html Corwin Brust
2023-09-27 18:04         ` https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html David Hedlund
2023-09-29  7:00 ` Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux Eli Zaretskii
2023-09-29 17:12   ` David Hedlund
2023-09-29 17:35     ` Eli Zaretskii
2023-09-29 20:57       ` David Hedlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874jjdx4jv.fsf@thaodan.de \
    --to=bjorn.bidar@thaodan.de \
    --cc=emacs-devel@gnu.org \
    --cc=public@beloved.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).