summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authortslil clingman <>2020-04-24 17:55:37 -0700
committertslil clingman <>2020-04-24 17:55:37 -0700
commitb15702ecef80740f8d2284eb5afad7e62028a1ef (patch)
tree9bcd7ae9763d7db224faa71d4d7f4aa85a1a675b /emacs
parentf9bfebc7b029df463d2e03bf9af178a8bb442ca3 (diff)
Switched to battery applet when under EXWM, fixed workspaces (final?)
Diffstat (limited to 'emacs')
-rw-r--r--emacs/inits/00-exwm.el11
-rw-r--r--emacs/inits/02-modeline.el34
2 files changed, 23 insertions, 22 deletions
diff --git a/emacs/inits/00-exwm.el b/emacs/inits/00-exwm.el
index 7735629..4d503f5 100644
--- a/emacs/inits/00-exwm.el
+++ b/emacs/inits/00-exwm.el
@@ -1,4 +1,4 @@
-;; Time-stamp: <2020-04-21 19:17:12 (tslil@bison)>
+;; Time-stamp: <2020-04-24 17:52:54 (tslil@bison)>
(defun banish-rat ()
(interactive)
@@ -72,12 +72,10 @@
(defun exwm-workspace-lighter ()
(format " @%d (*%d)" exwm-workspace-current-index exwm-workspace-last-index))
- (defun exwm-store-workspace-last-index (next)
- (when (/= next exwm-workspace-current-index)
- (setq exwm-workspace-last-index exwm-workspace-current-index)))
+ (defun exwm-store-workspace-last-index-switch (frame-or-index &optional force)
+ (setq exwm-workspace-last-index exwm-workspace-current-index))
- (advice-add 'exwm-workspace-switch-create :before #'exwm-store-workspace-last-index)
- ;; (advice-add 'exwm-workspace-switch :before #'exwm-store-workspace-last-index)
+ (advice-add 'exwm-workspace-switch :before #'exwm-store-workspace-last-index-switch)
(defun exwm-sanitise-workspace-last-index ()
(when (> (1+ exwm-workspace-last-index) (exwm-workspace--count))
@@ -117,6 +115,7 @@
(require 'exwm-systemtray)
(exwm-systemtray-enable)
+ (setq exwm-systemtray-height 24)
;; -------------------------------------------------------------------
;; RandR
diff --git a/emacs/inits/02-modeline.el b/emacs/inits/02-modeline.el
index aba6e9c..bae0a37 100644
--- a/emacs/inits/02-modeline.el
+++ b/emacs/inits/02-modeline.el
@@ -1,26 +1,28 @@
-;; Time-stamp: <2020-04-24 14:49:48 (tslil@bison)>
+;; Time-stamp: <2020-04-24 17:53:33 (tslil@bison)>
;; -----------------------------------------------------------------------------
;; Battery status and CPU temperature
-(defvar sys-status "")
-(defvar sys-status-cpu-temp-threshold "45")
+(unless (fboundp 'exwm-systemtray-enable)
+ (defvar sys-status "")
+ (defvar sys-status-cpu-temp-threshold "45")
-(defun linux-sys-status ()
- (let ((bat-s (string-trim (shell-command-to-string "~/.local/bin/battery")))
- (temp-s (if (not (file-exists-p "/sys/class/thermal/thermal_zone1/temp")) ""
- (with-temp-buffer
- (insert-file-contents "/sys/class/thermal/thermal_zone1/temp")
- (let ((temp (substring-no-properties (buffer-string) 0 -4)))
- (if (string-greaterp temp sys-status-cpu-temp-threshold)
- (concat " " temp "C") ""))))))
- (if (and (string-blank-p bat-s) (string-blank-p temp-s))
- "" (format " [%s%s]" bat-s temp-s))))
+ (defun linux-sys-status ()
+ (let ((bat-s (string-trim (shell-command-to-string (expand-file-name "~/.local/bin/battery"))))
+ (temp-s (if (not (file-exists-p "/sys/class/thermal/thermal_zone1/temp")) ""
+ (with-temp-buffer
+ (insert-file-contents "/sys/class/thermal/thermal_zone1/temp")
+ (let ((temp (substring-no-properties (buffer-string) 0 -4)))
+ (if (string-greaterp temp sys-status-cpu-temp-threshold)
+ (concat " " temp "C") ""))))))
+ (if (and (string-blank-p bat-s) (string-blank-p temp-s))
+ "" (format " [%s%s]" bat-s temp-s))))
-(defun sys-status-update ()
- (setq sys-status (linux-sys-status)))
+ (defun sys-status-update ()
+ (setq sys-status (linux-sys-status)))
+
+ (defvar sys-status-update-timer (run-at-time nil 60 'sys-status-update)))
-(defvar sys-status-update-timer (run-at-time nil 60 'sys-status-update))
;; -----------------------------------------------------------------------------
;; Remind me of my mortality