Skip to content

Commit

Permalink
Only init gui frame specific stuff if running a gui
Browse files Browse the repository at this point in the history
  • Loading branch information
regob committed Sep 3, 2024
1 parent 3a95a33 commit 52103ef
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions lisp/init-appearance.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@

;; Remove toolbars, menu and scrollbars
(menu-bar-mode -1)
(toggle-scroll-bar -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)

(setq visible-bell t ; Flash when bell would be emitted
frame-inhibit-implied-resize t ; Keep frame size
inhibit-startup-message t ; Hide the startup message
)

(column-number-mode)
(global-hl-line-mode)

;; start in full screen
(push '(fullscreen . maximized) default-frame-alist)


;; if gui do something in whatver type of emacs instance we are using
;; if gui do something in whatever type of emacs instance we are using
;; adapted from https://www.reddit.com/r/emacs/comments/pc189c/comment/hafl5os/
(defun rb-apply-if-gui (&rest action)
"Do specified ACTION if we're in a gui regardless of daemon or not."
Expand All @@ -40,6 +34,19 @@
(if (display-graphic-p)
(apply action))))

;; ----------------------------------------------------------------------------
;; Frame specific setup (only in graphical environments)
;; ----------------------------------------------------------------------------

(defun rb-frame-settings ()
(scroll-bar-mode -1)
;; start in full screen
(push '(fullscreen . maximized) default-frame-alist)
(setq frame-inhibit-implied-resize t) ; Keep frame size
)

(rb-apply-if-gui 'rb-frame-settings)

;; ----------------------------------------------------------------------------
;; Font config
;; ----------------------------------------------------------------------------
Expand Down

0 comments on commit 52103ef

Please sign in to comment.