On 9/26/23 16:12, Björn Bidar wrote: > David Hedlund writes: > >> 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. >> >> [1]: Workaround to bug: maximize* commands don't work for Emacs - >> https://savannah.nongnu.org/bugs/index.php?63979 > There are a few ways to achieve this on Linux. The Emacs wiki has a some > examples, e.g: > > (defun toggle-fullscreen () > "Toggle full screen on X11" > (interactive) > (when (eq window-system 'x) > (set-frame-parameter > nil 'fullscreen > (when (not (frame-parameter nil 'fullscreen)) 'fullboth)))) > > Or: > (defun switch-full-screen () > (interactive) > (shell-command "wmctrl -r :ACTIVE: -btoggle,fullscreen")) > > The first example also could work with PGTK, but the example only checks for > window system of x build . Thank you, but none of the solutions worked in Trisquel 11 (X11). > I'm not sure how exactly fullscreen should be > done on Wayland. > > Is the builtin function `toggle-frame-fullscreen` enough? > That will open emacs in full screen mode, as the subject says I want it to maximize. However, as a side note, I observed that toggle-frame-fullscreen expands the buffer quickly (like `emacs --maximize`) which gives me hope.