summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-06-29 17:42:27 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-06-29 17:52:59 -0700
commited1813bcb0c196f2eecce718ce002e0dfc8a74e0 (patch)
tree84bb245f9d21acfa52380472e9f30b7490f543e1
parent39858d236fb61a58f9c01132dd8cbb7c62f869c8 (diff)
downloaddotfiles-ed1813bcb0c196f2eecce718ce002e0dfc8a74e0.tar.gz
assume that we have dark-on-light in tmux & binding to get it
-rw-r--r--.emacs.d/init.el10
-rw-r--r--.tmux.conf7
2 files changed, 17 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index b5ab6462..6884069e 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -129,6 +129,16 @@ windows side-by-side in the frame."
:height (if scale-up-p 151 120)))))))
(add-to-list 'window-size-change-functions #'spw/maybe-scale-basic-faces)
+;; `frame--current-backround-mode' assumes that TERM=screen-256color means a
+;; dark background. But if we're in tmux then I can always have dark-on-light
+;; by typing C-\ W (see ~/.tmux.conf).
+(defun spw/set-tmux-background-mode (frame)
+ (when (cl-find-if (apply-partially #'string-prefix-p "TMUX=")
+ (frame-parameter frame 'environment))
+ (let ((frame-background-mode 'light))
+ (frame-set-background-mode frame))))
+(add-to-list 'after-make-frame-functions #'spw/set-tmux-background-mode)
+
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/.tmux.conf b/.tmux.conf
index 0e7b9d0f..afa2db00 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -59,6 +59,13 @@ bind e run-shell tmuxmacs
# bind N split-window -v -d "emacsclient -t -a '' -e '(switch-to-buffer \"*scratch*\")'" \; swap-pane -D \; resize-pane -t 1 -y 12 \; send c d Space / s r v / f t p - m a s t e r . d e b i a n . o r g / q u e u e / n e w Enter d a k Space p r o c e s s - n e w Space
# bind N send c d Space / s r v / f t p - m a s t e r . d e b i a n . o r g / q u e u e / n e w Enter d a k Space p r o c e s s - n e w Space
+# Obtain dark-on-light when the terminal emulator isn't already dark-on-light,
+# as it is on my own machines. We don't just set these styles unconditionally
+# because we want bg=#FFFFF6 to show through on my own machines. Typing C-\ W
+# is faster than trying to configure an unfamiliar local terminal emulator.
+bind W set -g window-style 'fg=black,bg=brightwhite'\;\
+ set -g window-active-style 'fg=black,bg=brightwhite'
+
# ---- status bar ----
set -g status-position top