Skip to content

Commit

Permalink
maximized on linux, fullscreen on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
jsigman committed Sep 16, 2024
1 parent 32e3d87 commit 8277aa9
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions init.org
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,22 @@ I'll do this first, so that it goes back to this when I exit full screen mode (i
#+end_src
*** Full Screen
#+begin_src emacs-lisp :load yes
(defun toggle-fullscreen ()
"Toggle full screen."
(defun toggle-fullscreen-or-maximized ()
"Toggle between fullscreen on macOS and maximized on Linux."
(interactive)
(set-frame-parameter
nil 'fullscreen
(if (frame-parameter nil 'fullscreen) nil 'fullboth)))
(add-hook 'window-setup-hook #'toggle-fullscreen)
(if (eq system-type 'darwin) ; macOS
(set-frame-parameter
nil 'fullscreen
(if (frame-parameter nil 'fullscreen)
nil
'fullboth))
(set-frame-parameter
nil 'fullscreen
(if (eq (frame-parameter nil 'fullscreen) 'maximized)
nil
'maximized)))) ; Linux

(add-hook 'window-setup-hook #'toggle-fullscreen-or-maximized)
#+end_src
** Copying syntax highlighting to the clipboard
#+begin_src emacs-lisp :load yes
Expand Down

0 comments on commit 8277aa9

Please sign in to comment.