summaryrefslogtreecommitdiff
path: root/.config/emacs/bd-mode-and-themes.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/bd-mode-and-themes.el')
-rw-r--r--.config/emacs/bd-mode-and-themes.el73
1 files changed, 36 insertions, 37 deletions
diff --git a/.config/emacs/bd-mode-and-themes.el b/.config/emacs/bd-mode-and-themes.el
index dbab69a..7cdc196 100644
--- a/.config/emacs/bd-mode-and-themes.el
+++ b/.config/emacs/bd-mode-and-themes.el
@@ -8,46 +8,46 @@
;;;; icon components for filename and git status
(use-package all-the-icons
:init
- (progn (progn (defun modeline-buffer-name ()
- "Return 'buffer-name' with proper spacing and icon."
- (format " %s %s" (all-the-icons-icon-for-file (buffer-name)) (buffer-name)))
- (defvar-local bd/buffer-identification-mode-line
- '(:eval (format "%s" (modeline-buffer-name)))
- "Formats the modeline-buffer-name."))
-
- (progn (defun git-vc-modeline ()
- (let ((branch (mapconcat 'concat (cdr (split-string vc-mode "[:-]")) "-")))
- (concat
- (propertize (format " %s" (all-the-icons-octicon "git-branch"))
- 'face `(:height 1 :family ,(all-the-icons-octicon-family))
- 'display '(raise 0))
- (propertize (format " %s" branch))
- (propertize " "))))
- (defvar-local bd/vc-mode-line
- '(:eval (when (and vc-mode (not (eq major-mode 'magit-status-mode))) ; temp fix to avoid bug which occurs in magit buffer
- (format "%s"
- (propertize (git-vc-modeline) 'face 'shadow))))
- "Formats the checked out git repository.")))
+ (defun modeline-buffer-name ()
+ "Return 'buffer-name' with proper spacing and icon."
+ (format " %s %s" (all-the-icons-icon-for-file (buffer-name)) (buffer-name)))
+ (defvar-local bd/buffer-identification-mode-line
+ '(:eval (format "%s" (modeline-buffer-name)))
+ "Formats the modeline-buffer-name.")
+
+ (defun git-vc-modeline ()
+ (let ((branch (mapconcat 'concat (cdr (split-string vc-mode "[:-]")) "-")))
+ (concat
+ (propertize (format " %s" (all-the-icons-octicon "git-branch"))
+ 'face `(:height 1 :family ,(all-the-icons-octicon-family))
+ 'display '(raise 0))
+ (propertize (format " %s" branch))
+ (propertize " "))))
+ (defvar-local bd/vc-mode-line
+ '(:eval (when (and vc-mode (not (eq major-mode 'magit-status-mode))) ; temp fix to avoid bug which occurs in magit buffer
+ (format "%s"
+ (propertize (git-vc-modeline) 'face 'shadow))))
+ "Formats the checked out git repository.")
:config
(setq emms-mode-line-icon-before-format (format "%s" (all-the-icons-fileicon "owl"))
emms-mode-line-icon-enabled-p t))
(use-package ednc
:init
- (progn (defun stack-notifications (&optional hide)
- "Return active notifications as a string, one
-per application."
- (mapconcat (lambda (notification
- (let ((app-name (ednc-notification-app-name notification)))
- (unless (member app-name hide)
- (push app-name hide)
- (end-format-notification notification)))
- (ednc-notifications) "")))))
+ (defun get-num-notifications ()
+ "Return number of active notifcations as a string."
+ (format "%s" (length (ednc-notifications))))
+ (defvar-local bd/notify-mode-line
+ '(:eval (when (and (ednc-notifications) (mode-line-window-selected-p))
+ (format " %s %s" (all-the-icons-material "notifications_active")
+ (propertize (get-num-notifications) 'face 'error))))
+ "Formats the notification number.")
:config
- (ednc-mode)
- (nconc global-mode-string '((:eval (stack-notifications))))
- (add-hook 'ednc-notification-presentation-functions
- (lambda (&rest _) (force-mode-line-update t))))
+ (ednc-mode))
+
+(defun test ()
+ (when (ednc-notifications)
+ (message "nice")))
;;;; time and date
(setq display-time-format "%m/%d/%y %H:%M (%a)"
@@ -71,9 +71,7 @@ only in the selected buffer.")
'display `((space :align-to (- (+ right right-fringe right-margin) ,reserve)))))
;;;; pad out space for time (this method is probably horrendous)
-(insert-into-list global-mode-string (mode-line-fill 30) (cl-position 'display-time-string global-mode-string))
-
- ; 21
+(insert-into-list global-mode-string (mode-line-fill 21) (cl-position 'display-time-string global-mode-string))
(dolist (construct '(bd/buffer-identification-mode-line
bd/vc-mode-line
@@ -91,6 +89,7 @@ only in the selected buffer.")
" "
;; mode-line-position
mode-line-modified
+ bd/notify-mode-line
bd/vc-mode-line
" "
bd/misc-mode-line
@@ -127,7 +126,7 @@ only in the selected buffer.")
;;;; true transparency
;; (add-to-list 'default-frame-alist '(alpha-background . 60))
-(set-frame-parameter (selected-frame) 'alpha '(72 . 72))
+(add-to-list 'default-frame-alist '(alpha . (72 . 72)))
(defun set-frame-alpha (value)
"Sets the transparency of the frame background. 0=transparent/100=opaque"