summaryrefslogtreecommitdiff
path: root/emacs/inits/00-exwm.el
diff options
context:
space:
mode:
authortslil clingman <>2020-05-05 20:26:45 -0700
committertslil clingman <>2020-05-05 20:26:45 -0700
commit5035096a71436a47821fce05ef7a559095999e0f (patch)
treed0de0427aa476d3bf184cda58c615a4b9f0819f2 /emacs/inits/00-exwm.el
parent1d2c9def58d0ee5bd69c5f985ca97538cdf93c9b (diff)
Something close to correct for EXWM+workspaces+statusbar
Diffstat (limited to 'emacs/inits/00-exwm.el')
-rw-r--r--emacs/inits/00-exwm.el38
1 files changed, 21 insertions, 17 deletions
diff --git a/emacs/inits/00-exwm.el b/emacs/inits/00-exwm.el
index e9fa71c..647c5c1 100644
--- a/emacs/inits/00-exwm.el
+++ b/emacs/inits/00-exwm.el
@@ -1,4 +1,4 @@
-;; Time-stamp: <2020-04-28 11:04:55 (tslil@bison)>
+;; Time-stamp: <2020-05-05 20:25:35 (tslil@bison)>
(defun banish-rat ()
(interactive)
@@ -90,7 +90,8 @@
(advice-add 'exwm-workspace-switch-create :after #'exwm-workspace-track-changes)
(defun exwm-sanitise-workspace-last-index ()
- (when (> (1+ exwm-workspace-last-idx) (exwm-workspace--count))
+ (when (and (< 0 (exwm-workspace--count))
+ (> (1+ exwm-workspace-last-idx) (exwm-workspace--count)))
(setq exwm-workspace-last-idx exwm-workspace-current-idx)
(exwm-update-workspace-lighter)))
@@ -130,21 +131,6 @@
(exwm-systemtray-enable)
(setq exwm-systemtray-height 24)
- ;; -----------------------------------------------------------------------------
- ;; Statusbar.el
-
- (add-to-list 'load-path (expand-file-name "~/.emacs.d/scripts/statusbar.el/"))
- (use-package posframe :ensure t)
- (use-package statusbar
- :config
- (advice-add 'exwm-update-workspace-lighter :after #'statusbar-refresh)
- (setq statusbar-modeline-variables '(exwm-workspace-lighter display-time-string)))
-
- ;; This is an awful hack, i'm not sure why i can't just run this immediately after EXWM
- (push (lambda ()
- (statusbar-mode 1)
- (exwm-update-workspace-lighter)) exwm-init-hook)
-
;; -------------------------------------------------------------------
;; RandR
@@ -161,6 +147,24 @@
(use-package exwm-edit
:ensure t
+ :if (and exwm-state (window-system))
:config
(add-hook 'exwm-edit-compose-hook (lambda ()
(text-mode))))
+
+;; -----------------------------------------------------------------------------
+;; Statusbar.el
+
+(use-package posframe
+ :defer 1 ;; HACK: why can't i just run this immediately after EXWM?
+ :if (and (window-system) (fboundp 'exwm-systemtray-enable))
+ :ensure t)
+
+(use-package statusbar
+ :if (and (window-system) (fboundp 'exwm-systemtray-enable))
+ :after posframe
+ :load-path "~/.emacs.d/scripts/statusbar.el/"
+ :config
+ (advice-add 'exwm-update-workspace-lighter :after #'statusbar-refresh)
+ (setq statusbar-modeline-variables '(exwm-workspace-lighter display-time-string))
+ (statusbar-mode +1))