all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Solution to a proposed FAQ, how to maximize emacs quickly (like `emacs --maximize`) for GNU/Linux
@ 2023-09-26 12:11 David Hedlund
  2023-09-26 14:12 ` Björn Bidar
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: David Hedlund @ 2023-09-26 12:11 UTC (permalink / raw)
  To: Emacs-devel

[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]

Methods to always maximize `emacs` (for example, from Alt+F2 in MATE), 
without the slightly distracting visual effect when the default frame 
size is growing to fullscreen. The window will be maximized quickly, 
like "emacs --maximize".

###########################

Windows - Solved

A while ago I suggested how to expand the Emacs window rapidly for 
Windows - 
https://lists.gnu.org/archive/html/emacs-devel/2023-04/msg00155.html

It has now been added:

"

Alternatively, you can avoid the visual effect of Emacs changing its 
frame size entirely in your init file (i.e., without using the 
Registry), like this:

(setq frame-resize-pixelwise t)
(set-frame-position nil 0 0)
(set-frame-size nil (display-pixel-width) (display-pixel-height) t)

" - 
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-MS_002dWindows.html. 
Here's the old revision: 
https://web.archive.org/web/20230202024025/https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-MS_002dWindows.html


###########################

GNU/Linux - proposed new section: 
https://www.gnu.org/software/emacs/manual/html_node/efaq/Fullscreen-mode-on-GNU-Linux.html


As far as I know, this cannot be done entirely with Emacs LISP for 
GNU/Linux, but I found a workaround by combining it with devilspie2.


I've successfully used this recipe for Trisquel 11:

* Step 1 to quickly maximize the window[1]: Install, configure, and 
autostart devilspie2 to nearly maximize emacs[1]. Run this in a terminal 
or as a script:

# Install devilspie2
sudo apt-get -y install devilspie2

# Configure devilspie2
mkdir -p ~/.config/devilspie2/

width="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 
'x' -f1)"
height="$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 
'x' -f2)"

tee ~/.config/devilspie2/emacs.lua /dev/null << EOF
if (get_class_instance_name() == "emacs") then

     set_window_geometry(0, 0, $width, $height);

end
EOF

# Autostart devilspie2
mkdir -p "$HOME/.config/autostart/" # The directory does not exist by 
default
cd "$HOME/.config/autostart/" || exit
file="devilspie-2.desktop"
touch "$file"
desktop-file-edit \
--set-name="Devilspie 2" \
--set-comment="Perform scripted actions on windows as they are created" \
--set-key="Type" --set-value="Application" \
--set-key="Exec" --set-value="devilspie2" \
--set-key="X-MATE-Autostart-Delay" --set-value="0" \
"$file"
desktop-file-validate "$file"

* Step 2 to quickly maximize the window[1]: Add this to ~/.emacs: 
(add-to-list 'default-frame-alist '(fullscreen . maximized))
* Log out and then log back into your desktop environment
* Every time you open `emacs`, regardless how you are opening it, it 
will open the window equally fast as `emacs --maximize`

[1]: Workaround to bug: maximize* commands don't work for Emacs - 
https://savannah.nongnu.org/bugs/index.php?63979



The above steps can of course be rewritten and described for general use 
to make it useful for any GNU/Linux distro.

[-- Attachment #2: Type: text/html, Size: 4805 bytes --]

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

end of thread, other threads:[~2023-11-10 11:04 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.