summaryrefslogtreecommitdiff
path: root/.config/wmii-hg/theme-emacs
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@datawire.io>2022-11-18 18:36:53 -0700
committerLuke Shumaker <lukeshu@datawire.io>2022-11-18 18:36:53 -0700
commit9a62b4a64933f116b08e9e3cb06e013319610e4c (patch)
tree27bb1b131d5a0d35d34fa31e73f72b2446576dc8 /.config/wmii-hg/theme-emacs
parent9adc8a2aeaf034f5172b32c9bd000c686465ab21 (diff)
stuff
Diffstat (limited to '.config/wmii-hg/theme-emacs')
-rw-r--r--.config/wmii-hg/theme-emacs16
1 files changed, 16 insertions, 0 deletions
diff --git a/.config/wmii-hg/theme-emacs b/.config/wmii-hg/theme-emacs
new file mode 100644
index 0000000..a45901c
--- /dev/null
+++ b/.config/wmii-hg/theme-emacs
@@ -0,0 +1,16 @@
+#!/hint/bash
+# Get theme settings from Emacs
+
+# emacs_unquote QUOTED_STRING
+emacs_unquote() {
+ local str="$*"
+ if [[ $str =~ ^\"(.*)\"$ ]]; then
+ str=${BASH_REMATCH[1]} # un-quote it
+ str="${str//\\\\/\\}" # \\ -> \
+ str="${str//\\\"/\"}" # \" -> "
+ str="${str//\\n/$'\n'}" # \n -> NL
+ fi
+ printf '%s' "$str"
+}
+
+eval "$(emacs_unquote "$(emacsclient --eval "(when (load \"${WMII_CONFPATH}/theme-emacs.el\") (wmii-theme-for-display \"${DISPLAY}\"))")")"