fedora-csb-system-manager
  1;;; config-appearance.el --- -*- lexical-binding: t -*-
  2;;; Commentary:
  3;;; Appearance configuration
  4;;; Code:
  5
  6(set-face-attribute 'fill-column-indicator nil
  7                    :foreground "#717C7C") ; katana-gray
  8(global-display-fill-column-indicator-mode 1)
  9
 10(setopt echo-keystrokes 0.1
 11        line-number-display-limit-width 10000
 12        indicate-buffer-boundaries 'left
 13        indicate-empty-lines +1)
 14
 15(line-number-mode 1)
 16(column-number-mode 1)
 17
 18;; let's enable it for all programming major modes
 19(add-hook 'prog-mode-hook #'hl-line-mode)
 20;; and for all modes derived from text-mode
 21(add-hook 'text-mode-hook #'hl-line-mode)
 22
 23(use-package frame
 24  :unless noninteractive
 25  :commands vde/cursor-type-mode
 26  :config
 27  (setq-default cursor-type 'box)
 28  (setq-default cursor-in-non-selected-windows '(bar . 2))
 29  (setq-default blink-cursor-blinks 50)
 30  (setq-default blink-cursor-interval nil) ; 0.75 would be my choice
 31  (setq-default blink-cursor-delay 0.2)
 32
 33  (blink-cursor-mode -1)
 34
 35  (define-minor-mode vde/cursor-type-mode
 36    "Toggle between static block and pulsing bar cursor."
 37    :init-value nil
 38    :global t
 39    (if vde/cursor-type-mode
 40        (progn
 41          (setq-local blink-cursor-interval 0.75
 42                      cursor-type '(bar . 2)
 43                      cursor-in-non-selected-windows 'hollow)
 44          (blink-cursor-mode 1))
 45      (dolist (local '(blink-cursor-interval
 46                       cursor-type
 47                       cursor-in-non-selected-windows))
 48        (kill-local-variable `,local))
 49      (blink-cursor-mode -1))))
 50
 51(use-package emacs
 52  :config
 53  (setq-default custom-safe-themes t)
 54  (setq-default custom--inhibit-theme-enable nil)
 55
 56  (defun vde/before-load-theme (&rest args)
 57    "Clear existing theme settings instead of layering them.
 58Ignores `ARGS'."
 59    (mapc #'disable-theme custom-enabled-themes))
 60
 61  (advice-add 'load-theme :before #'vde/before-load-theme))
 62
 63(use-package emacs
 64  :config
 65  (setq window-divider-default-right-width 1)
 66  (setq window-divider-default-bottom-width 1)
 67  (setq window-divider-default-places 'right-only)
 68  :hook (after-init . window-divider-mode))
 69
 70(use-package tab-bar
 71  :unless noninteractive
 72  :config
 73  (setq-default tab-bar-close-button-show nil)
 74  (setq-default tab-bar-close-last-tab-choice 'tab-bar-mode-disable)
 75  (setq-default tab-bar-close-tab-select 'recent)
 76  (setq-default tab-bar-new-tab-choice t)
 77  (setq-default tab-bar-new-tab-to 'right)
 78  (setq-default tab-bar-position nil)
 79  (setq-default tab-bar-show t)
 80  (setq-default tab-bar-tab-hints nil)
 81  (setq-default tab-bar-tab-name-function 'vde/tab-bar-tab-name)
 82
 83  (defun vde/tab-bar-tab-name ()
 84    "Generate tab name from the buffer of the selected window *or* projectile."
 85    (cond
 86     ((project-current) (let ((project-path (vde-project--project-current)))
 87                          (cond ((string-prefix-p "~/src" project-path)
 88                                 (directory-file-name (file-relative-name project-path "~/src")))
 89                                ((string-prefix-p "~/desktop" project-path)
 90                                 (directory-file-name (file-relative-name project-path "~/desktop")))
 91                                ((string-prefix-p "/etc" project-path)
 92                                 (directory-file-name (file-relative-name project-path "/etc")))
 93                                (t
 94                                 (file-relative-name project-path)))))
 95     (t (tab-bar-tab-name-current-with-count))))
 96
 97  (defun vde/complete-tab-bar-tab-dwim ()
 98    "Do-What-I-Mean function for getting to a `tab-bar-mode' tab.
 99If no other tab exists, create one and switch to it.  If there is
100one other tab (so two in total) switch to it without further
101questions.  Else use completion to select the tab to switch to."
102    (interactive)
103    (let ((tabs (mapcar (lambda (tab)
104                          (alist-get 'name tab))
105                        (tab-bar--tabs-recent))))
106      (cond ((eq tabs nil)
107             (tab-new))
108            ((eq (length tabs) 1)
109             (tab-next))
110            (t
111             (tab-bar-switch-to-tab
112              (completing-read "Select tab: " tabs nil t))))))
113
114  :bind (("C-x t t" . vde/complete-tab-bar-tab-dwim)
115         ("C-x t s" . tab-switcher)
116	 ("C-<next>" . tab-next)
117	 ("C-<prior>" . tab-previous)))
118
119(use-package minions
120  :hook (after-init . minions-mode)
121  :config
122  (add-to-list 'minions-prominent-modes 'flymake-mode))
123
124(use-package time
125  :unless noninteractive
126  :config
127  (setq-default display-time-24hr-format t
128                display-time-day-and-date t
129                display-time-world-list '(("Europe/Paris" "Paris")
130                                          ("Europe/London" "London")
131                                          ("America/New_York" "Boston")
132                                          ("America/Los_Angeles" "San Francisco")
133                                          ("Asia/Calcutta" "Bangalore")
134                                          ("Australia/Brisbane" "Brisbane"))
135                display-time-string-forms
136                '((format "%s %s %s, %s:%s"
137                          dayname
138                          monthname day
139                          24-hours minutes)))
140  (display-time))
141
142(use-package tooltip
143  :unless noninteractive
144  :config
145  (setq tooltip-delay 0.5)
146  (setq tooltip-short-delay 0.5)
147  (setq x-gtk-use-system-tooltips nil)
148  (setq tooltip-frame-parameters
149        '((name . "tooltip")
150          (internal-border-width . 6)
151          (border-width . 0)
152          (no-special-glyphs . t)))
153  :hook (after-init . tooltip-mode))
154
155(use-package alert
156  :init
157  (defun alert-after-finish-in-background (buf str)
158    (when (or (not (get-buffer-window buf 'visible)) (not (frame-focus-state)))
159      (alert str :buffer buf)))
160  :config
161  (setq alert-default-style 'libnotify))
162
163(provide 'config-appearance)
164;;; config-appearance.el ends here