polybar exwm

This commit is contained in:
Sakooooo 2024-02-07 14:46:14 +04:00
parent 6958f9e2e0
commit 7b467f4557
Signed by: sako
GPG key ID: 3FD715D87D7725E0
2 changed files with 84 additions and 50 deletions

View file

@ -1329,6 +1329,33 @@ RELEASE ME
(require 'exwm-systemtray)
(exwm-systemtray-enable)
;; polybar
(defvar sakomacs/polybar-process nil
"Holds the process of the running Polybar instance, if any")
(server-start)
(defun sakomacs/kill-panel ()
(interactive)
(when sakomacs/polybar-process
(ignore-errors
(kill-process sakomacs/polybar-process)))
(setq sakomacs/polybar-process nil))
(defun sakomacs/start-panel ()
(interactive)
(sakomacs/kill-panel)
(setq sakomacs/polybar-process (start-process-shell-command "polybar" nil "polybar panel")))
(defun sakomacs/send-polybar-hook (module-name hook-index)
(start-process-shell-command "polybar-msg" nil (format "polybar-msg hook %s %s" module-name hook-index)))
(defun sakomacs/send-polybar-exwm-workspace ()
(sakomacs/send-polybar-hook "exwm-workspace" 1))
;; Update panel indicator when workspace changes
(add-hook 'exwm-workspace-switch-hook #'sakomacs/send-polybar-exwm-workspace)
;; always use these keys in emacs
(setq exwm-input-prefix-keys
'(?\C-x

View file

@ -59,7 +59,7 @@ separator-foreground = ${colors.disabled}
font-0 = JetBrainsMono ;1
modules-left = xworkspaces xwindow
modules-left = exwm-workspace xwindow
modules-right = battery pulseaudio date
cursor-click = pointer
@ -75,6 +75,13 @@ wm-restack = bspwm
; override-redirect = true
[module/exwm-workspace]
type = custom/ipc
hook-0 = emacsclient -e "exwm-workspace-current-index" | sed -e 's/^"//' -e 's/"$//'
initial = 1
format-underline = ${colors.underline-1}
format-padding = 1
[module/xworkspaces]
type = internal/xworkspaces