forked from redguardtoo/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-gui-frames.el
63 lines (48 loc) · 2.31 KB
/
init-gui-frames.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
;;----------------------------------------------------------------------------
;; Stop C-z from minimizing windows under OS X
;;----------------------------------------------------------------------------
(global-set-key (kbd "C-z")
(lambda ()
(interactive)
(unless (and *is-a-mac* window-system)
(suspend-frame))))
;;----------------------------------------------------------------------------
;; Suppress GUI features
;;----------------------------------------------------------------------------
(setq use-file-dialog nil)
(setq use-dialog-box nil)
(setq inhibit-startup-screen t)
(setq inhibit-startup-echo-area-message t)
;;----------------------------------------------------------------------------
;; Show a marker in the left fringe for lines not in the buffer
;;----------------------------------------------------------------------------
(setq default-indicate-empty-lines t)
;;----------------------------------------------------------------------------
;; Window size and features
;;----------------------------------------------------------------------------
(if (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(if (fboundp 'set-scroll-bar-mode)
(set-scroll-bar-mode nil))
(setq ns-auto-hide-menu-bar t)
(require 'init-maxframe)
(defun adjust-opacity (frame incr)
(let* ((oldalpha (or (frame-parameter frame 'alpha) 100))
(newalpha (+ incr oldalpha)))
(when (and (<= frame-alpha-lower-limit newalpha) (>= 100 newalpha))
(modify-frame-parameters frame (list (cons 'alpha newalpha))))))
(when (fboundp 'ns-toggle-fullscreen)
;; Command-Option-f to toggle fullscreen mode
(global-set-key (kbd "M-ƒ") 'ns-toggle-fullscreen))
(global-set-key (kbd "M-C-8") '(lambda () (interactive) (adjust-opacity nil -5)))
(global-set-key (kbd "M-C-9") '(lambda () (interactive) (adjust-opacity nil 5)))
(global-set-key (kbd "M-C-0") '(lambda () (interactive) (modify-frame-parameters nil `((alpha . 100)))))
(add-hook 'after-make-frame-functions
(lambda (frame)
(let ((prev-frame (selected-frame)))
(select-frame frame)
(prog1
(unless window-system
(set-frame-parameter frame 'menu-bar-lines 0))
(select-frame prev-frame)))))
(provide 'init-gui-frames)