forked from Superbil/old-emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-gui-frames.el
61 lines (48 loc) · 2.33 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
;;----------------------------------------------------------------------------
;; Stop C-z from minimizing windows under OS X
;;----------------------------------------------------------------------------
(defun maybe-suspend-frame ()
(interactive)
(unless (and *is-a-mac* window-system)
(suspend-frame)))
(global-set-key (kbd "C-z") 'maybe-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 indicate-empty-lines t)
;;----------------------------------------------------------------------------
;; Window size and features
;;----------------------------------------------------------------------------
(when (fboundp 'tool-bar-mode)
(tool-bar-mode -1))
(when (fboundp 'set-scroll-bar-mode)
(set-scroll-bar-mode nil))
(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 (and *is-a-mac* (fboundp 'toggle-frame-fullscreen))
;; Command-Option-f to toggle fullscreen mode
;; Hint: Customize `ns-use-native-fullscreen'
(global-set-key (kbd "M-ƒ") 'toggle-frame-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)
(with-selected-frame frame
(unless window-system
(set-frame-parameter nil 'menu-bar-lines 0)))))
(setq frame-title-format
'((:eval (if (buffer-file-name)
(abbreviate-file-name (buffer-file-name))
"%b"))))
(provide 'init-gui-frames)