Add stuff for waybar
This commit is contained in:
		
							
								
								
									
										12
									
								
								init.el
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								init.el
									
									
									
									
									
								
							@ -585,6 +585,9 @@ printed representation (via `princ') set as the new value for the key."
 | 
			
		||||
(defun my/-set-eww-fcitx-state (enabled)
 | 
			
		||||
  "Set the fcitx state for eww to ENABLED."
 | 
			
		||||
  (my/eww-update-variables "fcitx5-state" (if enabled 2 1)))
 | 
			
		||||
(defun my/-update-waybar-fcitx-state ()
 | 
			
		||||
  "Update the waybar fcitx5 state."
 | 
			
		||||
  (call-process "pkill" nil 0 nil "-RTMIN+1" "waybar"))
 | 
			
		||||
(defun my/global-toggle-mozc (&optional no-eww)
 | 
			
		||||
  "Toggle mozc for all buffers.
 | 
			
		||||
With NO-EWW, don't update eww's state."
 | 
			
		||||
@ -603,7 +606,8 @@ With NO-EWW, don't update eww's state."
 | 
			
		||||
            (when (boundp 'evil-input-method)
 | 
			
		||||
              (setq-local evil-input-method nil)))))
 | 
			
		||||
      (unless no-eww
 | 
			
		||||
        (my/-set-eww-fcitx-state activate)))
 | 
			
		||||
        (my/-set-eww-fcitx-state activate)
 | 
			
		||||
        (my/-update-waybar-fcitx-state)))
 | 
			
		||||
    (force-mode-line-update t)))
 | 
			
		||||
(keymap-global-set "C-\\" #'my/global-toggle-mozc)
 | 
			
		||||
(defun my/mozc-active-in-buffer-p (&optional buffer)
 | 
			
		||||
@ -3233,8 +3237,10 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
 | 
			
		||||
(mu4e-context-switch nil "Personal")
 | 
			
		||||
;; refresh the eww message count
 | 
			
		||||
(defun my/-mu4e-eww-refresh-unread-count ()
 | 
			
		||||
  "Refresh the eww unread message count."
 | 
			
		||||
  (my/eww-poll-variables "mu4e"))
 | 
			
		||||
  "Refresh the eww unread message count.
 | 
			
		||||
This will also update waybar."
 | 
			
		||||
  (my/eww-poll-variables "mu4e")
 | 
			
		||||
  (call-process "pkill" nil 0 nil "-RTMIN+2" "waybar"))
 | 
			
		||||
(add-hook 'mu4e-message-changed-hook #'my/-mu4e-eww-refresh-unread-count)
 | 
			
		||||
 | 
			
		||||
;; mu4e compose HTML messages
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user